1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218 |
- /*! For license information please see HOUSEPLAY.js.LICENSE.txt */ ! function(t, e) {
- "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.HOUSEPLAY = e() : t.HOUSEPLAY = e()
- }(window, (function() {
- return function(t) {
- var e = {};
- function i(n) {
- if (e[n]) return e[n].exports;
- var r = e[n] = {
- i: n,
- l: !1,
- exports: {}
- };
- return t[n].call(r.exports, r, r.exports, i), r.l = !0, r.exports
- }
- return i.m = t, i.c = e, i.d = function(t, e, n) {
- i.o(t, e) || Object.defineProperty(t, e, {
- enumerable: !0,
- get: n
- })
- }, i.r = function(t) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
- value: "Module"
- }), Object.defineProperty(t, "__esModule", {
- value: !0
- })
- }, i.t = function(t, e) {
- if (1 & e && (t = i(t)), 8 & e) return t;
- if (4 & e && "object" == typeof t && t && t.__esModule) return t;
- var n = Object.create(null);
- if (i.r(n), Object.defineProperty(n, "default", {
- enumerable: !0,
- value: t
- }), 2 & e && "string" != typeof t)
- for (var r in t) i.d(n, r, function(e) {
- return t[e]
- }.bind(null, r));
- return n
- }, i.n = function(t) {
- var e = t && t.__esModule ? function() {
- return t.default
- } : function() {
- return t
- };
- return i.d(e, "a", e), e
- }, i.o = function(t, e) {
- return Object.prototype.hasOwnProperty.call(t, e)
- }, i.p = "", i(i.s = 77)
- }([function(t, e, i) {
- "use strict";
- // threejs
- }, function(t, e, i) {
- var n = i(0),
- r = i(3),
- o = i(5),
- a = i(101),
- s = i(102),
- l = i(24),
- u = i(15),
- h = i(7),
- c = i(25),
- d = i(26),
- p = {
- delBK: !0,
- delBKEdit: !1,
- isNewServerPreviewVersion: !1,
- isNewEditVersion: !1,
- isCleanUI: 0,
- jfedit: !1,
- screenshot: !1,
- unit_type: 0,
- unit_conversion_value: 1,
- unit_name: "m",
- unit_sq_name: "m²",
- debug: !1,
- isLocalVersion: !1,
- vrDebug: !1,
- fpsOn: !1,
- adjustCompass: !1,
- adjustColor: !1,
- newbarrage: !0,
- wscdn: !0,
- thirdCustomer: -1,
- version: "2.11.9-0-ga9537d5",
- pageTitle: "众趣科技",
- authorizationHeader: c.getAuthorizationHeader(),
- autoplay: r.valueFromHash("play", !0),
- logLevel: r.valueFromHash("log", 2),
- showLog: r.valueFromHash("db", 0),
- skyboxRadius: 250,
- modelBoundsPadding: 5,
- showNeighbors: !1,
- brand: r.valueFromHash("brand", !0),
- mls: r.valueFromHash("mls", 0),
- showHighlights: r.valueFromHash("hhl", !0),
- startHighlights: r.valueFromHash("hl", !1),
- specialEdition: r.valueFromHash("bn", 0),
- showTitleContainer: r.valueFromHash("title", !0),
- useWheel: r.valueFromHash("wh", !0),
- crossOrigin: "anonymous",
- fancierTransition: !0,
- wireframe: !0,
- skyboxWireframe: !0,
- modelAlpha: 1,
- highlightPanoSelection: !1,
- showSweeps: !0,
- showSkyboxes: !0,
- showMesh: !0,
- showFloors: !0,
- showFloorDuration: 300,
- showFloorDelay: 300,
- hideFloorDuration: 300,
- hideFloorDelay: 0,
- reticuleOpacityTransitionTime: 250,
- reticuleColor: s.yellow,
- markerOpacityTransitionTime: 500,
- guiAnimationSpeed: 250,
- highlightAnimationDuration: 500,
- barfadeAnimationDuration: 300,
- modelComponentLoadSpinnerDelay: 150,
- captureErrors: !1,
- maxMobileTextures: 10,
- startupFlyinDelay: 3e3,
- dollhouseDefault: {
- minDistance: 5,
- maxDistance: 50,
- minPolarAngle: n.Math.degToRad(10),
- maxPolarAngle: n.Math.degToRad(65)
- },
- hideReticuleTimeout: 1e3,
- titletagMaxdistance: 5,
- analytics: {
- inactivityThreshold: 30,
- sessionTrackingRate: .15,
- maxTrackedErrors: 20,
- sessionDurationPingFrequency: 10,
- sessionDurationTimeout: 15
- },
- flydown: {
- movementEasing: "easeInOutQuad",
- movementDelay: .001,
- rotationEasing: "easeInOutQuad",
- rotationDelay: .5,
- modelTextureDelay: .75,
- skyboxDelay: .75
- },
- transition: {
- flySpeed: .01,
- flyTime: 800,
- flytimeMaxDistanceThreshold: 5,
- flytimeDistanceMultiplier: 150,
- aimTime: 1150,
- aimSlowFactor: 1.5,
- blur: .2,
- movementEasing: "easeInOutQuad",
- blendEasing: "easeInOutQuad",
- fastForwardFactor: 1
- },
- show360Views: {
- enabled: !0,
- transitionTime: 1e3
- },
- quickstart: {
- enabled: 1 === r.valueFromHash("qs", 0),
- animation: 1e3,
- showTextDelay: 500,
- fadeOutDelay: 1e3,
- fovChange: 10
- },
- vr: {
- enabled: !1,
- option: r.valueFromHash("vr", a.CONTEXTUAL)
- },
- mattertags: {
- enabled: !0,
- enableLinking: !0,
- enablePanoSize: !0,
- startup: {
- hideUntilStart: !1,
- fadeInDuration: 500,
- fadeInDelay: 100
- },
- visibility: {
- anyDistance: !0,
- visibleDistance: 8,
- cameraClearance: .1,
- alphaTestLevel: .05,
- hideViaFloor: !0,
- hideOffScreenDisc: !1,
- hideOffScreenObject: !1
- },
- disc: {
- opacity: .9,
- disabledOpacity: .5,
- scale: {
- nearBound: 1.5,
- farBound: 4.8,
- linkFarBound: !1,
- linkPercent: 40,
- maxSize: 80,
- minSize: 40,
- baseViewportSize: 800,
- buildingViewportSize: 300,
- responsiveness: 100
- }
- },
- pole: {
- enabled: !0,
- height: .5,
- width: 2,
- opacity: .5,
- color: "white"
- },
- animation: {
- hoverOnClosing: !1,
- animInDelay: 100,
- animOutDelay: 50,
- animInTime: 200,
- animOutTime: 100
- },
- boardScale: {
- billboardScale: 1,
- scaleToDisc: !0,
- boardToDiscRatio: 1.2
- },
- navigate: {
- nearestPano: !0,
- lineOfSight: !0,
- reactivate: !0,
- aimAt: "disc",
- tiltTolerance: 25,
- rotateSpeedFactor: .6
- }
- },
- path: {
- color: s.white,
- colorUp: s._desat(s.white, .5),
- colorDown: s._darken(s.white, .35),
- opacity: .5,
- style: "ribbon",
- height: .025,
- ribbonWidth: .24,
- outsideHeight: .5,
- waypointRadius: .5,
- waypointIndoorRadius: .24,
- waypointPulse: 1e3,
- typ: l.BLACK,
- meshFree: r.valueFromHash("mf", 0),
- mapGuides: r.valueFromHash("guides", !0),
- fadeInTime: 400,
- fadeOutTime: 300
- },
- warp: {
- nearPanoDist: .1,
- matchCam: !1,
- blur: .33,
- fastTime: 1500,
- teleportTime: 1500,
- outsideTime: 2e3,
- lookAheadMax: .3,
- lookAheadDist: 2.5,
- softPushDist: .37,
- softPushEnd: .3,
- softBendAngle: 8,
- softBendTilt: 4,
- softBendEnd: .3,
- doBurns: r.valueFromHash("kb", !0),
- burnsAngle: 15,
- minBurnsAngle: 6,
- minDownAngle: -35,
- maxTurnPerSec: 280,
- maxAimPerSec: 45,
- minRotation: 12,
- maxAimRotation: 33.2,
- turnFriction: .2,
- flySpeed: .01,
- minWarpTime: 1200,
- warpInterruptionRedirectTime: 500,
- tourStepDelay: r.valueFromHash("st", 5e3),
- walkDelay: 0,
- walkMaxDist: 50,
- walkSlideShowThreshhold: 3e3,
- walkExtraPanosDistance: .4,
- timePerMeter: 800,
- motionLeadTime: 500,
- movementEasing: "easeInOutQuad",
- blendEasing: "easeInOutQuad",
- showBunny: !1,
- loop: r.valueFromHash("lp", !0),
- auto: r.valueFromHash("ts", -1),
- eOrder: "YXZ",
- stepFactor: .25,
- brakeStrength: 2,
- minBrakeAngle: .1,
- maxBrakeAngle: 1.8,
- climbEffort: 4,
- waitMultiplier1: 4,
- waitMultiplier2: 4
- },
- rotationFriction: .06,
- rotationAccelerationInside: 4.5,
- rotationAccelerationOutside: .15,
- rotationAfterMoveMultiplier: 60,
- rotationAfterMoveHistoryCount: 5,
- panFriction: .09,
- panAccelerationOutside: 60,
- onload: r.valueFromHash("onload", o.PANORAMA),
- zoomNearLimit: .1,
- zoomFarLimit: 10,
- navigation: {
- panoScores: !1,
- mouseDirection: !0,
- filterStrictness: .75,
- angleFactor: -30,
- directionFactor: 10,
- distanceFactor: -1,
- optionalityFactor: 3
- },
- secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
- console: r.valueFromHash("console", !1),
- noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
- panoramaNeighbourMaxDistance: 5,
- panoFloorClickRadius: .7,
- showScreenshotLocations: !1,
- showAxis: !0,
- showNeighbourRaycasts: !1,
- colorMarkerOnLoad: !1,
- colorMarkerByFloor: !1,
- tiling: {
- panoPreRenderRepeatDelay: 2500,
- panoPreRenderDelay: 500,
- preRenderTourPanos: r.valueFromHash("tileprerender", 0),
- tilingFlagNames: ["usetiles", "tiles"],
- maxNavPanoQuality: r.valueFromHash("maxtileq", null),
- maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
- overlayStyle: r.valueFromHash("tileoverlay", 0),
- uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
- initialIntervalDelay: r.valueFromHash("itiledelay", 0),
- maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
- maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
- customCompression: r.valueFromHash("tilecustcomp", 0),
- mobileHighQualityOverride: !1,
- allowUltraHighResolution: !1
- },
- zoom: {
- enabled: !0,
- max: r.valueFromHash("maxzoom", 8),
- min: r.valueFromHash("minzoom", 1),
- transitionStyle: r.valueFromHash("zoomtrans", 1),
- restoreTime: 500,
- activationThreshold: 1.1
- },
- panoramaSettings: {
- loading_2k: !1,
- screenshot_2k: !1,
- loading_fov82: !1,
- screenshot_fov82: !1
- }
- };
- (p = h.deepExtend(p, d, {
- panorama: {
- transitionTime: 1300,
- modelAlpha: 0,
- modelAlphaDelay: p.flydown.modelTextureDelay,
- modelAlphaLength: 1,
- skyboxOpacity: 1,
- skyboxOpacityDelay: p.flydown.skyboxDelay,
- skyboxOpacityLength: .9,
- fovLength: 1,
- fovDelay: 0,
- cameraMatrixDuration: .8,
- cameraMatrixDelay: 0,
- cameraMatrixEase: u.easeInCubic,
- reticuleOpacity: 1,
- markerOpacity: .6,
- markerOpacityOnHover: 1
- },
- dollhouse: {
- transitionTime: 1200,
- modelAlpha: 1,
- modelAlphaDelay: 0,
- modelAlphaLength: 1 - p.flydown.modelTextureDelay,
- skyboxOpacity: 0,
- skyboxOpacityDelay: 0,
- skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
- fovLength: 1,
- fovDelay: 0,
- cameraMatrixDuration: .8,
- cameraMatrixDelay: .3,
- cameraMatrixEase: u.easeInCubic,
- reticuleOpacity: 1,
- markerOpacity: 0,
- markerOpacityOnHover: 0
- },
- floorplan: {
- transitionTime: 1e3,
- modelAlpha: 1,
- modelAlphaDelay: 0,
- modelAlphaLength: 1 - p.flydown.modelTextureDelay,
- skyboxOpacity: 0,
- skyboxOpacityDelay: 0,
- skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
- fovLength: 1,
- fovDelay: 0,
- cameraMatrixDuration: .5,
- cameraMatrixDelay: 0,
- cameraMatrixEase: u.easeOutCubic,
- reticuleOpacity: 1,
- markerOpacity: 0,
- markerOpacityOnHover: 0
- },
- transitioning: {
- reticuleOpacity: 0
- },
- "floorplan-dollhouse": {
- rotationDelay: 0,
- rotationDuration: 1
- },
- "floorplan-panorama": {
- rotationDelay: .5,
- rotationDuration: 1
- },
- "dollhouse-panorama": {
- rotationDelay: .6,
- rotationDuration: 1
- },
- "dollhouse-floorplan": {
- rotationDelay: 0,
- rotationDuration: 1,
- cameraMatrixDuration: 1.05,
- cameraMatrixDelay: .5
- },
- "panorama-dollhouse": {
- rotationDelay: 0,
- rotationDuration: .4
- },
- "panorama-floorplan": {
- transitionTime: 1500,
- rotationDelay: 0,
- rotationDuration: .5
- }
- }))
- .path.meshFree && (p.path.typ = l.WALK), t.exports = p
- }, function(t, e, i) {
- (function(e) {
- var i = window.Raven;
- function n(t) {
- var r, o, a, s, l = t.split("/"),
- u = "[" + l[l.length - 1].replace(".js", "") + "]",
- h = {};
- if (n.consoleEnabled) {
- var c = function(t) {
- e("#debug-console")
- .append("<p>" + t + "</p>"), e("#debug-console")[0].scrollTop = e("#debug-console")[0].scrollHeight
- };
- r = function(t) {
- c(Array.prototype.slice.call(arguments)
- .join(" "))
- }, o = function(t) {
- c(Array.prototype.slice.call(arguments)
- .join(" "))
- }, a = function(t) {
- c("WARN: " + Array.prototype.slice.call(arguments)
- .join(" "))
- }, s = function(t) {
- c("ERROR: " + Array.prototype.slice.call(arguments)
- .join(" "))
- }
- } else console.debug ? (r = console.debug, o = console.info ? console.info : console.debug, a = console.warn ? console.warn : console.debug, s = console.error ? console.error : console.debug) : r = o = a = s = function() {};
- var d = function(t) {
- return [u, n.timestamp()].concat(Array.prototype.slice.call(t))
- },
- p = function(e, r) {
- if (i) {
- var o = Array.prototype.slice.call(e)
- .join(" ");
- i.captureMessage(o, {
- level: r,
- path: t,
- timestamp: n.timestamp()
- })
- }
- },
- f = function(e, r) {
- if (i) {
- var o = Array.prototype.slice.call(e)
- .join(" ");
- i.captureException(new Error(o), {
- level: r,
- path: t,
- timestamp: n.timestamp()
- })
- }
- };
- return {
- debug: function() {
- n.level >= n.levels.debug && r.appply(console, d(arguments))
- },
- info: function() {
- n.level >= n.levels.info && o.apply(console, d(arguments))
- },
- warn: function() {
- p(arguments, "warn"), n.level >= n.levels.warn && a.apply(console, d(arguments))
- },
- error: function() {
- f(arguments, "error"), n.level >= n.levels.error && s.apply(console, d(arguments))
- },
- v3str: function(t, e) {
- var i = void 0 === e ? 2 : e;
- return "(" + t.x.toPrecision(i) + ", " + t.y.toPrecision(i) + ", " + t.z.toPrecision(i) + ")"
- },
- eulstr: function(t, e) {
- var i = void 0 === e ? 2 : e;
- return "(" + THREE.Math.radToDeg(t.x)
- .toPrecision(i) + ", " + THREE.Math.radToDeg(t.y)
- .toPrecision(i) + ", " + THREE.Math.radToDeg(t.z)
- .toPrecision(i) + ' "' + t.order + '")'
- },
- time: function(t) {
- n.level >= n.levels.debug && (h[t] = Date.now())
- },
- timeEnd: function(t) {
- if (n.level >= n.levels.debug) {
- var e = h[t];
- if (!e) return;
- var i = (Date.now() - e) / 1e3;
- this.debug(t, i + "s")
- }
- }
- }
- }
- n.timestamp = function() {
- return (Date.now() - window.navigationStart) / 1e3 + "s"
- }, n.levels = {
- debug: 3,
- info: 2,
- warn: 1,
- error: 0
- }, n.level = n.levels.info, t.exports = n
- })
- .call(this, i(6))
- }, function(t, e, i) {
- (function(e) {
- function n(t, e) {
- var i = window.navigator.userAgent.match(t);
- return i = i ? i[1].split(e) : [], {
- major: parseInt(i[0]) || 0,
- minor: parseInt(i[1]) || 0,
- patch: parseInt(i[2]) || 0
- }
- }
- var r = i(99);
- t.exports = {
- isFullscreen: function() {
- return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
- },
- supportsFullscreen: function() {
- return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
- },
- isPointerLocked: function() {
- return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
- },
- requestFullscreen: function(t, i) {
- t.requestFullscreen ? t.requestFullscreen() : t.mozRequestFullScreen ? t.mozRequestFullScreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : t.msRequestFullscreen && t.msRequestFullscreen(), i && e(document)
- .on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
- },
- requestPointerLock: function() {
- var t;
- if (document.fullscreenElement) t = document.fullscreenElement();
- else if (document.mozFullscreenElement) t = document.mozFullscreenElement();
- else if (document.mozFullScreenElement) t = document.mozFullScreenElement();
- else {
- if (!document.webkitFullscreenElement) return;
- t = document.webkitFullscreenElement()
- }
- t.requestPointerLock = t.requestPointerLock || t.mozRequestPointerLock || t.webkitRequestPointerLock, t.requestPointerLock(), e(document)
- .off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
- },
- exitPointerLock: function() {
- document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock, document.exitPointerLock()
- },
- exitFullscreen: function() {
- document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
- },
- details: function() {
- var t = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
- return t ? {
- name: t[1],
- version: parseInt(t[2]),
- platform: navigator.platform
- } : {}
- },
- is: function(t) {
- return this.details() && this.details()
- .name === t
- },
- inIframe: function() {
- return window.parent !== window
- },
- aspectRatio: function() {
- var t = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight);
- return isFinite(t) ? t : 0
- },
- userAgent: function() {
- return window.navigator.userAgent
- },
- isMobile: function() {
- var t = navigator.userAgent || navigator.vendor || window.opera;
- 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(t) || /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(t.substr(0, 4))
- },
- isWeixin: function() {
- return "micromessenger" == navigator.userAgent.toLowerCase()
- .match(/MicroMessenger/i)
- },
- isSmallScreen: function() {
- return screen.width / window.devicePixelRatio < 240
- },
- detectIE: function() {
- return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
- },
- detectSafari: function() {
- return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
- },
- detectFirefox: function() {
- return -1 !== window.navigator.userAgent.indexOf("Firefox")
- },
- detectChrome: function() {
- return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
- },
- detectOpera: function() {
- return -1 !== window.navigator.userAgent.indexOf("OPR")
- },
- detectIOS: function() {
- var t = window.navigator.userAgent;
- return /iPad|iPhone|iPod/.test(t)
- },
- detectAndroid: function() {
- return -1 !== window.navigator.userAgent.indexOf("Android")
- },
- detectAndroidMobile: function() {
- var t = window.navigator.userAgent;
- return this.detectAndroid() && -1 !== t.indexOf("Mobile")
- },
- detectSamsungNative: function() {
- var t = window.navigator.userAgent;
- return -1 !== t.indexOf("SM-G900H") || -1 !== t.indexOf("GT-I9500") || -1 !== t.indexOf("SM-N900")
- },
- detectSamsungS6: function() {
- return -1 !== window.navigator.userAgent.indexOf("SM-G92")
- },
- detectHUAWEI5X: function() {
- return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
- },
- iosVersion: function() {
- if (!this.detectIOS()) throw new r("Did not detect an iDevice");
- return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
- },
- androidVersion: function() {
- if (!this.detectAndroid()) throw new r("Did not detect an Android based device");
- return n(/Android ((?:\d+\.?){1,3})/, ".")
- },
- valueFromCookie: function(t, e) {
- var i = new RegExp(t + "=([0-9a-f]+)(; ?|$)")
- .exec(document.cookie);
- if (!i) return e;
- var n = i[1];
- return "boolean" == typeof e ? "true" === n || "1" === n : "number" == typeof e ? parseFloat(n) : n
- },
- valueFromHash: function(t, e) {
- var i = new RegExp("[#&?]" + t + "=([^#&?]*)")
- .exec(window.location.href);
- if (!i) return e;
- var n = i[1];
- return "boolean" == typeof e ? "true" === n || "1" === n : "number" == typeof e ? parseFloat(n) : window.decodeURIComponent(n)
- },
- getAllValueFromSearch: function() {
- var t = window.location.search,
- e = {};
- if (-1 !== t.indexOf("?"))
- for (var i = t.substr(1)
- .split("&"), n = "", r = 0; r < i.length; r++) e[(n = i[r].split("="))[0]] = unescape(n[1]);
- return e
- },
- getQueryString: function(t) {
- var e = new RegExp("(^|&)" + t + "=([^&]*)(&|$)", "i"),
- i = window.location.search.substr(1)
- .match(e);
- return null != i ? decodeURI(i[2]) : null
- },
- is_weixin: function() {
- return !!(-1 != navigator.userAgent.toLowerCase()
- .indexOf("micromessenger"))
- },
- getUuid: function() {
- function t() {
- return (65536 * (1 + Math.random()) | 0)
- .toString(16)
- .substring(1)
- }
- return t() + t() + "-" + t() + "-" + t() + "-" + t() + "-" + t() + t() + t()
- },
- changeURLArg: function(t, e, i) {
- var n = e + "=([^&]*)",
- r = e + "=" + i;
- if (t.match(n)) {
- var o = "(" + e + "=)([^&]*)",
- a = new RegExp(o, "gi");
- return o = t.replace(a, r)
- }
- return t.match("[?]") ? t + "&" + r : t + "?" + r
- }
- }
- })
- .call(this, i(6))
- }, function(t, e, i) {
- "use strict";
- var n, r = "object" == typeof Reflect ? Reflect : null,
- o = r && "function" == typeof r.apply ? r.apply : function(t, e, i) {
- return Function.prototype.apply.call(t, e, i)
- };
- n = r && "function" == typeof r.ownKeys ? r.ownKeys : Object.getOwnPropertySymbols ? function(t) {
- return Object.getOwnPropertyNames(t)
- .concat(Object.getOwnPropertySymbols(t))
- } : function(t) {
- return Object.getOwnPropertyNames(t)
- };
- var a = Number.isNaN || function(t) {
- return t != t
- };
- function s() {
- s.init.call(this)
- }
- t.exports = s, t.exports.once = function(t, e) {
- return new Promise((function(i, n) {
- function r(i) {
- t.removeListener(e, o), n(i)
- }
- function o() {
- "function" == typeof t.removeListener && t.removeListener("error", r), i([].slice.call(arguments))
- }
- v(t, e, o, {
- once: !0
- }), "error" !== e && function(t, e, i) {
- "function" == typeof t.on && v(t, "error", e, i)
- }(t, r, {
- once: !0
- })
- }))
- }, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0;
- var l = 10;
- function u(t) {
- if ("function" != typeof t) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t)
- }
- function h(t) {
- return void 0 === t._maxListeners ? s.defaultMaxListeners : t._maxListeners
- }
- function c(t, e, i, n) {
- var r, o, a;
- if (u(i), void 0 === (o = t._events) ? (o = t._events = Object.create(null), t._eventsCount = 0) : (void 0 !== o.newListener && (t.emit("newListener", e, i.listener ? i.listener : i), o = t._events), a = o[e]), void 0 === a) a = o[e] = i, ++t._eventsCount;
- else if ("function" == typeof a ? a = o[e] = n ? [i, a] : [a, i] : n ? a.unshift(i) : a.push(i), (r = h(t)) > 0 && a.length > r && !a.warned) {
- a.warned = !0;
- var s = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
- s.name = "MaxListenersExceededWarning", s.emitter = t, s.type = e, s.count = a.length, console && console.warn
- }
- return t
- }
- function d() {
- if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments)
- }
- function p(t, e, i) {
- var n = {
- fired: !1,
- wrapFn: void 0,
- target: t,
- type: e,
- listener: i
- },
- r = d.bind(n);
- return r.listener = i, n.wrapFn = r, r
- }
- function f(t, e, i) {
- var n = t._events;
- if (void 0 === n) return [];
- var r = n[e];
- return void 0 === r ? [] : "function" == typeof r ? i ? [r.listener || r] : [r] : i ? function(t) {
- for (var e = new Array(t.length), i = 0; i < e.length; ++i) e[i] = t[i].listener || t[i];
- return e
- }(r) : g(r, r.length)
- }
- function m(t) {
- var e = this._events;
- if (void 0 !== e) {
- var i = e[t];
- if ("function" == typeof i) return 1;
- if (void 0 !== i) return i.length
- }
- return 0
- }
- function g(t, e) {
- for (var i = new Array(e), n = 0; n < e; ++n) i[n] = t[n];
- return i
- }
- function v(t, e, i, n) {
- if ("function" == typeof t.on) n.once ? t.once(e, i) : t.on(e, i);
- else {
- if ("function" != typeof t.addEventListener) throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
- t.addEventListener(e, (function r(o) {
- n.once && t.removeEventListener(e, r), i(o)
- }))
- }
- }
- Object.defineProperty(s, "defaultMaxListeners", {
- enumerable: !0,
- get: function() {
- return l
- },
- set: function(t) {
- if ("number" != typeof t || t < 0 || a(t)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
- l = t
- }
- }), s.init = function() {
- void 0 !== this._events && this._events !== Object.getPrototypeOf(this)
- ._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0
- }, s.prototype.setMaxListeners = function(t) {
- if ("number" != typeof t || t < 0 || a(t)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + ".");
- return this._maxListeners = t, this
- }, s.prototype.getMaxListeners = function() {
- return h(this)
- }, s.prototype.emit = function(t) {
- for (var e = [], i = 1; i < arguments.length; i++) e.push(arguments[i]);
- var n = "error" === t,
- r = this._events;
- if (void 0 !== r) n = n && void 0 === r.error;
- else if (!n) return !1;
- if (n) {
- var a;
- if (e.length > 0 && (a = e[0]), a instanceof Error) throw a;
- var s = new Error("Unhandled error." + (a ? " (" + a.message + ")" : ""));
- throw s.context = a, s
- }
- var l = r[t];
- if (void 0 === l) return !1;
- if ("function" == typeof l) o(l, this, e);
- else {
- var u = l.length,
- h = g(l, u);
- for (i = 0; i < u; ++i) o(h[i], this, e)
- }
- return !0
- }, s.prototype.addListener = function(t, e) {
- return c(this, t, e, !1)
- }, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function(t, e) {
- return c(this, t, e, !0)
- }, s.prototype.once = function(t, e) {
- return u(e), this.on(t, p(this, t, e)), this
- }, s.prototype.prependOnceListener = function(t, e) {
- return u(e), this.prependListener(t, p(this, t, e)), this
- }, s.prototype.removeListener = function(t, e) {
- var i, n, r, o, a;
- if (u(e), void 0 === (n = this._events)) return this;
- if (void 0 === (i = n[t])) return this;
- if (i === e || i.listener === e) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete n[t], n.removeListener && this.emit("removeListener", t, i.listener || e));
- else if ("function" != typeof i) {
- for (r = -1, o = i.length - 1; o >= 0; o--)
- if (i[o] === e || i[o].listener === e) {
- a = i[o].listener, r = o;
- break
- } if (r < 0) return this;
- 0 === r ? i.shift() : function(t, e) {
- for (; e + 1 < t.length; e++) t[e] = t[e + 1];
- t.pop()
- }(i, r), 1 === i.length && (n[t] = i[0]), void 0 !== n.removeListener && this.emit("removeListener", t, a || e)
- }
- return this
- }, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function(t) {
- var e, i, n;
- if (void 0 === (i = this._events)) return this;
- if (void 0 === i.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== i[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete i[t]), this;
- if (0 === arguments.length) {
- var r, o = Object.keys(i);
- for (n = 0; n < o.length; ++n) "removeListener" !== (r = o[n]) && this.removeAllListeners(r);
- return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this
- }
- if ("function" == typeof(e = i[t])) this.removeListener(t, e);
- else if (void 0 !== e)
- for (n = e.length - 1; n >= 0; n--) this.removeListener(t, e[n]);
- return this
- }, s.prototype.listeners = function(t) {
- return f(this, t, !0)
- }, s.prototype.rawListeners = function(t) {
- return f(this, t, !1)
- }, s.listenerCount = function(t, e) {
- return "function" == typeof t.listenerCount ? t.listenerCount(e) : m.call(t, e)
- }, s.prototype.listenerCount = m, s.prototype.eventNames = function() {
- return this._eventsCount > 0 ? n(this._events) : []
- }
- }, function(t, e, i) {
- var n = i(100);
- t.exports = {
- PANORAMA: "panorama",
- DOLLHOUSE: "dollhouse",
- FLOORPLAN: "floorplan",
- MESH: "mesh",
- OUTDOOR: "outdoor",
- TRANSITIONING: "transitioning",
- toInt: function(t) {
- switch (t) {
- case this.PANORAMA:
- return 1;
- case this.DOLLHOUSE:
- return 2;
- case this.FLOORPLAN:
- return 3;
- case this.OUTDOOR:
- return 4;
- case this.TRANSITIONING:
- return -1
- }
- throw new n("No known conversion for Viewmode to int for mode: " + t)
- },
- fromInt: function(t) {
- switch (t) {
- case "1":
- case 1:
- return this.PANORAMA;
- case "2":
- case 2:
- return this.DOLLHOUSE;
- case "3":
- case 3:
- return this.FLOORPLAN;
- case "4":
- case 4:
- return this.OUTDOOR
- }
- throw new n("No known conversion for int to viewmode for int: " + t)
- },
- convertWorkshopModeInt: function(t) {
- switch (t) {
- case "0":
- case 0:
- return this.PANORAMA;
- case "1":
- case 1:
- return this.FLOORPLAN;
- case "2":
- case 2:
- return this.DOLLHOUSE;
- case "3":
- case 3:
- return this.MESH
- }
- throw new n("No known conversion for Workshop int to viewmode for int: " + t)
- }
- }
- }, function(t, e, i) {
- // jquery 3.7.0
- }, function(t, e, i) {
- var n = i(0);
- t.exports = {
- normalizeUrl: function(t) {
- return t.replace("https://", "http://")
- },
- domainFromUrl: function(t) {
- var e = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(t);
- return e ? e[3] : t
- },
- average: function(t, e) {
- if (0 === t.length) return null;
- for (var i = 0, n = 0, r = 0; r < t.length; r++) {
- i += e ? t[r][e] : t[r], n++
- }
- return i / n
- },
- countUnique: function(t) {
- for (var e = {}, i = 0; i < t.length; i++) e[t[i]] = 1 + (e[t[i]] || 0);
- return Object.keys(e)
- .length
- },
- averageVectors: function(t, e) {
- var i = new n.Vector3;
- if (0 === t.length) return i;
- for (var r = 0, o = 0; o < t.length; o++) {
- var a = e ? t[o][e] : t[o];
- i.add(a), r++
- }
- return i.divideScalar(r)
- },
- equalLists: function(t, e) {
- if (t.length !== e.length) return !1;
- for (var i = 0; i < t.length; i++)
- if (t[i] !== e[i]) return !1;
- return !0
- },
- lowerMedian: function(t, e) {
- return 0 === t.length ? null : (e = e || 2, t.sort((function(t, e) {
- return t - e
- })), t[Math.floor(t.length / e)])
- },
- stableSort: function(t, e) {
- return t.map((function(t, e) {
- return {
- value: t,
- index: e
- }
- }))
- .sort((function(t, i) {
- var n = e(t.value, i.value);
- return 0 !== n ? n : t.index - i.index
- }))
- .map((function(t) {
- return t.value
- }))
- },
- filterAll: function(t, e) {
- return t.filter((function(t) {
- return e.every((function(e) {
- return e(t)
- }))
- }))
- },
- formatDate: function(t) {
- return [t.getFullYear(), t.getMonth() + 1, t.getDate()].join("-")
- },
- formatDatetime: function(t) {
- return [t.getFullYear(), t.getMonth() + 1, t.getDate(), t.getHours(), t.getMinutes()].join("-")
- },
- randomString: function(t) {
- for (var e = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < t; n++) e += i.charAt(Math.floor(Math.random() * i.length));
- return e
- },
- nth: function(t) {
- return 1 == (t %= 10) ? t + "st" : 2 == t ? t + "nd" : 3 == t ? t + "rd" : t + "th"
- },
- extendObject: function(t, e) {
- return Object.keys(e)
- .forEach((function(i) {
- t[i] = e[i]
- })), t
- },
- deepExtend: function t(e) {
- e = e || {};
- for (var i = 1; i < arguments.length; i++) {
- var n = arguments[i];
- if (n)
- for (var r in n) n.hasOwnProperty(r) && ("object" == typeof n[r] ? e[r] = t(e[r], n[r]) : e[r] = n[r])
- }
- return e
- },
- inherit: function(t, e) {
- t.prototype = Object.create(e.prototype), t.prototype.constructor = t
- },
- extend: function(t, e) {
- for (var i in e.prototype) t.prototype[i] = e.prototype[i]
- }
- }, Math.sign = function(t) {
- return t < 0 ? -1 : 1
- }
- }, function(t, e, i) {
- var n = i(15);
- t.exports = {
- globalDone: null,
- funcs: [],
- counter: 0,
- uniqueID: 0,
- start: function(t, e, i, r, o, a, s) {
- return r = r || 0, this.funcs.push({
- func: t,
- current: -r * Math.abs(e),
- duration: (1 - Math.max(r, 0)) * Math.abs(e),
- done: i,
- easing: o || n.linearTween,
- cycling: e < 0,
- running: !0,
- debug: r < 0,
- name: a || "T" + this.counter,
- id: void 0 === s ? this.counter : s,
- paused: !1
- }), t(0, 16), this.counter += 1, t
- },
- trigger: function(t) {
- var e = void 0 === t.delayRatio ? 0 : t.delayRatio,
- i = t.func || function() {},
- r = void 0 === t.duration ? 0 : t.duration;
- void 0 !== t.cycling && t.cycling && (r = -Math.abs(r));
- var o = t.done || null,
- a = t.easing || n.linearTween,
- s = t.name || "R" + this.counter,
- l = void 0 === t.id ? this.counter : t.id;
- return this.start(i, r, o, e, a, s, l)
- },
- setTimeout: function(t, e, i) {
- var n = void 0 === i ? this.counter : i;
- return this.trigger({
- done: t,
- duration: void 0 === e ? 0 : e,
- name: "O" + this.counter,
- id: n
- })
- },
- pause: function() {
- this.paused = !0
- },
- resume: function() {
- this.paused = !1
- },
- update: function(t) {
- this.funcs.forEach((function(e) {
- if (!(e.paused || (e.current += 1e3 * t, e.current < 0)))
- if (e.current >= e.duration && !e.cycling) {
- var i = e.easing(1, 0, 1, 1);
- e.func(i, 1e3 * t), e.done && e.done(), e.running = !1
- } else {
- var n = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
- (e.func(n, 1e3 * t) || !1) && (e.done && e.done(), e.running = !1)
- }
- }));
- var e = this.funcs.length;
- this.funcs = this.funcs.filter((function(t) {
- return t.running
- }));
- var i = this.funcs.length;
- if (e > 0 && 0 === i && this.globalDone) {
- var n = this.globalDone;
- this.globalDone = null, n()
- }
- },
- adjustSpeed: function(t, e) {
- var i = this.get(t);
- i && (i.duration /= e, i.current /= e)
- },
- getById: function(t) {
- return this.funcs.filter((function(e) {
- return t === e.id
- }))
- },
- get: function(t) {
- for (var e = 0; e < this.funcs.length; e += 1)
- if (this.funcs[e].func == t) return this.funcs[e];
- return null
- },
- isRunning: function(t) {
- var e = this.get(t);
- return null !== e && e.running
- },
- countActive: function() {
- for (var t = 0, e = 0; e < this.funcs.length; e += 1) t += this.funcs[e].running;
- return t
- },
- listActive: function() {
- for (var t = [], e = 0; e < this.funcs.length; e += 1) this.funcs[e].running && t.push(this.funcs[e].name);
- return t
- },
- done: function(t) {
- this.globalDone = t
- },
- cancelById: function(t) {
- var e = void 0 === t ? 0 : t;
- this.funcs = this.funcs.filter((function(t) {
- return t.id !== e
- }))
- },
- cancel: function(t) {
- this.funcs = this.funcs.filter((function(e) {
- return e.func !== t
- }))
- },
- getUniqueId: function() {
- return this.uniqueID -= 1, this.uniqueID
- }
- }
- }, function(t, e, i) {
- var n = i(0);
- t.exports = {
- convertVisionVector: function(t) {
- return new n.Vector3(t.x, t.z, -t.y)
- },
- convertVisionQuaternion: function(t) {
- return new n.Quaternion(t.x, t.z, -t.y, t.w)
- .multiply((new n.Quaternion)
- .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90)))
- },
- convertVisionQuaternionAutoScene: function(t) {
- return new n.Quaternion(t.x, t.y, t.z, t.w)
- .multiply((new n.Quaternion)
- .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(-90)))
- },
- convertWorkshopVector: function(t) {
- return new n.Vector3(-t.x, t.y, t.z)
- },
- convertWorkshopQuaternion: function(t) {
- return new n.Quaternion(-t.x, t.y, t.z, -t.w)
- .multiply(new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
- },
- convertWorkshopPanoramaQuaternion: function(t) {
- return new n.Quaternion(t.x, -t.y, -t.z, t.w)
- .normalize()
- .multiply((new n.Quaternion)
- .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270)))
- },
- convertWorkshopOrthoZoom: function(t) {
- return -1 === t ? -1 : t / 4
- },
- toPrecision: function(t, e) {
- var i = Math.pow(10, e);
- return Math.round(t * i) / i
- },
- projectPositionToCanvas: function(t, e, i) {
- (i = i || new n.Vector3)
- .copy(t);
- var r = .5 * (window.renderWidth || window.innerWidth),
- o = .5 * (window.renderHeight || window.innerHeight);
- return i.project(e), i.x = i.x * r + r, i.y = -i.y * o + o, i
- },
- convertScreenPositionToNDC: function(t, e, i) {
- return (i = i || new n.Vector2)
- .x = t / (window.renderWidth || window.innerWidth) * 2 - 1, i.y = -e / (window.renderHeight || window.innerHeight) * 2 + 1, i
- },
- constrainedTurn: function(t) {
- var e = t % (2 * Math.PI);
- return e > Math.PI ? e -= 2 * Math.PI : e < -Math.PI ? e += 2 * Math.PI : e
- },
- getFOVDotThreshold: function(t) {
- return Math.cos(n.Math.degToRad(t / 2))
- },
- compareFloats: function(t, e) {
- return Math.abs(t - e) < Number.EPSILON * Math.pow(2, 45)
- },
- convertWorldPositionToScreen: function(t, e) {
- var i = t.clone()
- .project(e),
- n = (window.renderWidth || window.innerWidth) / 2,
- r = (window.renderHeight || window.innerHeight) / 2;
- return {
- x: ~~(i.x * n + n),
- y: ~~(-i.y * r + r)
- }
- },
- getVerticesOfItemSize: function(t) {
- for (var e = t.attributes.position, i = e.itemSize, r = [], o = {}, a = 0, s = e.array.length; a < s; a += i) {
- var l = e.array[a],
- u = e.array[a + 1],
- h = e.array[a + 2],
- c = "k_" + l + "_" + u + "_" + h;
- void 0 === o[c] && (r.push(new n.Vector3(l, u, h)), o[c] = 1)
- }
- return r
- },
- computeWorldPositionOutCamera: function(t, e) {
- var i = (t = t.clone())
- .applyMatrix4(e.matrixWorldInverse)
- .applyMatrix4(e.projectionMatrix),
- n = Math.abs(i.x) > 1,
- r = Math.abs(i.y) > 1,
- o = Math.abs(i.z) > 1;
- return !!(n || r || o)
- },
- hexToRGB: function(t) {
- return "rgb(" + ((t = t.replace("#", "0x")) >> 16) + "," + (t >> 8 & 255) + "," + (255 & t) + ")"
- },
- RGBToHex: function(t) {
- var e = t.split(/[^\d]+/);
- return "#" + (e[1] << 16 | e[2] << 8 | e[3])
- .toString(16)
- },
- toFixed: function(t, e) {
- var i = (t += "")
- .indexOf(".");
- return t = -1 !== i ? t.substring(0, e + i + 1) : t.substring(0), parseFloat(t)
- .toFixed(e)
- }
- }
- }, function(t, e) {
- t.exports = {
- vector: function(t, e) {
- var i = t.clone();
- return e = e.clone(),
- function(n) {
- t.set(i.x * (1 - n) + e.x * n, i.y * (1 - n) + e.y * n, i.z * (1 - n) + e.z * n)
- }
- },
- quaternion: function(t, e) {
- var i = t.clone();
- return function(n) {
- t.copy(i)
- .slerp(e, n)
- }
- },
- property: function(t, e, i, n) {
- var r = t[e];
- return function(o) {
- t[e] = r * (1 - o) + i * o, n && n(t[e])
- }
- },
- uniform: function(t, e, i) {
- var n = t.material.uniforms[e].value;
- return function(r) {
- t.material.uniforms[e] && (t.material.uniforms[e].value = n * (1 - r) + i * r)
- }
- },
- matrix4: function(t, e) {
- var i = t.clone();
- return function(n) {
- for (var r = t.elements, o = i.elements, a = e.elements, s = 0; s < 16; s++) r[s] = o[s] * (1 - n) + a[s] * n
- }
- },
- allUniforms: function(t, e, i) {
- var n = t.map(function(t) {
- return this.uniform(t, e, i)
- }.bind(this));
- return function(t) {
- n.forEach((function(e) {
- e(t)
- }))
- }
- }
- }
- }, function(t, e, i) {
- (function(e) {
- (function(n) {
- function r(t, i, n) {
- function a() {
- o.warn("Retrying ", i), r(t, i, n)
- .done(l.resolve.bind(l))
- .progress(l.notify.bind(l))
- .fail(l.reject.bind(l))
- }
- var s = function(t, e, i) {
- var n = new XMLHttpRequest;
- if (i && "withCredentials" in n) n.open(t, e, i);
- else if ("undefined" != typeof XDomainRequest)(n = new XDomainRequest)
- .open(t, e);
- else {
- if (i) throw "Browser does not support CORS!";
- n.open(t, e)
- }
- return n
- }(t, i, !1);
- if ((n = n || {})
- .retries = void 0 !== n.retries ? n.retries : 0, n.retry = void 0 !== n.retry ? n.retry : "get" === t.toLowerCase(), n.responseType)
- if (["arraybuffer", "text", "json"].indexOf(n.responseType) > -1) s.responseType = n.responseType;
- else {
- if ("image/jpeg" !== n.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
- s.responseType = "arraybuffer"
- }
- "json" === n.responseType && s.setRequestHeader("Accept", "application/json"), n.auth && s.setRequestHeader("Authorization", n.auth), "object" == typeof n.data && (n.data = JSON.stringify(n.data), s.setRequestHeader("Content-Type", "application/json"));
- var l = e.Deferred();
- return s.onreadystatechange = function(t) {
- if (4 == this.readyState)
- if (this.status >= 500 && this.status <= 600 && n.retry && n.retries < 3) n.retries++, setTimeout(a, 1e3);
- else if (200 == this.status) {
- var e = function(t, e) {
- var i = t.response;
- if ("json" === e && "object" != typeof i) try {
- i = JSON.parse(t.responseText)
- } catch (t) {
- return void l.reject({
- error: "Failed parsing JSON"
- })
- } else if ("image/jpeg" === e) {
- var n = new Uint8Array(t.response),
- r = new Blob([n], {
- type: "image/jpeg"
- }),
- o = URL.createObjectURL(r);
- (i = new Image)
- .src = o, i.crossOrigin = "Anonymous", i.onload = function() {
- URL.revokeObjectURL(o)
- }
- } return i
- }(this, n.responseType);
- l.resolve(e)
- } else l.reject(this)
- }, s.onprogress = function(t) {
- l.notify(t)
- }, s.send(n.data), l.promise()
- }
- var o = new(i(2))(n);
- window.URL = window.URL || window.webkitURL, window.REQUEST_CACHE = window.REQUEST_CACHE || {}, G.basic = window.PREFETCHED_MODELDATA, window.PREFETCHED_MODELDATA = window.PREFETCHED_MODELDATA || {}, setTimeout((function() {
- window.REQUEST_CACHE = null, window.PREFETCHED_MODELDATA = {}
- }), 6e4), window.onpageshow = function(t) {
- t.persisted && (window.REQUEST_CACHE = null, window.PREFETCHED_MODELDATA = {})
- }, t.exports = {
- get: function(t, i) {
- var n, o;
- if (s = void 0 === (i = i || {})
- .cache || i.cache) {
- var a = (n = t, window.REQUEST_CACHE ? window.REQUEST_CACHE[n] : null);
- if (a) return a
- }
- var s = i.fetchNum;
- return o = 1 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom]) : 2 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2]) : 3 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3]) : r("GET", t, i), s && function(t, e) {
- window.REQUEST_CACHE && (window.REQUEST_CACHE[t] = e)
- }(t, o), o
- },
- post: function(t, e) {
- return r("POST", t, e)
- },
- patch: function(t, e) {
- return r("PATCH", t, e)
- },
- getImage: function(t, i) {
- function n() {
- o.warn("Retrying ", t), s.getImage(t, i - 1)
- .done(r.resolve.bind(r))
- .progress(r.notify.bind(r))
- .fail(r.reject.bind(r))
- }
- var r = e.Deferred(),
- a = new Image,
- s = this;
- return null != i || (i = 3), a.onerror = function() {
- i > 0 ? setTimeout(n, 1e3) : r.reject()
- }, a.onload = function() {
- r.resolve(a)
- }, a.crossOrigin = "anonymous", a.src = t, r
- }
- }
- })
- .call(this, "/js/util/ajax.js")
- })
- .call(this, i(6))
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(1),
- 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",
- a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
- t.exports = {
- basicTextured: {
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
- 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}"
- },
- copyCubeMap: {
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- 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}",
- 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}"
- },
- cube: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- }
- },
- vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
- 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"
- },
- model: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- modelAlpha: {
- type: "f",
- value: r.modelAlpha
- },
- opacity: {
- type: "f",
- value: 1
- },
- progress: {
- type: "f",
- value: 0
- },
- blackout: {
- type: "i",
- value: 0
- },
- pano0Map: {
- type: "t",
- value: null
- },
- pano0Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano0Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano1Map: {
- type: "t",
- value: null
- },
- pano1Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano1Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- measureMode: {
- type: "i",
- value: 0
- },
- mouseAPosition: {
- type: "v2",
- value: new n.Vector2
- },
- centerT: {
- type: "v3",
- value: new n.Vector3
- },
- centerB: {
- type: "v3",
- value: new n.Vector3
- },
- virtualCameraAngle: {
- type: "f",
- value: 0
- }
- },
- vertexShader: o + ["uniform vec3 pano0Position;", "uniform mat4 pano0Matrix;", "uniform vec3 pano1Position;", "uniform mat4 pano1Matrix;", "varying vec2 vUv;", "varying vec3 vWorldPosition;", "varying vec3 vWorldPosition0;", "varying vec3 vWorldPosition1;", "void main() {", "vUv = uv;", "vec4 worldPosition = modelMatrix * vec4(position, 1.0);", "vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;", "vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;", "vWorldPosition = position.xyz;", "vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;", "vWorldPosition0.x *= -1.0;", "vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;", "vWorldPosition1.x *= -1.0;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
- fragmentShader: a + ["uniform sampler2D map;", "uniform float modelAlpha;", "uniform float opacity;", "uniform float progress;", "uniform int blackout;", "uniform vec3 pano0Position;", "uniform samplerCube pano0Map;", "uniform vec3 pano1Position;", "uniform samplerCube pano1Map;", "uniform vec2 mouseAPosition;", "uniform vec2 mousePosition;\nuniform bool measureMode;\nuniform vec3 centerT;", "uniform vec3 centerB;", "uniform float virtualCameraAngle;", "varying vec2 vUv;", "varying vec3 vWorldPosition;", "varying vec3 vWorldPosition0;", "varying vec3 vWorldPosition1;", "void main() {", "const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);", "const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);", "const vec4 GREEN = vec4(0.0, 1.0, 0.0, 1.0);", "vec4 colorFromPanos;", "vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);", "vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);", "vec4 colorFromTexture = texture2D( map, vUv );", "if (blackout == 0) {", "colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);", "} else if (blackout == 1) {", "colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));", "colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));", "} else if (blackout == 2) {", "colorFromPanos = mix(colorFromPano0, BLACK, progress);", "} else if (blackout == 3) {", "colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));", "}", "if (measureMode && distance(mouseAPosition, gl_FragCoord.xy) < 80.0) {", "colorFromPanos = mix(colorFromPanos, colorFromTexture, 1.0);", "} else {", "colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);", "}", "vec3 centerT_vW = normalize(vec3(vWorldPosition.x - centerT.x, vWorldPosition.y - centerT.y, vWorldPosition.z - centerT.z));", "vec3 centerT_B = normalize(vec3(centerB.x - centerT.x, centerB.y - centerT.y, centerB.z - centerT.z ));", "float angle = acos(dot(centerT_vW, centerT_B));", "float cosine = cos(virtualCameraAngle);", "float cosineV = distance(centerT, centerB) / distance(centerT, vWorldPosition);", "bool condition1 = (angle < virtualCameraAngle);", "bool condition2 = (cosineV >= cosine && cosineV <= 1.0);", "if ( condition1 ) {", "colorFromPanos = mix(GREEN, colorFromPanos, 0.8);", "}", "float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);", "colorFromPanos = mix(colorFromPanos, GREY, whiteness);", "gl_FragColor = vec4(colorFromPanos.rgb, opacity);", "}"].join("\n")
- },
- model2: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- modelAlpha: {
- type: "f",
- value: r.modelAlpha
- },
- opacity: {
- type: "f",
- value: 1
- },
- progress: {
- type: "f",
- value: 0
- },
- blackout: {
- type: "i",
- value: 0
- },
- pano0Map: {
- type: "t",
- value: null
- },
- pano0Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano0Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano1Map: {
- type: "t",
- value: null
- },
- pano1Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano1Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- hue0: {
- type: "f",
- value: 0
- },
- saturation0: {
- type: "f",
- value: 0
- },
- brightness0: {
- type: "f",
- value: 0
- },
- contrast0: {
- type: "f",
- value: 0
- },
- gamma0: {
- type: "f",
- value: 1
- },
- vibrance0: {
- type: "f",
- value: 0
- },
- balance0: {
- type: "v3",
- value: new n.Vector3
- },
- hue1: {
- type: "f",
- value: 0
- },
- saturation1: {
- type: "f",
- value: 0
- },
- brightness1: {
- type: "f",
- value: 0
- },
- contrast1: {
- type: "f",
- value: 0
- },
- gamma1: {
- type: "f",
- value: 1
- },
- vibrance1: {
- type: "f",
- value: 0
- },
- balance1: {
- type: "v3",
- value: new n.Vector3
- },
- base: {
- type: "f",
- value: 2
- },
- measureMode: {
- type: "i",
- value: 0
- },
- mouseAPosition: {
- type: "v2",
- value: new n.Vector2
- }
- },
- 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",
- 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;\nuniform vec2 mousePosition;\nuniform int isEditVersion;\nuniform float hue0;\nuniform float saturation0;\nuniform float brightness0;\nuniform float contrast0;\nuniform float gamma0;\nuniform float vibrance0;\nuniform float hue1;\nuniform vec3 balance0;\nuniform float saturation1;\nuniform float brightness1;\nuniform float contrast1;\nuniform float gamma1;\nuniform float vibrance1;\nuniform vec3 balance1;\nuniform float base;\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\n\nfloat bcolor( in float value, in float b ) {\n\treturn max(min(value * pow(base, b), 1.0), 0.0);\n}\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\tfloat hue = mix(hue0, hue1, progress);\n\tfloat gamma = mix(gamma0, gamma1, progress);\n\tfloat brightness = mix(brightness0, brightness1, progress);\n\tfloat contrast = mix(contrast0, contrast1, progress);\n\tfloat saturation = mix(saturation0, saturation1, progress);\n\tfloat vibrance = mix(vibrance0, vibrance1, progress);\n\tvec3 balance = mix(balance0, balance1, progress);\n\tgl_FragColor.r = bcolor(gl_FragColor.r, balance.x);\n\tgl_FragColor.g = bcolor(gl_FragColor.g, balance.y);\n\tgl_FragColor.b = bcolor(gl_FragColor.b, balance.z);\n\tif (hue!=0.0){\n float angle = hue * 3.14159265;\n float s = sin(angle), c = cos(angle);\n vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\n float len = length(gl_FragColor.rgb);\n gl_FragColor.rgb = vec3(\n dot(gl_FragColor.rgb, weights.xyz),\n dot(gl_FragColor.rgb, weights.zxy),\n dot(gl_FragColor.rgb, weights.yzx)\n );\n }\n if (saturation!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n if (saturation > 0.0) {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));\n } else {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);\n }\n\t}\n gl_FragColor.rgb += brightness;\n if (contrast!=0.0){\n if (contrast > 0.0) {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;\n } else {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;\n }\n\t}\n if (vibrance!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n float mx = max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b));\n float amt = (mx - average) * (-vibrance * 3.0);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(mx), amt);\n }\n if (gamma!=1.0){\n gl_FragColor = LinearToGamma( gl_FragColor, float( gamma ) );\n }\n}\n"
- },
- modelOutside: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- },
- brightness: {
- type: "f",
- value: 0
- }
- },
- vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
- fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float brightness;\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"
- },
- ribbon: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- },
- color: {
- type: "c",
- value: new n.Color(r.path.color)
- }
- },
- 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",
- 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"
- },
- waypoint: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- },
- pulse: {
- type: "f",
- value: 1
- },
- nearFade: {
- type: "v2",
- value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
- },
- color: {
- type: "c",
- value: new n.Color(r.reticuleColor)
- }
- },
- 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",
- 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"
- },
- modelDebug: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- modelAlpha: {
- type: "f",
- value: r.modelAlpha
- },
- depthmapRatio: {
- type: "f",
- value: 0
- },
- opacity: {
- type: "f",
- value: 1
- },
- progress: {
- type: "f",
- value: 0
- },
- considerOcclusion: {
- type: "i",
- value: r.fancierTransition
- },
- highlightPanoSelection: {
- type: "i",
- value: 0
- },
- useThirdPano: {
- type: "i",
- value: r.useThirdPano
- },
- pano0Map: {
- type: "t",
- value: null
- },
- pano0Depth: {
- type: "t",
- value: null
- },
- pano0Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano0Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano0Weight: {
- type: "f",
- value: r.transition.pano0Weight
- },
- pano1Map: {
- type: "t",
- value: null
- },
- pano1Depth: {
- type: "t",
- value: null
- },
- pano1Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano1Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano1Weight: {
- type: "f",
- value: r.transition.pano1Weight
- },
- pano2Map: {
- type: "t",
- value: null
- },
- pano2Depth: {
- type: "t",
- value: null
- },
- pano2Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano2Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano2Weight: {
- type: "f",
- value: r.transition.pano2Weight
- }
- },
- 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",
- 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"
- },
- customDepth: {
- uniforms: {
- panoPosition: {
- type: "v3",
- value: new n.Vector3
- }
- },
- 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",
- 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"
- },
- skysphere: {
- uniforms: {
- radius: {
- type: "f",
- value: 0
- }
- },
- 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",
- 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"
- },
- tagDisc: {
- uniforms: {
- opacity: {
- type: "f",
- value: 0
- },
- color: {
- type: "c",
- value: new n.Color
- },
- bg: {
- type: "t",
- value: null
- },
- mask: {
- type: "t",
- value: null
- }
- },
- vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
- 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"
- }
- }
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(9),
- o = [];
- t.exports = {
- drawLine: function(t, e, i) {
- var r = new n.Geometry;
- r.vertices.push(t.clone()), r.vertices.push(e.clone());
- var o = new n.LineBasicMaterial({
- color: i
- });
- return new n.Line(r, o, n.LineSegments)
- },
- initCanvasLabel: function(t, e, i) {
- var r = document.createElement("canvas"),
- o = r.getContext("2d");
- o.font = t.fontSize + "px " + t.fontFace;
- var a = o.measureText(t.text)
- .width + t.fontSize,
- s = t.fontSize + t.fontSize,
- l = s / 10;
- r.width = a, r.height = s, o.lineWidth = 2, o.strokeStyle = e, o.fillStyle = e,
- function(t, e, i, n, r, o) {
- t.beginPath(), t.moveTo(e, i + o), t.lineTo(e, i + r - o), t.quadraticCurveTo(e, i + r, e + o, i + r), t.lineTo(e + n - o, i + r), t.quadraticCurveTo(e + n, i + r, e + n, i + r - o), t.lineTo(e + n, i + o), t.quadraticCurveTo(e + n, i, e + n - o, i), t.lineTo(e + o, i), t.quadraticCurveTo(e, i, e, i + o), t.stroke(), t.fill(), t.closePath()
- }(o, 2, 2, a - 4, s - 4, l),
- function(t, e) {
- t.fillStyle = i, t.font = e.fontSize + "px " + e.fontFace, t.textAlign = "center", t.textBaseline = "middle", t.fillText(e.text, a / 2, s / 2 + 2), t.fillText(e.text, a / 2, s / 2 + 2)
- }(o, t);
- var u = new n.CanvasTexture(r);
- return u.minFilter = n.LinearFilter, u.magFilter = n.LinearFilter, u.needsUpdate = !0, {
- texture: u,
- canvas: r
- }
- },
- drawBoxHelperOfLine2: function(t, e, i) {
- for (var o = r.getVerticesOfItemSize(t.geometry), a = {}, s = 0; s < o.length; ++s) {
- var l = o[s];
- a["v" + s] = [l.x, l.y, l.z]
- }
- var u = new n.LineMaterial({
- color: e,
- linewidth: 2,
- resolution: new n.Vector2(i.width, i.height)
- }),
- h = [a.v0.concat(a.v1)
- .concat(a.v5)
- .concat(a.v4)
- .concat(a.v0), a.v2.concat(a.v3)
- .concat(a.v7)
- .concat(a.v6)
- .concat(a.v2), a.v0.concat(a.v3), a.v1.concat(a.v2), a.v5.concat(a.v6), a.v4.concat(a.v7)
- ],
- c = new n.Group;
- for (s = 0; s < h.length; ++s) {
- var d = new n.LineGeometry;
- d.setPositions(h[s]);
- var p = new n.Line2(d, u);
- c.add(p)
- }
- return c
- },
- drawFatLine: function(t, e, i, r) {
- var o = new n.LineGeometry;
- o.setPositions([t.x, t.y, t.z, e.x, e.y, e.z]);
- var a = new n.LineMaterial({
- color: i,
- linewidth: r,
- resolution: new n.Vector2((window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight))
- }),
- s = new n.Line2(o, a);
- return s.computeLineDistances(), s.renderOrder = 99, s.scale.set(1, 1, 1), s
- },
- triggerLimit: function(t) {
- o.push(Date.now() || (new Date)
- .getTime());
- return 2 === o.length && (o[1] - o[0] < t ? (o.pop(), !0) : (o.shift(), !1))
- }
- }
- }, function(t, e) {
- t.exports = function(t) {
- this.message = t
- }
- }, function(t, e) {
- var i = {
- linearTween: function(t, e, i, n) {
- return i * t / n + e
- },
- easeInQuad: function(t, e, i, n) {
- return i * (t /= n) * t + e
- },
- easeOutQuad: function(t, e, i, n) {
- return -i * (t /= n) * (t - 2) + e
- },
- easeInOutQuad: function(t, e, i, n) {
- return (t /= n / 2) < 1 ? i / 2 * t * t + e : -i / 2 * (--t * (t - 2) - 1) + e
- },
- easeInCubic: function(t, e, i, n) {
- return i * (t /= n) * t * t + e
- },
- easeOutCubic: function(t, e, i, n) {
- return t /= n, i * (--t * t * t + 1) + e
- },
- easeInOutCubic: function(t, e, i, n) {
- return (t /= n / 2) < 1 ? i / 2 * t * t * t + e : i / 2 * ((t -= 2) * t * t + 2) + e
- },
- easeInQuart: function(t, e, i, n) {
- return i * (t /= n) * t * t * t + e
- },
- easeOutQuart: function(t, e, i, n) {
- return t /= n, -i * (--t * t * t * t - 1) + e
- },
- easeInOutQuart: function(t, e, i, n) {
- return (t /= n / 2) < 1 ? i / 2 * t * t * t * t + e : -i / 2 * ((t -= 2) * t * t * t - 2) + e
- },
- easeInQuint: function(t, e, i, n) {
- return i * (t /= n) * t * t * t * t + e
- },
- easeOutQuint: function(t, e, i, n) {
- return t /= n, i * (--t * t * t * t * t + 1) + e
- },
- easeInOutQuint: function(t, e, i, n) {
- return (t /= n / 2) < 1 ? i / 2 * t * t * t * t * t + e : i / 2 * ((t -= 2) * t * t * t * t + 2) + e
- },
- easeInSine: function(t, e, i, n) {
- return -i * Math.cos(t / n * (Math.PI / 2)) + i + e
- },
- easeOutSine: function(t, e, i, n) {
- return i * Math.sin(t / n * (Math.PI / 2)) + e
- },
- easeInOutSine: function(t, e, i, n) {
- return -i / 2 * (Math.cos(Math.PI * t / n) - 1) + e
- },
- easeInExpo: function(t, e, i, n) {
- return i * Math.pow(2, 10 * (t / n - 1)) + e
- },
- easeOutExpo: function(t, e, i, n) {
- return i * (1 - Math.pow(2, -10 * t / n)) + e
- },
- easeInOutExpo: function(t, e, i, n) {
- return (t /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (t - 1)) + e : (t--, i / 2 * (2 - Math.pow(2, -10 * t)) + e)
- },
- easeInCirc: function(t, e, i, n) {
- return t /= n, -i * (Math.sqrt(1 - t * t) - 1) + e
- },
- easeOutCirc: function(t, e, i, n) {
- return t /= n, t--, i * Math.sqrt(1 - t * t) + e
- },
- easeInOutCirc: function(t, e, i, n) {
- return (t /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - t * t) - 1) + e : (t -= 2, i / 2 * (Math.sqrt(1 - t * t) + 1) + e)
- },
- easeInElastic: function(t, e, i, n) {
- var r = 1.70158,
- o = 0,
- a = i;
- return 0 === t ? e : 1 == (t /= n) ? e + i : (o || (o = .3 * n), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), -a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) + e)
- },
- easeOutElastic: function(t, e, i, n) {
- var r = 1.70158,
- o = 0,
- a = i;
- return 0 === t ? e : 1 == (t /= n) ? e + i : (o || (o = .3 * n), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), a * Math.pow(2, -10 * t) * Math.sin((t * n - r) * (2 * Math.PI) / o) + i + e)
- },
- easeInOutElastic: function(t, e, i, n) {
- var r = 1.70158,
- o = 0,
- a = i;
- return 0 === t ? e : 2 == (t /= n / 2) ? e + i : (o || (o = n * (.3 * 1.5)), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), t < 1 ? a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) * -.5 + e : a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) * .5 + i + e)
- },
- easeInBack: function(t, e, i, n, r) {
- return void 0 === r && (r = 1.70158), i * (t /= n) * t * ((r + 1) * t - r) + e
- },
- easeOutBack: function(t, e, i, n, r) {
- return void 0 === r && (r = 1.70158), i * ((t = t / n - 1) * t * ((r + 1) * t + r) + 1) + e
- },
- easeInOutBack: function(t, e, i, n, r) {
- return void 0 === r && (r = 1.70158), (t /= n / 2) < 1 ? i / 2 * (t * t * ((1 + (r *= 1.525)) * t - r)) + e : i / 2 * ((t -= 2) * t * ((1 + (r *= 1.525)) * t + r) + 2) + e
- },
- easeOutBounce: function(t, e, i, n) {
- return (t /= n) < 1 / 2.75 ? i * (7.5625 * t * t) + e : t < 2 / 2.75 ? i * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + e : t < 2.5 / 2.75 ? i * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + e : i * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + e
- },
- easeInBounce: function(t, e, i, r) {
- return i - n.easeOutBounce(r - t, 0, i, r) + e
- },
- easeInOutBounce: function(t, e, i, r) {
- return t < r / 2 ? .5 * n.easeInBounce(2 * t, 0, i, r) + e : .5 * n.easeOutBounce(x, 2 * t - r, 0, i, r) + .5 * i + e
- }
- };
- t.exports = i
- }, function(t, e, i) {
- var n = i(11),
- r = i(0),
- o = {};
- t.exports = {
- load: function(t, e, i) {
- var a = o[t];
- return a ? (e && setTimeout((function() {
- e(a)
- }), 1), a) : ((a = new r.Texture)
- .sourceFile = t, o[t] = a, n.getImage(t)
- .then((function(t) {
- a.image = t, a.needsUpdate = !0, e && e(a)
- }))
- .fail(i), a)
- },
- loadBase64: function(t, e) {
- e = e || "png";
- var i = new r.Texture;
- return i.image = document.createElement("img"), i.image.setAttribute("src", "data:image/" + e + ";base64," + t), i.needsUpdate = !0, i
- },
- loadurl: function(t) {
- var e = new r.TextureLoader;
- return e.setCrossOrigin(!0), e.load(t)
- },
- loadCanvas: function(t) {
- var e = t.replace(/\s*/g, ""),
- i = new RegExp("^[a-zA-Z]+$"),
- n = "rgba(0,0,0,.4)",
- o = "rgba(0,0,0,.4)";
- (l = (s = document.createElement("canvas"))
- .getContext("2d"))
- .font = "100px Arial";
- var a, s, l, u = l.measureText(t),
- h = (a = i.test(e) ? 1.05 * u.width + 120 : u.width + 60) + 4;
- (l = (s = document.createElement("canvas"))
- .getContext("2d"))
- .canvas.width = h, l.canvas.height = 144, l.font = "Bold 100px Arial",
- function(t, e, i, r, a, s) {
- t.beginPath(), t.moveTo(e + s, i), t.lineWidth = 1, t.strokeStyle = o, t.fillStyle = n, t.arcTo(e + r, i, e + r, i + a, s), t.arcTo(e + r, i + a, e, i + a, s), t.arcTo(e, i + a, e, i, s), t.arcTo(e, i, e + r, i, s), t.stroke(), t.fill(), t.closePath()
- }(l, 1, 1, a + 2, 142, 30), l.fillStyle = "rgba(255,255,255, .85)", i.test(e) ? l.fillText(t, 62, 102) : l.fillText(t, 32, 102);
- var c = new r.Texture(s);
- return c.minFilter = r.LinearFilter, c.magFilter = r.LinearFilter, c.needsUpdate = !0, c
- },
- loadCanvasRe: function(t, e) {
- t.replace(/\s*/g, ""), new RegExp("^[a-zA-Z]+$");
- t = t || "", e = e || "Center";
- var i = document.createElement("canvas"),
- n = i.getContext("2d");
- i.width = 256, i.height = 256;
- n.font = "bold 54px Arial";
- var o = n.measureText(t)
- .width;
- ! function(t, e, i, r, o, a, s, l) {
- n.beginPath(), n.moveTo(t + o, e), n.lineWidth = a, n.strokeStyle = s, n.fillStyle = l, n.arcTo(t + i, e, t + i, e + r, o), n.arcTo(t + i, e + r, t, e + r, o), n.arcTo(t, e + r, t, e, o), n.arcTo(t, e, t + i, e, o), n.stroke(), n.fill(), n.closePath()
- }(5, 87, 246, 100, 30, 0, "rgba(0,0,0,.4)", "rgba(0,0,0,.4)"), n.fillStyle = "rgba(255,255,255,.85)", n.fillText(t, (i.width - o) / 2, (i.height + 54) / 2);
- var a = new r.Texture(i);
- return a.needsUpdate = !0, a
- },
- loadCanvasIn: function(t) {
- var e = 255,
- i = 255,
- n = 255,
- o = .85,
- a = "rgba(0,0,0,.4)",
- s = "rgba(0,0,0,.4)";
- (u = (l = document.createElement("canvas"))
- .getContext("2d"))
- .font = "100px Arial";
- var l, u, h = u.measureText(t)
- .width + 60,
- c = h + 4;
- (u = (l = document.createElement("canvas"))
- .getContext("2d"))
- .canvas.width = c, u.canvas.height = 144, u.font = "Bold 100px Arial",
- function(t, e, i, n, r, o) {
- t.beginPath(), t.moveTo(e + o, i), t.lineWidth = 1, t.strokeStyle = s, t.fillStyle = a, t.arcTo(e + n, i, e + n, i + r, o), t.arcTo(e + n, i + r, e, i + r, o), t.arcTo(e, i + r, e, i, o), t.arcTo(e, i, e + n, i, o), t.stroke(), t.fill(), t.closePath()
- }(u, 1, 1, h + 2, 142, 30), u.fillStyle = "rgba(" + e + "," + i + "," + n + "," + o + ")", u.fillText(t, 32, 102);
- var d = new r.Texture(l);
- return d.minFilter = r.LinearFilter, d.magFilter = r.LinearFilter, d.needsUpdate = !0, d
- },
- isLoaded: function(t) {
- return !!o[t]
- }
- }
- }, function(t, e) {
- t.exports = {
- visibleFloor: 1,
- ghostFloor: 3,
- boundingSkybox: 1,
- panoMarker: 2,
- reticule: 3,
- mattertagDisc: 1,
- mattertagCutout: 2,
- mattertagStem: 3,
- ribbon: 100
- }
- }, function(t, e, i) {
- var n = i(0);
- t.exports = {
- UP: new n.Vector3(0, 1, 0),
- DOWN: new n.Vector3(0, -1, 0),
- LEFT: new n.Vector3(-1, 0, 0),
- RIGHT: new n.Vector3(1, 0, 0),
- FORWARD: new n.Vector3(0, 0, -1),
- BACK: new n.Vector3(0, 0, 1)
- }
- }, function(t, e, i) {
- "use strict";
- (function(e) {
- var n, r = i(22),
- o = i(3),
- a = i(0),
- s = i(2),
- l = i(1),
- u = i(17),
- h = i(106),
- c = i(8),
- d = i(10),
- p = i(11),
- f = i(16),
- m = i(36),
- g = i(107),
- v = i(55),
- y = i(23),
- b = i(14),
- w = i(30),
- x = i(4)
- .EventEmitter,
- M = new s("/js/objects/Panorama.js"),
- T = new a.SphereBufferGeometry(.1),
- S = new a.PlaneBufferGeometry(.2, .2, 1, 1),
- _ = f.loadurl(r.splitUrl("./images/texture/location/location_512x512.png")),
- A = f.loadurl(r.splitUrl("./images/texture/location/disable_512x512.png")),
- P = parseInt(o.getQueryString("reticule"));
- function C(t, e, i, n) {
- if (this.model = t, this.enable = i.enable, this.id = e, this.alignmentType = i.alignmentType || h.ALIGNED, this.u = i.u || 0, this.v = i.v || 0, this.roomid = i.roomid, this.neighbourUUIDs = i.neighbours || null, this.neighbourPanos = null, this.floor = null, this.floorIndex = i.floor, this.failedLoadingAt = 0, this.maxLoadRetries = 4, this.adjustAngleEnable = i.angle_enable, this.adjustTAngleX = 0, this.adjustTAngleY = 0, this.adjustTAngleZ = 0, this.adjustAngleX = i.angle_x, this.adjustAngleY = i.angle_y, this.adjustAngleZ = i.angle_z, this.color = {
- brightness: i.color.brightness,
- contrast: i.color.contrast,
- gamma: i.color.gamma,
- hue: i.color.hue,
- saturation: i.color.saturation,
- vibrance: i.color.vibrance,
- balance: i.color.balance
- }, this.origin = i.position.clone(), this.originPosition = i.position.clone(), this.position = this.alignmentType === h.UNALIGNED ? new a.Vector3(0, -5, 0) : i.position.clone(), this.quaternion = i.quaternion.clone(), this.quaternionAutoScene = i.quaternionAutoScene.clone(), this.skyboxMesh = new a.Mesh(T), this.skyboxMesh.position.copy(this.position), this.skyboxMesh.quaternion.copy(this.quaternion), this.skyboxMesh.name = "skybox", this.skyboxMesh.visible = !1, this.skyboxMesh.updateMatrix(), this.marker = null, this.isAligned()) {
- var o = this.enable ? _ : A;
- this.marker = new a.Mesh(S, new a.MeshBasicMaterial({
- map: o,
- side: a.DoubleSide,
- opacity: 1,
- transparent: !0,
- depthWrite: !1
- })), this.marker.renderOrder = u.panoMarker, this.marker.name = "marker", this.marker.pano = this, this.marker.userData.postils = {}, this.marker.userData.default_texture = o, l.colorMarkerOnLoad && this.on("load", (function() {
- this.marker.material.color.set(65280)
- }))
- }
- this.debugColor = (new a.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 a.Texture([null, null, null, null, null, null]), this.solidSkybox.flipY = !1, l.minimalMemoryMode && (this.solidSkybox.minFilter = a.LinearFilter, this.solidSkybox.magFilter = a.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, l.colorMarkerOnLoad && this.on("load", (function() {
- this.marker.material.color.set(65280)
- })), 1 === P && this.marker && this.marker.visible && (this.marker.visible = !1);
- var s = new a.TextureLoader;
- s.setCrossOrigin(!0);
- var c = s.load(r.splitUrl("./images/texture.jpg"));
- if (this.vrMarker = new a.Mesh(new a.OctahedronGeometry(.1, 0), new a.MeshLambertMaterial({
- color: 16777215,
- transparent: !0,
- opacity: .75,
- map: c
- })), 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), l.showAxis && (this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0, 1, 0), new a.Vector3(0, 0, 0), 1, 255)), this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0, 0, 1), new a.Vector3(0, 0, 0), 1, 16711680)), this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(1, 0, 0), new a.Vector3(0, 0, 0), 1, 65280))), this.adjustAngleEnable) {
- var d = new a.Quaternion;
- d.setFromAxisAngle(new a.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(d);
- var p = new a.Quaternion;
- p.setFromAxisAngle(new a.Vector3(0, 1, 0), this.adjustAngleY), this.skyboxMesh.quaternion.multiply(p);
- var f = new a.Quaternion;
- f.setFromAxisAngle(new a.Vector3(0, 0, 1), this.adjustAngleZ), this.skyboxMesh.quaternion.multiply(f), this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos()
- }
- if (t.rooms_real) {
- var m = t.rooms_real.findIndex((function(t) {
- return i.roomid == t.roomidx
- })); - 1 !== m && (m = t.rooms_real[m], this.areaName = m.roomname, this.areasPoints = JSON.parse(m.kpoints), this.areaSize = m.area)
- }
- }
- C.prototype = Object.create(x.prototype), C.prototype.enter = function() {
- this.emit("enter")
- }, C.prototype.exit = function() {
- 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")
- }, C.prototype.hoverOn = function(t) {
- this.marker && (c.start(d.property(this.marker.material, "opacity", l[t].markerOpacityOnHover), 250), l.navigation.panoScores & l.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
- }, C.prototype.hoverOff = function(t) {
- this.marker && c.start(d.property(this.marker.material, "opacity", l[t].markerOpacity), 250)
- }, C.prototype.build1 = function() {
- 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(), l.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
- }, C.prototype.build2 = function() {
- this.floorPosition = this.floorPosition || this.interpolateFloorPosition(), this.height = this.position.distanceTo(this.floorPosition), this.placeMarker()
- }, C.prototype.updateAngleDisplay = function() {}, C.prototype.updateColorDisplay = function() {}, C.prototype.changeColor = function(t, e, i) {
- "balance_R" === e ? this.color.balance.x = i / 100 : "balance_G" === e ? this.color.balance.y = i / 100 : "balance_B" === e ? this.color.balance.z = i / 100 : this.color[e] = i / 100, t.setProjectedPanos(this, this, !1)
- }, C.prototype.resetColor = function(t) {
- this.color.brightness = 0, this.color.contrast = 0, this.color.gamma = 1, this.color.hue = 0, this.color.saturation = 0, this.color.vibrance = 0, this.color.balance = new a.Vector3, this.updateColorDisplay(), t.setProjectedPanos(this, this, !1)
- }, C.prototype.applyAllColor = function(t) {
- for (var e = 0; e < t.panos.list.length; e++) t.panos.list[e].color.brightness = this.color.brightness, t.panos.list[e].color.contrast = this.color.contrast, t.panos.list[e].color.gamma = this.color.gamma, t.panos.list[e].color.hue = this.color.hue, t.panos.list[e].color.saturation = this.color.saturation, t.panos.list[e].color.vibrance = this.color.vibrance, t.panos.list[e].color.balance.copy(this.color.balance)
- }, C.prototype.updateTAngleDisplay = function() {}, C.prototype.updateAngle = function(t, e) {
- function i(t) {
- var e = parseFloat(t);
- if (!isNaN(e)) return e = Math.round(1e3 * t) / 1e3
- }
- if ("x" == t) {
- var n = new a.Vector3(1, 0, 0);
- if (0 == e)(r = new a.Quaternion)
- .setFromAxisAngle(n, -this.adjustAngleX), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleX = 0;
- else if (1 == e) {
- var r = new a.Quaternion;
- null == this.adjustAngleX && (this.adjustAngleX = 0), this.adjustAngleX += .005, this.adjustAngleX = i(this.adjustAngleX), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r)
- } else if (2 == e) {
- r = new a.Quaternion;
- null == this.adjustAngleX && (this.adjustAngleX = 0), this.adjustAngleX -= .005, this.adjustAngleX = i(this.adjustAngleX), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r)
- }
- } else if ("y" == t) {
- n = new a.Vector3(0, 1, 0);
- if (0 == e)(r = new a.Quaternion)
- .setFromAxisAngle(n, -this.adjustAngleY), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleY = 0;
- else if (1 == e) {
- r = new a.Quaternion;
- null == this.adjustAngleY && (this.adjustAngleY = 0), this.adjustAngleY += .005, this.adjustAngleY = i(this.adjustAngleY), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r)
- } else if (2 == e) {
- r = new a.Quaternion;
- null == this.adjustAngleY && (this.adjustAngleY = 0), this.adjustAngleY -= .005, this.adjustAngleY = i(this.adjustAngleY), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r)
- }
- } else if ("z" == t) {
- n = new a.Vector3(0, 0, 1);
- if (0 == e)(r = new a.Quaternion)
- .setFromAxisAngle(n, -this.adjustAngleZ), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleZ = 0;
- else if (1 == e) {
- r = new a.Quaternion;
- null == this.adjustAngleZ && (this.adjustAngleZ = 0), this.adjustAngleZ += .005, this.adjustAngleZ = i(this.adjustAngleZ), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r)
- } else if (2 == e) {
- r = new a.Quaternion;
- null == this.adjustAngleZ && (this.adjustAngleZ = 0), this.adjustAngleZ -= .005, this.adjustAngleZ = i(this.adjustAngleZ), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r)
- }
- }
- this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos()
- }, C.prototype.updateTAngle = function(t, e) {
- function i(t) {
- var e = parseFloat(t);
- if (!isNaN(e)) return e = Math.round(1e3 * t) / 1e3
- }
- if ("" !== e) {
- if ("y" == t) {
- var n = new a.Vector4(0, i(e), 0, 0);
- n.applyMatrix4(this.skyboxMesh.matrix), this.adjustTAngleY = i(e), this.position.setX(this.originPosition.x + n.x), this.position.setY(this.originPosition.y + n.y), this.position.setZ(this.originPosition.z + n.z), this.skyboxMesh.position.copy(this.position)
- }
- this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos(), this.position.setFromMatrixPosition(this.skyboxMesh.matrixWorld)
- }
- }, C.prototype.update = function(t) {
- this.skyboxMesh.updateMatrixWorld()
- }, C.prototype.interpolateFloorPosition = function() {
- var t = this.model.panos.filter(C.filters.isNeighbourPanoTo(this))
- .filter((function(t) {
- return !!t.floorPosition
- }))
- .sort(function(t, e) {
- return t.position.distanceTo(this.position) - e.position.distanceTo(this.position)
- }.bind(this)),
- e = this.position.clone();
- return t.length >= 2 ? e.y = (t[0].floorPosition.y + t[1].floorPosition.y) / 2 : e.add(l.noMeshFloorPositionOffset), e
- }, C.prototype.raycastFloorPosition = function() {
- M.warn("Performance warning: Raycasting to find floor position");
- var t = new a.Raycaster(this.position, new a.Vector3(0, -1, 0))
- .intersectObjects(this.model.colliders);
- return t.length ? t[0].point : null
- }, C.prototype.raycastToFindFloor = (n = [new a.Vector3(0, -1, 0), new a.Vector3(1, -1, 0), new a.Vector3(0, -1, 1), new a.Vector3(-1, -1, 0), new a.Vector3(0, -1, -1), new a.Vector3(1, 0, 0), new a.Vector3(0, 0, 1), new a.Vector3(-1, 0, 0), new a.Vector3(0, 0, -1)], function() {
- for (var t = 0; t < n.length; t++) {
- var e = new a.Raycaster(this.position.clone(), n[t].clone())
- .intersectObjects(this.model.colliders);
- if (e.length) return e[0].object.parent.parent
- }
- return null
- }), C.prototype.placeMarker = function() {
- this.marker && (this.marker.position.copy(this.floorPosition), this.marker.position.y += .05, this.marker.lookAt(new a.Vector3(0, 1, 0)
- .add(this.marker.position)))
- }, C.prototype.findClosestMidtpointPanoTo = function(t) {
- return (new a.Vector3)
- .addVectors(this.position, t.position)
- .divideScalar(2), this.model.panos.find([C.filters.notIn([this, t])], [C.sortFunctions.distanceToPoint(point)])
- }, C.prototype.attachToPanoRenderer = function(t) {
- this.panoRenderer = t, this.panoRenderer.on(v.TileRenderSuccess, this.onTileRendered.bind(this)), this.panoRenderer.on(v.PanoRenderComplete, this.onPanoRendered.bind(this)), this.panoRenderer.on(v.TileRenderFailure, this.onTileRenderFail.bind(this)), this.panoRenderer.on(v.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
- };
- var E = {};
- C.prototype.getWaitDeferred = function(t) {
- var i = E[this.id];
- i || (i = {}, E[this.id] = i);
- var n = i[t];
- return n || (n = {
- deferred: e.Deferred(),
- active: !1
- }, i[t] = n), n
- }, C.prototype.resetWaitDeferred = function(t) {
- var i = this.getWaitDeferred(t);
- i.active = !1, i.deferred = e.Deferred()
- }, C.prototype.clearWaitDeferreds = function() {
- var t = E[this.id];
- for (var i in t || (t = {}, E[this.id] = t), t)
- if (t.hasOwnProperty(i)) {
- var n = t[i];
- n.active = !1, n.deferred = e.Deferred()
- }
- }, C.prototype.loadTiledPano = function() {
- var t = [],
- e = [];
- return function(i, n, r, o, a, s) {
- null != o || (o = !0), null != a || (a = !0);
- var l = this.getWaitDeferred(i),
- u = l.deferred,
- h = null,
- c = null;
- if (r && ("number" == typeof r ? h = r : (h = r.hFov, c = r.vFov)), !this.isLoaded(i)) {
- if (!l.active) {
- if (l.active = !0, r) {
- var d = w.matchingTilesInDirection(this, i, n, h, c);
- t[this.id + ":" + i] = {
- tileCount: 0,
- targetTileCount: d
- }, M.info("Loading partial pano: " + this.id + " with " + d + " tiles")
- }
- e[this.id] || (e[this.id] = !0, this.on(g.LoadComplete, function(t, e) {
- var i = this.getWaitDeferred(t)
- .deferred;
- i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= t && (i.resolve(t, e), this.resetWaitDeferred(t))
- }.bind(this)), this.on(g.LoadFailed, function(t) {
- var e = this.getWaitDeferred(t)
- .deferred;
- e && "pending" === e.state() && this.highestPartialTileRenderOpCompleted >= t && (e.reject(t), this.resetWaitDeferred(t))
- }.bind(this)), this.on(g.TileLoaded, function(e, i, n) {
- this.id == window.firstPanoId && 512 == e && window.loadingCount++;
- var r = this.getWaitDeferred(e)
- .deferred;
- if (r && "pending" === r.state()) {
- r.notify(e, i, n);
- var o = t[this.id + ":" + e];
- o && (o.tileCount++, o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, e, n, !0), r.resolve(e, n), this.resetWaitDeferred(e)))
- }
- }.bind(this)))
- }
- this.tileDownloader.forceQueueTilesForPano(this, i, n, h, c, s), this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxPanoSize(), o, a), this.panoRenderer.renderPanoTiles(this.id, n, a)
- }
- return u.promise()
- }
- }(), C.prototype.onUploadAttemptedForAllTiles = function(t, e, i) {
- o.isMobile() || t === this.id && e === this.qualityManager.getPanoSize(y.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1, this.panoRenderer.resetRenderStatus(t), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
- }, C.prototype.onTileRendered = function(t, e, i, n) {
- t === this.id && this.emit(g.TileLoaded, e, i, n)
- }, C.prototype.onPanoRendered = function(t, e, i, n) {
- t === this.id && (this.minimumTiledPanoLoaded = !0, this.skybox = this.tiledPanoRenderTarget.texture, e > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = e), !n && e > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = e), this.emit("load", e), this.model.emit("load", this), this.emit(g.LoadComplete, e, i))
- }, C.prototype.onTileRenderFail = function(t, e, i) {
- t === this.id && this.emit(g.LoadFailed, e)
- }, C.prototype.getSkyboxTexture = function() {
- return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
- }, C.prototype.isLoaded = function(t) {
- if (this.tiled) {
- if (t && "string" == typeof t) throw new b("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
- return !!this.minimumTiledPanoLoaded && (!t || this.highestPartialTileRenderOpCompleted >= t)
- }
- if (t && "number" == typeof t) throw new b("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
- return !!this.solidSkybox.high || t in this.solidSkybox
- }, C.prototype.getAjustedColors = function() {
- return this.color
- }, C.prototype.loadCube = function(t) {
- if (this.isLoaded(t)) return M.info("Skipping load of pano, already loaded"), e.when();
- this.emit("loading", t), this.model.emit("loading", this);
- var i = m.getCubemapUrls(this.model.urls, this.id, t),
- n = i.filter((function(t) {
- return !t
- }));
- "low" === t && n.length > 0 && (M.info("Pano", this.id, "not available in low res, loading high res right away"), t = "high", i = m.getCubemapUrls(this.model.urls, this.id, t));
- var r = 0,
- o = [0, 1, 2, 3, 4, 5].map(function(t, e, n) {
- return p.getImage(i[e])
- }.bind(this)),
- a = t;
- return e.when(o[0], o[1], o[2], o[3], o[4], o[5])
- .then(function(t, e, i, n, r, o) {
- return this.solidSkybox[a] = [t, e, 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
- }.bind(this), function() {
- I.error("Downloading cubemap for pano", this.id, "failed"), this.failedLoadingAt = Date.now()
- }.bind(this), (function() {
- return e.when(++r, 6)
- }))
- }, C.raycastsSkipped = 0, C.raycastsDone = 0, C.prototype.findNeighourPanos = function() {
- return this.model.panos.setNeighbour(this.id, this.id, !1), this.model.panos.forEach(function(t) {
- if (t !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][t.id])) {
- var e = this.position.distanceTo(t.position);
- if (e > l.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, t, !1), void C.raycastsSkipped++;
- var i = t.position.clone()
- .sub(this.position)
- .normalize(),
- n = new a.Raycaster(this.position, i.clone(), 0, e)
- .intersectObjects(this.model.colliders);
- C.raycastsDone++, this.model.panos.setNeighbour(this, t, 0 === n.length), l.showNeighbourRaycasts && (n.length ? this.floor.model.add(new a.ArrowHelper(i, this.position, n[0].distance, 16711680)) : this.floor.model.add(new a.ArrowHelper(i, this.position, e, 16777215, 0, 0)))
- }
- }.bind(this)), this.model.panos.neighbourMap[this.id]
- }, C.prototype.worldPosition = function() {
- return this.position
- }, C.prototype.addTextSprite = function(t, e) {
- this.removeTextSprite();
- var i = document.createElement("canvas"),
- n = i.getContext("2d");
- i.width = 256, i.height = 256;
- n.font = "bold 60px Arial", n.fillStyle = "white";
- var r = n.measureText(t)
- .width;
- n.fillText(t, (i.width - r) / 2, (i.height + 60) / 2);
- var o = new a.Texture(i);
- o.needsUpdate = !0;
- var s = new a.SpriteMaterial({
- map: o,
- color: e || 16428055
- });
- this.text3d = new a.Sprite(s), this.text3d.position.copy(this.skyboxMesh.position), this.floor.add(this.text3d)
- }, C.prototype.removeTextSprite = function() {
- this.text3d && (this.floor.remove(this.text3d), this.text3d = null)
- }, C.prototype.removeLocationTextSprite = function() {
- this.locationText && (this.floor.remove(this.locationText), this.locationText = null)
- }, C.prototype.isAligned = function() {
- return this.alignmentType === h.ALIGNED
- }, C.filters = {
- inDirection: function(t, e, i) {
- return function(n) {
- return n.position.clone()
- .sub(t)
- .normalize()
- .dot(e) > i
- }
- },
- inFloorDirection: function(t, e, i) {
- return function(n) {
- return n.floorPosition.clone()
- .sub(t)
- .normalize()
- .dot(e) > i
- }
- },
- inPanoDirection: function(t, e, i) {
- return i = l.navigation.panoScores ? l.navigation.filterStrictness : i,
- function(n) {
- var r = n.floorPosition.clone()
- .sub(t)
- .normalize(),
- o = n.position.clone()
- .sub(t)
- .normalize();
- return r.dot(e) > i || o.dot(e) > i
- }
- },
- atFloor: function(t) {
- return function(e) {
- return !t || e.floor === t
- }
- },
- not: function(t) {
- return function(e) {
- return e != t
- }
- },
- notIn: function(t) {
- return function(e) {
- return -1 === t.indexOf(e)
- }
- },
- isLoaded: function() {
- return function(t) {
- return t.isLoaded()
- }
- },
- isNotLoaded: function() {
- return function(t) {
- return !t.isLoaded()
- }
- },
- isCloseEnoughTo: function(t, e) {
- return function(i) {
- return t.distanceTo(i.floorPosition) < e
- }
- },
- hasMinimumHeightDifferenceTo: function(t, e) {
- return function(i) {
- return Math.abs(i.position.y - t.y) > e
- }
- },
- isNotBehindNormal: function(t, e) {
- var i = new a.Vector3;
- return e = e.clone(),
- function(n) {
- return i.copy(n.position)
- .sub(t)
- .normalize()
- .dot(e) > 0
- }
- },
- isNeighbourPanoTo: function(t) {
- return function(e) {
- return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
- }
- },
- isNeighbourOfNeighbourTo: function(t) {
- return function(e) {
- return !!t.neighbourPanos[e.id] || t.neighbourUUIDs.some((function(i) {
- var n = t.model.panos.get(i);
- return !!n && n.neighbourPanos[e.id]
- }))
- }
- },
- isNotRecentlyFailed: function(t) {
- return function(e) {
- return Date.now() - e.failedLoadingAt > t
- }
- },
- isOnVisibleFloor: function() {
- return function(t) {
- return !t.floor.hidden
- }
- },
- isPanoAligned: function() {
- return function(t) {
- return t.isAligned()
- }
- }
- }, C.sortFunctions = {
- distanceToPoint: function(t) {
- return function(e, i) {
- return e.position.distanceTo(t) - i.position.distanceTo(t)
- }
- },
- floorDistanceToPoint: function(t) {
- return function(e, i) {
- return e.floorPosition.distanceTo(t) - i.floorPosition.distanceTo(t)
- }
- },
- choose: function(t) {
- return function(e, i) {
- return t.id === e.id ? -1 : t.id === i.id ? 1 : 0
- }
- }
- }, C.scoreFunctions = {
- distance: function(t, e) {
- return e = e || l.navigation.distanceFactor,
- function(i) {
- return t ? t.position.distanceTo(i.position) * e : 0
- }
- },
- distanceSquared: function(t, e) {
- return e = e || l.navigation.distanceFactor,
- function(i) {
- return t ? t.position.distanceToSquared(i.position) * e : 0
- }
- },
- direction: function(t, e) {
- return function(i) {
- return i.position.clone()
- .sub(t)
- .normalize()
- .dot(e) * l.navigation.directionFactor
- }
- },
- angle: function(t, e) {
- return function(i) {
- return i.position.clone()
- .sub(t)
- .normalize()
- .angleTo(e) * l.navigation.angleFactor
- }
- },
- inFieldOfView: function(t, e) {
- return function(i) {
- return i.position.clone()
- .sub(t)
- .normalize()
- .dot(e) > .75 ? 10 : -1
- }
- },
- optionality: function(t) {
- return function(e) {
- return e.neighbourUUIDs.filter((function(e) {
- return !(e in t.neighbourUUIDs) && e !== t.id
- }))
- .length * l.navigation.optionalityFactor
- }
- },
- penalizeHeightDifferenceUnder: function(t, e) {
- return function(i) {
- return t.y - i.position.y < e ? -20 : 0
- }
- }
- }, C.prototype.setZoomed = function(t) {
- this.zoomed = t, this.updateSkyboxForZoomLevel()
- }, C.prototype.updateSkyboxForZoomLevel = function() {
- this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
- }, C.prototype.ensureSkyboxReadyForRender = function() {
- this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), this.solidSkybox.loaded = !0)
- }, t.exports = C
- })
- .call(this, i(6))
- }, function(t, e) {
- t.exports = {
- Move: "move",
- MoveComplete: "move.complete",
- ModeChanged: "mode.changed",
- ModeChanging: "mode.changing",
- RulersMove: "rulers.move",
- PanoChosen: "pano.chosen",
- warpTravelBlack: "warp.travel.black",
- ClosestPanoChanging: "closest.pano.changing",
- WarpStarted: "warp.started",
- WarpInterrupted: "warp.interrupted",
- WarpEnded: "warp.ended",
- FlyingStarted: "flying.started",
- FlyingInterrupted: "flying.interrupted",
- FlyingEnded: "flying.ended",
- Ready: "ready",
- StartInside: "start.inside",
- StartOutside: "start.outside",
- ViewChanged: "view.changed",
- WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
- InputStart: "input.start",
- EditAddTagHighlight: "edit.add.taghighlight",
- ClickTag: "clickTag"
- }
- }, function(t, e) {
- t.exports = {
- ModelAdded: "model-added",
- ActiveModelChanged: "active-model-changed"
- }
- }, function(t, e, i) {
- var n = i(1);
- t.exports.splitUrl = function(t) {
- if (n.isLocalVersion) {
- return t.split("/common/")[1] ? window.location.origin + window.location.pathname.split("index.html")[0] + "/" + t.split("/common/")[1] : window.location.origin + window.location.pathname.split("index.html")[0] + "/" + t.split("/common/")[0]
- }
- return t
- }, t.exports.splitComUrl = function(t) {
- return n.isLocalVersion ? t.split("/common/")[1] : t
- }
- }, function(t, e) {
- t.exports = {
- BASE: 1,
- STANDARD: 2,
- HIGH: 3,
- ULTRAHIGH: 4
- }
- }, function(t, e, i) {
- "use strict";
- t.exports = {
- BLACK: "black",
- STD: "std",
- WALK: "walk"
- }
- }, function(t, e, i) {
- var n, o = i(3),
- a = new(i(2))("js/utils/showcase");
- t.exports = {
- getAuthorizationHeader: function() {
- var t = o.valueFromHash("auth");
- if (t) return t.replace(",", " ");
- var e = o.valueFromCookie("token");
- return e ? "Token " + e : null
- },
- parseModelid: function(t) {
- var e, i;
- return t = t || "", i = (e = window.location.protocol + "//" + window.location.host) + "/api/player/models/" + t, {
- baseurl: window.location.protocol + "//" + window.location.host,
- playdir: "play",
- dataroot: "data",
- modelid: t,
- versiondir: "",
- locationpics: "",
- urlBase: e,
- urlModel: i,
- urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
- urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
- }
- },
- getModelIDFromQueryString: function() {
- return o.valueFromHash("model") || o.valueFromHash("m")
- },
- normalizeModeldata: function(t, e) {
- return (t = JSON.parse(JSON.stringify(t)))
- .scenes.forEach((function(t) {
- if (t._camera && "string" == typeof t._camera) try {
- t._camera = JSON.parse(t._camera)
- } catch (e) {
- a.warn("Unable to parse scene camera"), t._camera = null
- } else "object" == typeof t._camera && a.debug("scene.camera already a JSON object");
- t._camera && (t._camera._rotation && (t._camera._rotation = e.convertWorkshopQuaternion(t._camera._rotation)), t._camera._viewpoint && (t._camera._viewpoint = e.convertWorkshopVector(t._camera._viewpoint)), t._camera._zoom = e.convertWorkshopOrthoZoom(t._camera._zoom))
- })), t
- },
- visionVersionToInt: (n = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")), function(t) {
- if (!t) throw new Error("Vision version is required");
- var e = n.exec(t);
- if (null === e) throw new Error("String is not a vision version: " + t);
- return parseInt(e[1])
- }),
- modelDataPromisesTiles: function(t) {
- if (t.vision_version) try {
- return l.visionVersionToInt(t.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
- } catch (e) {
- s.warn("Invalid vision version: " + t.vision_version)
- }
- var e = t.created ? new Date(t.created) : null;
- return e && e >= r.visionTilingStartDate
- }
- }
- }, function(t, e) {
- t.exports = {
- signedUrlDefaultExpireTime: 24e4,
- signedUrlCheckInterval: 1e4,
- signedUrlRefreshBuffer: 15e3,
- dollhouseFOV: 70,
- dollhouseNear: 1,
- dollhouseFar: 5e3,
- insideFOV: 70,
- insideNear: .1,
- insideFar: 5e3,
- insideLookSpeed: .12,
- insideLookLimitUp: 50,
- insideLookLimitDown: -50,
- orthoNear: 1,
- orthoFar: 5e3,
- orthoBase: 10,
- narrowLandscapeHeight: 290,
- reallyNarrowLandscapeHeight: 250,
- visionTilingStartDate: new Date("8/26/2016"),
- visionTilingStartVersion: "1.1.407.13667",
- windowHeightHighQualityThreshold: 1200,
- tourStepDelayDefault: 3500,
- tourStepDelaySlideShow: 5e3,
- workshopApsect: 9 / 16,
- highQualityMaxZoom: 2,
- ultraHighQualityMaxZoom: 1.5
- }
- }, function(t, e) {
- t.exports = {
- Move: "move",
- InteractionDirect: "interaction.direct",
- InteractionKey: "interaction.key",
- InteractionGui: "interaction.gui",
- FlyInDirection: "fly.direction",
- InputStart: "input.start",
- Pinch: "input.pinch",
- Scroll: "input.scroll",
- HideEvent: "panorama.move",
- RulersMove: "rulers.move",
- RulersWalk: "rulers.walk",
- TtagsMove: "titletag.move",
- PanoramaMove: "camera.move",
- PanoramaMoveStop: "camera.move.stop"
- }
- }, function(t, e, i) {
- (function(e) {
- var n, r, o, a = i(4)
- .EventEmitter,
- s = i(104);
- function l() {
- this.uuid = "", this.sendOperationFalg = !1, this.initState = !1, this.signalState = !1, this.busyState = !1, this.busySended = !1, this.voiceFlag = !1, this.sync = !1;
- var t = !1;
- this.remoteControl = !1, this.syncInitState = !1, this.handelCallTimeOut = null, this.hangupType = "timeout", this.lookInstance = null;
- var e = this;
- Object.defineProperty(this, "busy", {
- get: function() {
- return t
- },
- set: function(i) {
- if (i) {
- if (e.remoteControl) return void e.emit("remote_busy");
- t = !0, this.sync = !1, this.sendBusy()
- } else t = !1, this.cancelBusy()
- }
- }), this.showTip = function() {}, this.getCurrentState = function() {}, this._handleMessage = this._handleMessage.bind(this), this._handleCall = this._handleCall.bind(this), this.callTimeHandle = null, this.userInfo = {
- identity: "4",
- customer: {
- state: !1,
- nickName: "客户",
- phoneNum: "15311496327",
- identity: "4",
- headImg: "",
- accid: ""
- },
- bussiness: {
- state: !1,
- nickName: "经纪人",
- phoneNum: "18911926367",
- identity: "1",
- headImg: "",
- accid: ""
- }
- }
- }
- l.prototype = Object.create(a.prototype), l.prototype.constructor = l, l.prototype.init = function() {
- var t = this,
- e = "";
- if (e = "4" === this.userInfo.identity ? this.userInfo.bussiness.accid : this.userInfo.customer.accid, this.lookInstance = new s({
- remoteAccid: e
- }), "platform-error" === this.lookInstance.init()) throw new Error("platform-error");
- return this.lookInstance.on("onData", this._handleMessage), this.lookInstance.on("onCall", this._handleCall), this.lookInstance.on("refuse", (function() {
- t.emit("bussiness_busy")
- })), this.lookInstance.on("hangup", (function() {
- "timeout" !== t.hangupType && ("4" === t.userInfo.identity ? t.userInfo.bussiness.state = !1 : t.userInfo.customer.state = !1, t.emit("close_connect", t.userInfo), t.destory())
- })), this.lookInstance.on("busy", (function() {
- this.lookInstance.hangup()
- })), this.signalState = !0, this.emit("init_done"), this.initState = !0, this.sendState({
- type: "connectState",
- state: "initdone"
- }), "4" === this.userInfo.identity ? t.userInfo.customer.state = !0 : t.userInfo.bussiness.state = !0, !0
- }, l.prototype._getUserinfoType = function(t, e) {
- var i = t[e];
- return {
- nickName: i[e + "Nickname"],
- headImg: i[e + "HeadImage"],
- identity: i[e + "Identity"],
- accid: i[e + "Accid"]
- }
- }, l.prototype.joinChannel = function(t, e, i) {
- if (this.emit("init"), this.getCurrentState = e, t) {
- var n = this._getUserinfoType(t, "bussiness"),
- r = this._getUserinfoType(t, "customer");
- this.userInfo.identity = t.currentIdentity, this.userInfo.bussiness = n, this.userInfo.customer = r
- }
- this.init()
- }, l.prototype._handleCall = function() {
- "4" === this.userInfo.identity ? this.userInfo.bussiness.state = !0 : this.userInfo.customer.state = !0, this.emit("identity", this.userInfo), this.emit("callsuccess"), this.emit("user_connected"), this.hangupType = "hangup", this.voiceFlag = !0
- }, l.prototype._handleMessage = function(t) {
- var e = JSON.parse(t);
- switch (e.type) {
- case "state":
- this._handleState(e);
- break;
- case "operation":
- this._handleOpertation(e);
- break;
- case "busy":
- this._handleBusy(e)
- }
- }, l.prototype.setBusy = (n = null, function() {
- var t = this;
- null !== n ? (clearTimeout(n), n = null) : (this.sync = !1, this.sendState({
- type: "busyState",
- state: "busy"
- }), this.busySended = !0), n = setTimeout((function() {
- t.sendState({
- type: "busyState",
- state: "nobusy"
- }), n = null, t.busySended = !1
- }), 400)
- }), l.prototype.sendBusy = function() {
- this.busySended || (this.sync = !1, this.sendState({
- type: "busyState",
- state: "busy"
- }), this.busySended = !0)
- }, l.prototype.cancelBusy = (r = null, function() {
- var t = this;
- null !== r && clearTimeout(r), r = setTimeout((function() {
- t.sendState({
- type: "busyState",
- state: "nobusy"
- }), t.busySended = !1
- }), 2500)
- }), l.prototype.getSyncState = function() {
- return this.remoteControl ? (this.emit("remote_busy"), !1) : (this.sync = !1, !0)
- }, l.prototype._handleBusy = function(t) {
- "busy" === t.state ? (this.remoteControl = !0, this.sync = !0) : this.remoteControl = !1
- }, l.prototype._handleState = function(t) {
- var e = t.data;
- switch (e.type) {
- case "connectState":
- this._handleConnectState(e);
- break;
- case "busyState":
- this._handleBusy(e)
- }
- }, l.prototype.startVoiceLink = function() {
- "4" === this.userInfo.identity && this.lookInstance.call()
- }, l.prototype.setStateDone = function() {
- this.syncInitState && (this.sendState({
- type: "connectState",
- state: "initstatedone"
- }), "4" !== this.userInfo.identity && (this.userInfo.customer.state = !0, this.lookInstance.accept()), this.emit("identity", this.userInfo), this.sendOperationFalg = !0)
- }, l.prototype._handleConnectState = function(t) {
- switch (t.state) {
- case "initdone":
- var e = this.getCurrentState();
- this.sendState({
- type: "connectState",
- state: "initstate",
- data: e
- });
- break;
- case "initstate":
- this.handelCallTimeOut && clearTimeout(this.handelCallTimeOut), this.syncInitState = !0, this.emit("changestate", t.data);
- break;
- case "initstatedone":
- this.sendOperationFalg = !0, "4" === this.userInfo.identity ? this.userInfo.bussiness.state = !0 : this.userInfo.customer.state = !0, this.emit("identity", this.userInfo)
- }
- }, l.prototype.setMute = function(t) {
- this.sendOperationFalg && (t ? this.lookInstance.mute() : this.lookInstance.unmute())
- }, l.prototype._handleOpertation = function(t) {
- if (this.voiceFlag) {
- this.sync = !0;
- var e = t.data;
- this.emit("operation", e)
- }
- }, l.prototype.sendMessage = function(t) {
- this.signalState && this.lookInstance.sendData(JSON.stringify(t))
- }, l.prototype.sendState = function(t) {
- var e = {
- type: "state",
- data: t
- };
- this.sendMessage(e)
- }, l.prototype.sendOperationasdf = (o = null, function(t) {
- var e = this;
- null !== o && clearTimeout(o), o = setTimeout((function() {
- e.sendOperation2remote(t)
- }), 15)
- }), l.prototype.sendOperation = function(t) {
- if ((this.sendOperationFalg || this.voiceFlag) && "uichange" !== t.type) {
- var e = {
- type: "operation",
- data: t
- };
- this.sendMessage(e)
- }
- }, l.prototype.destory = function() {
- this.lookInstance && this.lookInstance.hangup(), this.sendOperationFalg = !1, this.busyState = !1, this.sync = !1, this.remoteControl = !1, e("#customer-info")
- .find(".voice-button")
- .removeClass("mute")
- .addClass("unmute"), e("#proxy-info")
- .find(".voice-button")
- .removeClass("mute")
- .addClass("unmute")
- };
- var u, h = (u = null, function(t) {
- return null === u && (u = new l(t)), u
- });
- t.exports = h
- })
- .call(this, i(6))
- }, function(t, e) {
- t.exports = {
- GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
- }
- }, function(t, e, i) {
- var n, r, o = i(29),
- a = i(56),
- s = {};
- s.TILE_SIZE = 512, s.FACES_PER_PANO = 6, s.LocationOnTile = {
- Center: 0,
- UpperLeft: 1,
- UpperRight: 2,
- LowerRight: 3,
- LowerLeft: 4
- }, s.getTileVector = function(t, e, i, n, r, l, u, h) {
- var c = t / e,
- d = e / t * 2,
- p = d / 2,
- f = n / c * 2 - 1 + p,
- m = (r = c - 1 - r) / c * 2 - 1 + p;
- switch (l = l || s.LocationOnTile.Center) {
- case s.LocationOnTile.UpperLeft:
- f -= p, m += p, f += u * d;
- break;
- case s.LocationOnTile.UpperRight:
- f += p, m += p, m -= u * d;
- break;
- case s.LocationOnTile.LowerRight:
- f += p, m -= p, f -= u * d;
- break;
- case s.LocationOnTile.LowerLeft:
- f -= p, m -= p, m += u * d;
- break;
- case s.LocationOnTile.Center:
- }
- switch (i) {
- case o.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- a.setVector(h, -1, m, -f);
- break;
- case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- a.setVector(h, 1, m, f);
- break;
- case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- a.setVector(h, -f, 1, -m);
- break;
- case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- a.setVector(h, -f, -1, m);
- break;
- case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- a.setVector(h, -f, m, 1);
- break;
- case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- a.setVector(h, f, m, -1)
- }
- a.normalize(h)
- }, s.getFaceForTile = function(t, e) {
- var i = s.TILE_SIZE;
- t < s.TILE_SIZE && (i = t);
- var n = Math.floor(t / i),
- r = n * n;
- return Math.floor(e / r)
- }, s.getTileLocation = function(t, e, i) {
- var n = s.TILE_SIZE;
- t < s.TILE_SIZE && (n = t);
- var r = s.getFaceForTile(t, e),
- o = Math.floor(t / n),
- a = e - r * (o * o);
- i.tileX = a % o, i.tileY = Math.floor(a / o), i.face = r, i.faceTileIndex = a
- }, s.getTileCountForSize = function(t) {
- if (t <= s.TILE_SIZE) return s.FACES_PER_PANO;
- var e = Math.floor(t / s.TILE_SIZE);
- return e * e * s.FACES_PER_PANO
- }, s.getRelativeDirection = (n = new a.Matrix4, r = new a.Quaternion, function(t, e) {
- r.copy(t), r.inverse(), n.makeRotationFromQuaternion(r), n.applyToVector3(e), a.normalize(e)
- }), s.matchingTilesInDirection = function() {
- var t = new a.Vector3,
- e = new a.Vector3(0, 0, -1),
- i = new a.Quaternion,
- n = function(t, e) {
- t.push({
- face: e.face,
- faceTileIndex: e.faceTileIndex,
- tileX: e.tileX,
- tileY: e.tileY
- })
- },
- r = function() {
- var t = {
- face: -1,
- faceTileIndex: -1,
- tileX: -1,
- tileY: -1
- };
- return function(e, i, r) {
- for (var o = s.getTileCountForSize(e), a = 0, l = 0; l < o; l++) s.getTileLocation(e, l, t), i && !i(t) || (a++, r && n(r, t));
- return a
- }
- }();
- return function(n, o, l, u, h, c) {
- var d = o < s.TILE_SIZE ? o : s.TILE_SIZE;
- if (s.getTileCountForSize(o), !u && !h) return r(o, null, c);
- var p = !!h;
- if (h = h || u, h = Math.max(0, Math.min(h, 360)), u = Math.max(0, Math.min(u, 360)), a.copyVector(l, t), s.getRelativeDirection(n.quaternion, t), p) {
- i.setFromUnitVectors(t, e);
- return r(o, (function(t) {
- return s.isTileWithinFrustum(o, d, t.face, t.tileX, t.tileY, i, u, h)
- }), c)
- }
- return r(o, (function(e) {
- return s.isTileWithinFOV(o, d, e.face, e.tileX, e.tileY, t, u)
- }), c)
- }
- }(), s.isTileWithinFrustum = function() {
- var t = new a.Vector3;
- return function(e, i, n, r, o, l, u, h) {
- for (var c = Math.tan(.5 * h * a.RADIANS_PER_DEGREE), d = -c, p = Math.tan(.5 * u * a.RADIANS_PER_DEGREE), f = -p, m = s.mapFaceToCubemapFace(n), g = 0, v = 0, y = 0, b = 0, w = 0, x = s.LocationOnTile.Center; x <= s.LocationOnTile.LowerLeft; x++)
- if (s.getTileVector(e, i, m, r, o, x, 0, t), a.applyQuaternionToVector(l, t), t.z >= -1e-5) 0;
- else {
- var M = -1 / t.z,
- T = t.x * M,
- S = t.y * M;
- S > c ? g++ : S < d && v++, T > p ? y++ : T < f && b++, w++
- } return v !== w && g !== w && y !== w && b !== w
- }
- }(), s.isTileWithinFOV = function() {
- var t = new a.Vector3,
- e = new a.Vector3(0, 1, 0),
- i = new a.Vector3(1, 0, 0);
- return function(n, r, o, l, u, h, c) {
- var d = s.mapFaceToCubemapFace(o);
- if (a.cross(h, e, i), s.getTileVector(n, r, d, l, u, s.LocationOnTile.Center, 0, t), s.isWithinFOV(t, h, c, null)) return !0;
- for (var p = c / 360, f = Math.floor(1 / p), m = 0, g = 0; g < f; g++) {
- for (var v = s.LocationOnTile.UpperLeft; v <= s.LocationOnTile.LowerLeft; v++)
- if (s.getTileVector(n, r, d, l, u, v, m, t), s.isWithinFOV(t, h, c, null)) return !0;
- m += p
- }
- return !1
- }
- }(), s.isWithinFOV = function() {
- var t = new a.Vector3,
- e = new a.Vector3;
- return function(i, n, r, o) {
- if (a.copyVector(i, e), o) {
- a.copyVector(o, t), a.normalize(t);
- var s = a.dot(t, i);
- t.x *= s, t.y *= s, t.z *= s, a.subVector(e, t)
- }
- var l = r / 2 * a.RADIANS_PER_DEGREE,
- u = Math.cos(l);
- return a.dot(e, n) >= u
- }
- }(), s.mapFaceToCubemapFace = function() {
- var t = {
- 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
- 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
- 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
- 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
- 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
- 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
- };
- return function(e) {
- return t[e]
- }
- }(), s.getDirectionalFov = function() {
- var t = document.documentElement.clientWidth;
- return t > 0 && t < 512 ? 60 : t >= 512 && t < 1024 ? 80 : t >= 1024 && t < 2048 ? 100 : t >= 2048 && t < 4096 ? 120 : t >= 4096 ? 180 : 60
- }, t.exports = s
- }, function(t, e) {
- t.exports = {
- NONE: 0,
- MIDDLE: 1,
- END: 2,
- BEGINNING: 3,
- FADEIN: 4
- }
- }, function(t, e) {
- t.exports = {
- ZERO: 48,
- ONE: 49,
- TWO: 50,
- THREE: 51,
- FOUR: 52,
- FIVE: 53,
- SIX: 54,
- SEVEN: 55,
- EIGHT: 56,
- NINE: 57,
- LEFTARROW: 37,
- UPARROW: 38,
- RIGHTARROW: 39,
- DOWNARROW: 40,
- A: 65,
- B: 66,
- C: 67,
- D: 68,
- E: 69,
- F: 70,
- G: 71,
- H: 72,
- I: 73,
- J: 74,
- K: 75,
- L: 76,
- M: 77,
- N: 78,
- O: 79,
- P: 80,
- Q: 81,
- R: 82,
- S: 83,
- T: 84,
- U: 85,
- V: 86,
- W: 87,
- X: 88,
- Y: 89,
- Z: 90,
- SPACE: 32,
- RETURN: 13,
- PLUSEQUALS: 187,
- DASHUNDERSCORE: 189,
- OPENBRACKET: 219,
- ESC: 27,
- DELETE: 46
- }
- }, function(t, e, i) {
- function n() {
- this.list = [], this.index = {}, Object.defineProperty(this, "length", {
- get: function() {
- return this.list.length
- }
- })
- }
- new(i(2))("/js/util/IndexedCollection.js"), n.prototype.forEach = function(t) {
- this.list.forEach(t)
- }, n.prototype.add = function(t) {
- this.list.push(t), this.index[this.getIndex(t)] = t
- }, n.prototype.getIndex = function(t) {
- throw new Error("IndexedCollection.getIndex not implemented in subclass.")
- }, n.prototype.extend = function(t) {
- for (var e = 0; e < t.length; e++) this.add(t[e])
- }, n.prototype.get = function(t) {
- return this.index[t]
- }, n.prototype.first = function() {
- return this.list[0]
- }, n.prototype.last = function() {
- return this.list[this.list.length - 1]
- }, n.prototype.reIndex = function() {
- this.index = {};
- var t = this;
- this.forEach((function(e) {
- t.index[t.getIndex(e)] = e
- }))
- }, n.prototype.filter = function(t) {
- var e = this.list.filter(t);
- return this.reIndex(), e
- }, n.prototype.reduce = function(t, e) {
- return this.list.reduce(t, e)
- }, n.prototype.sort = function(t) {
- return this.list.sort(t)
- }, n.prototype.indexOf = function(t) {
- for (var e = 0; e < this.list.length; ++e)
- if (this.list[e] === t) return e;
- return -1
- }, n.prototype.getLength = function() {
- return this.list.length
- }, t.exports = n
- }, function(t, e) {}, function(t, e, i) {
- "use strict";
- (function(e) {
- var n, r, o, a, s, l, u = i(0),
- h = (i(2), i(1)),
- c = i(7),
- d = i(9),
- p = i(18),
- f = i(32),
- m = i(27),
- g = i(4)
- .EventEmitter,
- v = i(28),
- y = i(3),
- b = !1,
- w = !0;
- function x(t) {
- this.camera = t, this.camera.controls = this, this.target = new u.Vector3(0, 0, 0), this.lookVector = new u.Vector3, this.lookSpeed = .05, this.rotationAcc = new u.Vector2, this.rotationSpeed = new u.Vector2, this.lat = 0, this.lon = 0, this.phi = 0, this.theta = 0, this.enabled = !1, this.locked = !1, this.pointer = new u.Vector2(0, 0), this.rotationHistory = [], this.rotationDifference = new u.Vector2, this.pointerDragStart = new u.Vector2(0, 0), this.pinchDistance = 0, this.moveStart = new u.Vector2, this.moveTolerance = .01, this.pointersLimit = 2, this.pointers = [], this.euler = new u.Euler, this.el = new u.Euler, this.q0 = new u.Quaternion, this.q1 = new u.Quaternion(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this.up = new u.Vector3(0, 1, 0), this.right = new u.Vector3(0, 0, 1), this.v = new u.Vector3, this.offsetLon = 0, this.offsetLat = 0, this.q3 = new u.Quaternion, G.panoStill = !0, this.s_rotationSpeed = new u.Vector2, this.s_rotationDifference = new u.Vector3, this.s_lat = 0, this.s_lon = 0, this.handleOperation = this.handleOperation.bind(this), this.connect = v(), this.connect.on("operation", this.handleOperation), this.lockedRotationFrom = !1, this.lockedMouseWheel = !1, this.disableKeyMove = !1, this.disableKeyRotate = !1;
- var e = this,
- i = !1;
- Object.defineProperty(this, "pointerDragOn", {
- get: function() {
- return i
- },
- set: function(t) {
- i = t, e.connect.busy = t
- }
- })
- }
- function M() {
- G.conf.isCleanUI || (G.d.tourIsPlaying && G.d.stopTour(), clearTimeout(n), n = null, b || (b = !0))
- }
- function T() {
- G.conf.isCleanUI
- }
- function S(t) {
- t && function(t) {
- t && (t.preventDefault(), t.stopPropagation())
- }(t)
- }
- x.prototype = Object.create(g.prototype), x.prototype.bindEvents = function(t) {
- t.addEventListener("mousemove", this.onMouseMove.bind(this)), t.addEventListener("mousedown", this.onMouseDown.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this)), t.addEventListener("mouseover", function(t) {
- !this.pointerDragOn || 0 !== t.which && 0 !== t.buttons || this.onMouseUp(t)
- }.bind(this)), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("contextmenu", (function(t) {
- t.preventDefault()
- })), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerUp.bind(this)), t.addEventListener("pointercancel", this.onPointerUp.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("keydown", this.onKeyDown.bind(this)), t.addEventListener("keyup", this.onKeyUp.bind(this)), h.useWheel && (t.addEventListener("mousewheel", this.onMouseWheel.bind(this)), t.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this)))
- }, x.prototype.usable = function() {
- return !G.ori.flag && (h.quickstart.enabled ? this.enabled : this.enabled && !this.locked)
- }, x.prototype.lookAt = function(t) {
- 0 == t.x && -5 == t.y && 0 == t.z && (t.z = -1);
- var e = this.camera.position.clone()
- .sub(t),
- i = 0;
- 0 == e.x && 0 == e.y && 0 == e.z && (e.z = 1), i = Math.atan(e.z / e.x), i += e.x < 0 ? Math.PI : 0, i += e.x > 0 && e.z < 0 ? 2 * Math.PI : 0, this.lon = u.Math.radToDeg(i) + 180;
- var n = Math.sqrt(e.x * e.x + e.z * e.z);
- i = 0, i = Math.atan(e.y / n), this.lat = -u.Math.radToDeg(i)
- }, x.prototype.play = function(t) {
- w && (this.lon = t.lon, this.lat = t.lat)
- }, x.prototype.record = function() {
- !G.R.rtime || G.R.time.getElapsedTime() - G.R.rtime > .15 ? G.R.rtime = G.R.save({
- tap: "panorama",
- panoid: G.player.currentPano.id,
- action: "rotate",
- lon: parseFloat(this.lon.toFixed(5)),
- lat: parseFloat(this.lat.toFixed(5))
- }) : G.R.last = {
- tap: "panorama",
- panoid: G.player.currentPano.id,
- action: "rotate",
- lon: this.lon,
- lat: this.lat,
- time: G.R.time.getElapsedTime()
- }
- }, x.prototype.startRotationFrom = function(t, e) {
- this.lockedRotationFrom || (d.convertScreenPositionToNDC(t, e, this.pointer), this.pointerDragOn = !0, this.pointerDragStart.copy(this.pointer), this.moveStart.copy(this.pointer), this.rotationHistory = [], this.rotationSpeed.set(0, 0), this.disableOri())
- }, x.prototype.disableOri = function() {
- G.ori.timeoutID && clearTimeout(G.ori.timeoutID), G.ori.enable = !1
- }, x.prototype.onTouchStart = function(t) {
- if (this.usable()) {
- switch (w = !1, M(), S(t), t.preventDefault(), t.stopPropagation(), t.touches.length) {
- case 1:
- this.startRotationFrom(t.touches[0].clientX, t.touches[0].clientY);
- break;
- case 2:
- var e = (t.touches[0].clientX - t.touches[1].clientX) / (window.renderWidth || window.innerWidth),
- i = (t.touches[0].clientY - t.touches[1].clientY) / (window.renderHeight || window.innerHeight);
- this.pinchDistance = Math.sqrt(e * e + i * i)
- }
- this.emit(m.InputStart, "touch")
- }
- }, x.prototype.onPointerDown = function(t) {
- this.usable() && "touch" === t.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
- id: t.pointerId,
- clientX: t.clientX,
- clientY: t.clientY
- }), t.touches = this.pointers, this.onTouchStart(t), this.emit(m.InputStart, "pointer"))
- }, x.prototype.onMouseDown = function(t) {
- this.usable() && (w = !1, S(), M(), 0 === t.button && this.startRotationFrom(t.clientX, t.clientY), this.emit(m.InputStart, "mouse"))
- }, x.prototype.updateRotation = function() {
- if (this.usable() && this.pointerDragOn) {
- this.camera.matrix.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this.camera.matrixWorld.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- var t = new u.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1)
- .unproject(this.camera),
- e = new u.Vector3(this.pointer.x, this.pointer.y, -1)
- .unproject(this.camera),
- i = Math.sqrt(t.x * t.x + t.z * t.z),
- n = Math.sqrt(e.x * e.x + e.z * e.z),
- r = Math.atan2(t.y, i),
- o = Math.atan2(e.y, n);
- this.rotationDifference.y = u.Math.radToDeg(r - o), t.y = 0, e.y = 0;
- var a = Math.acos(t.dot(e) / t.length() / e.length());
- isNaN(a) || (this.rotationDifference.x = u.Math.radToDeg(a), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)), this.pointerDragStart.copy(this.pointer)
- }
- }, x.prototype.onMouseMove = function(t) {
- this.usable() && (d.convertScreenPositionToNDC(t.clientX, t.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(m.Move, "mouse"))
- }, x.prototype.onTouchMove = function(t) {
- if (this.usable()) {
- switch (t.touches.length) {
- case 1:
- d.convertScreenPositionToNDC(t.touches[0].clientX, t.touches[0].clientY, this.pointer), this.disableOri();
- break;
- case 2:
- var e = (t.touches[0].clientX - t.touches[1].clientX) / (window.renderWidth || window.innerWidth),
- i = (t.touches[0].clientY - t.touches[1].clientY) / (window.renderHeight || window.innerHeight),
- n = this.pinchDistance - Math.sqrt(e * e + i * i);
- Math.abs(n) > .01 && (this.emit(m.InteractionDirect), this.emit(m.Pinch, n), this.pinchDistance -= n)
- }
- this.emit(m.Move, "touch")
- }
- }, x.prototype.onPointerMove = function(t) {
- this.usable() && "touch" === t.pointerType && (this.pointers.forEach((function(e) {
- t.pointerId === e.id && (e.clientX = t.clientX, e.clientY = t.clientY)
- })), t.touches = this.pointers, this.onTouchMove(t))
- }, x.prototype.endRotation = function() {
- this.pointerDragOn = !1;
- var t = c.averageVectors(this.rotationHistory);
- this.rotationSpeed.set(t.x * h.rotationAfterMoveMultiplier, t.y * h.rotationAfterMoveMultiplier)
- }, x.prototype.onTouchEnd = function(t) {
- this.usable() && (T(), w = !0, t.preventDefault(), t.stopPropagation(), this.endRotation())
- }, x.prototype.onMouseUp = function(t) {
- this.usable() && (T(), w = !0, t.preventDefault(), t.stopPropagation(), this.endRotation())
- }, x.prototype.onPointerUp = function(t) {
- this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e, i) {
- t.pointerId === e.id && this.pointers.splice(i, 1)
- }.bind(this)), t.touches = this.pointers, this.onTouchEnd(t))
- }, x.prototype.update = function(t) {
- if (null != G.frameRate && (G.frameRate < 12 ? h.rotationFriction = .6 : h.rotationFriction = .06), y.isMobile() && (t = .016, 0 != this.rotationSpeed.x && Math.abs(this.rotationSpeed.x) < 6 && (this.rotationSpeed.x = 0), 0 != this.rotationSpeed.y && Math.abs(this.rotationSpeed.y) < 6 && (this.rotationSpeed.y = 0), 0 == this.rotationSpeed.x && 0 == this.rotationSpeed.y ? G.panoStill = !0 : G.panoStill = !1), !G.R.playing)
- for (this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > h.rotationAfterMoveHistoryCount;) this.rotationHistory.shift();
- var i = this.lon,
- n = this.lat;
- if (G.ori.flag ? (this.offsetLon += this.rotationDifference.x, this.offsetLat += this.rotationDifference.y, this.rotationSpeed.x = this.rotationSpeed.x * (1 - h.rotationFriction) + this.rotationAcc.x * h.rotationAccelerationInside, this.rotationSpeed.y = this.rotationSpeed.y * (1 - h.rotationFriction) + this.rotationAcc.y * h.rotationAccelerationInside, this.offsetLon += this.rotationSpeed.x * t, this.offsetLat += this.rotationSpeed.y * t, this.offsetLat = Math.max(h.insideLookLimitDown, Math.min(h.insideLookLimitUp, this.offsetLat)), G.ori.enable && !G.playing && (this.euler.set(G.ori.beta, G.ori.alpha, -G.ori.gamma, "YXZ"), this.q3 = this.camera.quaternion.clone(), this.q3.setFromEuler(this.euler)
- .multiply(this.q1), this.q3.multiply(this.q0.setFromAxisAngle(this.right, -G.ori.orient)), this.v.set(0, 0, 1)
- .applyQuaternion(this.q3), this.lat = u.Math.radToDeg(this.v.angleTo(this.up) - Math.PI / 2), this.v.set(1, 0, 0)
- .applyQuaternion(this.q3), this.v.clone()
- .cross(this.right)
- .y > 0 ? this.lon = 360 + u.Math.radToDeg(this.v.angleTo(this.right)) : this.lon = 360 - u.Math.radToDeg(this.v.angleTo(this.right))), this.phi = u.Math.degToRad(90 - (this.lat + this.offsetLat)), this.theta = u.Math.degToRad(this.lon + this.offsetLon), 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), G.ori.enable = !0) : (t || (t = 1 / 60), this.rotationSpeed.x = this.rotationSpeed.x * (1 - h.rotationFriction) + this.rotationAcc.x * h.rotationAccelerationInside, this.rotationSpeed.y = this.rotationSpeed.y * (1 - h.rotationFriction) + this.rotationAcc.y * h.rotationAccelerationInside, this.connect.remoteControl || this.connect.sync || (this.lon += this.rotationDifference.x, this.lat += this.rotationDifference.y, this.lon += this.rotationSpeed.x * t, this.lat += this.rotationSpeed.y * t, this.sendFrameData(t), this.rotationDifference.set(0, 0)), this.lat = Math.max(h.insideLookLimitDown, Math.min(h.insideLookLimitUp, this.lat)), this.updateCamera(this.lon, this.lat)), this.rotationDifference.set(0, 0), G.R.recording && this.record(), d.compareFloats(i, this.lon) && d.compareFloats(n, this.lat) ? this.emit(m.PanoramaMoveStop) : (this.emit(m.RulersMove), this.emit(m.PanoramaMove)), "open" === e("#size-button")
- .attr("openflag")) var r = this.lon,
- o = this.lat;
- if (G.player.mattertagManager && G.player.mattertagManager.showtitletags) {
- r = this.lon, o = this.lat;
- G.player.mattertagManager && (!G.player.mattertagManager.ttflying && d.compareFloats(i, r) && d.compareFloats(n, o) || this.emit(m.TtagsMove))
- }
- }, x.prototype.sendFrameData = (a = 0, s = new u.Vector2, l = new u.Vector2, function(t) {
- (a += t) < h.connectDelay || (a = 0, Math.abs(r - this.lon) < .001 && Math.abs(o - this.lat) < .001 || (this.connect.sendOperation({
- type: "pano",
- lon: this.lon,
- lat: this.lat,
- time: Date.now(),
- rotationDifference: this.rotationDifference.toArray(),
- rotationSpeed: this.rotationSpeed.toArray()
- }), r = this.lon, o = this.lat, s.copy(this.rotationSpeed), l.copy(this.rotationDifference)))
- });
- var _ = 0;
- x.prototype.updateCamera = function(t, e) {
- _++, this.phi = u.Math.degToRad(90 - e), this.theta = u.Math.degToRad(t), 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), 0 == _ % 6 && (_ = 0)
- }, x.prototype._progressNumber = function(t, e, i) {
- return t + (e - t) * i
- }, x.prototype._progressRad = function(t, e, i) {
- var n = 2 * Math.PI,
- r = Math.PI,
- o = function(t) {
- return (t % n + n) % n
- };
- return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
- }, x.prototype.handleOperation = function(t) {
- var e = this;
- if ("pano" === t.type) {
- var i = t.lon,
- n = t.lat;
- Date.now(), t.time;
- this.s_lon = i, this.s_lat = n, this.lonTweenProcess = null, this.latTweenProcess = null, this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null);
- var r = this.lon,
- o = this.lat;
- h.connectDelay;
- this.tweenProgress = new TWEEN.Tween({
- progress: 0
- })
- .to({
- progress: 1
- }, h.animationDelay)
- .easing(TWEEN.Easing.Linear.None)
- .start(), this.tweenProgress.onUpdate((function(t) {
- null === i && 0 === i || (e.lon = e._progressNumber(r, i, this.progress)), null === n && 0 === i || (e.lat = e._progressNumber(o, n, this.progress))
- })), this.tweenProgress.onComplete((function() {
- this.tweenProgress = null
- })), this.s_time = t.time, this.s_rotationDifference.fromArray(t.rotationDifference), this.s_rotationSpeed.fromArray(t.rotationSpeed), this.rotationSpeed.copy(this.s_rotationSpeed)
- }
- }, x.prototype.onMouseWheel = function(t) {
- if (!this.lockedMouseWheel && this.usable() && !G.R.playing) {
- var e = t.wheelDelta || -t.detail;
- this.emit(m.InteractionDirect), this.emit(m.Scroll, e)
- }
- }, x.prototype.onKeyDown = function(t) {
- this.usable() && (t.metaKey || t.ctrlKey || (t.preventDefault(), this.handleKeyDown(t.which)))
- }, x.prototype.handleKeyDown = function(t) {
- var e = function(t) {
- this.disableKeyMove || this.flyDirection(t)
- }.bind(this),
- i = function(t, e) {
- this.disableKeyRotate || (this.rotationAcc[t] = e)
- }.bind(this);
- this.emit(m.InteractionKey);
- var n = !0;
- switch (t) {
- case f.UPARROW:
- case f.W:
- e(p.FORWARD);
- break;
- case f.DOWNARROW:
- case f.S:
- e(p.BACK);
- break;
- case f.A:
- e(p.LEFT);
- break;
- case f.D:
- e(p.RIGHT);
- break;
- case f.LEFTARROW:
- case f.J:
- i("x", -1);
- break;
- case f.RIGHTARROW:
- case f.L:
- i("x", 1);
- break;
- case f.I:
- i("y", 1);
- break;
- case f.K:
- i("y", -1);
- break;
- default:
- n = !1
- }
- n && this.emit(m.Move, "key")
- }, x.prototype.onKeyUp = function(t) {
- this.usable() && (t.preventDefault(), t.stopPropagation(), this.handleKeyUp(t.which))
- }, x.prototype.handleKeyUp = function(t) {
- switch (t) {
- case f.LEFTARROW:
- case f.J:
- case f.RIGHTARROW:
- case f.L:
- this.rotationAcc.x = 0;
- break;
- case f.I:
- case f.K:
- this.rotationAcc.y = 0;
- break;
- case f.ESC:
- }
- }, x.prototype.reset = function() {
- this.pointerDragOn = !1, this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), this.pointers = []
- }, x.prototype.flyDirection = function(t) {
- this.emit(m.FlyInDirection, t.clone())
- }, x.prototype.copy = function(t) {
- this.target.copy(t.target), this.lookVector.copy(t.lookVector), this.lookSpeed = t.lookSpeed, this.rotationAcc.copy(t.rotationAcc), this.rotationSpeed.copy(t.rotationSpeed), this.lat = t.lat, this.lon = t.lon, this.phi = t.phi, this.theta = t.theta, this.enabled = t.enabled, this.locked = t.locked, this.pointer.copy(t.pointer), this.rotationHistory = t.rotationHistory.slice(), this.rotationDifference.copy(t.rotationDifference), this.pointerDragOn = t.pointerDragOn, this.pointerDragStart.copy(t.pointerDragStart), this.pinchDistance = t.pinchDistance, this.moveStart.copy(t.moveStart), this.moveTolerance = t.moveTolerance, this.pointersLimit = t.pointersLimit, this.pointers = t.pointers.slice()
- }, x.prototype.toJSON = function() {
- return {
- _viewpoint: {
- x: d.toPrecision(this.camera.position.x, 4),
- y: d.toPrecision(this.camera.position.y, 4),
- z: d.toPrecision(this.camera.position.z, 4)
- },
- _rotation: {
- x: d.toPrecision(this.camera.quaternion.x, 4),
- y: d.toPrecision(this.camera.quaternion.y, 4),
- z: d.toPrecision(this.camera.quaternion.z, 4),
- w: d.toPrecision(this.camera.quaternion.w, 4)
- }
- }
- }, x.prototype.setStateFromJSON = function(t) {
- this.camera.position.copy(t._viewpoint), this.camera.quaternion.copy(t._rotation)
- }, t.exports = x
- })
- .call(this, i(6))
- }, function(t, e, i) {
- var n = i(3);
- function r(t) {
- return s[t]
- }
- var o = i(29),
- a = [0, 1, 2, 3, 4, 5],
- s = {
- 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
- 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
- 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
- 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
- 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
- 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
- };
- t.exports = {
- mapFaceToCubemapFace: r,
- getCubemapUrls: function(t, e, i) {
- return a.map(function(t, o) {
- var a = n.isMobile() ? "mobile" : "pc";
- return G.url.model + "/locations/" + a + "/" + i + "/" + e + "_" + r(t) + ".jpg"
- }.bind(this))
- }
- }
- }, function(t, e, i) {
- var n = i(0),
- r = i(1);
- function o() {
- n.PerspectiveCamera.call(this, r.insideFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.insideNear, r.insideFar), this.controls = null
- }
- o.prototype = Object.create(n.PerspectiveCamera.prototype), o.prototype.updateAspect = function(t) {
- this.aspect = t, this.updateProjectionMatrix()
- }, t.exports = o
- }, function(t, e, i) {
- (function(e) {
- i(3);
- function n(t, e, i, r, o) {
- this.qualityManager = t, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(), this.baseSize = e, this.standardSize = i, this.highSize = r, this.ultraHighSize = o, this.priorityCriteria = new n.PriorityCriteria(null, new l.Vector3(0, 0, 0), new l.Vector3(0, 0, -1), new l.Vector3(0, 0, -1)), this.directional_fov = this.getDirectionalFov()
- }
- var r, o, a, s, l = i(0),
- u = (i(5), i(1), i(19)),
- h = i(2),
- c = (i(18), i(23), i(21), i(29), i(65)),
- d = (i(3), i(30)),
- p = i(9),
- f = (i(4)
- .EventEmitter, new h(e), Object.freeze({
- None: 0,
- DirectionalFOV: 1
- }));
- n.PriorityCriteria = function(t, e, i, n, r) {
- this.pano = t, this.cameraPosition = (new l.Vector3)
- .copy(e), this.cameraDir = (new l.Vector3)
- .copy(i), this.panoSpaceDir = (new l.Vector3)
- .copy(n), this.upcomingPanos = r, this.copy = function(t) {
- this.pano = t.pano, this.cameraPosition.copy(t.cameraPosition), this.cameraDir.copy(t.cameraDir), this.panoSpaceDir.copy(t.panoSpaceDir), this.upcomingPanos = r
- }, this.zoomingActive = !1
- }, n.DIRECTIONAL_FOV_NARROW = 10, n.MAX_SCORED_PANOS_TOCONSIDER = 6, n.MAX_SCORED_PANOS_TOADD = 2, n.MAX_UPCOMING_PANOS_TOADD = 3, n.DIRECTION_SCORE_STRICTNESS = .75, n.appendQueue = function(t, e) {
- if (t && e)
- for (var i = 0; i < e.length; i++) t.push(e[i])
- }, n.prototype.getDirectionalFov = function() {
- var t = document.documentElement.clientWidth;
- return t > 0 && t < 512 ? 60 : t >= 512 && t < 1024 ? 80 : t >= 1024 && t < 2048 ? 100 : t >= 2048 && t < 4096 ? 120 : t >= 4096 ? 180 : 60
- }, n.prototype.updateCriteria = function(t, e, i, n) {
- this.priorityCriteria.pano = t, this.priorityCriteria.cameraPosition.copy(e), this.priorityCriteria.cameraDir.copy(i), this.priorityCriteria.upcomingPanos = n, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
- }, n.prototype.filterAndPrioritize = (o = [], a = [], s = [], function(t, e, i) {
- this.populateNeighborPanos(this.priorityCriteria.pano, e, o), this.populateScoredPanos(this.priorityCriteria.pano, e, a, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
- var r = this.baseSize,
- l = this.standardSize,
- u = this.highSize,
- h = this.ultraHighSize;
- this.queueTilesForPano(t, i, this.priorityCriteria.pano, r), this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(t, this.priorityCriteria.upcomingPanos, i, r, n.MAX_UPCOMING_PANOS_TOADD), s.length = 0, this.canDownloadSize(l) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), this.queueTilesForPanos(t, a, i, r, n.MAX_SCORED_PANOS_TOADD), s.length = 0, this.canDownloadSize(u) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, u, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), this.canDownloadSize(h) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), s.length = 0, this.canDownloadSize(l) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), this.canDownloadSize(u) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, u, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), this.canDownloadSize(h) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), this.queueTilesForPanos(t, o, i, r)
- }), n.prototype.canDownloadSize = function(t) {
- return this.maxNavQuality >= t || this.maxZoomQuality >= t && this.zoomingActive
- }, n.prototype.populateNeighborPanos = function(t, e, i) {
- (i = i || [])
- .length = 0;
- var n = e.getNeighbours(t),
- r = 0;
- for (var o in n)
- if (n.hasOwnProperty(o)) {
- var a = e.get(o);
- if (t.id !== a.id && (i.push(a), 1 == ++r)) break
- } return i
- }, n.prototype.populateScoredPanos = function(t, e, i, r, o) {
- (i = i || [])
- .length = 0;
- var a = [u.filters.inPanoDirection(t.position, r, n.DIRECTION_SCORE_STRICTNESS), u.filters.not(t)],
- s = [u.scoreFunctions.distanceSquared(t), u.scoreFunctions.direction(t.position, r)],
- l = e.sortByScore(a, s);
- if (l)
- for (var h = 0; h < l.length && h < o; h++) {
- var c = l[h].pano;
- i.push(c)
- }
- return i
- }, n.prototype.queueTilesForPanos = function(t, e, i, n, r) {
- for (var o = 0, a = 0; a < e.length; a++) {
- var s = e[a];
- if (o += this.queueTilesForPano(t, i, s, n) > 0 ? 1 : 0, r && o >= r) break
- }
- return o
- }, n.prototype.queueTilesForPano = (r = {
- filter: f.None
- }, function(t, e, i, n) {
- return this.filterAndQueueTileDownloadDescriptors(t, e, i, n, r)
- }), n.prototype.queueTilesForPanosInDirection = function() {
- var t = new l.Vector3;
- return function(e, i, n, r, o, a, s, l) {
- for (var u = 0, h = 0; h < n.length; h++) {
- var c = n[h];
- if (t.copy(c.position), t.sub(o), t.normalize(), Math.max(Math.min(a.dot(t), 1), -1) >= p.getFOVDotThreshold(s))
- if (u += this.queueTilesInDirectionForPano(e, i, c, r, o, a, s) > 0 ? 1 : 0, l && u >= l) break
- }
- return u
- }
- }(), n.prototype.queueTilesInDirectionForPanos = function(t, e, i, n, r, o, a, s) {
- for (var l = 0, u = 0; u < i.length; u++) {
- var h = i[u];
- if (l += this.queueTilesInDirectionForPano(t, e, h, n, o, a) > 0 ? 1 : 0, s && l >= s) break
- }
- return l
- }, n.prototype.queueTilesInDirectionForPano = function() {
- var t = {
- filter: f.DirectionalFOV,
- direction: new l.Vector3,
- fov: 60
- },
- e = new l.Vector3;
- return function(i, n, r, o, a, s, l) {
- return e.copy(s), d.getRelativeDirection(r.quaternion, e), t.direction.copy(e), t.fov = l, this.filterAndQueueTileDownloadDescriptors(i, n, r, o, t)
- }
- }(), n.prototype.filterAndQueueTileDownloadDescriptors = function() {
- var t = [];
- return function(e, i, n, r, o) {
- var a = i.getTileDownloadDescriptors(n, r);
- t.length = 0, this.filterTileDownloadDescriptors(n, a, t, o);
- for (var s = 0, l = 0; l < t.length; l++) {
- var u = t[l];
- u && (e.push(u), s++)
- }
- return s
- }
- }(), n.prototype.filterTileDownloadDescriptors = (new l.Vector3, function(t, e, i, n) {
- var r, o;
- switch (n.filter) {
- case f.DirectionalFOV:
- for (r = 0; r < e.length; r++) o = e[r], d.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
- break;
- default:
- for (r = 0; r < e.length; r++) o = e[r], i.push(o)
- }
- for (r = 0; r < i.length; r++) o = i[r], this.canIncludeDescriptor(o) || (i[r] = null)
- }), n.prototype.canIncludeDescriptor = function(t) {
- return t.status !== c.Downloading && t.status !== c.Downloaded
- }, n.prototype.canIncludePano = function(t, e) {
- return !t.isLoaded(e)
- }, n.getFOVDotThreshold = function(t) {
- return Math.cos(l.Math.degToRad(t / 2))
- };
- var m = function() {
- var t = function t(e, i) {
- var n = t._panoSpaceDir,
- r = t._fovThreshold,
- o = t._fovThresholdNarrow,
- a = Math.max(Math.min(n.dot(e.direction), 1), -1),
- s = Math.max(Math.min(n.dot(i.direction), 1), -1);
- return e._dot = a, i._dot = s, a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o || e.panoSize > i.panoSize ? 1 : i.panoSize > e.panoSize ? -1 : -(a - s)
- };
- return t._panoSpaceDir = new l.Vector3, t._fovThreshold = -1, t._fovThresholdNarrow = -1, t
- }();
- n.sortPanoTiles = function(t, e, i) {
- m._panoSpaceDir.copy(i), d.getRelativeDirection(e.quaternion, m._panoSpaceDir), m._fovThresholdNarrow = p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW), m._fovThreshold = p.getFOVDotThreshold(d.getDirectionalFov()), t.sort(m)
- }, n.insertSortedPanoTile = function(t, e, i, r) {
- m._panoSpaceDir.copy(r), d.getRelativeDirection(i.quaternion, m._panoSpaceDir), m._fovThresholdNarrow = p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW), m._fovThreshold = p.getFOVDotThreshold(d.getDirectionalFov());
- for (var o = -1, a = 0; a < t.length; a++) {
- if (m(e, t[a]) <= 0) {
- o = a;
- break
- }
- }
- if (-1 === o) t[t.length] = e;
- else {
- for (var s = t.length; s > o; s--) t[s] = t[s - 1];
- t[o] = e
- }
- }, n.prototype.setZoomingActive = function(t) {
- t !== this.zoomingActive && (this.zoomingActive = t)
- }, t.exports = n
- })
- .call(this, "/js/tile/TilePrioritizer.js")
- }, function(t, e) {
- t.exports = {
- BuildingType: 0,
- TextOnly: 1,
- ImageText: 2,
- Audio: 4,
- OtherModel: 5,
- TextAudio: 6,
- ImageTextAudio: 7,
- IFrame: 8,
- Tag360T1: 9,
- TagTo360: 10,
- Video: 11,
- Title: 12,
- RegionalJump: 13,
- Custome: 104,
- ClassifyType: {
- Indoor: 1,
- Building: 2
- },
- EW: 101,
- IKEA: 102,
- Pano: 9e3
- }
- }, function(t, e) {
- t.exports = function(t) {
- var e = function(e) {
- t.MeshBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.opacity = .8, this.color.setHex(e.color), this.highlight = function(t) {
- this.opacity = t ? 1 : .8
- }
- };
- (e.prototype = Object.create(t.MeshBasicMaterial.prototype))
- .constructor = e;
- var i = function(e) {
- t.LineBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.linewidth = 1, this.color.setHex(e.color), this.highlight = function(t) {}
- };
- (i.prototype = Object.create(t.LineBasicMaterial.prototype))
- .constructor = i;
- var n = (new t.TextureLoader)
- .load("images/torus_2x.png"),
- r = (new t.TextureLoader)
- .load("images/arc_surface_2x.png");
- n.minFilter = r.minFilter = t.LinearFilter, n.magFilter = r.magFilter = t.LinearFilter;
- var o = function() {
- for (var e = [{
- x: 26,
- y: 16
- }, {
- x: 26,
- y: 6
- }, {
- x: -54,
- y: 6
- }, {
- x: -54,
- y: -6
- }, {
- x: 26,
- y: -6
- }, {
- x: 26.1,
- y: -16.1
- }, {
- x: 54,
- y: 0
- }], i = new t.Shape, n = 0, r = e.length; n < r; ++n) 0 === n ? i.moveTo(e[n].x, e[n].y) : i.lineTo(e[n].x, e[n].y);
- return new t.ExtrudeBufferGeometry(i, {
- depth: 8,
- bevelEnabled: !1,
- bevelSegments: 1,
- steps: 1,
- bevelSize: 1,
- bevelThickness: 1
- })
- },
- a = function(e) {
- var i = [{
- x: -84.5,
- y: 21.5
- }, {
- x: -82.8,
- y: -11.5
- }, {
- x: -72,
- y: -2.7
- }, {
- x: -60.3,
- y: -7.8
- }, {
- x: -50.2,
- y: -11.9
- }, {
- x: -36.3,
- y: -16.2
- }, {
- x: -24.8,
- y: -18.8
- }, {
- x: -10.57,
- y: -21.01
- }, {
- x: 6.4,
- y: -21.74
- }, {
- x: 20.67,
- y: -21.09
- }, {
- x: 35.02,
- y: -18.28
- }, {
- x: 45.3,
- y: -15.7
- }, {
- x: 56.5,
- y: -11.5
- }, {
- x: 72.6,
- y: -4.5
- }, {
- x: 83.5,
- y: -13.5
- }, {
- x: 84.5,
- y: 20.5
- }, {
- x: 52.5,
- y: 13.1
- }, {
- x: 60.7,
- y: 5
- }, {
- x: 48.38,
- y: .6
- }, {
- x: 35.6,
- y: -3.1
- }, {
- x: 24.7,
- y: -5.2
- }, {
- x: 12.9,
- y: -6.7
- }, {
- x: -1.6,
- y: -7
- }, {
- x: -14.9,
- y: -5.7
- }, {
- x: -27.8,
- y: -3.2
- }, {
- x: -41.2,
- y: .5
- }, {
- x: -50.7,
- y: 3.9
- }, {
- x: -59.7,
- y: 7.6
- }, {
- x: -51.8,
- y: 14.4
- }],
- n = new t.Shape;
- n.moveTo(i[0].x, i[0].y);
- for (var r = 1; r < i.length; ++r) n.lineTo(i[r].x, i[r].y);
- return new t.ExtrudeGeometry(n, {
- depth: e,
- bevelEnabled: !1,
- bevelSegments: 1,
- steps: 1,
- bevelSize: 1,
- bevelThickness: 1
- })
- },
- s = function() {
- var e = new t.PlaneBufferGeometry(4, 4),
- i = new t.MeshBasicMaterial({
- map: n,
- side: t.DoubleSide,
- transparent: !0,
- depthTest: !1,
- depthWrite: !1
- });
- return new t.Mesh(e, i)
- },
- l = function() {
- var e = new t.PlaneBufferGeometry(2.84, .74),
- i = new t.MeshBasicMaterial({
- map: r,
- side: t.DoubleSide,
- transparent: !0,
- depthTest: !1,
- depthWrite: !1
- });
- return new t.Mesh(e, i)
- },
- u = function(i) {
- var n = new t.Group,
- r = new t.Mesh(new a(8), new e({
- color: i.color
- }));
- r.name = i.name, r.scale.set(.01, .01, .01), r.position.set(0, -1.84, 0), r.userData.isPicker = !0, n.add(r);
- var o = new s;
- o.name = "Torus", o.visible = !1, n.add(o);
- var u = new l;
- return u.name = "ArcSurface", u.visible = !1, u.position.y -= 1.84 - .37 + .18, u.position.z += .01, n.add(u), n
- };
- function h(e, i) {
- t.Object3D.call(this), i = void 0 !== i ? i : document, this.object = void 0, this.visible = !1, this.translationSnap = null, this.rotationSnap = null, this.space = "world", this.size = 1, this.axis = null, this.currentWorldPosition = new t.Vector3, this.clock = new t.Clock, this.delta = 0, this.MOVELOCK = {
- X: {
- state: !1,
- crash_point: null
- },
- Y: {
- state: !1,
- crash_point: null
- },
- Z: {
- state: !1,
- crash_point: null
- }
- };
- var n = this,
- r = "translate",
- o = !1,
- a = {
- translate: new t.TransformGizmoDIYTranslate,
- rotate: new t.TransformGizmoDIYRotate
- };
- for (var s in this._gizmo = a, a) {
- var l = a[s];
- l.visible = s === r, this.add(l)
- }
- var u = {
- type: "change"
- },
- h = {
- type: "mouseDown"
- },
- c = {
- type: "mouseUp",
- mode: r
- },
- d = {
- type: "objectChange"
- },
- p = new t.Raycaster,
- f = new t.Vector2,
- m = new t.Vector3,
- g = new t.Vector3,
- v = new t.Vector3,
- y = new t.Vector3,
- b = 1,
- w = (new t.Matrix4, new t.Vector3),
- x = new t.Matrix4,
- M = new t.Vector3,
- T = new t.Quaternion,
- S = new t.Vector3(1, 0, 0),
- _ = new t.Vector3(0, 1, 0),
- A = new t.Vector3(0, 0, 1),
- P = new t.Quaternion,
- C = new t.Quaternion,
- E = new t.Quaternion,
- D = new t.Quaternion,
- L = (new t.Quaternion, new t.Vector3),
- O = new t.Vector3,
- I = new t.Matrix4,
- R = new t.Matrix4,
- N = new t.Vector3,
- k = new t.Vector3,
- F = new t.Euler,
- B = new t.Matrix4,
- z = new t.Vector3,
- U = new t.Euler;
- function V(t) {
- if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
- var e = W(t.changedTouches ? t.changedTouches[0] : t, a[r].pickers.children),
- i = null;
- e && (i = e.object.name, t.preventDefault()), n.axis !== i && (n.axis = i, n.update(), n.dispatchEvent(u))
- }
- }
- function j(t) {
- if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
- var e = t.changedTouches ? t.changedTouches[0] : t;
- if (0 === e.button || void 0 === e.button) {
- var i = W(e, a[r].pickers.children);
- if (i) {
- t.preventDefault(), t.stopPropagation(), n.dispatchEvent(h), n.axis = i.object.name, n.update(), w.copy(z)
- .sub(k)
- .normalize(), a[r].setActivePlane(n.axis, w);
- var s = W(e, [a[r].activePlane]);
- s && (L.copy(n.object.position), O.copy(n.object.scale), I.extractRotation(n.object.matrix), B.extractRotation(n.object.matrixWorld), R.extractRotation(n.object.parent.matrixWorld), N.setFromMatrixScale(x.getInverse(n.object.parent.matrixWorld)), g.copy(s.point));
- var l = i.object,
- u = n.getMode(),
- c = n._gizmo[u].pickerGizmos;
- if ("rotate" === u && l.userData.isPicker) {
- for (var d in c) {
- (p = c[d][0][0].children[0])
- .visible = !1
- }
- l.parent.getObjectByName("Torus")
- .visible = !0, l.parent.getObjectByName("ArcSurface")
- .visible = !0
- }
- if ("translate" === u && l.userData.isPicker)
- for (var d in c) {
- var p = c[d][0][0];
- n.axis !== d && (p.visible = !1)
- }
- }
- }
- o = !0
- }
- }
- function H(e) {
- if (void 0 !== n.object && null !== n.axis && !1 !== o && (void 0 === e.button || 0 === e.button)) {
- var i = W(e.changedTouches ? e.changedTouches[0] : e, [a[r].activePlane]);
- if (!1 !== i) {
- if (e.preventDefault(), e.stopPropagation(), m.copy(i.point), "translate" === r) {
- if (n.MOVELOCK[n.axis].state) return;
- m.sub(g), m.multiply(N), "world" !== n.space && -1 === n.axis.search("XYZ") || (-1 === n.axis.search("X") && (m.x = 0), -1 === n.axis.search("Y") && (m.y = 0), -1 === n.axis.search("Z") && (m.z = 0), m.applyMatrix4(x.getInverse(R)), n.object.position.copy(L), n.object.position.add(m))
- }
- if ("rotate" === r) {
- if (n.MOVELOCK[n.axis].state) return;
- if (m.sub(k), m.multiply(N), M.copy(g)
- .sub(k), M.multiply(N), "world" === n.space) {
- if (v.set(Math.atan2(m.z, m.y), Math.atan2(m.x, m.z), Math.atan2(m.y, m.x)), y.set(Math.atan2(M.z, M.y), Math.atan2(M.x, M.z), Math.atan2(M.y, M.x)), T.setFromRotationMatrix(x.getInverse(R)), null !== n.rotationSnap ? (C.setFromAxisAngle(S, Math.round((v.x - y.x) / n.rotationSnap) * n.rotationSnap), E.setFromAxisAngle(_, Math.round((v.y - y.y) / n.rotationSnap) * n.rotationSnap), D.setFromAxisAngle(A, Math.round((v.z - y.z) / n.rotationSnap) * n.rotationSnap)) : (C.setFromAxisAngle(S, v.x - y.x), E.setFromAxisAngle(_, v.y - y.y), D.setFromAxisAngle(A, v.z - y.z)), P.setFromRotationMatrix(B), "X" === n.axis) {
- T.multiplyQuaternions(T, C);
- var s = n._gizmo[r].pickerGizmos.X[0][0].getObjectByName("ArcSurface");
- (l = new t.Quaternion)
- .setFromAxisAngle(A, v.x), s.quaternion.copy(l)
- }
- if ("Y" === n.axis) {
- T.multiplyQuaternions(T, E);
- s = n._gizmo[r].pickerGizmos.Y[0][0].getObjectByName("ArcSurface");
- (l = new t.Quaternion)
- .setFromAxisAngle(A, v.y), s.quaternion.copy(l)
- }
- if ("Z" === n.axis) {
- T.multiplyQuaternions(T, D);
- var l;
- s = n._gizmo[r].pickerGizmos.Z[0][0].getObjectByName("ArcSurface");
- (l = new t.Quaternion)
- .setFromAxisAngle(A, v.z), s.quaternion.copy(l)
- }
- if (n.MOVELOCK[n.axis].state) return;
- T.multiplyQuaternions(T, P), n.object.quaternion.copy(T)
- }
- }
- n.update(), n.dispatchEvent(u), n.dispatchEvent(d)
- }
- }
- }
- function G(t) {
- if (t.preventDefault(), void 0 === t.button || 0 === t.button) {
- if (o && null !== n.axis) {
- c.mode = r, n.dispatchEvent(c);
- var e = n.getMode(),
- i = n.axis,
- a = n._gizmo[e].pickerGizmos;
- if ("rotate" === e) {
- for (var s in a) {
- (l = a[s][0][0].children[0])
- .visible = !0
- }
- a[i][0][0].getObjectByName("Torus")
- .visible = !1, a[i][0][0].getObjectByName("ArcSurface")
- .visible = !1
- }
- if ("translate" === e)
- for (var s in a) {
- var l = a[s][0][0];
- n.axis !== s && (l.visible = !0)
- }
- }
- o = !1, "TouchEvent" in window && t instanceof TouchEvent ? (n.axis = null, n.update(), n.dispatchEvent(u)) : V(t)
- }
- }
- function W(t, n) {
- var r = i.getBoundingClientRect(),
- o = (t.clientX - r.left) / r.width,
- a = (t.clientY - r.top) / r.height;
- f.set(2 * o - 1, -2 * a + 1), p.setFromCamera(f, e);
- var s = p.intersectObjects(n, !0);
- return !!s[0] && s[0]
- }
- i.addEventListener("mousedown", j, !1), i.addEventListener("mousemove", V, !1), i.addEventListener("mousemove", H, !1), i.addEventListener("mouseup", G, !1), i.addEventListener("mouseout", G, !1), this.dispose = function() {
- i.removeEventListener("mousedown", j), i.removeEventListener("mousemove", V), i.removeEventListener("mousemove", H), i.removeEventListener("mouseup", G), i.removeEventListener("mouseout", G)
- }, this.attach = function(t) {
- this.object = t, this.visible = !0, this.update()
- }, this.detach = function() {
- this.object = void 0, this.visible = !1, this.axis = null
- }, this.getMode = function() {
- return r
- }, this.setMode = function(t) {
- for (var e in "scale" === (r = t || r) && (n.space = "local"), a) a[e].visible = e === r;
- this.update(), n.dispatchEvent(u)
- }, this.setTranslationSnap = function(t) {
- n.translationSnap = t
- }, this.setRotationSnap = function(t) {
- n.rotationSnap = t
- }, this.setSize = function(t) {
- n.size = t, this.update(), n.dispatchEvent(u)
- }, this.setSpace = function(t) {
- n.space = t, this.update(), n.dispatchEvent(u)
- }, this.update = function() {
- void 0 !== n.object && (n.object.updateMatrixWorld(), k.setFromMatrixPosition(n.object.matrixWorld), F.setFromRotationMatrix(x.extractRotation(n.object.matrixWorld)), e.updateMatrixWorld(), z.setFromMatrixPosition(e.matrixWorld), U.setFromRotationMatrix(x.extractRotation(e.matrixWorld)), b = k.distanceTo(z) / 6 * n.size, "Group" === n.object.type ? this.position.copy(n.currentWorldPosition) : this.position.copy(k), this.scale.set(b, b, b), e instanceof t.PerspectiveCamera ? w.copy(z)
- .sub(k)
- .normalize() : e instanceof t.OrthographicCamera && w.copy(z)
- .normalize(), "local" === n.space ? a[r].update(F, w) : "world" === n.space && a[r].update(new t.Euler, w), a[r].highlight(n.axis))
- }
- }
- return t.TransformGizmoDIY = function() {
- this.init = function() {
- t.Object3D.call(this), this.handles = new t.Object3D, this.pickers = new t.Object3D, this.planes = new t.Object3D, this.add(this.handles), this.add(this.pickers), this.add(this.planes);
- var e = new t.PlaneBufferGeometry(50, 50, 2, 2),
- i = new t.MeshBasicMaterial({
- visible: !1,
- side: t.DoubleSide
- }),
- n = {
- XY: new t.Mesh(e, i),
- YZ: new t.Mesh(e, i),
- XZ: new t.Mesh(e, i)
- };
- for (var r in n.YZ.rotation.set(0, Math.PI / 2, 0), n.XZ.rotation.set(-Math.PI / 2, 0, 0), n) n[r].name = r, this.planes.add(n[r]), this.planes[r] = n[r];
- var o = function(t, e) {
- for (var i in t)
- for (r = t[i].length; r--;) {
- var n = t[i][r][0],
- o = t[i][r][1],
- a = t[i][r][2];
- n.name = i, o && n.position.set(o[0], o[1], o[2]), a && n.rotation.set(a[0], a[1], a[2]), e.add(n)
- }
- };
- o(this.handleGizmos, this.handles), o(this.pickerGizmos, this.pickers), this.traverse((function(e) {
- if (e instanceof t.Mesh) {
- e.updateMatrix();
- var i = e.geometry.clone();
- i.applyMatrix(e.matrix), e.geometry = i, e.position.set(0, 0, 0), e.rotation.set(0, 0, 0), e.scale.set(1, 1, 1)
- }
- }))
- };
- this.highlight = function(t) {
- this.traverse((function(e) {
- e.material && e.material.highlight && (e.name === t ? e.material.highlight(!0) : e.material.highlight(!1))
- }))
- }
- }, t.TransformGizmoDIY.prototype = Object.create(t.Object3D.prototype), t.TransformGizmoDIY.prototype.constructor = t.TransformGizmoDIY, t.TransformGizmoDIY.prototype.update = function(t, e) {}, t.TransformGizmoDIYTranslate = function() {
- t.TransformGizmoDIY.call(this);
- var n = new t.BufferGeometry;
- n.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3));
- var r = new t.Line(n, new i({
- color: 65280
- }));
- r.userData.isLine = !0;
- var a = new t.BufferGeometry;
- a.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3));
- var s = new t.Line(a, new i({
- color: 16711680
- }));
- s.userData.isLine = !0;
- var l = new t.BufferGeometry;
- l.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3));
- var u = new t.Line(l, new i({
- color: 16776960
- }));
- r.userData.isLine = !0, this.handleGizmos = {
- X: [
- [r]
- ],
- Y: [
- [s]
- ],
- Z: [
- [u]
- ]
- };
- var h = new t.Mesh(new o, new e({
- visible: !0,
- transparent: !0,
- color: 65280
- }));
- h.scale.set(.01, .01, .01), h.userData.isPicker = !0;
- var c = new t.Mesh(new o, new e({
- visible: !0,
- transparent: !0,
- color: 16711680
- }));
- c.scale.set(.01, .01, .01), c.userData.isPicker = !0;
- var d = new t.Mesh(new o, new e({
- visible: !0,
- transparent: !0,
- color: 16776960
- }));
- d.scale.set(.01, .01, .01), d.userData.isPicker = !0, this.pickerGizmos = {
- X: [
- [h, [1.2, 0, 0],
- [Math.PI / 2, 0, 0]
- ]
- ],
- Y: [
- [c, [0, 1.2, 0],
- [0, 0, Math.PI / 2]
- ]
- ],
- Z: [
- [d, [0, 0, 1.2],
- [Math.PI / 2, 0, Math.PI / 2]
- ]
- ]
- }, this.setActivePlane = function(e, i) {
- var n = new t.Matrix4;
- i.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))), "X" === e && (this.activePlane = this.planes.XY, Math.abs(i.y) > Math.abs(i.z) && (this.activePlane = this.planes.XZ)), "Y" === e && (this.activePlane = this.planes.XY, Math.abs(i.x) > Math.abs(i.z) && (this.activePlane = this.planes.YZ)), "Z" === e && (this.activePlane = this.planes.XZ, Math.abs(i.x) > Math.abs(i.y) && (this.activePlane = this.planes.YZ)), "XYZ" === e && (this.activePlane = this.planes.XYZE), "XY" === e && (this.activePlane = this.planes.XY), "YZ" === e && (this.activePlane = this.planes.YZ), "XZ" === e && (this.activePlane = this.planes.XZ)
- };
- var p = new t.Vector3(1, 0, 0),
- f = new t.Vector3(0, 1, 0),
- m = new t.Vector3(0, 0, 1),
- g = new t.Quaternion,
- v = new t.Quaternion,
- y = new t.Vector3(0, 1, 0);
- this.update = function(e, i) {
- t.TransformGizmoDIY.prototype.update.apply(this, arguments), this.traverse((function(e) {
- var n;
- "X" === e.name && ((n = y.copy(p)
- .applyQuaternion(g)
- .dot(i)) < 0 && (e.scale.x = -1), n > 0 && (e.scale.x = 1));
- if ("Y" === e.name) {
- var r = new t.Quaternion,
- o = new t.Quaternion;
- r.setFromAxisAngle(f, Math.atan2(i.x, i.z)), o.multiplyQuaternions(o, r), e.quaternion.copy(o)
- }
- "Z" === e.name && ((n = y.copy(m)
- .applyQuaternion(v)
- .dot(i)) < 0 && (e.scale.z = -1), n > 0 && (e.scale.z = 1))
- }))
- }, this.init()
- }, t.TransformGizmoDIYTranslate.prototype = Object.create(t.TransformGizmoDIY.prototype), t.TransformGizmoDIYTranslate.prototype.constructor = t.TransformGizmoDIYTranslate, t.TransformGizmoDIYRotate = function() {
- t.TransformGizmoDIY.call(this);
- var e = new t.BufferGeometry;
- e.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3));
- var n = new t.Line(e, new i({
- color: 65280
- }));
- n.userData.isLine = !0;
- var r = new t.BufferGeometry;
- r.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3));
- var o = new t.Line(r, new i({
- color: 16711680
- }));
- o.userData.isLine = !0;
- var a = new t.BufferGeometry;
- a.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3));
- var s = new t.Line(a, new i({
- color: 16776960
- }));
- s.userData.isLine = !0, this.handleGizmos = {
- X: [
- [n]
- ],
- Y: [
- [o]
- ],
- Z: [
- [s]
- ]
- };
- var l = new u({
- color: 8446604,
- name: "X"
- }),
- h = new u({
- color: 15897485,
- name: "Y"
- }),
- c = new u({
- color: 16701062,
- name: "Z"
- });
- this.pickerGizmos = {
- X: [
- [l, [0, 0, 0],
- [0, Math.PI / 2, -3 * Math.PI / 4]
- ]
- ],
- Y: [
- [h, [0, 0, 0],
- [-Math.PI / 2, 0, 0]
- ]
- ],
- Z: [
- [c, [0, 0, 0],
- [0, 0, 3 * Math.PI / 4]
- ]
- ]
- }, this.setActivePlane = function(t) {
- "X" === t && (this.activePlane = this.planes.YZ), "Y" === t && (this.activePlane = this.planes.XZ), "Z" === t && (this.activePlane = this.planes.XY)
- }, this.update = function(e, i) {
- t.TransformGizmoDIY.prototype.update.apply(this, arguments);
- this.handles, this.pickers, new t.Matrix4, new t.Euler(0, 0, 1);
- var n = new t.Quaternion,
- r = new t.Vector3(1, 0, 0),
- o = new t.Vector3(0, 1, 0),
- a = new t.Vector3(0, 0, 1),
- s = new t.Quaternion,
- l = (new t.Quaternion, new t.Quaternion),
- u = i.clone(),
- h = new t.Vector3(0, 1, 0),
- c = h.copy(r)
- .applyQuaternion(s)
- .dot(u),
- d = h.copy(a)
- .applyQuaternion(l)
- .dot(u);
- c < 0 && 1 === this.handleGizmos.X[0][0].scale.x && (this.handleGizmos.X[0][0].scale.x = -1, this.pickerGizmos.Z[0][0].rotateZ(Math.PI / 2)), c > 0 && -1 === this.handleGizmos.X[0][0].scale.x && (this.handleGizmos.X[0][0].scale.x = 1, this.pickerGizmos.Z[0][0].rotateZ(-Math.PI / 2)), d < 0 && 1 === this.handleGizmos.Z[0][0].scale.z && (this.handleGizmos.Z[0][0].scale.z = -1, this.pickerGizmos.X[0][0].rotateZ(-Math.PI / 2)), d > 0 && -1 === this.handleGizmos.Z[0][0].scale.z && (this.handleGizmos.Z[0][0].scale.z = 1, this.pickerGizmos.X[0][0].rotateZ(Math.PI / 2));
- var p = new t.Quaternion;
- n = new t.Quaternion;
- p.setFromAxisAngle(o, Math.atan2(u.x, u.z)), n.multiplyQuaternions(n, p), this.pickerGizmos.Y[0][0].quaternion.copy(n), this.pickerGizmos.Y[0][0].rotateX(-Math.PI / 2)
- }, this.init()
- }, t.TransformGizmoDIYRotate.prototype = Object.create(t.TransformGizmoDIY.prototype), t.TransformGizmoDIYRotate.prototype.constructor = t.TransformGizmoDIYRotate, h.prototype = Object.create(t.Object3D.prototype), h.prototype.constructor = h, h
- }
- }, function(t, e) {
- t.exports = {
- canbeChoosedOfMode3D: !0
- }
- }, function(t, e) {
- t.exports = {
- TagActivated: "tag.activated",
- TagDismissed: "tag.dismissed",
- TagNavigation: "tag.navigation"
- }
- }, function(t, e, i) {
- var n = i(0),
- r = i(12),
- o = i(7);
- function a(t) {
- t = t || {}, G.model.enablefilter ? n.RawShaderMaterial.call(this, o.extendObject({
- fragmentShader: r.model2.fragmentShader,
- vertexShader: r.model2.vertexShader,
- uniforms: n.UniformsUtils.clone(r.model2.uniforms),
- name: "ModelTextureMaterial",
- depthTest: !0,
- depthWrite: !0
- }, t)) : n.RawShaderMaterial.call(this, o.extendObject({
- fragmentShader: r.model.fragmentShader,
- vertexShader: r.model.vertexShader,
- uniforms: n.UniformsUtils.clone(r.model.uniforms),
- name: "ModelTextureMaterial",
- depthTest: !0,
- depthWrite: !0
- }, t))
- }
- a.prototype = Object.create(n.RawShaderMaterial.prototype), a.prototype.constructor = a, a.prototype.setProjectedPanos = function(t, e, i) {
- if (G.model.enablefilter) {
- var n = t.getAjustedColors(),
- r = e.getAjustedColors();
- i && (this.uniforms.progress.value = 0), t.ensureSkyboxReadyForRender(), this.uniforms.pano0Map.value = t.getSkyboxTexture(), this.uniforms.brightness0.value = n.brightness, this.uniforms.contrast0.value = n.contrast, this.uniforms.gamma0.value = n.gamma, this.uniforms.hue0.value = n.hue, this.uniforms.saturation0.value = n.saturation, this.uniforms.vibrance0.value = n.vibrance, this.uniforms.balance0.value.copy(n.balance), this.uniforms.pano0Position.value.copy(t.position), this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld), e.ensureSkyboxReadyForRender(), this.uniforms.pano1Map.value = e.getSkyboxTexture(), this.uniforms.brightness1.value = r.brightness, this.uniforms.contrast1.value = r.contrast, this.uniforms.gamma1.value = r.gamma, this.uniforms.hue1.value = r.hue, this.uniforms.saturation1.value = r.saturation, this.uniforms.vibrance1.value = r.vibrance, this.uniforms.balance1.value.copy(r.balance), this.uniforms.pano1Position.value.copy(e.position), this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld)
- } else i && (this.uniforms.progress.value = 0), t.ensureSkyboxReadyForRender(), this.uniforms.pano0Map.value = t.getSkyboxTexture(), this.uniforms.pano0Position.value.copy(t.position), this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld), e.ensureSkyboxReadyForRender(), this.uniforms.pano1Map.value = e.getSkyboxTexture(), this.uniforms.pano1Position.value.copy(e.position), this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld)
- }, t.exports = a
- }, function(t, e, i) {
- var n = i(0),
- r = i(1),
- o = i(7),
- a = i(10),
- s = i(153),
- l = i(8),
- u = i(15),
- h = i(17);
- function c(t, e, i) {
- n.Object3D.call(this), this.model = t, this.floorIndex = e, this.name = i || e + 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, this.pano360Position = null
- }
- c.prototype = Object.create(n.Object3D.prototype), c.prototype.enter = function(t) {
- this.model.setFloor(this, t)
- }, c.prototype.hide = function(t) {
- if (!this.hidden || this.transition) {
- this.chunks.forEach((function(t) {
- t.material.transparent = !0
- })), l.cancel(this.transition);
- var e = t ? 0 : r.hideFloorDuration + r.hideFloorDelay,
- i = t ? 0 : r.hideFloorDelay / e;
- this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), e, function() {
- this.hidden = !0
- }.bind(this), i, u.easeInOutQuad)
- }
- }, c.prototype.show = function(t) {
- if (this.hidden || this.transition) {
- this.hidden = !1, l.cancel(this.transition);
- var e = t ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay,
- i = t ? 0 : r.showFloorDelay / e;
- this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), e, function() {
- this.hidden || this.chunks.forEach((function(t) {
- t.material.transparent = !1
- }))
- }.bind(this), i, u.easeInOutQuad)
- }
- }, c.prototype.toggle = function(t, e) {
- (t = void 0 === t ? this.hidden : t) ? this.show(e): this.hide(e)
- }, c.prototype.containsPoint = function(t) {
- return this.collider.children.some((function(e) {
- return e.geometry.boundingBox || e.geometry.computeBoundingBox(), e.geometry.boundingBox.containsPoint(t)
- }))
- }, c.prototype.distanceToPoint = function(t) {
- var e = null,
- i = 1 / 0;
- return this.collider.children.forEach((function(n) {
- n.geometry.boundingBox || n.geometry.computeBoundingBox();
- var r = n.geometry.boundingBox.distanceToPoint(t);
- (!e || i > r) && (i = r, e = n)
- })), i
- }, c.prototype.addChunk = function(t) {
- t.renderOrder = h.ghostFloor, this.add(t), this.chunks.push(t), this.boundingBox.union(t.geometry.boundingBox), this.size = this.boundingBox.getSize(new n.Vector3), this.colliderBuilder.add(t.geometry)
- }, c.prototype.addPano = function(t) {
- this.panos.push(t), this.add(t.skyboxMesh), t.marker && this.add(t.marker);
- var e = new n.Vector3(1, 1, 1);
- 2 == t.alignmentType && (null == this.pano360Position && (this.pano360Position = new n.Vector3((this.boundingBox.min.x + this.boundingBox.max.x) / 2, this.boundingBox.min.y - 2.1, (this.boundingBox.min.z + this.boundingBox.max.z) / 2)), t.position = this.pano360Position, t.skyboxMesh.position.copy(t.position), e = new n.Vector3(4, 4, 4));
- var i = (new n.Box3)
- .setFromCenterAndSize(t.position, e);
- this.boundingBox.union(i)
- }, c.prototype.build = function() {
- this.collider = this.colliderBuilder.build(!0), this.add(this.collider), this.center = this.boundingBox.getCenter(new n.Vector3), this.conservativeBoundingBox.copy(this.boundingBox), this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map((function(t) {
- return t.geometry.boundingBox.min.y
- })), 5), this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map((function(t) {
- return t.geometry.boundingBox.max.y
- })), 5), this.colliderBuilder = null
- }, c.prototype.toShortString = function() {
- return o.nth(this.floorIndex + 1)
- }, c.prototype.toString = function() {
- return this.name
- }, t.exports = c
- }, function(t, e, i) {
- var n = i(0),
- r = i(12),
- o = i(5),
- a = i(43);
- function s(t) {
- this.materialInside = new a({
- side: n.DoubleSide
- }), this.materialOutside = new n.RawShaderMaterial({
- fragmentShader: r.modelOutside.fragmentShader,
- vertexShader: r.modelOutside.vertexShader,
- uniforms: n.UniformsUtils.clone(r.modelOutside.uniforms),
- side: n.FrontSide,
- name: "chunkOut",
- depthWrite: !0
- }), n.Mesh.call(this, t.geometry, this.materialInside), this.name = t.name || "", this.textureName = t.textureName, this.meshUrl = t.meshUrl
- }
- s.prototype = Object.create(n.Mesh.prototype), s.prototype.setTextureMap = function(t) {
- this.materialInside.uniforms.map.value = t, this.materialOutside.uniforms.map.value = t
- }, s.prototype.setMode = function(t) {
- var e = t === o.DOLLHOUSE || t === o.FLOORPLAN ? this.materialOutside : this.materialInside;
- e.side = t === o.PANORAMA ? n.DoubleSide : n.FrontSide, e.transparent = this.material.transparent, e.uniforms.opacity.value = this.material.uniforms.opacity.value, this.material = e
- }, t.exports = s
- }, function(t, e, i) {
- (function(n) {
- var r, o, a;
- o = [i(168)], void 0 === (a = "function" == typeof(r = function(t, e) {
- "use strict";
- var r, o = {};
- return o.ByteBuffer = t, o.Long = t.Long || null, o.VERSION = "5.0.3", 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 = {
- int32: {
- name: "int32",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- uint32: {
- name: "uint32",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- sint32: {
- name: "sint32",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- int64: {
- name: "int64",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: o.Long ? o.Long.ZERO : void 0
- },
- uint64: {
- name: "uint64",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: o.Long ? o.Long.UZERO : void 0
- },
- sint64: {
- name: "sint64",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: o.Long ? o.Long.ZERO : void 0
- },
- bool: {
- name: "bool",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: !1
- },
- double: {
- name: "double",
- wireType: o.WIRE_TYPES.BITS64,
- defaultValue: 0
- },
- string: {
- name: "string",
- wireType: o.WIRE_TYPES.LDELIM,
- defaultValue: ""
- },
- bytes: {
- name: "bytes",
- wireType: o.WIRE_TYPES.LDELIM,
- defaultValue: null
- },
- fixed32: {
- name: "fixed32",
- wireType: o.WIRE_TYPES.BITS32,
- defaultValue: 0
- },
- sfixed32: {
- name: "sfixed32",
- wireType: o.WIRE_TYPES.BITS32,
- defaultValue: 0
- },
- fixed64: {
- name: "fixed64",
- wireType: o.WIRE_TYPES.BITS64,
- defaultValue: o.Long ? o.Long.UZERO : void 0
- },
- sfixed64: {
- name: "sfixed64",
- wireType: o.WIRE_TYPES.BITS64,
- defaultValue: o.Long ? o.Long.ZERO : void 0
- },
- float: {
- name: "float",
- wireType: o.WIRE_TYPES.BITS32,
- defaultValue: 0
- },
- enum: {
- name: "enum",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- message: {
- name: "message",
- wireType: o.WIRE_TYPES.LDELIM,
- defaultValue: null
- },
- group: {
- name: "group",
- wireType: o.WIRE_TYPES.STARTGROUP,
- defaultValue: null
- }
- }, 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 n || n + "" != "[object process]" || n.browser), r.XHR = function() {
- for (var t = [function() {
- return new XMLHttpRequest
- }, function() {
- return new ActiveXObject("Msxml2.XMLHTTP")
- }, function() {
- return new ActiveXObject("Msxml3.XMLHTTP")
- }, function() {
- return new ActiveXObject("Microsoft.XMLHTTP")
- }], e = null, i = 0; i < t.length; i++) {
- try {
- e = t[i]()
- } catch (t) {
- continue
- }
- break
- }
- if (!e) throw Error("XMLHttpRequest is not supported");
- return e
- }, r.fetch = function(t, e) {
- if (e && "function" != typeof e && (e = null), r.IS_NODE) {
- var n = i(170);
- if (e) n.readFile(t, (function(t, i) {
- e(t ? null : "" + i)
- }));
- else try {
- return n.readFileSync(t)
- } catch (t) {
- return null
- }
- } else {
- var o = r.XHR();
- if (o.open("GET", t, !!e), o.setRequestHeader("Accept", "text/plain"), "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"), !e) return o.send(null), 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
- if (o.onreadystatechange = function() {
- 4 == o.readyState && (200 == o.status || 0 == o.status && "string" == typeof o.responseText ? e(o.responseText) : e(null))
- }, 4 == o.readyState) return;
- o.send(null)
- }
- }, r.toCamelCase = function(t) {
- return t.replace(/_([a-zA-Z])/g, (function(t, e) {
- return e.toUpperCase()
- }))
- }, r), o.Lang = {
- DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
- RULE: /^(?:required|optional|repeated|map)$/,
- TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
- NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
- TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
- TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
- FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
- NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
- NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
- NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
- NUMBER_OCT: /^0[0-7]+$/,
- NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
- BOOL: /^(?:true|false)$/i,
- ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
- NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
- WHITESPACE: /\s/,
- STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
- STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
- STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
- }, o.DotProto = function(t, e) {
- var i = {},
- n = function(t) {
- this.source = t + "", this.index = 0, this.line = 1, this.stack = [], this._stringOpen = null
- },
- r = n.prototype;
- r._readString = function() {
- var t = '"' === this._stringOpen ? e.STRING_DQ : e.STRING_SQ;
- t.lastIndex = this.index - 1;
- var i = t.exec(this.source);
- if (!i) throw Error("unterminated string");
- return this.index = t.lastIndex, this.stack.push(this._stringOpen), this._stringOpen = null, i[1]
- }, r.next = function() {
- if (this.stack.length > 0) return this.stack.shift();
- if (this.index >= this.source.length) return null;
- if (null !== this._stringOpen) return this._readString();
- var t, i, n;
- do {
- for (t = !1; e.WHITESPACE.test(n = this.source.charAt(this.index));)
- if ("\n" === n && ++this.line, ++this.index === this.source.length) return null;
- if ("/" === this.source.charAt(this.index))
- if (++this.index, "/" === this.source.charAt(this.index)) {
- for (;
- "\n" !== this.source.charAt(++this.index);)
- if (this.index == this.source.length) return null;
- ++this.index, ++this.line, t = !0
- } else {
- if ("*" !== (n = this.source.charAt(this.index))) return "/";
- do {
- if ("\n" === n && ++this.line, ++this.index === this.source.length) return null;
- i = n, n = this.source.charAt(this.index)
- } while ("*" !== i || "/" !== n);
- ++this.index, t = !0
- }
- } while (t);
- if (this.index === this.source.length) return null;
- var r = this.index;
- if (e.DELIM.lastIndex = 0, !e.DELIM.test(this.source.charAt(r++)))
- for (; r < this.source.length && !e.DELIM.test(this.source.charAt(r));) ++r;
- var o = this.source.substring(this.index, this.index = r);
- return '"' !== o && "'" !== o || (this._stringOpen = o), o
- }, r.peek = function() {
- if (0 === this.stack.length) {
- var t = this.next();
- if (null === t) return null;
- this.stack.push(t)
- }
- return this.stack[0]
- }, r.skip = function(t) {
- var e = this.next();
- if (e !== t) throw Error("illegal '" + e + "', '" + t + "' expected")
- }, r.omit = function(t) {
- return this.peek() === t && (this.next(), !0)
- }, r.toString = function() {
- return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
- }, i.Tokenizer = n;
- var o = function(t) {
- this.tn = new n(t), this.proto3 = !1
- },
- a = o.prototype;
- function s(t, i) {
- var n = -1,
- r = 1;
- if ("-" == t.charAt(0) && (r = -1, t = t.substring(1)), e.NUMBER_DEC.test(t)) n = parseInt(t);
- else if (e.NUMBER_HEX.test(t)) n = parseInt(t.substring(2), 16);
- else {
- if (!e.NUMBER_OCT.test(t)) throw Error("illegal id value: " + (r < 0 ? "-" : "") + t);
- n = parseInt(t.substring(1), 8)
- }
- if (n = r * n | 0, !i && n < 0) throw Error("illegal id value: " + (r < 0 ? "-" : "") + t);
- return n
- }
- function l(t) {
- var i = 1;
- if ("-" == t.charAt(0) && (i = -1, t = t.substring(1)), e.NUMBER_DEC.test(t)) return i * parseInt(t, 10);
- if (e.NUMBER_HEX.test(t)) return i * parseInt(t.substring(2), 16);
- if (e.NUMBER_OCT.test(t)) return i * parseInt(t.substring(1), 8);
- if ("inf" === t) return i * (1 / 0);
- if ("nan" === t) return NaN;
- if (e.NUMBER_FLT.test(t)) return i * parseFloat(t);
- throw Error("illegal number value: " + (i < 0 ? "-" : "") + t)
- }
- function u(t, e, i) {
- void 0 === t[e] ? t[e] = i : (Array.isArray(t[e]) || (t[e] = [t[e]]), t[e].push(i))
- }
- return a.parse = function() {
- var t, i, n = {
- name: "[ROOT]",
- package: null,
- messages: [],
- enums: [],
- imports: [],
- options: {},
- services: []
- },
- r = !0;
- try {
- for (; t = this.tn.next();) switch (t) {
- case "package":
- if (!r || null !== n.package) throw Error("unexpected 'package'");
- if (t = this.tn.next(), !e.TYPEREF.test(t)) throw Error("illegal package name: " + t);
- this.tn.skip(";"), n.package = t;
- break;
- case "import":
- if (!r) throw Error("unexpected 'import'");
- ("public" === (t = this.tn.peek()) || (i = "weak" === t)) && this.tn.next(), t = this._readString(), this.tn.skip(";"), i || n.imports.push(t);
- break;
- case "syntax":
- if (!r) throw Error("unexpected 'syntax'");
- this.tn.skip("="), "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(";");
- break;
- case "message":
- this._parseMessage(n, null), r = !1;
- break;
- case "enum":
- this._parseEnum(n), r = !1;
- break;
- case "option":
- this._parseOption(n);
- break;
- case "service":
- this._parseService(n);
- break;
- case "extend":
- this._parseExtend(n);
- break;
- default:
- throw Error("unexpected '" + t + "'")
- }
- } catch (t) {
- throw t.message = "Parse error at line " + this.tn.line + ": " + t.message, t
- }
- return delete n.name, n
- }, o.parse = function(t) {
- return new o(t)
- .parse()
- }, a._readString = function() {
- var t, e, i = "";
- do {
- if ("'" !== (e = this.tn.next()) && '"' !== e) throw Error("illegal string delimiter: " + e);
- i += this.tn.next(), this.tn.skip(e), t = this.tn.peek()
- } while ('"' === t || '"' === t);
- return i
- }, a._readValue = function(t) {
- var i = this.tn.peek();
- if ('"' === i || "'" === i) return this._readString();
- if (this.tn.next(), e.NUMBER.test(i)) return l(i);
- if (e.BOOL.test(i)) return "true" === i.toLowerCase();
- if (t && e.TYPEREF.test(i)) return i;
- throw Error("illegal value: " + i)
- }, a._parseOption = function(t, i) {
- var n = this.tn.next(),
- r = !1;
- if ("(" === n && (r = !0, n = this.tn.next()), !e.TYPEREF.test(n)) throw Error("illegal option name: " + n);
- var o = n;
- r && (this.tn.skip(")"), o = "(" + o + ")", n = this.tn.peek(), e.FQTYPEREF.test(n) && (o += n, this.tn.next())), this.tn.skip("="), this._parseOptionValue(t, o), i || this.tn.skip(";")
- }, a._parseOptionValue = function(t, i) {
- var n = this.tn.peek();
- if ("{" !== n) u(t.options, i, this._readValue(!0));
- else
- for (this.tn.skip("{");
- "}" !== (n = this.tn.next());) {
- if (!e.NAME.test(n)) throw Error("illegal option name: " + i + "." + n);
- this.tn.omit(":") ? u(t.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(t, i + "." + n)
- }
- }, a._parseService = function(t) {
- var i = this.tn.next();
- if (!e.NAME.test(i)) throw Error("illegal service name at line " + this.tn.line + ": " + i);
- var n = {
- name: i,
- rpc: {},
- options: {}
- };
- for (this.tn.skip("{");
- "}" !== (i = this.tn.next());)
- if ("option" === i) this._parseOption(n);
- else {
- if ("rpc" !== i) throw Error("illegal service token: " + i);
- this._parseServiceRPC(n)
- } this.tn.omit(";"), t.services.push(n)
- }, a._parseServiceRPC = function(t) {
- var i = this.tn.next();
- if (!e.NAME.test(i)) throw Error("illegal rpc service method name: " + i);
- var n = i,
- r = {
- request: null,
- response: null,
- request_stream: !1,
- response_stream: !1,
- options: {}
- };
- if (this.tn.skip("("), "stream" === (i = this.tn.next())
- .toLowerCase() && (r.request_stream = !0, i = this.tn.next()), !e.TYPEREF.test(i)) throw Error("illegal rpc service request type: " + i);
- if (r.request = i, this.tn.skip(")"), "returns" !== (i = this.tn.next())
- .toLowerCase()) throw Error("illegal rpc service request type delimiter: " + i);
- if (this.tn.skip("("), "stream" === (i = this.tn.next())
- .toLowerCase() && (r.response_stream = !0, i = this.tn.next()), r.response = i, this.tn.skip(")"), "{" === (i = this.tn.peek())) {
- for (this.tn.next();
- "}" !== (i = this.tn.next());) {
- if ("option" !== i) throw Error("illegal rpc service token: " + i);
- this._parseOption(r)
- }
- this.tn.omit(";")
- } else this.tn.skip(";");
- void 0 === t.rpc && (t.rpc = {}), t.rpc[n] = r
- }, a._parseMessage = function(t, i) {
- var n = !!i,
- r = this.tn.next(),
- o = {
- name: "",
- fields: [],
- enums: [],
- messages: [],
- options: {},
- services: [],
- oneofs: {}
- };
- if (!e.NAME.test(r)) throw Error("illegal " + (n ? "group" : "message") + " name: " + r);
- for (o.name = r, n && (this.tn.skip("="), i.id = s(this.tn.next()), o.isGroup = !0), "[" === (r = this.tn.peek()) && i && this._parseFieldOptions(i), this.tn.skip("{");
- "}" !== (r = this.tn.next());)
- if (e.RULE.test(r)) this._parseMessageField(o, r);
- else if ("oneof" === r) this._parseMessageOneOf(o);
- else if ("enum" === r) this._parseEnum(o);
- else if ("message" === r) this._parseMessage(o);
- else if ("option" === r) this._parseOption(o);
- else if ("service" === r) this._parseService(o);
- else if ("extensions" === r) o.hasOwnProperty("extensions") ? o.extensions = o.extensions.concat(this._parseExtensionRanges()) : o.extensions = this._parseExtensionRanges();
- else if ("reserved" === r) this._parseIgnored();
- else if ("extend" === r) this._parseExtend(o);
- else {
- if (!e.TYPEREF.test(r)) throw Error("illegal message token: " + r);
- if (!this.proto3) throw Error("illegal field rule: " + r);
- this._parseMessageField(o, "optional", r)
- }
- return this.tn.omit(";"), t.messages.push(o), o
- }, a._parseIgnored = function() {
- for (;
- ";" !== this.tn.peek();) this.tn.next();
- this.tn.skip(";")
- }, a._parseMessageField = function(t, i, n) {
- if (!e.RULE.test(i)) throw Error("illegal message field rule: " + i);
- var r, o = {
- rule: i,
- type: "",
- name: "",
- options: {},
- id: 0
- };
- if ("map" === i) {
- if (n) throw Error("illegal type: " + n);
- if (this.tn.skip("<"), r = this.tn.next(), !e.TYPE.test(r) && !e.TYPEREF.test(r)) throw Error("illegal message field type: " + r);
- if (o.keytype = r, this.tn.skip(","), r = this.tn.next(), !e.TYPE.test(r) && !e.TYPEREF.test(r)) throw Error("illegal message field: " + r);
- if (o.type = r, this.tn.skip(">"), r = this.tn.next(), !e.NAME.test(r)) throw Error("illegal message field name: " + r);
- o.name = r, this.tn.skip("="), o.id = s(this.tn.next()), "[" === (r = this.tn.peek()) && this._parseFieldOptions(o), this.tn.skip(";")
- } else if ("group" === (n = void 0 !== n ? n : this.tn.next())) {
- var a = this._parseMessage(t, o);
- if (!/^[A-Z]/.test(a.name)) throw Error("illegal group name: " + a.name);
- o.type = a.name, o.name = a.name.toLowerCase(), this.tn.omit(";")
- } else {
- if (!e.TYPE.test(n) && !e.TYPEREF.test(n)) throw Error("illegal message field type: " + n);
- if (o.type = n, r = this.tn.next(), !e.NAME.test(r)) throw Error("illegal message field name: " + r);
- o.name = r, this.tn.skip("="), o.id = s(this.tn.next()), "[" === (r = this.tn.peek()) && this._parseFieldOptions(o), this.tn.skip(";")
- }
- return t.fields.push(o), o
- }, a._parseMessageOneOf = function(t) {
- var i = this.tn.next();
- if (!e.NAME.test(i)) throw Error("illegal oneof name: " + i);
- var n, r = i,
- o = [];
- for (this.tn.skip("{");
- "}" !== (i = this.tn.next());)(n = this._parseMessageField(t, "optional", i))
- .oneof = r, o.push(n.id);
- this.tn.omit(";"), t.oneofs[r] = o
- }, a._parseFieldOptions = function(t) {
- this.tn.skip("[");
- for (var e = !0;
- "]" !== this.tn.peek();) e || this.tn.skip(","), this._parseOption(t, !0), e = !1;
- this.tn.next()
- }, a._parseEnum = function(t) {
- var i = {
- name: "",
- values: [],
- options: {}
- },
- n = this.tn.next();
- if (!e.NAME.test(n)) throw Error("illegal name: " + n);
- for (i.name = n, this.tn.skip("{");
- "}" !== (n = this.tn.next());)
- if ("option" === n) this._parseOption(i);
- else {
- if (!e.NAME.test(n)) throw Error("illegal name: " + n);
- this.tn.skip("=");
- var r = {
- name: n,
- id: s(this.tn.next(), !0)
- };
- "[" === (n = this.tn.peek()) && this._parseFieldOptions({
- options: {}
- }), this.tn.skip(";"), i.values.push(r)
- } this.tn.omit(";"), t.enums.push(i)
- }, a._parseExtensionRanges = function() {
- var e, i, n, r = [];
- do {
- for (i = [];;) {
- switch (e = this.tn.next()) {
- case "min":
- n = t.ID_MIN;
- break;
- case "max":
- n = t.ID_MAX;
- break;
- default:
- n = l(e)
- }
- if (i.push(n), 2 === i.length) break;
- if ("to" !== this.tn.peek()) {
- i.push(n);
- break
- }
- this.tn.next()
- }
- r.push(i)
- } while (this.tn.omit(","));
- return this.tn.skip(";"), r
- }, a._parseExtend = function(t) {
- var i = this.tn.next();
- if (!e.TYPEREF.test(i)) throw Error("illegal extend reference: " + i);
- var n = {
- ref: i,
- fields: []
- };
- for (this.tn.skip("{");
- "}" !== (i = this.tn.next());)
- if (e.RULE.test(i)) this._parseMessageField(n, i);
- else {
- if (!e.TYPEREF.test(i)) throw Error("illegal extend token: " + i);
- if (!this.proto3) throw Error("illegal field rule: " + i);
- this._parseMessageField(n, "optional", i)
- } return this.tn.omit(";"), t.messages.push(n), n
- }, a.toString = function() {
- return "Parser at line " + this.tn.line
- }, i.Parser = o, i
- }(o, o.Lang), o.Reflect = function(e) {
- var i = {},
- n = function(t, e, i) {
- this.builder = t, this.parent = e, this.name = i, this.className
- },
- r = n.prototype;
- r.fqn = function() {
- for (var t = this.name, e = this; null != (e = e.parent);) t = e.name + "." + t;
- return t
- }, r.toString = function(t) {
- return (t ? this.className + " " : "") + this.fqn()
- }, r.build = function() {
- throw Error(this.toString(!0) + " cannot be built directly")
- }, i.T = n;
- var o = function(t, e, i, r, o) {
- n.call(this, t, e, i), this.className = "Namespace", this.children = [], this.options = r || {}, this.syntax = o || "proto2"
- },
- a = o.prototype = Object.create(n.prototype);
- a.getChildren = function(t) {
- if (null == (t = t || null)) return this.children.slice();
- for (var e = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof t && e.push(this.children[i]);
- return e
- }, a.addChild = function(t) {
- var e;
- if (e = this.getChild(t.name))
- if (e instanceof h.Field && e.name !== e.originalName && null === this.getChild(e.originalName)) e.name = e.originalName;
- else {
- if (!(t instanceof h.Field && t.name !== t.originalName && null === this.getChild(t.originalName))) throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + t.name);
- t.name = t.originalName
- } this.children.push(t)
- }, a.getChild = function(t) {
- for (var e = "number" == typeof t ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
- if (this.children[i][e] === t) return this.children[i];
- return null
- }, a.resolve = function(t, e) {
- var n, r = "string" == typeof t ? t.split(".") : t,
- o = this,
- a = 0;
- if ("" === r[a]) {
- for (; null !== o.parent;) o = o.parent;
- a++
- }
- do {
- do {
- if (!(o instanceof i.Namespace)) {
- o = null;
- break
- }
- if (!(n = o.getChild(r[a])) || !(n instanceof i.T) || e && !(n instanceof i.Namespace)) {
- o = null;
- break
- }
- o = n, a++
- } while (a < r.length);
- if (null != o) break;
- if (null !== this.parent) return this.parent.resolve(t, e)
- } while (null != o);
- return o
- }, a.qn = function(t) {
- var e = [],
- n = t;
- do {
- e.unshift(n.name), n = n.parent
- } while (null !== n);
- for (var r = 1; r <= e.length; r++) {
- var o = e.slice(e.length - r);
- if (t === this.resolve(o, t instanceof i.Namespace)) return o.join(".")
- }
- return t.fqn()
- }, a.build = function() {
- for (var t, e = {}, i = this.children, n = 0, r = i.length; n < r; ++n)(t = i[n]) instanceof o && (e[t.name] = t.build());
- return Object.defineProperty && Object.defineProperty(e, "$options", {
- value: this.buildOpt()
- }), e
- }, a.buildOpt = function() {
- for (var t = {}, e = Object.keys(this.options), i = 0, n = e.length; i < n; ++i) {
- var r = e[i],
- o = this.options[e[i]];
- t[r] = o
- }
- return t
- }, a.getOption = function(t) {
- return void 0 === t ? this.options : void 0 !== this.options[t] ? this.options[t] : null
- }, i.Namespace = o;
- var s = function(t, i, n, r, o) {
- if (this.type = t, this.resolvedType = i, this.isMapKey = n, this.syntax = r, this.name = o, n && e.MAP_KEY_TYPES.indexOf(t) < 0) throw Error("Invalid map key type: " + t.name)
- },
- l = s.prototype;
- function u(t, i) {
- if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low == t.low && t.high == t.high) return new e.Long(t.low, t.high, void 0 === i ? t.unsigned : i);
- if ("string" == typeof t) return e.Long.fromString(t, i || !1, 10);
- if ("number" == typeof t) return e.Long.fromNumber(t, i || !1);
- throw Error("not convertible to Long")
- }
- s.defaultFieldValue = function(i) {
- if ("string" == typeof i && (i = e.TYPES[i]), void 0 === i.defaultValue) throw Error("default value for type " + i.name + " is not supported");
- return i == e.TYPES.bytes ? new t(0) : i.defaultValue
- }, l.toString = function() {
- return (this.name || "") + (this.isMapKey ? "map" : "value") + " element"
- }, l.verifyValue = function(i) {
- var n = this;
- function r(t, e) {
- throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + t + " (" + e + ")")
- }
- switch (this.type) {
- case e.TYPES.int32:
- case e.TYPES.sint32:
- case e.TYPES.sfixed32:
- return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), i > 4294967295 ? 0 | i : i;
- case e.TYPES.uint32:
- case e.TYPES.fixed32:
- return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), i < 0 ? i >>> 0 : i;
- case e.TYPES.int64:
- case e.TYPES.sint64:
- case e.TYPES.sfixed64:
- if (e.Long) try {
- return u(i, !1)
- } catch (t) {
- r(typeof i, t.message)
- } else r(typeof i, "requires Long.js");
- case e.TYPES.uint64:
- case e.TYPES.fixed64:
- if (e.Long) try {
- return u(i, !0)
- } catch (t) {
- r(typeof i, t.message)
- } else r(typeof i, "requires Long.js");
- case e.TYPES.bool:
- return "boolean" != typeof i && r(typeof i, "not a boolean"), i;
- case e.TYPES.float:
- case e.TYPES.double:
- return "number" != typeof i && r(typeof i, "not a number"), i;
- case e.TYPES.string:
- return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"), "" + i;
- case e.TYPES.bytes:
- return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
- case e.TYPES.enum:
- var o = this.resolvedType.getChildren(e.Reflect.Enum.Value);
- for (s = 0; s < o.length; s++) {
- if (o[s].name == i) return o[s].id;
- if (o[s].id == i) return o[s].id
- }
- if ("proto3" === this.syntax) return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"), i;
- r(i, "not a valid enum value");
- case e.TYPES.group:
- case e.TYPES.message:
- if (i && "object" == typeof i || r(typeof i, "object expected"), i instanceof this.resolvedType.clazz) return i;
- if (i instanceof e.Builder.Message) {
- var a = {};
- for (var s in i) i.hasOwnProperty(s) && (a[s] = i[s]);
- i = a
- }
- return new this.resolvedType.clazz(i)
- }
- throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
- }, l.calculateLength = function(i, n) {
- if (null === n) return 0;
- var r;
- switch (this.type) {
- case e.TYPES.int32:
- return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
- case e.TYPES.uint32:
- return t.calculateVarint32(n);
- case e.TYPES.sint32:
- return t.calculateVarint32(t.zigZagEncode32(n));
- case e.TYPES.fixed32:
- case e.TYPES.sfixed32:
- case e.TYPES.float:
- return 4;
- case e.TYPES.int64:
- case e.TYPES.uint64:
- return t.calculateVarint64(n);
- case e.TYPES.sint64:
- return t.calculateVarint64(t.zigZagEncode64(n));
- case e.TYPES.fixed64:
- case e.TYPES.sfixed64:
- return 8;
- case e.TYPES.bool:
- return 1;
- case e.TYPES.enum:
- return t.calculateVarint32(n);
- case e.TYPES.double:
- return 8;
- case e.TYPES.string:
- return r = t.calculateUTF8Bytes(n), t.calculateVarint32(r) + r;
- case e.TYPES.bytes:
- if (n.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
- return t.calculateVarint32(n.remaining()) + n.remaining();
- case e.TYPES.message:
- return r = this.resolvedType.calculate(n), t.calculateVarint32(r) + r;
- case e.TYPES.group:
- return (r = this.resolvedType.calculate(n)) + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
- }
- throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
- }, l.encodeValue = function(i, n, r) {
- if (null === n) return r;
- switch (this.type) {
- case e.TYPES.int32:
- n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
- break;
- case e.TYPES.uint32:
- r.writeVarint32(n);
- break;
- case e.TYPES.sint32:
- r.writeVarint32ZigZag(n);
- break;
- case e.TYPES.fixed32:
- r.writeUint32(n);
- break;
- case e.TYPES.sfixed32:
- r.writeInt32(n);
- break;
- case e.TYPES.int64:
- case e.TYPES.uint64:
- r.writeVarint64(n);
- break;
- case e.TYPES.sint64:
- r.writeVarint64ZigZag(n);
- break;
- case e.TYPES.fixed64:
- r.writeUint64(n);
- break;
- case e.TYPES.sfixed64:
- r.writeInt64(n);
- break;
- case e.TYPES.bool:
- "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
- break;
- case e.TYPES.enum:
- r.writeVarint32(n);
- break;
- case e.TYPES.float:
- r.writeFloat32(n);
- break;
- case e.TYPES.double:
- r.writeFloat64(n);
- break;
- case e.TYPES.string:
- r.writeVString(n);
- break;
- case e.TYPES.bytes:
- if (n.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
- var o = n.offset;
- r.writeVarint32(n.remaining()), r.append(n), n.offset = o;
- break;
- case e.TYPES.message:
- var a = (new t)
- .LE();
- this.resolvedType.encode(n, a), r.writeVarint32(a.offset), r.append(a.flip());
- break;
- case e.TYPES.group:
- this.resolvedType.encode(n, r), r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
- break;
- default:
- throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
- }
- return r
- }, l.decode = function(t, i, n) {
- if (i != this.type.wireType) throw Error("Unexpected wire type for element");
- var r, o;
- switch (this.type) {
- case e.TYPES.int32:
- return 0 | t.readVarint32();
- case e.TYPES.uint32:
- return t.readVarint32() >>> 0;
- case e.TYPES.sint32:
- return 0 | t.readVarint32ZigZag();
- case e.TYPES.fixed32:
- return t.readUint32() >>> 0;
- case e.TYPES.sfixed32:
- return 0 | t.readInt32();
- case e.TYPES.int64:
- return t.readVarint64();
- case e.TYPES.uint64:
- return t.readVarint64()
- .toUnsigned();
- case e.TYPES.sint64:
- return t.readVarint64ZigZag();
- case e.TYPES.fixed64:
- return t.readUint64();
- case e.TYPES.sfixed64:
- return t.readInt64();
- case e.TYPES.bool:
- return !!t.readVarint32();
- case e.TYPES.enum:
- return t.readVarint32();
- case e.TYPES.float:
- return t.readFloat();
- case e.TYPES.double:
- return t.readDouble();
- case e.TYPES.string:
- return t.readVString();
- case e.TYPES.bytes:
- if (o = t.readVarint32(), t.remaining() < o) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
- return (r = t.clone())
- .limit = r.offset + o, t.offset += o, r;
- case e.TYPES.message:
- return o = t.readVarint32(), this.resolvedType.decode(t, o);
- case e.TYPES.group:
- return this.resolvedType.decode(t, -1, n)
- }
- throw Error("[INTERNAL] Illegal decode type")
- }, l.valueFromString = function(i) {
- if (!this.isMapKey) throw Error("valueFromString() called on non-map-key element");
- switch (this.type) {
- case e.TYPES.int32:
- case e.TYPES.sint32:
- case e.TYPES.sfixed32:
- case e.TYPES.uint32:
- case e.TYPES.fixed32:
- return this.verifyValue(parseInt(i));
- case e.TYPES.int64:
- case e.TYPES.sint64:
- case e.TYPES.sfixed64:
- case e.TYPES.uint64:
- case e.TYPES.fixed64:
- return this.verifyValue(i);
- case e.TYPES.bool:
- return "true" === i;
- case e.TYPES.string:
- return this.verifyValue(i);
- case e.TYPES.bytes:
- return t.fromBinary(i)
- }
- }, l.valueToString = function(t) {
- if (!this.isMapKey) throw Error("valueToString() called on non-map-key element");
- return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
- }, i.Element = s;
- var h = function(t, e, i, n, r, a) {
- o.call(this, t, e, i, n, a), this.className = "Message", this.extensions = void 0, this.clazz = null, this.isGroup = !!r, this._fields = null, this._fieldsById = null, this._fieldsByName = null
- },
- c = h.prototype = Object.create(o.prototype);
- function d(t, i) {
- var n = i.readVarint32(),
- r = 7 & n,
- o = n >>> 3;
- switch (r) {
- case e.WIRE_TYPES.VARINT:
- do {
- n = i.readUint8()
- } while (128 == (128 & n));
- break;
- case e.WIRE_TYPES.BITS64:
- i.offset += 8;
- break;
- case e.WIRE_TYPES.LDELIM:
- n = i.readVarint32(), i.offset += n;
- break;
- case e.WIRE_TYPES.STARTGROUP:
- d(o, i);
- break;
- case e.WIRE_TYPES.ENDGROUP:
- if (o === t) return !1;
- throw Error("Illegal GROUPEND after unknown group: " + o + " (" + t + " expected)");
- case e.WIRE_TYPES.BITS32:
- i.offset += 4;
- break;
- default:
- throw Error("Illegal wire type in unknown group " + t + ": " + r)
- }
- return !0
- }
- c.build = function(i) {
- if (this.clazz && !i) return this.clazz;
- var n = function(e, i) {
- var n = i.getChildren(e.Reflect.Message.Field),
- r = i.getChildren(e.Reflect.Message.OneOf),
- o = function(a, s) {
- e.Builder.Message.call(this);
- for (var l = 0, u = r.length; l < u; ++l) this[r[l].name] = null;
- for (l = 0, u = n.length; l < u; ++l) {
- var h = n[l];
- this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null, !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
- }
- var c;
- if (arguments.length > 0)
- if (1 !== arguments.length || null === a || "object" != typeof a || !("function" != typeof a.encode || a instanceof o) || Array.isArray(a) || a instanceof e.Map || t.isByteBuffer(a) || a instanceof ArrayBuffer || e.Long && a instanceof e.Long)
- for (l = 0, u = arguments.length; l < u; ++l) void 0 !== (c = arguments[l]) && this.$set(n[l].name, c);
- else this.$set(a)
- },
- a = o.prototype = Object.create(e.Builder.Message.prototype);
- a.add = function(t, n, r) {
- var o = i._fieldsByName[t];
- if (!r) {
- if (!o) throw Error(this + "#" + t + " is undefined");
- if (!(o instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
- if (!o.repeated) throw Error(this + "#" + t + " is not a repeated field");
- n = o.verifyValue(n, !0)
- }
- return null === this[t] && (this[t] = []), this[t].push(n), this
- }, a.$add = a.add, a.set = function(t, n, r) {
- if (t && "object" == typeof t) {
- for (var o in r = n, t) t.hasOwnProperty(o) && void 0 !== (n = t[o]) && void 0 === i._oneofsByName[o] && this.$set(o, n, r);
- return this
- }
- var a = i._fieldsByName[t];
- if (r) this[t] = n;
- else {
- if (!a) throw Error(this + "#" + t + " is not a field: undefined");
- if (!(a instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
- this[a.name] = n = a.verifyValue(n)
- }
- if (a && a.oneof) {
- var s = this[a.oneof.name];
- null !== n ? (null !== s && s !== a.name && (this[s] = null), this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
- }
- return this
- }, a.$set = a.set, a.get = function(t, n) {
- if (n) return this[t];
- var r = i._fieldsByName[t];
- if (!(r && r instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: undefined");
- if (!(r instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
- return this[r.name]
- }, a.$get = a.get;
- for (var s = 0; s < n.length; s++) {
- var l = n[s];
- l instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(t) {
- var e = t.originalName.replace(/(_[a-zA-Z])/g, (function(t) {
- return t.toUpperCase()
- .replace("_", "")
- }));
- e = e.substring(0, 1)
- .toUpperCase() + e.substring(1);
- var n = t.originalName.replace(/([A-Z])/g, (function(t) {
- return "_" + t
- })),
- r = function(e, i) {
- return this[t.name] = i ? e : t.verifyValue(e), this
- },
- o = function() {
- return this[t.name]
- };
- null === i.getChild("set" + e) && (a["set" + e] = r), null === i.getChild("set_" + n) && (a["set_" + n] = r), null === i.getChild("get" + e) && (a["get" + e] = o), null === i.getChild("get_" + n) && (a["get_" + n] = o)
- }(l)
- }
- function u(i, n, r, o) {
- if (null === i || "object" != typeof i) {
- if (o && o instanceof e.Reflect.Enum) {
- var a = e.Reflect.Enum.getName(o.object, i);
- if (null !== a) return a
- }
- return i
- }
- if (t.isByteBuffer(i)) return n ? i.toBase64() : i.toBuffer();
- if (e.Long.isLong(i)) return r ? i.toString() : e.Long.fromValue(i);
- var s;
- if (Array.isArray(i)) return s = [], i.forEach((function(t, e) {
- s[e] = u(t, n, r, o)
- })), s;
- if (s = {}, i instanceof e.Map) {
- for (var l = i.entries(), h = l.next(); !h.done; h = l.next()) s[i.keyElem.valueToString(h.value[0])] = u(h.value[1], n, r, i.valueElem.resolvedType);
- return s
- }
- var c = i.$type,
- d = void 0;
- for (var p in i) i.hasOwnProperty(p) && (c && (d = c.getChild(p)) ? s[p] = u(i[p], n, r, d.resolvedType) : s[p] = u(i[p], n, r));
- return s
- }
- return a.encode = function(e, n) {
- "boolean" == typeof e && (n = e, e = void 0);
- var r = !1;
- e || (e = new t, r = !0);
- var o = e.littleEndian;
- try {
- return i.encode(this, e.LE(), n), (r ? e.flip() : e)
- .LE(o)
- } catch (t) {
- throw e.LE(o), t
- }
- }, o.encode = function(t, e, i) {
- return new o(t)
- .encode(e, i)
- }, a.calculate = function() {
- return i.calculate(this)
- }, a.encodeDelimited = function(e, n) {
- var r = !1;
- e || (e = new t, r = !0);
- var o = (new t)
- .LE();
- return i.encode(this, o, n)
- .flip(), e.writeVarint32(o.remaining()), e.append(o), r ? e.flip() : e
- }, a.encodeAB = function() {
- try {
- return this.encode()
- .toArrayBuffer()
- } catch (t) {
- throw t.encoded && (t.encoded = t.encoded.toArrayBuffer()), t
- }
- }, a.toArrayBuffer = a.encodeAB, a.encodeNB = function() {
- try {
- return this.encode()
- .toBuffer()
- } catch (t) {
- throw t.encoded && (t.encoded = t.encoded.toBuffer()), t
- }
- }, a.toBuffer = a.encodeNB, a.encode64 = function() {
- try {
- return this.encode()
- .toBase64()
- } catch (t) {
- throw t.encoded && (t.encoded = t.encoded.toBase64()), t
- }
- }, a.toBase64 = a.encode64, a.encodeHex = function() {
- try {
- return this.encode()
- .toHex()
- } catch (t) {
- throw t.encoded && (t.encoded = t.encoded.toHex()), t
- }
- }, a.toHex = a.encodeHex, a.toRaw = function(t, e) {
- return u(this, !!t, !!e, this.$type)
- }, a.encodeJSON = function() {
- return JSON.stringify(u(this, !0, !0, this.$type))
- }, o.decode = function(e, n, r) {
- "string" == typeof n && (r = n, n = -1), "string" == typeof e ? e = t.wrap(e, r || "base64") : t.isByteBuffer(e) || (e = t.wrap(e));
- var o = e.littleEndian;
- try {
- var a = i.decode(e.LE(), n);
- return e.LE(o), a
- } catch (t) {
- throw e.LE(o), t
- }
- }, o.decodeDelimited = function(e, n) {
- if ("string" == typeof e ? e = t.wrap(e, n || "base64") : t.isByteBuffer(e) || (e = t.wrap(e)), e.remaining() < 1) return null;
- var r = e.offset,
- o = e.readVarint32();
- if (e.remaining() < o) return e.offset = r, null;
- try {
- var a = i.decode(e.slice(e.offset, e.offset + o)
- .LE());
- return e.offset += o, a
- } catch (t) {
- throw e.offset += o, t
- }
- }, o.decode64 = function(t) {
- return o.decode(t, "base64")
- }, o.decodeHex = function(t) {
- return o.decode(t, "hex")
- }, o.decodeJSON = function(t) {
- return new o(JSON.parse(t))
- }, a.toString = function() {
- return i.toString()
- }, Object.defineProperty && (Object.defineProperty(o, "$options", {
- value: i.buildOpt()
- }), Object.defineProperty(a, "$options", {
- value: o.$options
- }), Object.defineProperty(o, "$type", {
- value: i
- }), Object.defineProperty(a, "$type", {
- value: i
- })), o
- }(e, this);
- this._fields = [], this._fieldsById = {}, this._fieldsByName = {}, this._oneofsByName = {};
- for (var r, o = 0, a = this.children.length; o < a; o++)
- if ((r = this.children[o]) instanceof g || r instanceof h || r instanceof b) {
- if (n.hasOwnProperty(r.name)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
- n[r.name] = r.build()
- } else if (r instanceof h.Field) r.build(), this._fields.push(r), this._fieldsById[r.id] = r, this._fieldsByName[r.name] = r;
- else if (r instanceof h.OneOf) this._oneofsByName[r.name] = r;
- else if (!(r instanceof h.OneOf || r instanceof y)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
- return this.clazz = n
- }, c.encode = function(t, e, i) {
- for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a) r = t[(n = this._fields[a])
- .name], n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), e, t);
- if (null !== o) {
- var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
- throw l.encoded = e, l
- }
- return e
- }, c.calculate = function(t) {
- for (var e, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
- if (i = t[(e = this._fields[r])
- .name], e.required && null === i) throw Error("Missing at least one required field for " + this.toString(!0) + ": " + e);
- n += e.calculate(i, t)
- }
- return n
- }, c.decode = function(t, i, n) {
- "number" != typeof i && (i = -1);
- for (var r, o, a, s, l = t.offset, u = new this.clazz; t.offset < l + i || -1 === i && t.remaining() > 0;) {
- if (a = (r = t.readVarint32()) >>> 3, (o = 7 & r) === e.WIRE_TYPES.ENDGROUP) {
- if (a !== n) throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + a + " (" + (n ? n + " expected" : "not a group") + ")");
- break
- }
- if (s = this._fieldsById[a]) {
- if (s.repeated && !s.options.packed) u[s.name].push(s.decode(o, t));
- else if (s.map) {
- var h = s.decode(o, t);
- u[s.name].set(h[0], h[1])
- } else if (u[s.name] = s.decode(o, t), s.oneof) {
- var c = u[s.oneof.name];
- null !== c && c !== s.name && (u[c] = null), u[s.oneof.name] = s.name
- }
- } else switch (o) {
- case e.WIRE_TYPES.VARINT:
- t.readVarint32();
- break;
- case e.WIRE_TYPES.BITS32:
- t.offset += 4;
- break;
- case e.WIRE_TYPES.BITS64:
- t.offset += 8;
- break;
- case e.WIRE_TYPES.LDELIM:
- var p = t.readVarint32();
- t.offset += p;
- break;
- case e.WIRE_TYPES.STARTGROUP:
- for (; d(a, t););
- break;
- default:
- throw Error("Illegal wire type for unknown field " + a + " in " + this.toString(!0) + "#decode: " + o)
- }
- }
- for (var f = 0, m = this._fields.length; f < m; ++f)
- if (null === u[(s = this._fields[f])
- .name])
- if ("proto3" === this.syntax) u[s.name] = s.defaultValue;
- else {
- if (s.required) {
- var g = Error("Missing at least one required field for " + this.toString(!0) + ": " + s.name);
- throw g.decoded = u, g
- }
- e.populateDefaults && null !== s.defaultValue && (u[s.name] = s.defaultValue)
- } return u
- }, i.Message = h;
- var p = function(t, i, r, o, a, s, l, u, c, d) {
- n.call(this, t, i, s), this.className = "Message.Field", this.required = "required" === r, this.repeated = "repeated" === r, this.map = "map" === r, this.keyType = o || null, this.type = a, this.resolvedType = null, this.id = l, this.options = u || {}, this.defaultValue = null, this.oneof = c || null, this.syntax = d || "proto2", this.originalName = this.name, this.element = null, this.keyElement = null, !this.builder.options.convertFieldsToCamelCase || this instanceof h.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
- },
- f = p.prototype = Object.create(n.prototype);
- f.build = function() {
- this.element = new s(this.type, this.resolvedType, !1, this.syntax, this.name), this.map && (this.keyElement = new s(this.keyType, void 0, !0, this.syntax, this.name)), "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = s.defaultFieldValue(this.type)
- }, f.verifyValue = function(t, i) {
- i = i || !1;
- var n, r = this;
- function o(t, e) {
- throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + t + " (" + e + ")")
- }
- if (null === t) return this.required && o(typeof t, "required"), "proto3" === this.syntax && this.type !== e.TYPES.message && o(typeof t, "proto3 field without field presence cannot be null"), null;
- if (this.repeated && !i) {
- Array.isArray(t) || (t = [t]);
- var a = [];
- for (n = 0; n < t.length; n++) a.push(this.element.verifyValue(t[n]));
- return a
- }
- return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || o(typeof t, "expected ProtoBuf.Map or raw object for map field"), new e.Map(this, t)) : (!this.repeated && Array.isArray(t) && o(typeof t, "no array expected"), this.element.verifyValue(t))
- }, f.hasWirePresence = function(t, i) {
- if ("proto3" !== this.syntax) return null !== t;
- if (this.oneof && i[this.oneof.name] === this.name) return !0;
- switch (this.type) {
- case e.TYPES.int32:
- case e.TYPES.sint32:
- case e.TYPES.sfixed32:
- case e.TYPES.uint32:
- case e.TYPES.fixed32:
- return 0 !== t;
- case e.TYPES.int64:
- case e.TYPES.sint64:
- case e.TYPES.sfixed64:
- case e.TYPES.uint64:
- case e.TYPES.fixed64:
- return 0 !== t.low || 0 !== t.high;
- case e.TYPES.bool:
- return t;
- case e.TYPES.float:
- case e.TYPES.double:
- return 0 !== t;
- case e.TYPES.string:
- return t.length > 0;
- case e.TYPES.bytes:
- return t.remaining() > 0;
- case e.TYPES.enum:
- return 0 !== t;
- case e.TYPES.message:
- return null !== t;
- default:
- return !0
- }
- }, f.encode = function(i, n, r) {
- if (null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
- if (null === i || this.repeated && 0 == i.length) return n;
- try {
- var o;
- if (this.repeated)
- if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
- n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), n.ensureCapacity(n.offset += 1);
- var a = n.offset;
- for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n);
- var s = n.offset - a,
- l = t.calculateVarint32(s);
- if (l > 1) {
- var u = n.slice(a, n.offset);
- a += l - 1, n.offset = a, n.append(u)
- }
- n.writeVarint32(s, a - l)
- } else
- for (o = 0; o < i.length; o++) n.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, i[o], n);
- else this.map ? i.forEach((function(i, r, o) {
- var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
- n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), n.writeVarint32(a), n.writeVarint32(8 | this.keyType.wireType), this.keyElement.encodeValue(1, r, n), n.writeVarint32(16 | this.type.wireType), this.element.encodeValue(2, i, n)
- }), this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, i, n))
- } catch (t) {
- throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + t + ")")
- }
- return n
- }, f.calculate = function(i, n) {
- if (i = this.verifyValue(i), null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
- if (null === i || this.repeated && 0 == i.length) return 0;
- var r = 0;
- try {
- var o, a;
- if (this.repeated)
- if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
- for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), a = 0, o = 0; o < i.length; o++) a += this.element.calculateLength(this.id, i[o]);
- r += t.calculateVarint32(a), r += a
- } else
- for (o = 0; o < i.length; o++) r += t.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, i[o]);
- else this.map ? i.forEach((function(i, n, o) {
- var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
- r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), r += t.calculateVarint32(a), r += a
- }), this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, i))
- } catch (t) {
- throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + t + ")")
- }
- return r
- }, f.decode = function(t, i, n) {
- var r, o;
- if (!(!this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM)) throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
- if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
- o = i.readVarint32(), o = i.offset + o;
- for (var a = []; i.offset < o;) a.push(this.decode(this.type.wireType, i, !0));
- return a
- }
- if (this.map) {
- var l = s.defaultFieldValue(this.keyType);
- if (r = s.defaultFieldValue(this.type), o = i.readVarint32(), i.remaining() < o) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
- var u = i.clone();
- for (u.limit = u.offset + o, i.offset += o; u.remaining() > 0;) {
- var h = u.readVarint32();
- t = 7 & h;
- var c = h >>> 3;
- if (1 === c) l = this.keyElement.decode(u, t, c);
- else {
- if (2 !== c) throw Error("Unexpected tag in map field key/value submessage");
- r = this.element.decode(u, t, c)
- }
- }
- return [l, r]
- }
- return this.element.decode(i, t, this.id)
- }, i.Message.Field = p;
- var m = function(t, e, i, n, r, o, a) {
- p.call(this, t, e, i, null, n, r, o, a), this.extension
- };
- m.prototype = Object.create(p.prototype), i.Message.ExtensionField = m, i.Message.OneOf = function(t, e, i) {
- n.call(this, t, e, i), this.fields = []
- };
- var g = function(t, e, i, n, r) {
- o.call(this, t, e, i, n, r), this.className = "Enum", this.object = null
- };
- g.getName = function(t, e) {
- for (var i, n = Object.keys(t), r = 0; r < n.length; ++r)
- if (t[i = n[r]] === e) return i;
- return null
- }, (g.prototype = Object.create(o.prototype))
- .build = function(t) {
- if (this.object && !t) return this.object;
- for (var i = new e.Builder.Enum, n = this.getChildren(g.Value), r = 0, o = n.length; r < o; ++r) i[n[r].name] = n[r].id;
- return Object.defineProperty && Object.defineProperty(i, "$options", {
- value: this.buildOpt(),
- enumerable: !1
- }), this.object = i
- }, i.Enum = g;
- var v = function(t, e, i, r) {
- n.call(this, t, e, i), this.className = "Enum.Value", this.id = r
- };
- v.prototype = Object.create(n.prototype), i.Enum.Value = v;
- var y = function(t, e, i, r) {
- n.call(this, t, e, i), this.field = r
- };
- y.prototype = Object.create(n.prototype), i.Extension = y;
- var b = function(t, e, i, n) {
- o.call(this, t, e, i, n), this.className = "Service", this.clazz = null
- };
- (b.prototype = Object.create(o.prototype))
- .build = function(i) {
- return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
- for (var n = function(t) {
- e.Builder.Service.call(this), this.rpcImpl = t || function(t, e, i) {
- setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
- }
- }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++) ! function(e) {
- r[e.name] = function(n, r) {
- try {
- try {
- n = e.resolvedRequestType.clazz.decode(t.wrap(n))
- } catch (t) {
- if (!(t instanceof TypeError)) throw t
- }
- if (null === n || "object" != typeof n) throw Error("Illegal arguments");
- n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)), this.rpcImpl(e.fqn(), n, (function(t, n) {
- if (t) r(t);
- else {
- null === n && (n = "");
- try {
- n = e.resolvedResponseType.clazz.decode(n)
- } catch (t) {}
- n && n instanceof e.resolvedResponseType.clazz ? r(null, n) : r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
- }
- }))
- } catch (t) {
- setTimeout(r.bind(this, t), 0)
- }
- }, n[e.name] = function(t, i, r) {
- new n(t)[e.name](i, r)
- }, Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
- value: e.buildOpt()
- }), Object.defineProperty(r[e.name], "$options", {
- value: n[e.name].$options
- }))
- }(o[a]);
- return Object.defineProperty && (Object.defineProperty(n, "$options", {
- value: i.buildOpt()
- }), Object.defineProperty(r, "$options", {
- value: n.$options
- }), Object.defineProperty(n, "$type", {
- value: i
- }), Object.defineProperty(r, "$type", {
- value: i
- })), n
- }(e, this)
- }, i.Service = b;
- var w = function(t, e, i, r) {
- n.call(this, t, e, i), this.className = "Service.Method", this.options = r || {}
- };
- (w.prototype = Object.create(n.prototype))
- .buildOpt = a.buildOpt, i.Service.Method = w;
- var x = function(t, e, i, n, r, o, a, s) {
- w.call(this, t, e, i, s), this.className = "Service.RPCMethod", this.requestName = n, this.responseName = r, this.requestStream = o, this.responseStream = a, this.resolvedRequestType = null, this.resolvedResponseType = null
- };
- return x.prototype = Object.create(w.prototype), i.Service.RPCMethod = x, i
- }(o), o.Builder = function(t, e, n) {
- var r = function(t) {
- this.ns = new n.Namespace(this, null, ""), this.ptr = this.ns, this.resolved = !1, this.result = null, this.files = {}, this.importRoot = null, this.options = t || {}
- },
- o = r.prototype;
- return r.isMessage = function(t) {
- return "string" == typeof t.name && void 0 === t.values && void 0 === t.rpc
- }, r.isMessageField = function(t) {
- return "string" == typeof t.rule && "string" == typeof t.name && "string" == typeof t.type && void 0 !== t.id
- }, r.isEnum = function(t) {
- return "string" == typeof t.name && !(void 0 === t.values || !Array.isArray(t.values) || 0 === t.values.length)
- }, r.isService = function(t) {
- return !("string" != typeof t.name || "object" != typeof t.rpc || !t.rpc)
- }, r.isExtend = function(t) {
- return "string" == typeof t.ref
- }, o.reset = function() {
- return this.ptr = this.ns, this
- }, o.define = function(t) {
- if ("string" != typeof t || !e.TYPEREF.test(t)) throw Error("illegal namespace: " + t);
- return t.split(".")
- .forEach((function(t) {
- var e = this.ptr.getChild(t);
- null === e && this.ptr.addChild(e = new n.Namespace(this, this.ptr, t)), this.ptr = e
- }), this), this
- }, o.create = function(e) {
- if (!e) return this;
- if (Array.isArray(e)) {
- if (0 === e.length) return this;
- e = e.slice()
- } else e = [e];
- for (var i = [e]; i.length > 0;) {
- if (e = i.pop(), !Array.isArray(e)) throw Error("not a valid namespace: " + JSON.stringify(e));
- for (; e.length > 0;) {
- var o = e.shift();
- if (r.isMessage(o)) {
- var a = new n.Message(this, this.ptr, o.name, o.options, o.isGroup, o.syntax),
- s = {};
- o.oneofs && Object.keys(o.oneofs)
- .forEach((function(t) {
- a.addChild(s[t] = new n.Message.OneOf(this, a, t))
- }), this), o.fields && o.fields.forEach((function(t) {
- if (null !== a.getChild(0 | t.id)) throw Error("duplicate or invalid field id in " + a.name + ": " + t.id);
- if (t.options && "object" != typeof t.options) throw Error("illegal field options in " + a.name + "#" + t.name);
- var e = null;
- if ("string" == typeof t.oneof && !(e = s[t.oneof])) throw Error("illegal oneof in " + a.name + "#" + t.name + ": " + t.oneof);
- t = new n.Message.Field(this, a, t.rule, t.keytype, t.type, t.name, t.id, t.options, e, o.syntax), e && e.fields.push(t), a.addChild(t)
- }), this);
- var l = [];
- if (o.enums && o.enums.forEach((function(t) {
- l.push(t)
- })), o.messages && o.messages.forEach((function(t) {
- l.push(t)
- })), o.services && o.services.forEach((function(t) {
- l.push(t)
- })), o.extensions && ("number" == typeof o.extensions[0] ? a.extensions = [o.extensions] : a.extensions = o.extensions), this.ptr.addChild(a), l.length > 0) {
- i.push(e), e = l, l = null, this.ptr = a, a = null;
- continue
- }
- l = null
- } else if (r.isEnum(o)) a = new n.Enum(this, this.ptr, o.name, o.options, o.syntax), o.values.forEach((function(t) {
- a.addChild(new n.Enum.Value(this, a, t.name, t.id))
- }), this), this.ptr.addChild(a);
- else if (r.isService(o)) a = new n.Service(this, this.ptr, o.name, o.options), Object.keys(o.rpc)
- .forEach((function(t) {
- var e = o.rpc[t];
- a.addChild(new n.Service.RPCMethod(this, a, t, e.request, e.response, !!e.request_stream, !!e.response_stream, e.options))
- }), this), this.ptr.addChild(a);
- else {
- if (!r.isExtend(o)) throw Error("not a valid definition: " + JSON.stringify(o));
- if (a = this.ptr.resolve(o.ref, !0)) o.fields.forEach((function(e) {
- if (null !== a.getChild(0 | e.id)) throw Error("duplicate extended field id in " + a.name + ": " + e.id);
- if (a.extensions) {
- var i = !1;
- if (a.extensions.forEach((function(t) {
- e.id >= t[0] && e.id <= t[1] && (i = !0)
- })), !i) throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
- }
- var r = e.name;
- this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
- var o = new n.Message.ExtensionField(this, a, e.rule, e.type, this.ptr.fqn() + "." + r, e.id, e.options),
- s = new n.Extension(this, this.ptr, e.name, o);
- o.extension = s, this.ptr.addChild(s), a.addChild(o)
- }), this);
- else if (!/\.?google\.protobuf\./.test(o.ref)) throw Error("extended message " + o.ref + " is not defined")
- }
- o = null, a = null
- }
- e = null, this.ptr = this.ptr.parent
- }
- return this.resolved = !1, this.result = null, this
- }, o.import = function(e, n) {
- var r = "/";
- if ("string" == typeof n) {
- if (t.Util.IS_NODE && (n = i(34)
- .resolve(n)), !0 === this.files[n]) return this.reset();
- this.files[n] = !0
- } else if ("object" == typeof n) {
- var o, a = n.root;
- if (t.Util.IS_NODE && (a = i(34)
- .resolve(a)), (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (r = "\\"), o = t.Util.IS_NODE ? i(34)
- .join(a, n.file) : a + r + n.file, !0 === this.files[o]) return this.reset();
- this.files[o] = !0
- }
- if (e.imports && e.imports.length > 0) {
- var s, l = !1;
- "object" == typeof n ? (this.importRoot = n.root, l = !0, s = this.importRoot, n = n.file, (s.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (r = "\\")) : "string" == typeof n ? this.importRoot ? s = this.importRoot : n.indexOf("/") >= 0 ? "" === (s = n.replace(/\/[^\/]*$/, "")) && (s = "/") : n.indexOf("\\") >= 0 ? (s = n.replace(/\\[^\\]*$/, ""), r = "\\") : s = "." : s = null;
- for (var u = 0; u < e.imports.length; u++)
- if ("string" == typeof e.imports[u]) {
- if (!s) throw Error("cannot determine import root");
- var h = e.imports[u];
- if ("google/protobuf/descriptor.proto" === h) continue;
- if (h = t.Util.IS_NODE ? i(34)
- .join(s, h) : s + r + h, !0 === this.files[h]) continue;
- /\.proto$/i.test(h) && !t.DotProto && (h = h.replace(/\.proto$/, ".json"));
- var c = t.Util.fetch(h);
- if (null === c) throw Error("failed to import '" + h + "' in '" + n + "': file not found");
- /\.json$/i.test(h) ? this.import(JSON.parse(c + ""), h) : this.import(t.DotProto.Parser.parse(c), h)
- } else n ? /\.(\w+)$/.test(n) ? this.import(e.imports[u], n.replace(/^(.+)\.(\w+)$/, (function(t, e, i) {
- return e + "_import" + u + "." + i
- }))) : this.import(e.imports[u], n + "_import" + u) : this.import(e.imports[u]);
- l && (this.importRoot = null)
- }
- e.package && this.define(e.package), e.syntax && function t(e) {
- e.messages && e.messages.forEach((function(i) {
- i.syntax = e.syntax, t(i)
- })), e.enums && e.enums.forEach((function(t) {
- t.syntax = e.syntax
- }))
- }(e);
- var d = this.ptr;
- return e.options && Object.keys(e.options)
- .forEach((function(t) {
- d.options[t] = e.options[t]
- })), e.messages && (this.create(e.messages), this.ptr = d), e.enums && (this.create(e.enums), this.ptr = d), e.services && (this.create(e.services), this.ptr = d), e.extends && this.create(e.extends), this.reset()
- }, o.resolveAll = function() {
- var i;
- if (null == this.ptr || "object" == typeof this.ptr.type) return this;
- if (this.ptr instanceof n.Namespace) this.ptr.children.forEach((function(t) {
- this.ptr = t, this.resolveAll()
- }), this);
- else if (this.ptr instanceof n.Message.Field) {
- if (e.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type];
- else {
- if (!e.TYPEREF.test(this.ptr.type)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
- if (!(i = (this.ptr instanceof n.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);
- if (this.ptr.resolvedType = i, i instanceof n.Enum) {
- if (this.ptr.type = t.TYPES.enum, "proto3" === this.ptr.syntax && "proto3" !== i.syntax) throw Error("proto3 message cannot reference proto2 enum")
- } else {
- if (!(i instanceof n.Message)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
- this.ptr.type = i.isGroup ? t.TYPES.group : t.TYPES.message
- }
- }
- if (this.ptr.map) {
- if (!e.TYPE.test(this.ptr.keyType)) throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
- this.ptr.keyType = t.TYPES[this.ptr.keyType]
- }
- "proto3" === this.ptr.syntax && this.ptr.repeated && void 0 === this.ptr.options.packed && -1 !== t.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) && (this.ptr.options.packed = !0)
- } else if (this.ptr instanceof t.Reflect.Service.Method) {
- if (!(this.ptr instanceof t.Reflect.Service.RPCMethod)) throw Error("illegal service type in " + this.ptr.toString(!0));
- if (!((i = this.ptr.parent.resolve(this.ptr.requestName, !0)) && i instanceof t.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
- if (this.ptr.resolvedRequestType = i, !((i = this.ptr.parent.resolve(this.ptr.responseName, !0)) && i instanceof t.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
- this.ptr.resolvedResponseType = i
- } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value)) throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
- return this.reset()
- }, o.build = function(t) {
- if (this.reset(), this.resolved || (this.resolveAll(), this.resolved = !0, this.result = null), null === this.result && (this.result = this.ns.build()), !t) return this.result;
- for (var e = "string" == typeof t ? t.split(".") : t, i = this.result, n = 0; n < e.length; n++) {
- if (!i[e[n]]) {
- i = null;
- break
- }
- i = i[e[n]]
- }
- return i
- }, o.lookup = function(t, e) {
- return t ? this.ns.resolve(t, e) : this.ns
- }, o.toString = function() {
- return "Builder"
- }, r.Message = function() {}, r.Enum = function() {}, r.Service = function() {}, r
- }(o, o.Lang, o.Reflect), o.Map = function(t, e) {
- var i = function(t, i) {
- if (!t.map) throw Error("field is not a map");
- if (this.field = t, this.keyElem = new e.Element(t.keyType, null, !0, t.syntax), this.valueElem = new e.Element(t.type, t.resolvedType, !1, t.syntax), this.map = {}, Object.defineProperty(this, "size", {
- get: function() {
- return Object.keys(this.map)
- .length
- }
- }), i)
- for (var n = Object.keys(i), r = 0; r < n.length; r++) {
- var o = this.keyElem.valueFromString(n[r]),
- a = this.valueElem.verifyValue(i[n[r]]);
- this.map[this.keyElem.valueToString(o)] = {
- key: o,
- value: a
- }
- }
- },
- n = i.prototype;
- function r(t) {
- var e = 0;
- return {
- next: function() {
- return e < t.length ? {
- done: !1,
- value: t[e++]
- } : {
- done: !0
- }
- }
- }
- }
- return n.clear = function() {
- this.map = {}
- }, n.delete = function(t) {
- var e = this.keyElem.valueToString(this.keyElem.verifyValue(t)),
- i = e in this.map;
- return delete this.map[e], i
- }, n.entries = function() {
- for (var t, e = [], i = Object.keys(this.map), n = 0; n < i.length; n++) e.push([(t = this.map[i[n]])
- .key, t.value
- ]);
- return r(e)
- }, n.keys = function() {
- for (var t = [], e = Object.keys(this.map), i = 0; i < e.length; i++) t.push(this.map[e[i]].key);
- return r(t)
- }, n.values = function() {
- for (var t = [], e = Object.keys(this.map), i = 0; i < e.length; i++) t.push(this.map[e[i]].value);
- return r(t)
- }, n.forEach = function(t, e) {
- for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++) t.call(e, (i = this.map[n[r]])
- .value, i.key, this)
- }, n.set = function(t, e) {
- var i = this.keyElem.verifyValue(t),
- n = this.valueElem.verifyValue(e);
- return this.map[this.keyElem.valueToString(i)] = {
- key: i,
- value: n
- }, this
- }, n.get = function(t) {
- var e = this.keyElem.valueToString(this.keyElem.verifyValue(t));
- if (e in this.map) return this.map[e].value
- }, n.has = function(t) {
- return this.keyElem.valueToString(this.keyElem.verifyValue(t)) in this.map
- }, i
- }(0, o.Reflect), o.loadProto = function(t, e, i) {
- return ("string" == typeof e || e && "string" == typeof e.file && "string" == typeof e.root) && (i = e, e = void 0), o.loadJson(o.DotProto.Parser.parse(t), e, i)
- }, o.protoFromString = o.loadProto, o.loadProtoFile = function(t, e, i) {
- if (e && "object" == typeof e ? (i = e, e = null) : e && "function" == typeof e || (e = null), e) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, (function(n) {
- if (null !== n) try {
- e(null, o.loadProto(n, i, t))
- } catch (t) {
- e(t)
- } else e(Error("Failed to fetch file"))
- }));
- var n = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
- return null === n ? null : o.loadProto(n, i, t)
- }, o.protoFromFile = o.loadProtoFile, o.newBuilder = function(t) {
- return void 0 === (t = t || {})
- .convertFieldsToCamelCase && (t.convertFieldsToCamelCase = o.convertFieldsToCamelCase), void 0 === t.populateAccessors && (t.populateAccessors = o.populateAccessors), new o.Builder(t)
- }, o.loadJson = function(t, e, i) {
- return ("string" == typeof e || e && "string" == typeof e.file && "string" == typeof e.root) && (i = e, e = null), e && "object" == typeof e || (e = o.newBuilder()), "string" == typeof t && (t = JSON.parse(t)), e.import(t, i), e.resolveAll(), e
- }, o.loadJsonFile = function(t, e, i) {
- if (e && "object" == typeof e ? (i = e, e = null) : e && "function" == typeof e || (e = null), e) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, (function(n) {
- if (null !== n) try {
- e(null, o.loadJson(JSON.parse(n), i, t))
- } catch (t) {
- e(t)
- } else e(Error("Failed to fetch file"))
- }));
- var n = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
- return null === n ? null : o.loadJson(JSON.parse(n), i, t)
- }, o
- }) ? r.apply(e, o) : r) || (t.exports = a)
- })
- .call(this, i(50))
- }, function(t, e, i) {
- "use strict";
- (function(t) {
- var n = i(172),
- r = i(173),
- o = i(174);
- function a() {
- return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
- }
- function s(t, e) {
- if (a() < e) throw new RangeError("Invalid typed array length");
- return l.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e))
- .__proto__ = l.prototype : (null === t && (t = new l(e)), t.length = e), t
- }
- function l(t, e, i) {
- if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l)) return new l(t, e, i);
- if ("number" == typeof t) {
- if ("string" == typeof e) throw new Error("If encoding is specified then the first argument must be a string");
- return c(this, t)
- }
- return u(this, t, e, i)
- }
- function u(t, e, i, n) {
- if ("number" == typeof e) throw new TypeError('"value" argument must not be a number');
- return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function(t, e, i, n) {
- if (e.byteLength, i < 0 || e.byteLength < i) throw new RangeError("'offset' is out of bounds");
- if (e.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds");
- e = void 0 === i && void 0 === n ? new Uint8Array(e) : void 0 === n ? new Uint8Array(e, i) : new Uint8Array(e, i, n);
- l.TYPED_ARRAY_SUPPORT ? (t = e)
- .__proto__ = l.prototype : t = d(t, e);
- return t
- }(t, e, i, n) : "string" == typeof e ? function(t, e, i) {
- "string" == typeof i && "" !== i || (i = "utf8");
- if (!l.isEncoding(i)) throw new TypeError('"encoding" must be a valid string encoding');
- var n = 0 | f(e, i),
- r = (t = s(t, n))
- .write(e, i);
- r !== n && (t = t.slice(0, r));
- return t
- }(t, e, i) : function(t, e) {
- if (l.isBuffer(e)) {
- var i = 0 | p(e.length);
- return 0 === (t = s(t, i))
- .length || e.copy(t, 0, 0, i), t
- }
- if (e) {
- if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length" in e) return "number" != typeof e.length || (n = e.length) != n ? s(t, 0) : d(t, e);
- if ("Buffer" === e.type && o(e.data)) return d(t, e.data)
- }
- var n;
- throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
- }(t, e)
- }
- function h(t) {
- if ("number" != typeof t) throw new TypeError('"size" argument must be a number');
- if (t < 0) throw new RangeError('"size" argument must not be negative')
- }
- function c(t, e) {
- if (h(e), t = s(t, e < 0 ? 0 : 0 | p(e)), !l.TYPED_ARRAY_SUPPORT)
- for (var i = 0; i < e; ++i) t[i] = 0;
- return t
- }
- function d(t, e) {
- var i = e.length < 0 ? 0 : 0 | p(e.length);
- t = s(t, i);
- for (var n = 0; n < i; n += 1) t[n] = 255 & e[n];
- return t
- }
- function p(t) {
- if (t >= a()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a()
- .toString(16) + " bytes");
- return 0 | t
- }
- function f(t, e) {
- if (l.isBuffer(t)) return t.length;
- if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer)) return t.byteLength;
- "string" != typeof t && (t = "" + t);
- var i = t.length;
- if (0 === i) return 0;
- for (var n = !1;;) switch (e) {
- case "ascii":
- case "latin1":
- case "binary":
- return i;
- case "utf8":
- case "utf-8":
- case void 0:
- return U(t)
- .length;
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return 2 * i;
- case "hex":
- return i >>> 1;
- case "base64":
- return V(t)
- .length;
- default:
- if (n) return U(t)
- .length;
- e = ("" + e)
- .toLowerCase(), n = !0
- }
- }
- function m(t, e, i) {
- var n = !1;
- if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
- if ((void 0 === i || i > this.length) && (i = this.length), i <= 0) return "";
- if ((i >>>= 0) <= (e >>>= 0)) return "";
- for (t || (t = "utf8");;) switch (t) {
- case "hex":
- return E(this, e, i);
- case "utf8":
- case "utf-8":
- return A(this, e, i);
- case "ascii":
- return P(this, e, i);
- case "latin1":
- case "binary":
- return C(this, e, i);
- case "base64":
- return _(this, e, i);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return D(this, e, i);
- default:
- if (n) throw new TypeError("Unknown encoding: " + t);
- t = (t + "")
- .toLowerCase(), n = !0
- }
- }
- function g(t, e, i) {
- var n = t[e];
- t[e] = t[i], t[i] = n
- }
- function v(t, e, i, n, r) {
- if (0 === t.length) return -1;
- if ("string" == typeof i ? (n = i, i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648), i = +i, isNaN(i) && (i = r ? 0 : t.length - 1), i < 0 && (i = t.length + i), i >= t.length) {
- if (r) return -1;
- i = t.length - 1
- } else if (i < 0) {
- if (!r) return -1;
- i = 0
- }
- if ("string" == typeof e && (e = l.from(e, n)), l.isBuffer(e)) return 0 === e.length ? -1 : y(t, e, i, n, r);
- if ("number" == typeof e) return e &= 255, l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(t, e, i) : Uint8Array.prototype.lastIndexOf.call(t, e, i) : y(t, [e], i, n, r);
- throw new TypeError("val must be string, number or Buffer")
- }
- function y(t, e, i, n, r) {
- var o, a = 1,
- s = t.length,
- l = e.length;
- if (void 0 !== n && ("ucs2" === (n = String(n)
- .toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
- if (t.length < 2 || e.length < 2) return -1;
- a = 2, s /= 2, l /= 2, i /= 2
- }
- function u(t, e) {
- return 1 === a ? t[e] : t.readUInt16BE(e * a)
- }
- if (r) {
- var h = -1;
- for (o = i; o < s; o++)
- if (u(t, o) === u(e, -1 === h ? 0 : o - h)) {
- if (-1 === h && (h = o), o - h + 1 === l) return h * a
- } else -1 !== h && (o -= o - h), h = -1
- } else
- for (i + l > s && (i = s - l), o = i; o >= 0; o--) {
- for (var c = !0, d = 0; d < l; d++)
- if (u(t, o + d) !== u(e, d)) {
- c = !1;
- break
- } if (c) return o
- }
- return -1
- }
- function b(t, e, i, n) {
- i = Number(i) || 0;
- var r = t.length - i;
- n ? (n = Number(n)) > r && (n = r) : n = r;
- var o = e.length;
- if (o % 2 != 0) throw new TypeError("Invalid hex string");
- n > o / 2 && (n = o / 2);
- for (var a = 0; a < n; ++a) {
- var s = parseInt(e.substr(2 * a, 2), 16);
- if (isNaN(s)) return a;
- t[i + a] = s
- }
- return a
- }
- function w(t, e, i, n) {
- return j(U(e, t.length - i), t, i, n)
- }
- function x(t, e, i, n) {
- return j(function(t) {
- for (var e = [], i = 0; i < t.length; ++i) e.push(255 & t.charCodeAt(i));
- return e
- }(e), t, i, n)
- }
- function M(t, e, i, n) {
- return x(t, e, i, n)
- }
- function T(t, e, i, n) {
- return j(V(e), t, i, n)
- }
- function S(t, e, i, n) {
- return j(function(t, e) {
- for (var i, n, r, o = [], a = 0; a < t.length && !((e -= 2) < 0); ++a) i = t.charCodeAt(a), n = i >> 8, r = i % 256, o.push(r), o.push(n);
- return o
- }(e, t.length - i), t, i, n)
- }
- function _(t, e, i) {
- return 0 === e && i === t.length ? n.fromByteArray(t) : n.fromByteArray(t.slice(e, i))
- }
- function A(t, e, i) {
- i = Math.min(t.length, i);
- for (var n = [], r = e; r < i;) {
- var o, a, s, l, u = t[r],
- h = null,
- c = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
- if (r + c <= i) switch (c) {
- case 1:
- u < 128 && (h = u);
- break;
- case 2:
- 128 == (192 & (o = t[r + 1])) && (l = (31 & u) << 6 | 63 & o) > 127 && (h = l);
- break;
- case 3:
- o = t[r + 1], a = t[r + 2], 128 == (192 & o) && 128 == (192 & a) && (l = (15 & u) << 12 | (63 & o) << 6 | 63 & a) > 2047 && (l < 55296 || l > 57343) && (h = l);
- break;
- case 4:
- o = t[r + 1], a = t[r + 2], s = t[r + 3], 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (l = (15 & u) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) > 65535 && l < 1114112 && (h = l)
- }
- null === h ? (h = 65533, c = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), n.push(h), r += c
- }
- return function(t) {
- var e = t.length;
- if (e <= 4096) return String.fromCharCode.apply(String, t);
- var i = "",
- n = 0;
- for (; n < e;) i += String.fromCharCode.apply(String, t.slice(n, n += 4096));
- return i
- }(n)
- }
- e.Buffer = l, e.SlowBuffer = function(t) {
- +t != t && (t = 0);
- return l.alloc(+t)
- }, e.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function() {
- try {
- var t = new Uint8Array(1);
- return t.__proto__ = {
- __proto__: Uint8Array.prototype,
- foo: function() {
- return 42
- }
- }, 42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1)
- .byteLength
- } catch (t) {
- return !1
- }
- }(), e.kMaxLength = a(), l.poolSize = 8192, l._augment = function(t) {
- return t.__proto__ = l.prototype, t
- }, l.from = function(t, e, i) {
- return u(null, t, e, i)
- }, l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype, l.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, {
- value: null,
- configurable: !0
- })), l.alloc = function(t, e, i) {
- return function(t, e, i, n) {
- return h(e), e <= 0 ? s(t, e) : void 0 !== i ? "string" == typeof n ? s(t, e)
- .fill(i, n) : s(t, e)
- .fill(i) : s(t, e)
- }(null, t, e, i)
- }, l.allocUnsafe = function(t) {
- return c(null, t)
- }, l.allocUnsafeSlow = function(t) {
- return c(null, t)
- }, l.isBuffer = function(t) {
- return !(null == t || !t._isBuffer)
- }, l.compare = function(t, e) {
- if (!l.isBuffer(t) || !l.isBuffer(e)) throw new TypeError("Arguments must be Buffers");
- if (t === e) return 0;
- for (var i = t.length, n = e.length, r = 0, o = Math.min(i, n); r < o; ++r)
- if (t[r] !== e[r]) {
- i = t[r], n = e[r];
- break
- } return i < n ? -1 : n < i ? 1 : 0
- }, l.isEncoding = function(t) {
- switch (String(t)
- .toLowerCase()) {
- case "hex":
- case "utf8":
- case "utf-8":
- case "ascii":
- case "latin1":
- case "binary":
- case "base64":
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return !0;
- default:
- return !1
- }
- }, l.concat = function(t, e) {
- if (!o(t)) throw new TypeError('"list" argument must be an Array of Buffers');
- if (0 === t.length) return l.alloc(0);
- var i;
- if (void 0 === e)
- for (e = 0, i = 0; i < t.length; ++i) e += t[i].length;
- var n = l.allocUnsafe(e),
- r = 0;
- for (i = 0; i < t.length; ++i) {
- var a = t[i];
- if (!l.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers');
- a.copy(n, r), r += a.length
- }
- return n
- }, l.byteLength = f, l.prototype._isBuffer = !0, l.prototype.swap16 = function() {
- var t = this.length;
- if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
- for (var e = 0; e < t; e += 2) g(this, e, e + 1);
- return this
- }, l.prototype.swap32 = function() {
- var t = this.length;
- if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
- for (var e = 0; e < t; e += 4) g(this, e, e + 3), g(this, e + 1, e + 2);
- return this
- }, l.prototype.swap64 = function() {
- var t = this.length;
- if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
- for (var e = 0; e < t; e += 8) g(this, e, e + 7), g(this, e + 1, e + 6), g(this, e + 2, e + 5), g(this, e + 3, e + 4);
- return this
- }, l.prototype.toString = function() {
- var t = 0 | this.length;
- return 0 === t ? "" : 0 === arguments.length ? A(this, 0, t) : m.apply(this, arguments)
- }, l.prototype.equals = function(t) {
- if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
- return this === t || 0 === l.compare(this, t)
- }, l.prototype.inspect = function() {
- var t = "",
- i = e.INSPECT_MAX_BYTES;
- return this.length > 0 && (t = this.toString("hex", 0, i)
- .match(/.{2}/g)
- .join(" "), this.length > i && (t += " ... ")), "<Buffer " + t + ">"
- }, l.prototype.compare = function(t, e, i, n, r) {
- if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
- if (void 0 === e && (e = 0), void 0 === i && (i = t ? t.length : 0), void 0 === n && (n = 0), void 0 === r && (r = this.length), e < 0 || i > t.length || n < 0 || r > this.length) throw new RangeError("out of range index");
- if (n >= r && e >= i) return 0;
- if (n >= r) return -1;
- if (e >= i) return 1;
- if (this === t) return 0;
- for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (e >>>= 0), s = Math.min(o, a), u = this.slice(n, r), h = t.slice(e, i), c = 0; c < s; ++c)
- if (u[c] !== h[c]) {
- o = u[c], a = h[c];
- break
- } return o < a ? -1 : a < o ? 1 : 0
- }, l.prototype.includes = function(t, e, i) {
- return -1 !== this.indexOf(t, e, i)
- }, l.prototype.indexOf = function(t, e, i) {
- return v(this, t, e, i, !0)
- }, l.prototype.lastIndexOf = function(t, e, i) {
- return v(this, t, e, i, !1)
- }, l.prototype.write = function(t, e, i, n) {
- if (void 0 === e) n = "utf8", i = this.length, e = 0;
- else if (void 0 === i && "string" == typeof e) n = e, i = this.length, e = 0;
- else {
- if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
- e |= 0, isFinite(i) ? (i |= 0, void 0 === n && (n = "utf8")) : (n = i, i = void 0)
- }
- var r = this.length - e;
- if ((void 0 === i || i > r) && (i = r), t.length > 0 && (i < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
- n || (n = "utf8");
- for (var o = !1;;) switch (n) {
- case "hex":
- return b(this, t, e, i);
- case "utf8":
- case "utf-8":
- return w(this, t, e, i);
- case "ascii":
- return x(this, t, e, i);
- case "latin1":
- case "binary":
- return M(this, t, e, i);
- case "base64":
- return T(this, t, e, i);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return S(this, t, e, i);
- default:
- if (o) throw new TypeError("Unknown encoding: " + n);
- n = ("" + n)
- .toLowerCase(), o = !0
- }
- }, l.prototype.toJSON = function() {
- return {
- type: "Buffer",
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
- };
- function P(t, e, i) {
- var n = "";
- i = Math.min(t.length, i);
- for (var r = e; r < i; ++r) n += String.fromCharCode(127 & t[r]);
- return n
- }
- function C(t, e, i) {
- var n = "";
- i = Math.min(t.length, i);
- for (var r = e; r < i; ++r) n += String.fromCharCode(t[r]);
- return n
- }
- function E(t, e, i) {
- var n = t.length;
- (!e || e < 0) && (e = 0), (!i || i < 0 || i > n) && (i = n);
- for (var r = "", o = e; o < i; ++o) r += z(t[o]);
- return r
- }
- function D(t, e, i) {
- for (var n = t.slice(e, i), r = "", o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1]);
- return r
- }
- function L(t, e, i) {
- if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
- if (t + e > i) throw new RangeError("Trying to access beyond buffer length")
- }
- function O(t, e, i, n, r, o) {
- if (!l.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
- if (e > r || e < o) throw new RangeError('"value" argument is out of bounds');
- if (i + n > t.length) throw new RangeError("Index out of range")
- }
- function I(t, e, i, n) {
- e < 0 && (e = 65535 + e + 1);
- for (var r = 0, o = Math.min(t.length - i, 2); r < o; ++r) t[i + r] = (e & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
- }
- function R(t, e, i, n) {
- e < 0 && (e = 4294967295 + e + 1);
- for (var r = 0, o = Math.min(t.length - i, 4); r < o; ++r) t[i + r] = e >>> 8 * (n ? r : 3 - r) & 255
- }
- function N(t, e, i, n, r, o) {
- if (i + n > t.length) throw new RangeError("Index out of range");
- if (i < 0) throw new RangeError("Index out of range")
- }
- function k(t, e, i, n, o) {
- return o || N(t, 0, i, 4), r.write(t, e, i, n, 23, 4), i + 4
- }
- function F(t, e, i, n, o) {
- return o || N(t, 0, i, 8), r.write(t, e, i, n, 52, 8), i + 8
- }
- l.prototype.slice = function(t, e) {
- var i, n = this.length;
- if ((t = ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n), (e = void 0 === e ? n : ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), e < t && (e = t), l.TYPED_ARRAY_SUPPORT)(i = this.subarray(t, e))
- .__proto__ = l.prototype;
- else {
- var r = e - t;
- i = new l(r, void 0);
- for (var o = 0; o < r; ++o) i[o] = this[o + t]
- }
- return i
- }, l.prototype.readUIntLE = function(t, e, i) {
- t |= 0, e |= 0, i || L(t, e, this.length);
- for (var n = this[t], r = 1, o = 0; ++o < e && (r *= 256);) n += this[t + o] * r;
- return n
- }, l.prototype.readUIntBE = function(t, e, i) {
- t |= 0, e |= 0, i || L(t, e, this.length);
- for (var n = this[t + --e], r = 1; e > 0 && (r *= 256);) n += this[t + --e] * r;
- return n
- }, l.prototype.readUInt8 = function(t, e) {
- return e || L(t, 1, this.length), this[t]
- }, l.prototype.readUInt16LE = function(t, e) {
- return e || L(t, 2, this.length), this[t] | this[t + 1] << 8
- }, l.prototype.readUInt16BE = function(t, e) {
- return e || L(t, 2, this.length), this[t] << 8 | this[t + 1]
- }, l.prototype.readUInt32LE = function(t, e) {
- return e || L(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]
- }, l.prototype.readUInt32BE = function(t, e) {
- return e || L(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3])
- }, l.prototype.readIntLE = function(t, e, i) {
- t |= 0, e |= 0, i || L(t, e, this.length);
- for (var n = this[t], r = 1, o = 0; ++o < e && (r *= 256);) n += this[t + o] * r;
- return n >= (r *= 128) && (n -= Math.pow(2, 8 * e)), n
- }, l.prototype.readIntBE = function(t, e, i) {
- t |= 0, e |= 0, i || L(t, e, this.length);
- for (var n = e, r = 1, o = this[t + --n]; n > 0 && (r *= 256);) o += this[t + --n] * r;
- return o >= (r *= 128) && (o -= Math.pow(2, 8 * e)), o
- }, l.prototype.readInt8 = function(t, e) {
- return e || L(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t]
- }, l.prototype.readInt16LE = function(t, e) {
- e || L(t, 2, this.length);
- var i = this[t] | this[t + 1] << 8;
- return 32768 & i ? 4294901760 | i : i
- }, l.prototype.readInt16BE = function(t, e) {
- e || L(t, 2, this.length);
- var i = this[t + 1] | this[t] << 8;
- return 32768 & i ? 4294901760 | i : i
- }, l.prototype.readInt32LE = function(t, e) {
- return e || L(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24
- }, l.prototype.readInt32BE = function(t, e) {
- return e || L(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]
- }, l.prototype.readFloatLE = function(t, e) {
- return e || L(t, 4, this.length), r.read(this, t, !0, 23, 4)
- }, l.prototype.readFloatBE = function(t, e) {
- return e || L(t, 4, this.length), r.read(this, t, !1, 23, 4)
- }, l.prototype.readDoubleLE = function(t, e) {
- return e || L(t, 8, this.length), r.read(this, t, !0, 52, 8)
- }, l.prototype.readDoubleBE = function(t, e) {
- return e || L(t, 8, this.length), r.read(this, t, !1, 52, 8)
- }, l.prototype.writeUIntLE = function(t, e, i, n) {
- (t = +t, e |= 0, i |= 0, n) || O(this, t, e, i, Math.pow(2, 8 * i) - 1, 0);
- var r = 1,
- o = 0;
- for (this[e] = 255 & t; ++o < i && (r *= 256);) this[e + o] = t / r & 255;
- return e + i
- }, l.prototype.writeUIntBE = function(t, e, i, n) {
- (t = +t, e |= 0, i |= 0, n) || O(this, t, e, i, Math.pow(2, 8 * i) - 1, 0);
- var r = i - 1,
- o = 1;
- for (this[e + r] = 255 & t; --r >= 0 && (o *= 256);) this[e + r] = t / o & 255;
- return e + i
- }, l.prototype.writeUInt8 = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 1, 255, 0), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), this[e] = 255 & t, e + 1
- }, l.prototype.writeUInt16LE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : I(this, t, e, !0), e + 2
- }, l.prototype.writeUInt16BE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : I(this, t, e, !1), e + 2
- }, l.prototype.writeUInt32LE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t) : R(this, t, e, !0), e + 4
- }, l.prototype.writeUInt32BE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : R(this, t, e, !1), e + 4
- }, l.prototype.writeIntLE = function(t, e, i, n) {
- if (t = +t, e |= 0, !n) {
- var r = Math.pow(2, 8 * i - 1);
- O(this, t, e, i, r - 1, -r)
- }
- var o = 0,
- a = 1,
- s = 0;
- for (this[e] = 255 & t; ++o < i && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o - 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255;
- return e + i
- }, l.prototype.writeIntBE = function(t, e, i, n) {
- if (t = +t, e |= 0, !n) {
- var r = Math.pow(2, 8 * i - 1);
- O(this, t, e, i, r - 1, -r)
- }
- var o = i - 1,
- a = 1,
- s = 0;
- for (this[e + o] = 255 & t; --o >= 0 && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o + 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255;
- return e + i
- }, l.prototype.writeInt8 = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1
- }, l.prototype.writeInt16LE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : I(this, t, e, !0), e + 2
- }, l.prototype.writeInt16BE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : I(this, t, e, !1), e + 2
- }, l.prototype.writeInt32LE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 4, 2147483647, -2147483648), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24) : R(this, t, e, !0), e + 4
- }, l.prototype.writeInt32BE = function(t, e, i) {
- return t = +t, e |= 0, i || O(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : R(this, t, e, !1), e + 4
- }, l.prototype.writeFloatLE = function(t, e, i) {
- return k(this, t, e, !0, i)
- }, l.prototype.writeFloatBE = function(t, e, i) {
- return k(this, t, e, !1, i)
- }, l.prototype.writeDoubleLE = function(t, e, i) {
- return F(this, t, e, !0, i)
- }, l.prototype.writeDoubleBE = function(t, e, i) {
- return F(this, t, e, !1, i)
- }, l.prototype.copy = function(t, e, i, n) {
- if (i || (i = 0), n || 0 === n || (n = this.length), e >= t.length && (e = t.length), e || (e = 0), n > 0 && n < i && (n = i), n === i) return 0;
- if (0 === t.length || 0 === this.length) return 0;
- if (e < 0) throw new RangeError("targetStart out of bounds");
- if (i < 0 || i >= this.length) throw new RangeError("sourceStart out of bounds");
- if (n < 0) throw new RangeError("sourceEnd out of bounds");
- n > this.length && (n = this.length), t.length - e < n - i && (n = t.length - e + i);
- var r, o = n - i;
- if (this === t && i < e && e < n)
- for (r = o - 1; r >= 0; --r) t[r + e] = this[r + i];
- else if (o < 1e3 || !l.TYPED_ARRAY_SUPPORT)
- for (r = 0; r < o; ++r) t[r + e] = this[r + i];
- else Uint8Array.prototype.set.call(t, this.subarray(i, i + o), e);
- return o
- }, l.prototype.fill = function(t, e, i, n) {
- if ("string" == typeof t) {
- if ("string" == typeof e ? (n = e, e = 0, i = this.length) : "string" == typeof i && (n = i, i = this.length), 1 === t.length) {
- var r = t.charCodeAt(0);
- r < 256 && (t = r)
- }
- if (void 0 !== n && "string" != typeof n) throw new TypeError("encoding must be a string");
- if ("string" == typeof n && !l.isEncoding(n)) throw new TypeError("Unknown encoding: " + n)
- } else "number" == typeof t && (t &= 255);
- if (e < 0 || this.length < e || this.length < i) throw new RangeError("Out of range index");
- if (i <= e) return this;
- var o;
- if (e >>>= 0, i = void 0 === i ? this.length : i >>> 0, t || (t = 0), "number" == typeof t)
- for (o = e; o < i; ++o) this[o] = t;
- else {
- var a = l.isBuffer(t) ? t : U(new l(t, n)
- .toString()),
- s = a.length;
- for (o = 0; o < i - e; ++o) this[o + e] = a[o % s]
- }
- return this
- };
- var B = /[^+\/0-9A-Za-z-_]/g;
- function z(t) {
- return t < 16 ? "0" + t.toString(16) : t.toString(16)
- }
- function U(t, e) {
- var i;
- e = e || 1 / 0;
- for (var n = t.length, r = null, o = [], a = 0; a < n; ++a) {
- if ((i = t.charCodeAt(a)) > 55295 && i < 57344) {
- if (!r) {
- if (i > 56319) {
- (e -= 3) > -1 && o.push(239, 191, 189);
- continue
- }
- if (a + 1 === n) {
- (e -= 3) > -1 && o.push(239, 191, 189);
- continue
- }
- r = i;
- continue
- }
- if (i < 56320) {
- (e -= 3) > -1 && o.push(239, 191, 189), r = i;
- continue
- }
- i = 65536 + (r - 55296 << 10 | i - 56320)
- } else r && (e -= 3) > -1 && o.push(239, 191, 189);
- if (r = null, i < 128) {
- if ((e -= 1) < 0) break;
- o.push(i)
- } else if (i < 2048) {
- if ((e -= 2) < 0) break;
- o.push(i >> 6 | 192, 63 & i | 128)
- } else if (i < 65536) {
- if ((e -= 3) < 0) break;
- o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
- } else {
- if (!(i < 1114112)) throw new Error("Invalid code point");
- if ((e -= 4) < 0) break;
- o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
- }
- }
- return o
- }
- function V(t) {
- return n.toByteArray(function(t) {
- if ((t = function(t) {
- return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
- }(t)
- .replace(B, ""))
- .length < 2) return "";
- for (; t.length % 4 != 0;) t += "=";
- return t
- }(t))
- }
- function j(t, e, i, n) {
- for (var r = 0; r < n && !(r + i >= e.length || r >= t.length); ++r) e[r + i] = t[r];
- return r
- }
- })
- .call(this, i(171))
- }, function(t, e) {
- t.exports = {
- ContextCreated: "scene-renderer-context-created",
- AfterRender: "after-render",
- MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
- }
- }, function(t, e, i) {
- "use strict";
- i.r(e),
- function(t) {
- i.d(e, "Easing", (function() {
- return r
- })), i.d(e, "Group", (function() {
- return a
- })), i.d(e, "Interpolation", (function() {
- return s
- })), i.d(e, "Sequence", (function() {
- return l
- })), i.d(e, "Tween", (function() {
- return h
- })), i.d(e, "VERSION", (function() {
- return c
- })), i.d(e, "add", (function() {
- return g
- })), i.d(e, "getAll", (function() {
- return f
- })), i.d(e, "nextId", (function() {
- return d
- })), i.d(e, "now", (function() {
- return o
- })), i.d(e, "remove", (function() {
- return v
- })), i.d(e, "removeAll", (function() {
- return m
- })), i.d(e, "update", (function() {
- return y
- }));
- var n, r = {
- Linear: {
- None: function(t) {
- return t
- }
- },
- Quadratic: {
- In: function(t) {
- return t * t
- },
- Out: function(t) {
- return t * (2 - t)
- },
- InOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1)
- }
- },
- Cubic: {
- In: function(t) {
- return t * t * t
- },
- Out: function(t) {
- return --t * t * t + 1
- },
- InOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2)
- }
- },
- Quartic: {
- In: function(t) {
- return t * t * t * t
- },
- Out: function(t) {
- return 1 - --t * t * t * t
- },
- InOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2)
- }
- },
- Quintic: {
- In: function(t) {
- return t * t * t * t * t
- },
- Out: function(t) {
- return --t * t * t * t * t + 1
- },
- InOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2)
- }
- },
- Sinusoidal: {
- In: function(t) {
- return 1 - Math.cos(t * Math.PI / 2)
- },
- Out: function(t) {
- return Math.sin(t * Math.PI / 2)
- },
- InOut: function(t) {
- return .5 * (1 - Math.cos(Math.PI * t))
- }
- },
- Exponential: {
- In: function(t) {
- return 0 === t ? 0 : Math.pow(1024, t - 1)
- },
- Out: function(t) {
- return 1 === t ? 1 : 1 - Math.pow(2, -10 * t)
- },
- InOut: function(t) {
- return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? .5 * Math.pow(1024, t - 1) : .5 * (2 - Math.pow(2, -10 * (t - 1)))
- }
- },
- Circular: {
- In: function(t) {
- return 1 - Math.sqrt(1 - t * t)
- },
- Out: function(t) {
- return Math.sqrt(1 - --t * t)
- },
- InOut: function(t) {
- return (t *= 2) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1)
- }
- },
- Elastic: {
- In: function(t) {
- return 0 === t ? 0 : 1 === t ? 1 : -Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI)
- },
- Out: function(t) {
- return 0 === t ? 0 : 1 === t ? 1 : Math.pow(2, -10 * t) * Math.sin(5 * (t - .1) * Math.PI) + 1
- },
- InOut: function(t) {
- return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? -.5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) : .5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1
- }
- },
- Back: {
- In: function(t) {
- var e = 1.70158;
- return t * t * ((e + 1) * t - e)
- },
- Out: function(t) {
- var e = 1.70158;
- return --t * t * ((e + 1) * t + e) + 1
- },
- InOut: function(t) {
- var e = 2.5949095;
- return (t *= 2) < 1 ? t * t * ((e + 1) * t - e) * .5 : .5 * ((t -= 2) * t * ((e + 1) * t + e) + 2)
- }
- },
- Bounce: {
- In: function(t) {
- return 1 - r.Bounce.Out(1 - t)
- },
- Out: function(t) {
- return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375
- },
- InOut: function(t) {
- return t < .5 ? .5 * r.Bounce.In(2 * t) : .5 * r.Bounce.Out(2 * t - 1) + .5
- }
- }
- },
- o = "undefined" == typeof self && void 0 !== t && t.hrtime ? function() {
- var e = t.hrtime();
- return 1e3 * e[0] + e[1] / 1e6
- } : "undefined" != typeof self && void 0 !== self.performance && void 0 !== self.performance.now ? self.performance.now.bind(self.performance) : void 0 !== Date.now ? Date.now : function() {
- return (new Date)
- .getTime()
- },
- a = function() {
- function t() {
- this._tweens = {}, this._tweensAddedDuringUpdate = {}
- }
- return t.prototype.getAll = function() {
- var t = this;
- return Object.keys(this._tweens)
- .map((function(e) {
- return t._tweens[e]
- }))
- }, t.prototype.removeAll = function() {
- this._tweens = {}
- }, t.prototype.add = function(t) {
- this._tweens[t.getId()] = t, this._tweensAddedDuringUpdate[t.getId()] = t
- }, t.prototype.remove = function(t) {
- delete this._tweens[t.getId()], delete this._tweensAddedDuringUpdate[t.getId()]
- }, t.prototype.update = function(t, e) {
- void 0 === t && (t = o()), void 0 === e && (e = !1);
- var i = Object.keys(this._tweens);
- if (0 === i.length) return !1;
- for (; i.length > 0;) {
- this._tweensAddedDuringUpdate = {};
- for (var n = 0; n < i.length; n++) {
- var r = this._tweens[i[n]],
- a = !e;
- r && !1 === r.update(t, a) && !e && delete this._tweens[i[n]]
- }
- i = Object.keys(this._tweensAddedDuringUpdate)
- }
- return !0
- }, t
- }(),
- s = {
- Linear: function(t, e) {
- var i = t.length - 1,
- n = i * e,
- r = Math.floor(n),
- o = s.Utils.Linear;
- return e < 0 ? o(t[0], t[1], n) : e > 1 ? o(t[i], t[i - 1], i - n) : o(t[r], t[r + 1 > i ? i : r + 1], n - r)
- },
- Bezier: function(t, e) {
- for (var i = 0, n = t.length - 1, r = Math.pow, o = s.Utils.Bernstein, a = 0; a <= n; a++) i += r(1 - e, n - a) * r(e, a) * t[a] * o(n, a);
- return i
- },
- CatmullRom: function(t, e) {
- var i = t.length - 1,
- n = i * e,
- r = Math.floor(n),
- o = s.Utils.CatmullRom;
- return t[0] === t[i] ? (e < 0 && (r = Math.floor(n = i * (1 + e))), o(t[(r - 1 + i) % i], t[r], t[(r + 1) % i], t[(r + 2) % i], n - r)) : e < 0 ? t[0] - (o(t[0], t[0], t[1], t[1], -n) - t[0]) : e > 1 ? t[i] - (o(t[i], t[i], t[i - 1], t[i - 1], n - i) - t[i]) : o(t[r ? r - 1 : 0], t[r], t[i < r + 1 ? i : r + 1], t[i < r + 2 ? i : r + 2], n - r)
- },
- Utils: {
- Linear: function(t, e, i) {
- return (e - t) * i + t
- },
- Bernstein: function(t, e) {
- var i = s.Utils.Factorial;
- return i(t) / i(e) / i(t - e)
- },
- Factorial: (n = [1], function(t) {
- var e = 1;
- if (n[t]) return n[t];
- for (var i = t; i > 1; i--) e *= i;
- return n[t] = e, e
- }),
- CatmullRom: function(t, e, i, n, r) {
- var o = .5 * (i - t),
- a = .5 * (n - e),
- s = r * r;
- return (2 * e - 2 * i + o + a) * (r * s) + (-3 * e + 3 * i - 2 * o - a) * s + o * r + e
- }
- }
- },
- l = function() {
- function t() {}
- return t.nextId = function() {
- return t._nextId++
- }, t._nextId = 0, t
- }(),
- u = new a,
- h = function() {
- function t(t, e) {
- void 0 === e && (e = u), this._object = t, this._group = e, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = r.Linear.None, this._interpolationFunction = s.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = l.nextId(), this._isChainStopped = !1, this._goToEnd = !1
- }
- return t.prototype.getId = function() {
- return this._id
- }, t.prototype.isPlaying = function() {
- return this._isPlaying
- }, t.prototype.isPaused = function() {
- return this._isPaused
- }, t.prototype.to = function(t, e) {
- return this._valuesEnd = Object.create(t), void 0 !== e && (this._duration = e), this
- }, t.prototype.duration = function(t) {
- return this._duration = t, this
- }, t.prototype.start = function(t) {
- if (this._isPlaying) return this;
- if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed)
- for (var e in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(e), this._valuesStart[e] = this._valuesStartRepeat[e];
- return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = void 0 !== t ? "string" == typeof t ? o() + parseFloat(t) : t : o(), this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this
- }, t.prototype._setupProperties = function(t, e, i, n) {
- for (var r in i) {
- var o = t[r],
- a = Array.isArray(o),
- s = a ? "array" : typeof o,
- l = !a && Array.isArray(i[r]);
- if ("undefined" !== s && "function" !== s) {
- if (l) {
- var u = i[r];
- if (0 === u.length) continue;
- u = u.map(this._handleRelativeValue.bind(this, o)), i[r] = [o].concat(u)
- }
- if ("object" !== s && !a || !o || l) void 0 === e[r] && (e[r] = o), a || (e[r] *= 1), n[r] = l ? i[r].slice()
- .reverse() : e[r] || 0;
- else {
- for (var h in e[r] = a ? [] : {}, o) e[r][h] = o[h];
- n[r] = a ? [] : {}, this._setupProperties(o, e[r], i[r], n[r])
- }
- }
- }
- }, t.prototype.stop = function() {
- return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._group && this._group.remove(this), this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this
- }, t.prototype.end = function() {
- return this._goToEnd = !0, this.update(1 / 0), this
- }, t.prototype.pause = function(t) {
- return void 0 === t && (t = o()), this._isPaused || !this._isPlaying || (this._isPaused = !0, this._pauseStart = t, this._group && this._group.remove(this)), this
- }, t.prototype.resume = function(t) {
- return void 0 === t && (t = o()), this._isPaused && this._isPlaying ? (this._isPaused = !1, this._startTime += t - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this) : this
- }, t.prototype.stopChainedTweens = function() {
- for (var t = 0, e = this._chainedTweens.length; t < e; t++) this._chainedTweens[t].stop();
- return this
- }, t.prototype.group = function(t) {
- return this._group = t, this
- }, t.prototype.delay = function(t) {
- return this._delayTime = t, this
- }, t.prototype.repeat = function(t) {
- return this._initialRepeat = t, this._repeat = t, this
- }, t.prototype.repeatDelay = function(t) {
- return this._repeatDelayTime = t, this
- }, t.prototype.yoyo = function(t) {
- return this._yoyo = t, this
- }, t.prototype.easing = function(t) {
- return this._easingFunction = t, this
- }, t.prototype.interpolation = function(t) {
- return this._interpolationFunction = t, this
- }, t.prototype.chain = function() {
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
- return this._chainedTweens = t, this
- }, t.prototype.onStart = function(t) {
- return this._onStartCallback = t, this
- }, t.prototype.onUpdate = function(t) {
- return this._onUpdateCallback = t, this
- }, t.prototype.onRepeat = function(t) {
- return this._onRepeatCallback = t, this
- }, t.prototype.onComplete = function(t) {
- return this._onCompleteCallback = t, this
- }, t.prototype.onStop = function(t) {
- return this._onStopCallback = t, this
- }, t.prototype.update = function(t, e) {
- if (void 0 === t && (t = o()), void 0 === e && (e = !0), this._isPaused) return !0;
- var i, n, r = this._startTime + this._duration;
- if (!this._goToEnd && !this._isPlaying) {
- if (t > r) return !1;
- e && this.start(t)
- }
- if (this._goToEnd = !1, t < this._startTime) return !0;
- !1 === this._onStartCallbackFired && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), n = (t - this._startTime) / this._duration, n = 0 === this._duration || n > 1 ? 1 : n;
- var a = this._easingFunction(n);
- if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, a), this._onUpdateCallback && this._onUpdateCallback(this._object, n), 1 === n) {
- if (this._repeat > 0) {
- for (i in isFinite(this._repeat) && this._repeat--, this._valuesStartRepeat) this._yoyo || "string" != typeof this._valuesEnd[i] || (this._valuesStartRepeat[i] = this._valuesStartRepeat[i] + parseFloat(this._valuesEnd[i])), this._yoyo && this._swapEndStartRepeatValues(i), this._valuesStart[i] = this._valuesStartRepeat[i];
- return this._yoyo && (this._reversed = !this._reversed), void 0 !== this._repeatDelayTime ? this._startTime = t + this._repeatDelayTime : this._startTime = t + this._delayTime, this._onRepeatCallback && this._onRepeatCallback(this._object), !0
- }
- this._onCompleteCallback && this._onCompleteCallback(this._object);
- for (var s = 0, l = this._chainedTweens.length; s < l; s++) this._chainedTweens[s].start(this._startTime + this._duration);
- return this._isPlaying = !1, !1
- }
- return !0
- }, t.prototype._updateProperties = function(t, e, i, n) {
- for (var r in i)
- if (void 0 !== e[r]) {
- var o = e[r] || 0,
- a = i[r],
- s = Array.isArray(t[r]),
- l = Array.isArray(a);
- !s && l ? t[r] = this._interpolationFunction(a, n) : "object" == typeof a && a ? this._updateProperties(t[r], o, a, n) : "number" == typeof(a = this._handleRelativeValue(o, a)) && (t[r] = o + (a - o) * n)
- }
- }, t.prototype._handleRelativeValue = function(t, e) {
- return "string" != typeof e ? e : "+" === e.charAt(0) || "-" === e.charAt(0) ? t + parseFloat(e) : parseFloat(e)
- }, t.prototype._swapEndStartRepeatValues = function(t) {
- var e = this._valuesStartRepeat[t],
- i = this._valuesEnd[t];
- this._valuesStartRepeat[t] = "string" == typeof i ? this._valuesStartRepeat[t] + parseFloat(i) : this._valuesEnd[t], this._valuesEnd[t] = e
- }, t
- }(),
- c = "18.6.4",
- d = l.nextId,
- p = u,
- f = p.getAll.bind(p),
- m = p.removeAll.bind(p),
- g = p.add.bind(p),
- v = p.remove.bind(p),
- y = p.update.bind(p),
- b = {
- Easing: r,
- Group: a,
- Interpolation: s,
- now: o,
- Sequence: l,
- nextId: d,
- Tween: h,
- VERSION: c,
- getAll: f,
- removeAll: m,
- add: g,
- remove: v,
- update: y
- };
- e.default = b
- }.call(this, i(50))
- }, function(t, e) {
- var i, n, r = t.exports = {};
- function o() {
- throw new Error("setTimeout has not been defined")
- }
- function a() {
- throw new Error("clearTimeout has not been defined")
- }
- function s(t) {
- if (i === setTimeout) return setTimeout(t, 0);
- if ((i === o || !i) && setTimeout) return i = setTimeout, setTimeout(t, 0);
- try {
- return i(t, 0)
- } catch (e) {
- try {
- return i.call(null, t, 0)
- } catch (e) {
- return i.call(this, t, 0)
- }
- }
- }! function() {
- try {
- i = "function" == typeof setTimeout ? setTimeout : o
- } catch (t) {
- i = o
- }
- try {
- n = "function" == typeof clearTimeout ? clearTimeout : a
- } catch (t) {
- n = a
- }
- }();
- var l, u = [],
- h = !1,
- c = -1;
- function d() {
- h && l && (h = !1, l.length ? u = l.concat(u) : c = -1, u.length && p())
- }
- function p() {
- if (!h) {
- var t = s(d);
- h = !0;
- for (var e = u.length; e;) {
- for (l = u, u = []; ++c < e;) l && l[c].run();
- c = -1, e = u.length
- }
- l = null, h = !1,
- function(t) {
- if (n === clearTimeout) return clearTimeout(t);
- if ((n === a || !n) && clearTimeout) return n = clearTimeout, clearTimeout(t);
- try {
- n(t)
- } catch (e) {
- try {
- return n.call(null, t)
- } catch (e) {
- return n.call(this, t)
- }
- }
- }(t)
- }
- }
- function f(t, e) {
- this.fun = t, this.array = e
- }
- function m() {}
- r.nextTick = function(t) {
- var e = new Array(arguments.length - 1);
- if (arguments.length > 1)
- for (var i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
- u.push(new f(t, e)), 1 !== u.length || h || s(p)
- }, f.prototype.run = function() {
- this.fun.apply(null, this.array)
- }, r.title = "browser", r.browser = !0, r.env = {}, r.argv = [], r.version = "", r.versions = {}, r.on = m, r.addListener = m, r.once = m, r.off = m, r.removeListener = m, r.removeAllListeners = m, r.emit = m, r.prependListener = m, r.prependOnceListener = m, r.listeners = function(t) {
- return []
- }, r.binding = function(t) {
- throw new Error("process.binding is not supported")
- }, r.cwd = function() {
- return "/"
- }, r.chdir = function(t) {
- throw new Error("process.chdir is not supported")
- }, r.umask = function() {
- return 0
- }
- }, function(t, e, i) {
- var n, r = i(0),
- o = i(1),
- a = i(8),
- s = i(16),
- l = i(10),
- u = i(12),
- h = i(17),
- c = i(22);
- i(3);
- function d(t) {
- var e = r.UniformsUtils.clone(u.waypoint.uniforms);
- e.map.value = n, e.opacity.value = 0, e.color.value.set(o.reticuleColor);
- var i = new r.PlaneBufferGeometry(.2, .2, 1, 1),
- a = new r.RawShaderMaterial({
- side: r.DoubleSide,
- depthWrite: !1,
- depthTest: !1,
- transparent: !0,
- vertexShader: u.waypoint.vertexShader,
- fragmentShader: u.waypoint.fragmentShader,
- uniforms: e,
- name: "waypoint",
- opacity: 0
- });
- r.Mesh.call(this, i, a), this.renderOrder = h.reticule, this.player = t, this.direction = new r.Vector3, this.hidden = !0, this.mouseLastMoveTime = Date.now(), this.editHidden = !1
- }
- n = G.conf.isCleanUI ? s.loadurl(c.splitUrl("./images/nonepointer.png")) : s.loadurl(c.splitUrl("./images/pointermain_512x512.png")), d.prototype = Object.create(r.Mesh.prototype), d.prototype.move = function(t, e, i) {
- this.editHidden ? this.hidden = !0 : (this.hidden = i, this.mouseLastMoveTime = Date.now())
- }, d.prototype.hide = function() {
- this.hidden || (this.hidden = !0, a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
- }, d.prototype.show = function() {
- this.hidden = !1, this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
- }, d.prototype.changeNormalMaterial = function() {}, d.prototype.changeCrossMaterial = function() {}, d.prototype.update = function() {
- this.editHidden
- }, d.prototype.updatePosition = function(t, e) {
- if (!this.hidden) {
- if (!e) return this.hide();
- var i = e.point,
- n = t.distanceTo(i),
- r = 1 + .01 * n;
- n < 1 && (r -= 1 - n), this.show(), this.scale.set(r, r, r), this.direction = this.direction.multiplyScalar(.8), this.direction.add(e.face.normal.clone()
- .multiplyScalar(.2)), this.position.copy(i)
- .add(e.face.normal.clone()
- .multiplyScalar(.01)), this.lookAt(this.position.clone()
- .add(this.direction))
- }
- }, d.prototype.writeAsMattertag = function() {
- var t = Math.floor(4294967296 * (1 + Math.random()))
- .toString(16) + Math.floor(16 * (1 + Math.random()))
- .toString(16),
- e = new Date;
- this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
- var i = {
- enabled: !0,
- version: "0",
- created: e.toISOString(),
- created_by: "APITest",
- position: this.position.clone(),
- stem: {
- enabled: o.mattertags.pole.enabled,
- direction: this.direction.multiplyScalar(o.mattertags.pole.height)
- },
- label: "Mattertag " + this.tagCount,
- description: "Description " + t,
- floor: function(t) {
- if (t.currentFloor) {
- var e = t.floors.indexOf(t.currentFloor);
- return e > -1 ? e : void 0
- }
- }(this.player.model),
- type: "info",
- metadata: {
- preferred_camera: {
- mode: this.player.mode
- }
- }
- },
- n = this.player.model.addMattertag(t, i)
- .build();
- n && (n.disc && this.player.mattertagDiscs.push(n.disc), n.visible || n.show(o.mattertags.startup.fadeInDuration))
- }, t.exports = d
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(1),
- o = i(53);
- function a(t) {
- o.call(this, t), this.minPolarAngle = r.dollhouseDefault.minPolarAngle, this.maxPolarAngle = r.dollhouseDefault.maxPolarAngle, this.minDistance = r.dollhouseDefault.minDistance, this.maxDistance = r.dollhouseDefault.maxDistance, this.adjustedMinDistance = this.minDistance, this.adjustedMaxDistance = this.maxDistance
- }
- a.prototype = Object.create(o.prototype), a.prototype.pan = function(t, e) {
- this.camera.updateMatrix();
- var i = this.camera.position.clone()
- .sub(this.target)
- .length();
- i *= Math.tan(this.camera.fov / 2 * Math.PI / 180), this.panLeft(2 * t * i / (window.renderHeight || window.innerHeight)), this.panUp(-2 * e * i / (window.renderHeight || window.innerHeight))
- }, a.prototype.updateZoom = function() {
- return this.cameraLength *= this.scale, this.cameraLength
- }, a.prototype.setZoomBounds = function(t) {
- var e = t.min.distanceTo(t.max);
- this.adjustedMinDistance = Math.max(Math.min(e / 2, r.dollhouseDefault.minDistance), 0), this.adjustedMaxDistance = Math.min(Math.max(e, r.dollhouseDefault.maxDistance), r.skyboxRadius), this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance
- }, a.prototype.resetRanges = function(t, e) {
- t ? (this.minDistance = Math.min(t, this.minDistance), this.maxDistance = Math.max(t, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance), e ? (this.minPolarAngle = n.Math.degToRad(10), this.maxPolarAngle = n.Math.degToRad(65)) : (this.minPolarAngle = r.dollhouseDefault.minPolarAngle, this.maxPolarAngle = r.dollhouseDefault.maxPolarAngle)
- }, a.prototype.toJSON = function() {
- return o.prototype.toJSON.call(this)
- }, t.exports = a
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(1),
- o = i(7),
- a = i(9),
- s = i(32),
- l = i(27),
- u = i(4)
- .EventEmitter,
- h = i(28),
- c = 1e-6,
- d = -1,
- p = 0,
- f = 1,
- m = 2,
- g = 3,
- v = 4;
- function y(t) {
- this.camera = t, this.camera.controls = this, this.enabled = !1, this.target = new n.Vector3, this.targetBounds = new n.Box3, this.noZoom = !1, this.zoomSpeed = 1, this.minDistance = 0, this.maxDistance = 1 / 0, this.noRotate = !1, this.noRotateUpDown = !1, this.rotateSpeed = 1, this.keyboardZoomSpeed = 0, this.noPan = !0, this.keyPanSpeed = 7, this.autoRotate = !1, this.autoRotateSpeed = 2, this.minPolarAngle = n.Math.degToRad(25), this.maxPolarAngle = n.Math.degToRad(65), this.noKeys = !1, this.rotationAcceleration = new n.Vector2, this.rotationSpeed = new n.Vector2, this.panAcceleration = new n.Vector2, this.panSpeed = new n.Vector2, this.rotateStart = new n.Vector2, this.rotateEnd = new n.Vector2, this.rotateDelta = new n.Vector2, this.panStart = new n.Vector2, this.panEnd = new n.Vector2, this.panDelta = new n.Vector2, this.panOffset = new n.Vector3, this.offset = new n.Vector3, this.dollyStart = new n.Vector2, this.dollyEnd = new n.Vector2, this.dollyDelta = new n.Vector2, this.phiDelta = 0, this.thetaDelta = 0, this.scale = 1, this.panVector = new n.Vector3, this.lastPosition = new n.Vector3, this.state = d, this.lastMoveTime = 0, this.pointersLimit = 2, this.pointers = [], this.lon = 0, this.lat = 0, this.on("touch-one-finger-start", y.touch.rotate.start), this.on("touch-one-finger-move", y.touch.rotate.move), this.on("touch-two-finger-start", y.touch.pan.start), this.on("touch-two-finger-start", y.touch.zoom.start), this.on("touch-two-finger-move", y.touch.zoom.move), this.sendData = !1, this.responseMessage = this.responseMessage.bind(this), this.connect = h(), this.connect.on("operation", this.responseMessage), this._lockedMouseWheel = !1, this.defineProperty()
- }
- y.prototype = Object.create(u.prototype), y.prototype.defineProperty = function() {
- var t = !0,
- e = this;
- Object.defineProperty(this, "touchup", {
- get: function() {
- return t
- },
- set: function(i) {
- t = i, e.connect.busy = !i
- }
- }), Object.defineProperty(this, "lockedMouseWheel", {
- get: function() {
- return this._lockedMouseWheel
- },
- set: function(t) {
- this._lockedMouseWheel = t
- }
- })
- }, y.prototype.setBounds = function(t) {
- this.targetBounds = t
- }, y.prototype.bindEvents = function(t) {
- (t = t || document)
- .addEventListener("contextmenu", (function(t) {
- t.preventDefault()
- })), t.addEventListener("mousedown", this.onMouseDown.bind(this)), t.addEventListener("mousemove", this.onMouseMove.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this)), t.addEventListener("mouseover", function(t) {
- 0 !== t.which && 0 !== t.buttons || this.onMouseUp(t)
- }.bind(this)), r.useWheel && (t.addEventListener("mousewheel", this.onMouseWheel.bind(this)), t.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerUp.bind(this)), t.addEventListener("pointercancel", this.onPointerUp.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("keydown", this.onKeyDown.bind(this)), t.addEventListener("keyup", this.onKeyUp.bind(this))
- }, y.prototype.isEngaged = function() {
- return this.state !== d
- };
- var b, w, x, M, T, S, _ = null,
- A = null,
- P = null;
- y.prototype.rotateLeft = function(t) {
- void 0 === t && (t = this.getAutoRotationAngle()), this.thetaDelta -= t, 0 === this.thetaDelta && 0 === t && null === _ && this.touchup ? (_ = !0, this.emit("dollhouse-move-stop")) : 0 < this.thetaDelta ? (_ = null, .001 < this.thetaDelta ? (A = !1, this.emit("dollhouse-move")) : !1 === A && (A = !0, this.emit("dollhouse-move-stop"))) : 0 > this.thetaDelta && (_ = null, -.001 > this.thetaDelta ? (P = !1, this.emit("dollhouse-move")) : !1 === P && (P = !0, this.emit("dollhouse-move-stop")))
- }, y.prototype.rotateUp = function(t) {
- this.noRotateUpDown || (void 0 === t && (t = this.getAutoRotationAngle()), this.phiDelta -= t)
- }, y.prototype.panLeft = function(t) {
- var e = this.camera.matrix.elements;
- 0 == e[0] && 0 == e[2] ? this.panOffset.set(e[0], 0, e[2]) : this.panOffset.set(e[0], 0, e[2])
- .normalize(), this.panOffset.multiplyScalar(-t), this.panVector.add(this.panOffset)
- }, y.prototype.panUp = function(t) {
- var e = this.camera.matrix.elements;
- 0 == e[4] && 0 == e[6] ? this.panOffset.set(e[4], 0, e[6]) : this.panOffset.set(e[4], 0, e[6])
- .normalize(), this.panOffset.multiplyScalar(-t), this.panVector.add(this.panOffset)
- }, y.prototype.dollyIn = function(t) {
- void 0 === t && (t = this.getZoomScale()), G.R.recording && G.R.save({
- tap: "zoom",
- type: "dollhouse",
- level: 1 / t
- }), this.scale /= t, this.emit("dollhouse-move-stop")
- }, y.prototype.dollyOut = function(t) {
- void 0 === t && (t = this.getZoomScale()), G.R.recording && G.R.save({
- tap: "zoom",
- type: "dollhouse",
- level: t
- }), this.scale *= t, this.emit("dollhouse-move-stop")
- }, y.prototype.lookAt = function(t, e, i) {
- this.camera.position.copy(t), this.camera.quaternion.copy(i), this.target.copy(e), this.offset.copy(t)
- .sub(e), this.lon = Math.atan2(this.offset.x, this.offset.z), this.lat = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y), this.cameraLength = this.offset.length()
- }, y.prototype.update = function(t) {
- var e, i, n, o;
- if (!G.measurestarted) {
- if (e = this.camera.position, this.updateFromRecord) return this.updateFromRecord = !1, void this.updateCamera(this.lon, this.lat);
- this.updateFromRecord = !1, t || (t = 1 / 60), this.rotationSpeed.multiplyScalar(1 - r.rotationFriction)
- .addScaledVector(this.rotationAcceleration, r.rotationAccelerationOutside * t), this.rotateLeft(-this.rotationSpeed.x), this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y), this.panSpeed.multiplyScalar(1 - r.panFriction)
- .addScaledVector(this.panAcceleration, r.panAccelerationOutside * t), this.pan(-this.panSpeed.x, this.panSpeed.y), this.offset.copy(e)
- .sub(this.target), i = Math.atan2(this.offset.x, this.offset.z), n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y), this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()), o = this.offset.length(), i += this.thetaDelta, n += this.phiDelta, i < 0 && (i += 2 * Math.PI), (this.connect.remoteControl || this.connect.sync) && "floorplan" !== this.type || (this.lon = i, this.lat = n, this.cameraLength = o), G.R.recording && this.record(i), this.updateCamera(this.lon, this.lat), this.connect.remoteControl || this.connect.sync || this.sendFrameData(t), this.thetaDelta = 0, this.phiDelta = 0, this.scale = 1, this.panVector.set(0, 0, 0), this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
- }
- }, y.prototype.updateCamera = (w = new n.Vector3, function(t, e) {
- "floorplan" === this.type && (t = 0, e = 0), b = this.updateZoom(), b = Math.max(this.minDistance, Math.min(this.maxDistance, b)), isNaN(t) || isNaN(e) || (e = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, e)), e = Math.max(c, Math.min(Math.PI - c, e)), w.x = b * Math.sin(e) * Math.sin(t), w.y = b * Math.cos(e), w.z = b * Math.sin(e) * Math.cos(t)), this.camera.position.copy(this.target)
- .add(w), this.camera.lookAt(this.target)
- }), y.prototype.sendFrameData = (S = 0, function(t) {
- "dollhouse" === G.player.mode && ((S += t) < r.connectDelay || Math.abs(x - this.lon) < .001 && Math.abs(M - this.lat) < .001 && Math.abs(T - this.cameraLength) < .001 || (S = 0, this.connect.sendOperation({
- type: "outside",
- lon: this.lon,
- lat: this.lat,
- cameraLength: this.cameraLength
- }), x = this.lon, M = this.lat, T = this.cameraLength))
- }), y.prototype._progressNumber = function(t, e, i) {
- return t + (e - t) * i
- }, y.prototype._progressRad = function(t, e, i) {
- var n = 2 * Math.PI,
- r = Math.PI,
- o = function(t) {
- return (t % n + n) % n
- };
- return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
- }, y.prototype.responseMessage = function(t) {
- var e = this;
- if ("outside" === t.type) {
- var i = t.lon,
- n = t.lat,
- o = t.cameraLength;
- this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null);
- var a = this.lon,
- s = this.lat,
- l = this.cameraLength;
- this.tweenProgress = new TWEEN.Tween({
- progress: 0
- })
- .to({
- progress: 1
- }, r.animationDelay)
- .easing(TWEEN.Easing.Linear.None)
- .start(), this.tweenProgress.onUpdate((function(t) {
- null === i && 0 === i || (e.lon = e._progressRad(a, i, this.progress)), null === n && 0 === i || (e.lat = e._progressNumber(s, n, this.progress)), e.cameraLength = e._progressNumber(l, o, this.progress)
- })), this.tweenProgress.onComplete((function() {
- this.tweenProgress = null
- }))
- }
- }, y.prototype.getAutoRotationAngle = function(t, e) {
- return {
- lon: t,
- lat: e
- }
- }, y.prototype.getAutoRotationAngle = function() {
- return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
- }, y.prototype.getZoomScale = function() {
- return Math.pow(.95, this.zoomSpeed)
- }, y.prototype.onMouseDown = function(t) {
- if (this.enabled) {
- switch (this.touchup = !1, t.preventDefault(), this.mouseDown = !0, t.button) {
- case 0:
- if (this.noRotate) return;
- this.state = p, this.rotateStart.set(t.clientX, this.noRotateUpDown ? 0 : t.clientY), this.rotationSpeed.set(0, 0);
- break;
- case 1:
- if (this.noZoom) return;
- this.state = f, this.dollyStart.set(t.clientX, t.clientY);
- break;
- case 2:
- if (this.noPan) return;
- this.state = m, this.panStart.set(t.clientX, t.clientY)
- }
- this.emit(l.InputStart, "mouse")
- }
- }, y.prototype.play = function(t) {
- this.touchup && (this.lon = t.lon, this.lat = t.lat, this.updateFromRecord = !0)
- }, y.prototype.record = function(t) {
- G.player.flying || G.R.rtime && !(G.R.time.getElapsedTime() - G.R.rtime > .15) || ("dollhouse" === G.player.mode ? (void 0 !== G.R.lastlon && Math.abs(this.lon - G.R.lastlon) > 3 && (this.lon < G.R.lastlon ? G.R.lon += 2 * Math.PI : G.R.lon -= 2 * Math.PI), G.R.rtime = G.R.save({
- tap: "dollhouse",
- lon: parseFloat((this.lon + G.R.lon)
- .toFixed(5)),
- lat: parseFloat(this.lat.toFixed(5)),
- action: "rotate"
- }), G.R.lastlon = this.lon) : "floorplan" === G.player.mode && (G.R.rtime = G.R.save({
- tap: "floorplan",
- lon: parseFloat(this.lon.toFixed(5)),
- lat: parseFloat(this.lat.toFixed(5)),
- action: "rotate"
- })))
- }, y.prototype.onMouseMove = function(t) {
- if (this.enabled && this.mouseDown && 0 !== t.buttons) {
- if (t.preventDefault(), r.delBK && "floorplan" === G.player.mode) return !1;
- var e = t.currentTarget;
- switch (this.state) {
- case p:
- if (this.noRotate) return;
- this.rotateEnd.set(t.clientX, this.noRotateUpDown ? 0 : t.clientY), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / e.clientWidth * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / e.clientHeight * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd);
- break;
- case f:
- if (this.noZoom) return;
- this.dollyEnd.set(t.clientX, t.clientY), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart), (this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut)
- .call(this), this.dollyStart.copy(this.dollyEnd);
- break;
- case m:
- if (this.noPan) return;
- this.panEnd.set(t.clientX, t.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd)
- }
- this.emit(l.Move, "mouse"), this.lastMoveTime = t.timeStamp, this.update()
- }
- }, y.prototype.onMouseUp = function(t) {
- if (!this.enabled) return !1;
- this.mouseDown = !1, this.touchup = !0, this.state = d, "mouseover" !== t.type && (t.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))
- }, y.prototype.onMouseWheel = function(t) {
- this._lockedMouseWheel || this.enabled && !this.noZoom && r.useWheel && !G.R.playing && (r.delBK && "floorplan" === G.player.mode || (this.emit(l.Move, "wheel"), ((t.wheelDelta || -t.detail) > 0 ? this.dollyOut : this.dollyIn)
- .call(this), this.update()))
- }, y.prototype.onKeyDown = function(t) {
- "floorplan" !== G.player.mode && (!this.enabled || this.noKeys || t.metaKey || t.ctrlKey || (t.preventDefault(), this.handleKeyDown(t.which)))
- }, y.prototype.handleKeyDown = function(t) {
- var e = function(t, e) {
- "y" === t ? this.noRotateUpDown ? this.keyboardZoomSpeed = e : this.rotationAcceleration.y = e : this.rotationAcceleration.x = e
- }.bind(this),
- i = function(t, e) {
- this.panAcceleration[t] = e
- }.bind(this),
- n = !0;
- switch (t) {
- case s.UPARROW:
- case s.I:
- e("y", 1);
- break;
- case s.DOWNARROW:
- case s.K:
- e("y", -1);
- break;
- case s.LEFTARROW:
- case s.J:
- e("x", -1);
- break;
- case s.RIGHTARROW:
- case s.L:
- e("x", 1);
- break;
- case s.W:
- i("y", 1);
- break;
- case s.S:
- i("y", -1);
- break;
- case s.A:
- i("x", -1);
- break;
- case s.D:
- i("x", 1);
- break;
- default:
- n = !1
- }
- n && this.emit(l.Move, "key")
- }, y.prototype.onKeyUp = function(t) {
- !this.enabled || this.noKeys || (t.preventDefault(), t.stopPropagation(), this.handleKeyUp(t.which))
- }, y.prototype.handleKeyUp = function(t) {
- switch (t) {
- case s.I:
- case s.K:
- case s.UPARROW:
- case s.DOWNARROW:
- this.keyboardZoomSpeed = 0, this.rotationAcceleration.y = 0;
- break;
- case s.J:
- case s.L:
- case s.LEFTARROW:
- case s.RIGHTARROW:
- this.rotationAcceleration.x = 0;
- break;
- case s.S:
- case s.W:
- this.panAcceleration.y = 0;
- break;
- case s.A:
- case s.D:
- this.panAcceleration.x = 0
- }
- }, y.prototype.onTouchStart = function(t) {
- if (this.enabled) {
- switch (this.touchup = !1, t.preventDefault(), t.stopPropagation(), t.touches.length) {
- case 1:
- this.emit("touch-one-finger-start", t);
- break;
- case 2:
- this.emit("touch-two-finger-start", t);
- break;
- default:
- this.state = d
- }
- this.rotationSpeed.set(0, 0), this.emit(l.InputStart, "touch")
- }
- }, y.prototype.onTouchMove = function(t) {
- if (this.enabled) {
- if (r.delBK && "floorplan" === G.player.mode) return !1;
- switch (t.preventDefault(), t.stopPropagation(), t.touches.length) {
- case 1:
- this.emit("touch-one-finger-move", t), this.update();
- break;
- case 2:
- this.emit("touch-two-finger-move", t), this.update();
- break;
- default:
- this.state = d
- }
- this.lastMoveTime = t.timeStamp
- }
- }, y.prototype.onTouchEnd = function(t) {
- this.enabled && (this.emit("touch-one-finger-end", t), this.touchup = !0, this.emit("touch-two-finger-end", t), this.state = d, t.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))
- }, y.prototype._progressNumber = function(t, e, i) {
- return t + (e - t) * i
- }, y.prototype._progressRad = function(t, e, i) {
- var n = 2 * Math.PI,
- r = Math.PI,
- o = function(t) {
- return (t % n + n) % n
- };
- return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
- }, y.prototype.translateWithAnimation = function(t, e, i) {
- var n = this;
- this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null);
- var r = this.lon,
- o = this.lat;
- this.tweenProgress = new TWEEN.Tween({
- progress: 0
- })
- .to({
- progress: 1
- }, i)
- .easing(TWEEN.Easing.Linear.None)
- .start(), this.tweenProgress.onUpdate((function() {
- null !== t && 0 !== t && (n.lon = n._progressRad(r, t, this.progress)), null !== e && 0 !== e && (n.lat = n._progressNumber(o, e, this.progress))
- })), this.tweenProgress.onComplete((function() {
- this.tweenProgress = null
- }))
- }, y.prototype.onPointerDown = function(t) {
- this.enabled && ("touch" === t.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
- id: t.pointerId,
- pageX: t.pageX,
- pageY: t.pageY
- }), t.touches = this.pointers, this.onTouchStart(t)), this.emit(l.InputStart, "pointer"))
- }, y.prototype.onPointerMove = function(t) {
- this.enabled && "touch" === t.pointerType && (this.pointers.forEach((function(e) {
- t.pointerId === e.id && (e.pageX = t.pageX, e.pageY = t.pageY)
- })), t.touches = this.pointers, this.onTouchMove(t))
- }, y.prototype.onPointerUp = function(t) {
- this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e, i) {
- t.pointerId === e.id && this.pointers.splice(i, 1)
- }.bind(this)), t.touches = this.pointers, this.onTouchEnd(t))
- }, y.prototype.reset = function() {
- this.state = d, this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0)
- }, y.prototype.toJSON = function() {
- return {
- _viewpoint: {
- x: a.toPrecision(this.camera.position.x, 4),
- y: a.toPrecision(this.camera.position.y, 4),
- z: a.toPrecision(this.camera.position.z, 4)
- },
- _rotation: {
- x: a.toPrecision(this.camera.quaternion.x, 4),
- y: a.toPrecision(this.camera.quaternion.y, 4),
- z: a.toPrecision(this.camera.quaternion.z, 4),
- w: a.toPrecision(this.camera.quaternion.w, 4)
- }
- }
- }, y.touch = {
- rotate: {
- start: function(t) {
- this.state = g, this.rotateStart.set(t.touches[0].pageX, t.touches[0].pageY)
- },
- move: function(t) {
- if (this.state === g) {
- this.emit(l.Move, "touch");
- var e = t.currentTarget;
- this.rotateEnd.set(t.touches[0].pageX, t.touches[0].pageY), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / e.clientWidth * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / e.clientHeight * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd)
- }
- }
- },
- zoom: {
- start: function(t) {
- this.state = v;
- var e = t.touches[0].pageX - t.touches[1].pageX,
- i = t.touches[0].pageY - t.touches[1].pageY,
- n = Math.sqrt(e * e + i * i);
- this.dollyStart.set(0, n)
- },
- move: function(t) {
- if (this.state === v) {
- this.emit(l.Move, "touch");
- var e = t.touches[0].pageX - t.touches[1].pageX,
- i = t.touches[0].pageY - t.touches[1].pageY,
- n = Math.sqrt(e * e + i * i);
- this.dollyEnd.set(0, n), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart), this.dollyDelta.y > 0 ? this.dollyOut(1 - this.dollyDelta.y / 500) : this.dollyIn(1 + this.dollyDelta.y / 500), this.dollyStart.copy(this.dollyEnd)
- }
- }
- },
- pan: {
- start: function(t) {
- this.state = v, this.panStart.set(o.average(t.touches, "pageX"), o.average(t.touches, "pageY"))
- },
- move: function(t) {
- this.state === v && (this.emit(l.Move, "touch"), this.panEnd.set(o.average(t.touches, "pageX"), o.average(t.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))
- }
- }
- }, t.exports = y
- }, function(t, e, i) {
- var n = i(0),
- r = i(1),
- o = i(53),
- a = i(9),
- s = i(3);
- function l(t) {
- o.call(this, t), this.minDistance = 20, this.maxDistance = 50, this.noRotateUpDown = !0, this.minPolarAngle = 0, this.maxPolarAngle = 0, this.absoluteScale = 1, this.currentScale = 1
- }
- l.prototype = Object.create(o.prototype), l.prototype.zoomToContain = function(t) {
- if (r.delBK) {
- var e = Math.max(t.x, t.z, t.x * this.camera.aspect, t.z * this.camera.aspect);
- this.absoluteScale = e / 2 / r.orthoBase * 1.4, this.currentScale = this.absoluteScale
- } else {
- var i = Math.max(t.x, t.z),
- n = Math.min(t.x, t.z),
- o = Math.max(i, n * this.camera.aspect),
- a = Math.max(n, i * this.camera.aspect);
- this.absoluteScale = (s.aspectRatio() < 1 ? a : o) / 2 / r.orthoBase * 1.2, this.currentScale = this.absoluteScale
- }
- }, l.prototype.rotateToView = function(t, e) {
- if (r.delBK) {
- var i = 0;
- this.rotateLeft(i), this.update(0)
- } else {
- i = 0;
- s.aspectRatio() < 1 === t.x < t.z ? e.z > 0 && (i = Math.PI) : i = e.x > 0 ? Math.PI / 2 : -Math.PI / 2, this.rotateLeft(i)
- }
- }, l.prototype.pan = function(t, e) {
- this.camera.updateMatrix(), this.panLeft(t * (this.camera.right - this.camera.left) / (window.renderWidth || window.innerWidth)), this.panUp(-e * (this.camera.top - this.camera.bottom) / (window.renderHeight || window.innerHeight))
- }, l.prototype.updateZoom = function() {
- return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed, this.absoluteScale = Math.max(r.zoomNearLimit, Math.min(this.absoluteScale, r.zoomFarLimit)), this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale, this.camera.left = -r.orthoBase * this.currentScale, this.camera.right = r.orthoBase * this.currentScale, this.camera.top = r.orthoBase * this.currentScale / this.camera.aspect, this.camera.bottom = -r.orthoBase * this.currentScale / this.camera.aspect, this.camera.updateProjectionMatrix(), this.offset.length()
- }, l.prototype.toJSON = function() {
- var t = new n.Quaternion,
- e = (new n.Quaternion)
- .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90)),
- i = new n.Quaternion;
- return function() {
- var n = o.prototype.toJSON.call(this);
- return t.copy(n._rotation), i.copy(e), i.multiply(t), n._rotation.x = a.toPrecision(i.x, 4), n._rotation.y = a.toPrecision(i.y, 4), n._rotation.z = a.toPrecision(i.z, 4), n._rotation.w = a.toPrecision(i.w, 4), n._zoom = a.toPrecision(this.currentScale * this.camera.aspect, 4), n
- }
- }(), t.exports = l
- }, function(t, e) {
- t.exports = {
- PanoRenderComplete: "panorama.render.complete",
- TileRenderFailure: "panorama.tile.render.failed",
- TileRenderSuccess: "panorama.tile.render.success",
- TileUploadAttempted: "panorama.tile.upload.attempted",
- UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles"
- }
- }, function(t, e) {
- var i, n, r = {};
- r.RADIANS_PER_DEGREE = Math.PI / 180, r.DEGREES_PER_RADIAN = 180 / Math.PI, r.Vector3 = function(t, e, i) {
- this.x = t || 0, this.y = e || 0, this.z = i || 0
- }, r.Matrix4 = function() {
- this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
- }, r.Matrix4.prototype = {
- identity: function() {
- return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
- },
- copy: function(t) {
- return this.elements.set(t.elements), this
- },
- applyToVector3: function(t) {
- var e = t.x,
- i = t.y,
- n = t.z,
- r = this.elements;
- return t.x = r[0] * e + r[4] * i + r[8] * n + r[12], t.y = r[1] * e + r[5] * i + r[9] * n + r[13], t.z = r[2] * e + r[6] * i + r[10] * n + r[14], this
- },
- getInverse: function(t, e) {
- var i = this.elements,
- n = t.elements,
- r = n[0],
- o = n[1],
- a = n[2],
- s = n[3],
- l = n[4],
- u = n[5],
- h = n[6],
- c = n[7],
- d = n[8],
- p = n[9],
- f = n[10],
- m = n[11],
- g = n[12],
- v = n[13],
- y = n[14],
- b = n[15],
- w = p * y * c - v * f * c + v * h * m - u * y * m - p * h * b + u * f * b,
- x = g * f * c - d * y * c - g * h * m + l * y * m + d * h * b - l * f * b,
- M = d * v * c - g * p * c + g * u * m - l * v * m - d * u * b + l * p * b,
- T = g * p * h - d * v * h - g * u * f + l * v * f + d * u * y - l * p * y,
- S = r * w + o * x + a * M + s * T;
- if (0 === S) {
- if (e) throw new Error("MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0");
- return this.identity()
- }
- var _ = 1 / S;
- return i[0] = w * _, i[1] = (v * f * s - p * y * s - v * a * m + o * y * m + p * a * b - o * f * b) * _, i[2] = (u * y * s - v * h * s + v * a * c - o * y * c - u * a * b + o * h * b) * _, i[3] = (p * h * s - u * f * s - p * a * c + o * f * c + u * a * m - o * h * m) * _, i[4] = x * _, i[5] = (d * y * s - g * f * s + g * a * m - r * y * m - d * a * b + r * f * b) * _, i[6] = (g * h * s - l * y * s - g * a * c + r * y * c + l * a * b - r * h * b) * _, i[7] = (l * f * s - d * h * s + d * a * c - r * f * c - l * a * m + r * h * m) * _, i[8] = M * _, i[9] = (g * p * s - d * v * s - g * o * m + r * v * m + d * o * b - r * p * b) * _, i[10] = (l * v * s - g * u * s + g * o * c - r * v * c - l * o * b + r * u * b) * _, i[11] = (d * u * s - l * p * s - d * o * c + r * p * c + l * o * m - r * u * m) * _, i[12] = T * _, i[13] = (d * v * a - g * p * a + g * o * f - r * v * f - d * o * y + r * p * y) * _, i[14] = (g * u * a - l * v * a - g * o * h + r * v * h + l * o * y - r * u * y) * _, i[15] = (l * p * a - d * u * a + d * o * h - r * p * h - l * o * f + r * u * f) * _, this
- },
- makeRotationFromQuaternion: function(t) {
- var e = this.elements,
- i = t.x,
- n = t.y,
- r = t.z,
- o = t.w,
- a = i + i,
- s = n + n,
- l = r + r,
- u = i * a,
- h = i * s,
- c = i * l,
- d = n * s,
- p = n * l,
- f = r * l,
- m = o * a,
- g = o * s,
- v = o * l;
- return e[0] = 1 - (d + f), e[4] = h - v, e[8] = c + g, e[1] = h + v, e[5] = 1 - (u + f), e[9] = p - m, e[2] = c - g, e[6] = p + m, e[10] = 1 - (u + d), e[3] = 0, e[7] = 0, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, this
- }
- }, r.Quaternion = function(t, e, i, n) {
- this._x = t || 0, this._y = e || 0, this._z = i || 0, this._w = void 0 !== n ? n : 1
- }, r.Quaternion.prototype = {
- get x() {
- return this._x
- },
- set x(t) {
- this._x = t
- },
- get y() {
- return this._y
- },
- set y(t) {
- this._y = t
- },
- get z() {
- return this._z
- },
- set z(t) {
- this._z = t
- },
- get w() {
- return this._w
- },
- set w(t) {
- this._w = t
- },
- copy: function(t) {
- this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w
- },
- inverse: function() {
- return this.conjugate()
- .normalize()
- },
- conjugate: function() {
- return this._x *= -1, this._y *= -1, this._z *= -1, this
- },
- length: function() {
- return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
- },
- normalize: function() {
- var t = this.length();
- return 0 === t ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t = 1 / t, this._x = this._x * t, this._y = this._y * t, this._z = this._z * t, this._w = this._w * t), this
- },
- setFromAxisAngle: function(t, e) {
- var i = e / 2,
- n = Math.sin(i);
- return this._x = t.x * n, this._y = t.y * n, this._z = t.z * n, this._w = Math.cos(i), this
- },
- setFromUnitVectors: function(t, e) {
- return void 0 === i && (i = new r.Vector3), (n = r.dot(t, e) + 1) < 1e-6 ? (n = 0, Math.abs(t.x) > Math.abs(t.z) ? r.setVector(i, -t.y, t.x, 0) : r.setVector(i, 0, -t.z, t.y)) : r.cross(t, e, i), this._x = i.x, this._y = i.y, this._z = i.z, this._w = n, this.normalize()
- },
- multiply: function(t) {
- return this.multiplyQuaternions(this, t)
- },
- premultiply: function(t) {
- return this.multiplyQuaternions(t, this)
- },
- multiplyQuaternions: function(t, e) {
- var i = t._x,
- n = t._y,
- r = t._z,
- o = t._w,
- a = e._x,
- s = e._y,
- l = e._z,
- u = e._w;
- return this._x = i * u + o * a + n * l - r * s, this._y = n * u + o * s + r * a - i * l, this._z = r * u + o * l + i * s - n * a, this._w = o * u - i * a - n * s - r * l, this
- }
- }, r.convertWorkshopVector = function(t) {
- return new r.Vector3(-t.x, t.y, t.z)
- }, r.convertWorkshopQuaternion = function(t) {
- return new r.Quaternion(-t.x, t.y, t.z, -t.w)
- .multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
- }, r.convertWorkshopOrthoZoom = function(t) {
- return -1 === t ? -1 : t / 4
- }, r.convertWorkshopPanoramaQuaternion = function(t) {
- return new r.Quaternion(t.x, -t.y, -t.z, t.w)
- .normalize()
- .multiply((new r.Quaternion)
- .setFromAxisAngle(new r.Vector3(0, 1, 0), 270 * r.RADIANS_PER_DEGREE))
- }, r.normalize = function(t) {
- var e = t.x * t.x + t.y * t.y + t.z * t.z,
- i = Math.sqrt(e);
- t.x /= i, t.y /= i, t.z /= i
- }, r.dot = function(t, e) {
- return t.x * e.x + t.y * e.y + t.z * e.z
- }, r.cross = function(t, e, i) {
- var n = t.x,
- r = t.y,
- o = t.z;
- i.x = r * e.z - o * e.y, i.y = o * e.x - n * e.z, i.z = n * e.y - r * e.x
- }, r.setVector = function(t, e, i, n) {
- t.x = e, t.y = i, t.z = n
- }, r.copyVector = function(t, e) {
- e.x = t.x, e.y = t.y, e.z = t.z
- }, r.addVector = function(t, e) {
- t.x += e.x, t.y += e.y, t.z += e.z
- }, r.subVector = function(t, e) {
- t.x -= e.x, t.y -= e.y, t.z -= e.z
- }, r.applyQuaternionToVector = function(t, e) {
- var i = e.x,
- n = e.y,
- r = e.z,
- o = t.x,
- a = t.y,
- s = t.z,
- l = t.w,
- u = l * i + a * r - s * n,
- h = l * n + s * i - o * r,
- c = l * r + o * n - a * i,
- d = -o * i - a * n - s * r;
- e.x = u * l + d * -o + h * -s - c * -a, e.y = h * l + d * -a + c * -o - u * -s, e.z = c * l + d * -s + u * -a - h * -o
- }, r.angleBetweenVectors = function(t, e) {
- return Math.acos(r.dot(t, e))
- }, t.exports = r
- }, function(t, e, i) {
- (function(e) {
- function n(t) {
- o.call(this, t), this.panoId = t.panoId, this.orthoZoom = t.orthoZoom, this.floorVisibility = t.floorVisibility, this.thumbUrl = t.thumbUrl, this.name = t.name, this.isHero = t.isHero, this.script = t.script, this.cameraType = t.cameraType
- }
- var r = (i(0), i(2)),
- o = (i(1), i(5), i(7), i(8), i(10), i(11), i(16), i(58));
- i(4)
- .EventEmitter, new r(e), n.prototype = Object.create(o.prototype), n.prototype.isPano = function() {
- return this.panoId && "" !== this.panoId
- }, t.exports = n
- })
- .call(this, "/js/objects/Snapshot.js")
- }, function(t, e, i) {
- (function(e) {
- var n = i(0),
- r = i(4)
- .EventEmitter;
- function o(t) {
- t = t || {}, this.position = new n.Vector3, this.quaternion = new n.Quaternion, this.update(t)
- }
- n = i(0);
- var a = i(2);
- i(1), i(5), i(7), i(8), i(10), i(11), i(16), r = i(4)
- .EventEmitter;
- new a(e), o.prototype = Object.create(r.prototype), o.prototype.isValid = function() {
- return !!this.cameraMode
- }, o.prototype.update = function(t) {
- return this.cameraMode = t.cameraMode || this.cameraMode, this.pano = t.pano || this.pano, t.position && this.position.copy(t.position), t.quaternion && this.quaternion.copy(t.quaternion), this
- }, t.exports = o
- })
- .call(this, "/js/objects/View.js")
- }, function(t, e, i) {
- var n = i(0),
- r = i(5),
- o = i(8),
- a = i(20),
- s = new n.ShaderPass(n.HorizontalBlurShader),
- l = new n.ShaderPass(n.VerticalBlurShader);
- l.renderToScreen = !0;
- var u = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight);
- isNaN(u) && (u = 1);
- var h = {
- currentBlur: 0,
- aspect: u,
- blurStrength: 1,
- hblurPass: s,
- vblurPass: l,
- bindEvents: function(t) {
- t.on(a.ModeChanged, (function(t, e) {
- t === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, "deblur"))
- }))
- },
- blur: function(t) {
- h.currentBlur = 1;
- var e = t * h.blurStrength;
- l.uniforms.v.value = e / 512 * h.aspect, s.uniforms.h.value = e / 512
- },
- addBlur: function(t) {
- t = Math.max(t, h.currentBlur), h.blur(t)
- },
- removeBlur: function(t) {
- t = Math.min(1 - t, h.currentBlur), h.blur(t)
- }
- };
- h.blur(1), t.exports = h
- }, function(t, e, i) {
- var n = (i(0), i(7)),
- r = i(14),
- o = i(21),
- a = i(4)
- .EventEmitter;
- function s() {
- this.modelMap = {}, this.activeModel = null, this.modelCount = 0, this.tileDownloader = null, this.panoRenderer = null
- }
- s.prototype.init = function(t, e, i) {
- this.tileDownloader = t, this.panoRenderer = e, this.qualityManager = i
- }, s.prototype.addModel = function(t) {
- this.modelMap[t.modelid] = t, 0 === this.modelCount && this.activateModel(t.modelid), this.modelCount++, this.emit(o.ModelAdded)
- }, s.prototype.activateModel = function(t) {
- var e = this.modelMap[t];
- if (!e) throw new r("Tried to activate invalid model!");
- var i = this.activeModel;
- this.activeModel = e, this.tileDownloader.setPanoData(e.panos, e.listImagePanos(), e.modelid), this.tileDownloader.setUrls(e.urls), e.panos.forEach(function(t) {
- t.attachToPanoRenderer(this.panoRenderer), t.tileDownloader = this.tileDownloader, t.qualityManager = this.qualityManager
- }.bind(this)), this.emit(o.ActiveModelChanged, {
- oldModel: i,
- model: e
- })
- }, s.prototype.getActiveModel = function() {
- return this.activeModel
- }, n.extend(s, a), t.exports = s
- }, function(t, e, i) {
- var n = i(0),
- r = i(1);
- function o() {
- n.PerspectiveCamera.call(this, r.dollhouseFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.dollhouseNear, r.dollhouseFar), this.controls = null
- }
- o.prototype = Object.create(n.PerspectiveCamera.prototype), o.prototype.updateAspect = function(t) {
- this.aspect = t, this.updateProjectionMatrix()
- }, t.exports = o
- }, function(t, e, i) {
- var n = i(0),
- r = i(1);
- function o() {
- var t = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight);
- n.OrthographicCamera.call(this, -r.orthoBase, r.orthoBase, r.orthoBase / t, -r.orthoBase / t, r.orthoNear, r.orthoFar), this.controls = null, this.updateAspect(t)
- }
- o.prototype = Object.create(n.OrthographicCamera.prototype), o.prototype.updateAspect = function(t) {
- this.aspect = t, this.top = r.orthoBase / t, this.bottom = -r.orthoBase / t, this.updateProjectionMatrix()
- }, t.exports = o
- }, function(t, e) {
- t.exports = Object.freeze({
- Standard: 0,
- Slow: 1,
- Retain: 2
- })
- }, function(t, e) {
- t.exports = Object.freeze({
- Show: 0,
- Hide: 1,
- Retain: 2
- })
- }, function(t, e) {
- t.exports = Object.freeze({
- None: 0,
- Queued: 1,
- ForceQueued: 2,
- Downloading: 3,
- Downloaded: 4,
- DownloadFailed: 5
- })
- }, function(t, e) {
- t.exports = {
- STAY3D: 1,
- FLYTOPANO: 2,
- STARTPANO: 3
- }
- }, function(t, e, i) {
- var n = i(0),
- r = i(1),
- o = null;
- function a(t) {
- o = this, this.player = t, this.raycaster = this.player.raycaster, this.camera = this.player.camera;
- this.perspectiveCamera = new n.PerspectiveCamera(r.insideFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.insideNear, r.insideFar), this.sRender = t.sRender, this.scene = this.sRender.scene, this.lookVector = new n.Vector2, this.renderTarget = new n.WebGLRenderTarget(512, 512), this.lensMesh = null
- }
- a.prototype.createNewColliders = function() {
- return !1
- }, a.prototype.createMeasureLens = function() {
- return !1
- }, a.prototype.onMouseMove = function(t, e, i) {
- return e.chunks.forEach((function(t) {
- t.material.uniforms.mouseAPosition && t.material.uniforms.measureMode && (t.material.uniforms.mouseAPosition.value.copy(i), t.material.uniforms.measureMode.value = 1)
- })), !1
- }, a.prototype.show = function() {
- return !1
- }, a.prototype.hide = function() {
- return !1
- }, a.prototype.update = function() {
- return !1
- }, a.prototype.render = function() {
- this.sRender.mesaueLensRender(o.scene, o.perspectiveCamera, o.renderTarget, !0)
- }, t.exports = a
- }, function(t, e, i) {
- "use strict";
- function n() {
- this.enabled = !0
- }
- n.prototype.echo = function(t, e) {
- this.enabled && t.apply(console, e)
- }, n.prototype.log = function() {
- this.echo(console.debug, arguments)
- }, n.prototype.info = function() {
- this.echo(console.info, arguments)
- }, n.prototype.debug = function() {
- this.echo(console.debug, arguments)
- }, n.prototype.warn = function() {
- this.echo(console.warn, arguments)
- }, n.prototype.error = function() {
- this.echo(console.error, arguments)
- };
- var r = new n;
- G.ncz_my_log = r, t.exports = r
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(132);
- function o(t) {
- this.id = t, this.postil = null, this.settingItem = null
- }
- o.prototype.init = function(t) {
- var e;
- (this.postilEngine = {
- type_1: this.createTorus,
- type_2: this.createRect
- }, t) || (this.settingItem = new r(this.id), 1 === this.settingItem.type && (e = 328), 2 === this.settingItem.type && (e = 320), this.postil = this.postilEngine["type_" + this.id].call(this, 8, e, "#ff0000"), this.settingItem.uuid = this.postil.uuid);
- t && (this.settingItem = t, 1 === t.type && (e = 328), 2 === t.type && (e = 320), this.postil = this.postilEngine["type_" + this.id].call(this, t.fat, e, t.color), this.postil.position.copy(t.position), this.postil.scale.copy(t.scale));
- return this.settingItem.uuid = this.postil.uuid, this.settingItem.position = this.postil.position, this.settingItem.scale = this.postil.scale, this.initUserData(), this.postil
- }, o.prototype.initUserData = function() {
- this.postil.name = "postil_" + (new Date)
- .getTime(), this.postil.userData.PostilModel = this, this.postil.userData.fat = this.settingItem.fat, this.postil.userData.type = "postil", this.postil.userData.follow_mouse = !1, this.postil.userData.box_line = null, this.postil.userData.transform_control = null, this.postil.userData.setting_item = this.settingItem
- }, o.prototype.createTorusTexture = function(t, e, i) {
- var r = document.createElement("canvas"),
- o = r.getContext("2d"),
- a = 1024,
- s = a * (t / e);
- r.width = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), r.height = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), o.beginPath(), o.lineWidth = s, o.strokeStyle = i || "#ff0000", o.arc(r.width / 2, r.height / 2, (r.width - s) / 2, 0, 360, !1), o.stroke(), o.closePath(), window.devicePixelRatio && o.scale(window.devicePixelRatio, window.devicePixelRatio);
- var l = new n.CanvasTexture(r);
- return l.minFilter = n.LinearFilter, l.magFilter = n.LinearFilter, l
- }, o.prototype.createRectTexture = function(t, e, i) {
- var r = document.createElement("canvas"),
- o = r.getContext("2d"),
- a = 1024,
- s = a * (t / e);
- r.width = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), r.height = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), o.lineWidth = s, o.strokeStyle = i || "#ff0000", o.moveTo(0, 0), o.lineTo(r.width, 0), o.lineTo(r.width, r.height), o.lineTo(0, r.height), o.lineTo(0, 0), o.stroke(), window.devicePixelRatio && o.scale(window.devicePixelRatio, window.devicePixelRatio);
- var l = new n.CanvasTexture(r);
- return l.minFilter = n.LinearFilter, l.magFilter = n.LinearFilter, l
- }, o.prototype.createPostilOfTexture = function(t) {
- var e = new n.PlaneBufferGeometry(.5, .5),
- i = new n.MeshBasicMaterial({
- map: t,
- side: n.DoubleSide,
- transparent: !0,
- depthTest: !1,
- depthWrite: !1
- }),
- r = new n.Mesh(e, i);
- return r.scale.divideScalar(2), r
- }, o.prototype.createTorus = function(t, e, i) {
- var n = this.createTorusTexture(t, e, i),
- r = this.createPostilOfTexture(n);
- return r.userData.default_scale = r.scale.clone(), r.userData.default_size = {
- width: 328,
- height: 328
- }, r.userData.default_fat = 8, r
- }, o.prototype.createRect = function(t, e, i) {
- var n = this.createRectTexture(t, e, i),
- r = this.createPostilOfTexture(n);
- return r.userData.default_scale = r.scale.clone(), r.userData.default_size = {
- width: 320,
- height: 320
- }, r.userData.default_fat = 8, r
- }, t.exports = o
- }, function(t, e) {
- t.exports = {
- ActionInterrupted: "action.interrupted"
- }
- }, function(t, e) {
- t.exports = {
- Normal: 0,
- Audio: 1,
- Video: 2,
- IFrame: 3
- }
- }, function(t, e, i) {
- (function(e) {
- new(i(2))(e);
- var n = {
- parseIdsFromChunkName: function(t, e) {
- e.floorId = n.parseFloor(t), e.roomId = n.parseRoom(t)
- },
- parseFloor: function(t) {
- var e, i = t.match(/block_([0-9]+)/);
- if (!i) return 0;
- try {
- e = parseInt(i[1], 10)
- } catch (t) {
- return 0
- }
- return this.getfid(e)
- },
- getfid: function(t) {
- for (var e = G.settings.building.blocks, i = e.length || 0, n = 0; n < i; n++)
- if (e[n].blockidx === t) return e[n].flooridx;
- return 0
- },
- getflooridx: function() {
- for (var t = G.model.chunks, e = 0; e < t.length; e++)
- if (G.model.chunks[e].id === G.interchunkid) return this.getfid(e);
- return 0
- },
- getrid: function(t) {
- for (var e = G.settings.building.blocks, i = e.length || 0, n = 0; n < i; n++)
- if (e[n].blockidx === t) return e[n].roomidx;
- return 0
- },
- parseRoom: function(t) {
- var e, i = t.match(/block_([0-9]+)/);
- if (!i) return 0;
- try {
- e = parseInt(i[1], 10)
- } catch (t) {
- return 0
- }
- return this.getrid(e)
- }
- };
- t.exports = n
- })
- .call(this, "/js/model/Chunks.js")
- }, function(t, e, i) {
- var n = i(4)
- .EventEmitter,
- r = function() {
- this.audioContext = null, window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.msAudioContext, window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame, window.cancelAnimationFrame = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame;
- try {
- this.audioContext = new AudioContext
- } catch (t) {}
- this.audioContext || alert("该浏览器不支持AudioContext,讲房无法正常使用!"), this.bufferList = {}, this.cellList = {}
- };
- r.prototype.load = function(t) {
- var e = new XMLHttpRequest;
- e.open("GET", t, !0), e.responseType = "arraybuffer";
- var i = this;
- this.audioContext && (i.cellList[t] = new o(this.audioContext)), e.onload = function() {
- i.audioContext && i.audioContext.decodeAudioData(e.response, (function(e) {
- e && i.cellList[t].setBuffer(e)
- }))
- }, e.onerror = function() {}, e.send()
- }, r.prototype.getCell = function(t) {
- return null !== this.cellList[t] ? this.cellList[t] : null
- };
- var o = function(t) {
- this.audioContext = t, this.audioBuffer = null, this.source = null, this.pauseTime = 0, this.startTime = 0, this.readyState = 0, this.oncanplay = function() {}, this.audioContext && this.audioContext.addEventListener("ended", (function() {})), this._ended = this._ended.bind(this);
- var e = this;
- Object.defineProperty(this, "contextCurrentTime", {
- get: function() {
- return e.audioContext.currentTime
- },
- set: function(t) {
- t,
- e.pauseTime = t
- }
- }), Object.defineProperty(this, "currentTime", {
- get: function() {
- return e.audioContext.currentTime - e.startTime
- },
- set: function(t) {
- t,
- e.pauseTime = t
- }
- }), Object.defineProperty(this, "duration", {
- get: function() {
- return e.audioBuffer.duration
- }
- }), this.keeprunning = this.keeprunning.bind(this), document.body.addEventListener("touchend", this.keeprunning, !1)
- };
- o.prototype = Object.create(n.prototype), o.prototype.setBuffer = function(t) {
- this.audioBuffer = t, this.readyState = 4, this.oncanplay()
- }, o.prototype.keeprunning = function() {
- if ("running" !== this.audioContext) {
- var t = this;
- this.audioContext.resume();
- var e = setTimeout((function() {
- "running" === t.audioContext.state && clearTimeout(e)
- }), 0)
- }
- }, o.prototype.play = function() {
- var t = 0;
- 0 !== this.pauseTime && (t = this.pauseTime, this.pauseTime = 0);
- var e = this.audioContext,
- i = e.createBufferSource();
- i.connect(e.destination), i.buffer = this.audioBuffer, i.start || (i.start = i.noteOn, i.stop = i.noteOff), this.source = i, this.startTime = this.contextCurrentTime, i.onended = this._ended, i.start(0, t)
- }, o.prototype._ended = function() {
- this.emit("play_done")
- }, o.prototype.pause = function() {
- null !== this.source && (this.pauseTime = this.contextCurrentTime - this.startTime, this.source.disconnect())
- }, o.prototype.stop = function() {
- null !== this.source && this.source.disconnect()
- };
- var a, s = (a = null, function() {
- return null === a && (a = new r), a
- });
- t.exports = s
- }, function(t, e, i) {
- function n() {
- var t = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
- e = new r.RawShaderMaterial({
- fragmentShader: o.skysphere.fragmentShader,
- vertexShader: o.skysphere.vertexShader,
- uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
- side: r.BackSide,
- name: "skysphere"
- });
- e.uniforms.radius.value = t.parameters.radius, r.Mesh.call(this, t, e)
- }
- var r = i(0),
- o = i(12),
- a = i(1);
- n.prototype = Object.create(r.Mesh.prototype), n.prototype.constructor = n, t.exports = n
- }, function(t, e, i) {
- (function(e) {
- function n(t) {
- t.camera && (t.camera.quaternion = r(t.camera.quaternion)), t.pano && (t.pano.quaternion = r(t.pano.quaternion))
- }
- function r(t) {
- return t = t || new c.Quaternion, 0 === Math.abs(t.x) && 0 === Math.abs(t.y) && 0 === Math.abs(t.z) && 0 === Math.abs(t.w) && (t.w = 1), t
- }
- function o(t) {
- return a.deserialize(t)
- }
- var a = i(182),
- s = i(9),
- l = i(3),
- u = i(5),
- h = i(2),
- c = i(0),
- d = new h(e);
- t.exports = {
- optionsFromString: o,
- getStartCameraOptions: function(t, e, i, r) {
- var a = {};
- if (r || (a = function(t) {
- var e = l.valueFromHash("start", ""),
- i = {};
- "" !== e && (d.debug("Start override found in parameters, trying to parse..."), (i = o(e) || {})
- .tag = l.valueFromHash("tag", null), i.panoId && (i.pano = t.get(i.panoId)));
- return i
- }(e)), "" != (a = function(t) {
- var e = l.valueFromHash("o", ""),
- i = {};
- e || (e = t.data.orientationkey);
- if (e) {
- var n = t.data.orientations;
- if (null != n && null != n) {
- var r = n.length;
- for (i = 0; i < r; i++)
- if (n[i].key == e) return n[i]
- }
- }
- return i
- }(t)) && a.enable) {
- var h = a.location_id,
- p = a.rotation,
- f = e.list.length;
- if (1 == a.type) {
- a.mode = u.PANORAMA;
- for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = p);
- return a.quaternion && (a.quaternion = s.convertWorkshopQuaternion(a.quaternion)), a
- }
- for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternion);
- return a
- }
- var m = l.valueFromHash("l", "");
- if ("" != m) {
- h = m, f = e.list.length;
- a.mode = u.PANORAMA;
- for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternion);
- return a.quaternion && (a.quaternion = s.convertWorkshopQuaternion(a.quaternion)), a
- }
- var g = function(t) {
- var e = t.data.images.scenes,
- i = t.settings;
- if (i.jf && i.jf.enable && i.jf.dataset.length > 0) return e[0]._camera;
- for (var n = 0; n < e.length; n++) {
- var r = e[n];
- if (null !== r.name && "总述" !== r.name) return r._camera
- }
- return ""
- }(t);
- if ("" !== g) {
- h = g._locationid, f = e.list.length, p = g._rotation;
- a.mode = u.PANORAMA;
- for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], 2 == g._type ? a.quaternion = a.pano.quaternionAutoScene : a.quaternion = p, a.position = a.pano.position);
- if (a.quaternion) {
- var v = a.quaternion;
- a.quaternion = new c.Quaternion(v.x, v.y, v.z, v.w)
- }
- return a
- }
- var y = t.data.camera_start;
- if (y) try {
- n(y), Object.keys(y)
- .length > 0 && 0 === Object.keys(a)
- .length && (a.mode = u.convertWorkshopModeInt(y.mode), a.position = y.camera.position, a.quaternion = y.camera.quaternion, a.zoom = s.convertWorkshopOrthoZoom(y.camera.zoom), y.pano && (a.pano = e.get(y.pano.locationid), d.debug("Using camera_start"), d.debug("Modeldata pano: ", a.pano.quaternion), d.debug("Camera start pano: ", y.pano.quaternion)), a.mode !== u.PANORAMA && (a.floorVisibility = t.heroImage._camera.floor_visibility))
- } catch (t) {
- d.warn(t.message)
- }
- if (0 === Object.keys(a)
- .length && (a = function(t, e) {
- if (!t.heroImage || !t.heroImage._camera._viewpoint) return {};
- var i = {},
- n = t.heroImage._camera;
- d.debug("Using start position from thumbnail image"), i.position = n._viewpoint, i.quaternion = n._rotation;
- try {
- i.mode = u.convertWorkshopModeInt(0), i.mode === u.PANORAMA ? i.pano = e.get(n._locationid) : i.floorVisibility = n.floor_visibility
- } catch (t) {
- d.debug(t.message)
- }
- return i
- }(t, e)), t.outsideAllowed() || a.mode === u.PANORAMA || (a = {}), 0 === Object.keys(a)
- .length) {
- for (i = 0; i < e.list.length && 1 != e.list[i].alignmentType; i++);
- a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternionAutoScene, d.info("Starting at 1st pano " + a.pano.id)
- }
- return a.mode = a.mode || u.PANORAMA, a.pano || (d.debug("No pano selected, choosing the closest one to player location"), a.pano = e.findClosest(a.position || i)), a.mode === u.MESH && (a.mode = u.PANORAMA, a.position = a.pano ? a.pano.position : i), a
- }
- }
- })
- .call(this, "/js/util/camera.js")
- }, function(t, e) {
- t.exports = {
- TileDownloadSuccess: "tiledownloader.download.success",
- TileDownloadFailure: "tiledownloader.download.failure",
- PanoDownloadComplete: "tiledownloader.pano.download.complete"
- }
- }, function(t, e, i) {
- var n = i(78),
- r = i(3),
- o = i(1),
- a = i(2);
- t.exports.HousePlay = n, t.exports.Browser = r, t.exports.Config = o, t.exports.Logger = a
- }, function(t, e, i) {
- "use strict";
- (function(e) {
- window.G = {}, G.conf = {
- isNewServerPreviewVersion: !1,
- isNewEditVersion: !1,
- isCleanUI: 0,
- jfedit: !1,
- screenshot: !1,
- modelplaced: !0,
- modelMeasure: !1,
- annotation: !1,
- publicity: !1
- }, i(79), i(80), i(81), i(82), i(83), i(84), i(85), i(86), i(87), i(88), i(89), i(90), i(91), i(92), i(93), i(94), i(95), i(96), i(97), i(10), i(11);
- var n = i(0),
- r = i(98),
- o = i(144),
- a = i(60),
- s = i(145),
- l = i(5),
- u = i(2),
- h = i(146),
- c = i(3),
- d = i(1),
- p = i(8),
- f = i(59),
- m = i(74),
- g = (i(25), i(75)),
- v = i(183),
- y = i(4)
- .EventEmitter,
- b = i(184),
- w = i(186),
- x = i(191),
- M = i(195),
- T = i(196),
- S = (i(42), i(198)),
- _ = i(199),
- A = i(48),
- P = i(66),
- C = i(20),
- E = i(27),
- D = i(201),
- L = i(28)(),
- O = i(202);
- function I(t) {
- t.stopPropagation(), t.preventDefault()
- }
- function R(t) {
- y.defaultMaxListeners = 1e3,
- function(t) {
- t.addEventListener("dragenter", I, !1), t.addEventListener("dragover", I, !1)
- }(t)
- }
- function N(t) {
- ! function t(e) {
- for (var i in e) "object" == typeof e[i] ? t(e[i]) : "string" == typeof e[i] && (e[i] = e[i].replace("modelcdn.3dnest.cn", "modelcdn2.3dnest.cn")
- .replace("infocdn.3dnest.cn", "infocdn2.3dnest.cn")
- .replace("template.3dnest.cn", "template2.3dnest.cn"))
- }(t)
- }
- function k(t, e, i, n) {
- return n.progressCallback = e, t.load(i)
- .progress(F.bind(this, n))
- }
- function F(t, e) {
- var i;
- t.modelElementsToLoad = e[1], (i = t)
- .totalElementsToLoad = i.modelElementsToLoad + i.panoElementsToLoad,
- function(t) {
- t.totalElementsLoaded++, t.totalPercentageLoaded = t.totalElementsLoaded / t.totalElementsToLoad, t.progressCallback && t.progressCallback(100 * t.totalPercentageLoaded)
- }(t)
- }
- function B(t, e, i) {
- try {
- t.start(e)
- } catch (t) {
- throw i.modelid, (n = c.details()) && "Safari" === n.name && n.version > 500 && n.version, t
- }
- var n
- }
- u.level = d.logLevel, u.consoleEnabled = d.console;
- var z = function(t) {
- if (this.event = {
- load: new y,
- player: new y,
- director: new y,
- model: new y
- }, this.playContainer = void 0 !== t.container ? t.container : document.getElementById("player"), this.modelId = void 0 !== t.modelId ? t.modelId : "", this.settings = void 0 !== t.settings ? t.settings : {}, this.version = void 0 !== t.version ? t.version : {}, this.siteConf = void 0 !== t.siteConf ? t.siteConf : {}, this.enterType = void 0 !== t.enterType ? t.enterType : 2, this.loadingState = !1, this.compassAngle = 0, this.lastCompassAngle = 0, this.settings.basic.menu && (d.unit_type = this.settings.basic.menu.unit_type || 0, 1 === d.unit_type && (d.unit_conversion_value = 3.28, d.unit_name = "ft", d.unit_sq_name = "ft²")), !this.modelId) return this.event.error.emit("invalid_modelid");
- var e = this.settings.building.blocks;
- if (e && this.settings.building)
- for (var i = 0; i < e.length; i++) e[i].blockidx = parseInt(e[i].blockidx), e[i].flooridx = parseInt(e[i].flooridx), e[i].roomidx = parseInt(e[i].roomidx);
- else this.settings.building.blocks = {};
- G.url = G.url || {}, G.url.modelid = this.modelId, G.url.type = this.siteConf.type, window.PREFETCHED_MODELDATA = this.settings;
- var n = this;
- this.progStruct = {
- panoElementsToLoad: 6,
- modelElementsToLoad: 0,
- totalElementsLoaded: 0,
- totalElementsToLoad: 0,
- totalPercentageLoaded: 0,
- progressCallback: null
- }, this.qFlag = d.quickstart.enabled, this.quickstartManager = null, this.startOptions = null, this.player = null, this.director = null, this.mattertagManager = null, this.sceneRenderer = null, this.tileDownloader = null, this.qualityManager = null, this.model = null, this.Controller = null, this.panoRenderer = null, this.quickStart = null, this.panoramaSize = new D, this.panoramaSize.on("updatePanoSize", (function(t, e, i) {
- n.panoramaSize.enable && n.emit("updatePanoSize", t, e, i)
- })), this.record = null, this.playType = "heighlight", R(this.playContainer);
- var r, o, a = (this.modelId, r = this.version, this.settings, (o = this.siteConf)
- .type, {
- modelLink: o.modelpre + r.version,
- infoLink: o.infopre + r.version
- });
- G.url.model = a.modelLink, G.url.info = a.infoLink, G.settings = this.settings || {}, N(this.settings), this._updatePanorameSize = this._updatePanorameSize.bind(this), this._emitAngle = this._emitAngle.bind(this), this._emitFloorChange = this._emitFloorChange.bind(this), this._emitSpinnerState = this._emitSpinnerState.bind(this), this._emitFlyingEnd = this._emitFlyingEnd.bind(this), this._emitHighlightsBarChange = this._emitHighlightsBarChange.bind(this), this._emitModeChange = this._emitModeChange.bind(this), this._emitMoveState = this._emitMoveState.bind(this), this._emitUpdateTour = this._emitUpdateTour.bind(this), this._emitPanoChange = this._emitPanoChange.bind(this), this._emitPnaoChosen = this._emitPnaoChosen.bind(this), this._emitStopTour = this._emitStopTour.bind(this), this._emitLoadProgress = this._emitLoadProgress.bind(this), this._emitExitMeasureActive = this._emitExitMeasureActive.bind(this), this._emitChoosedHumanModel = this._emitChoosedHumanModel.bind(this), this._emitHumanModelIsLoaded = this._emitHumanModelIsLoaded.bind(this), this._emitAddModelListItem = this._emitAddModelListItem.bind(this), this._emitDeletePutModelSuccess = this._emitDeletePutModelSuccess.bind(this), this._emitHidePutModelInfoPanel = this._emitHidePutModelInfoPanel.bind(this), this._emitShowLoaddingOfLoadPutModel = this._emitShowLoaddingOfLoadPutModel.bind(this), this._emitHideLoaddingOfLoadPutModel = this._emitHideLoaddingOfLoadPutModel.bind(this), this._emitPutModelListLoadingIsOver = this._emitPutModelListLoadingIsOver.bind(this), this._emitResetPutModelInfo = this._emitResetPutModelInfo.bind(this), this._emitSetPutModelToolsPosition = this._emitSetPutModelToolsPosition.bind(this), this._emitHidePutModelSetTools = this._emitHidePutModelSetTools.bind(this), this._emitShowPutModelSetTools = this._emitShowPutModelSetTools.bind(this), this._emitViewModeTransitioning = this._emitViewModeTransitioning.bind(this), this._emitViewModePanorama = this._emitViewModePanorama.bind(this), this._emitShowModelListPanel = this._emitShowModelListPanel.bind(this), this._emitHideModelListPanel = this._emitHideModelListPanel.bind(this), this._emitUpdatePostilShow = this._emitUpdatePostilShow.bind(this), this._emitChoosedPostil = this._emitChoosedPostil.bind(this), this._emitAddPostilItem = this._emitAddPostilItem.bind(this), this._emitUpdatePostilUI = this._emitUpdatePostilUI.bind(this), this._emitHidePostilSetTool = this._emitHidePostilSetTool.bind(this), this._emitDeletePostilSuccess = this._emitDeletePostilSuccess.bind(this), this._emitShowDeleteDialogOfPostil = this._emitShowDeleteDialogOfPostil.bind(this), this._emitShowEditPanelOfPostil = this._emitShowEditPanelOfPostil.bind(this), this._emitShowAllPostils = this._emitShowAllPostils.bind(this), this._emitHideAllPostils = this._emitHideAllPostils.bind(this), this._emitEditConfirm = this._emitEditConfirm.bind(this), this._emitChoosedWeapon = this._emitEditProbeModel.bind(this), this._emitPutProbeModelComplete = this._emitPutProbeModelComplete.bind(this), this._emitGetMeasurementInfo = this._emitGetMeasurementInfo.bind(this), this._emitAddHumanLabel = this._emitAddHumanLabel.bind(this), this._emitChoosedVirtualCamera = this._emitChoosedVirtualCamera.bind(this), this._emitHideAllHumanLabel = this._emitHideAllHumanLabel.bind(this), this._emitAddVirtualCameraLabel = this._emitAddVirtualCameraLabel.bind(this), this._emitHideAllVirtualCameraLabel = this._emitHideAllVirtualCameraLabel.bind(this), this._emitShowVirtualCameraInfo = this._emitShowVirtualCameraInfo.bind(this), this._emitHideVirtualCameraInfo = this._emitHideVirtualCameraInfo.bind(this), this._emitHideRightTools = this._emitHideRightTools.bind(this), this._emitShowRightTools = this._emitShowRightTools.bind(this), this._emitPutModelFollowMouse = this._emitPutModelFollowMouse.bind(this), this._emitPutModelFollowMouseOver = this._emitPutModelFollowMouseOver.bind(this), this._emitPutModelFollowMouseCancel = this._emitPutModelFollowMouseCancel.bind(this), this._emitQuitPutMode = this._emitQuitPutMode.bind(this), this._emitViewModeDollhouse = this._emitViewModeDollhouse.bind(this), this._emitShowVirtualHumanInfo = this._emitShowVirtualHumanInfo.bind(this), this._emitHideVirtualHumanInfo = this._emitHideVirtualHumanInfo.bind(this), this._emitHandleControlPanoramaMove = this._emitHandleControlPanoramaMove.bind(this), this._emitHandleControlDollhouseMove = this._emitHandleControlDollhouseMove.bind(this), this._emitUpateUiRoate = this._emitUpateUiRoate.bind(this), this.registryOri()
- };
- function U(t, e) {}(z.prototype = Object.create(y.prototype))
- .start = function(t, i) {
- var u = "quickstart" === t || d.quickstart.enabled,
- y = null,
- C = null,
- E = this;
- this.loadingState = !0, this.record = new O, G.R = this.record, h.initS({
- url: this.modelId,
- floors: c.valueFromHash("f", !0),
- autoload: !1
- }, this.settings)
- .then((function(t) {
- return E.model = t, E.model.startup_type === P.STARTPANO && (u = !0, d.quickstart.enabled = !0), E.model.loadPanos()
- }))
- .then((function() {
- y = g.getStartCameraOptions(E.model, E.model.panos, new n.Vector3(0, 0, 0), !0), E.sceneRenderer = function(t) {
- var e = new n.PerspectiveCamera,
- i = new n.Scene,
- r = new n.AmbientLight(16053492, 1);
- i.add(r);
- var o = new n.HemisphereLight(16053492, 4473924, 1);
- return i.add(o), i.skybox = new m, i.add(i.skybox), i.plane = new n.Mesh(new n.PlaneBufferGeometry(1e5, 1e5), new n.RawShaderMaterial({
- side: n.DoubleSide
- })), i.plane.position.y = 0, i.plane.rotateX(-Math.PI / 2), i.plane.material.visible = !1, i.add(i.plane), d.showScreenshotLocations && t.data.images.forEach((function(t) {
- if (t._camera && t._camera._viewpoint) {
- var e = t._camera._viewpoint,
- r = new n.Mesh(new n.BoxGeometry(.3, .3, .3));
- r.position.copy(e.clone()), i.add(r);
- var o = t._camera._viewpoint,
- a = new n.Vector3(0, 0, -1)
- .applyQuaternion(o);
- i.add(new n.ArrowHelper(a, e.clone(), 1, 16711680))
- }
- })), d.showAxis && (i.add(new n.ArrowHelper(new n.Vector3(0, 1, 0), new n.Vector3(0, 0, 0), 1, 255)), i.add(new n.ArrowHelper(new n.Vector3(0, 0, 1), new n.Vector3(0, 0, 0), 1, 16711680)), i.add(new n.ArrowHelper(new n.Vector3(1, 0, 0), new n.Vector3(0, 0, 0), 1, 65280))), new w(i, e, f)
- }(E.model), C = function(t, e, i, n) {
- var l = t ? 1 : 1e3,
- u = new M,
- h = new S({
- concurrentDownloads: c.valueFromHash("tileconc", 4)
- }),
- d = new _,
- f = new a,
- m = new o,
- g = new r(e),
- v = new s(l),
- y = new T;
- return u.init(f), h.init(u), d.init(i, h, u), f.init(h, d, u), f.addModel(n), i.addComponent(p), {
- qualityManager: u,
- panoRenderer: d,
- tileDownloader: h,
- player: g,
- director: m,
- modelManager: f,
- mattertagManager: y,
- displayController: v
- }
- }(u, y.mode, E.sceneRenderer, E.model), E.player = C.player, E.director = C.director, E.mattertagManager = C.mattertagManager, E.tileDownloader = C.tileDownloader, E.qualityManager = C.qualityManager, E.panoRenderer = C.panoRenderer, E.record.init(E.settings.jf), E.model.supportsTiles && E.tileDownloader.start(), u && y.mode !== l.PANORAMA && (u = !1), (u || y.mode === l.PANORAMA) && y.pano && E.emit("enterPoint", y.pano.id);
- var t = null;
- return u && (E.quickstartManager = new x(E.qualityManager, E.sceneRenderer.scene, E.sceneRenderer.camera, E.playContainer), B(E.sceneRenderer, E.playContainer, E.model), t = E.quickstartManager.load(y)
- .then((function() {
- E.sceneRenderer.addComponent(E.quickstartManager), d.autoplay && (E.quickStart = E.quickstartManager.startLanding()), E.sceneRenderer.once(A.AfterRender, (function() {}))
- }))), E.director.sLen = E.model.getSceneLength(), E.emit("initLoading"), E.emit("startLoading", E.model, !0, u, E.settings), e.when(t)
- }))
- .then((function() {
- return k(E.model, E._emitLoadProgress, !u, E.progStruct)
- }))
- .then((function() {
- var e = !1;
- function r() {
- var t, i;
- (e = !0, function(t, e, i, n) {
- var r = i.qualityManager,
- o = i.panoRenderer,
- a = i.tileDownloader,
- s = i.modelManager,
- l = i.player,
- u = i.director,
- h = i.mattertagManager,
- c = i.displayController;
- e.scene.add(t), e.qualityManager = r, t.update();
- var d = {
- camera: e.camera,
- director: u,
- modelManager: s,
- tileDownloader: a,
- panoRenderer: o,
- qualityManager: r,
- mattertagManager: h,
- container: n
- };
- l.init(d), l.setScene(e.scene), u.init(l, s), h.init(s, l, u), c.init(u, l, s, h, n), f.bindEvents(l), e.addComponent(h), e.addComponent(t), e.addComponent(l), e.addComponent(o), e.addComponent(G.R), l.mattertagManager.updateModel()
- }(E.model, E.sceneRenderer, C, E.playContainer), b.init(E.director, E.player), E.sceneRenderer.started || B(E.sceneRenderer, E.playContainer, E.model), u || E.emit("endLoading", y.mode), (t = E.player, E.model, i = y, t.start(i))
- .done((function() {
- if (G.conf.isNewEditVersion && window.parent && (window.parent.flag = 1), G.model.panosUV.find((function(t) {
- return G.player.currentPano ? G.player.currentPano.id == t.id : null
- })) && E.player.currentPano) {
- var t = G.player.currentPano;
- E._emitPanoChange(t, 0), E._emitModeChange(null, E.player.mode), E.player.updateWarpEnded()
- }
- E.director.autoTour()
- })), u && (E.quickstartManager.controls.locked = !1, E.player.control.copy(E.quickstartManager.controls), E.sceneRenderer.removeComponent(E.quickstartManager), E.quickstartManager.destroy()), E.model.supportsTiles) || new v(E.model, E.player)
- .start();
- E.registryEvent(E.model, E.play, E.director), E.panoramaSize.init(E.player.currentPano), E._initEvent(), E.emit("endLoading", y.mode), E.settings.jf && E.settings.jf.dataset && E.settings.jf.dataset.length > 0 && E.settings.jf.enable && (E.playType = "Lecture"), E.model && E.model.steeringWheel && (E.model.steeringWheel.visible = !0), E.sceneRenderer.once(A.AfterRender, (function() {
- E.loadingState = !1, E.emit("afterRender"), E.player.mode === l.PANORAMA && E.model.setEntranceState(!1), E.initMeasure(), G.startEntryPage = !0, E.settings.jf && E.settings.jf.dataset && E.settings.jf.dataset.length > 0 && E.settings.jf.enable && (E.playType = "Lecture"), E.model.steeringWheel && (E.model.steeringWheel.visible = !0)
- }))
- }
- y = g.getStartCameraOptions(E.model, E.model.panos, E.player.position), E.model.data.player_options.show3d ? E.model.startup_type === P.STARTPANO ? y.quickstart = !0 : y.quickstart = u : y.quickstart = !0;
- var o = null;
- if ("guid" === t) {
- var a = !1;
- E.connectEvent(L, {
- init: "connect_init_start",
- init_done: "connect_init_done",
- wait_connect: "connect_wait_connect",
- user_added: "connect_uesr_added",
- bussiness_busy: "connect_call_refuse",
- user_connected: "connect_user_addIn",
- close_connect: "connect_close",
- remote_busy: "connect_remote_operate_busy",
- callsuccess: "connect_call_success"
- }), L.on("init_done", (function() {
- o = setTimeout((function() {
- u ? E.quickStart.done(r) : r(), o = null
- }), 1e3)
- })), L.on("operation", (function(t) {
- E.emit("connect_operation", t)
- })), L.on("close_connect", (function(t) {
- E.emit("connect_identity_update", t)
- })), L.on("identity", (function(t) {
- E.emit("connect_identity_update", t)
- })), L.on("changestate", (function(t) {
- if (o && clearTimeout(o), !e) {
- var i = function(t, e) {
- for (var i = null, n = e.list, r = 0; r < n.length; r++)
- if (n[r].id === t) {
- i = n[r];
- break
- } return i
- }(t.location, E.model.panos);
- y.mode = t.mode, y.pano = i, "panorama" === t.mode ? (y.position = t.position, y.quaternion = (new n.Quaternion)
- .copy(t.rotation)) : "dollhouse" === t.mode ? (y.floorVisibility = t.floorVisibility, y.position = t.position, y.quaternion = (new n.Quaternion)
- .copy(t.rotation)) : "floorplan" === t.mode && (y.floorVisibility = t.floorVisibility, y.position = t.position, y.quaternion = (new n.Quaternion)
- .copy(t.rotation), y.zoom = t.zoom), a ? r() : u ? E.quickStart.done(r) : r()
- }
- }));
- try {
- u && E.quickStart.done((function() {
- a = !0
- })), L.joinChannel(i, E.player.getCurrentState)
- } catch (t) {
- t,
- u ? E.quickStart.done(r) : r()
- }
- } else u ? E.quickStart.done(r) : r()
- }))
- .fail(U.bind(this))
- }, z.prototype.connectEvent = function(t, e) {
- function i(t, e, i) {
- t.on(e, (function() {
- n.emit(i)
- }))
- }
- var n = this;
- for (var r in e) i(t, r, e[r])
- }, z.prototype.registryEvent = function(t, e, i) {
- var n = this;
- this.model.on("floor.changed", this._emitFloorChange), this.model.on("waiting", this._emitSpinnerState), this.model.on("waiting-done", this._emitSpinnerState), this.director.on("tourStop", this._emitStopTour), this.director.on("update.controls", this._emitUpdateTour), this.player.on("PanoAnimation", this._emitPanoChange), this.player.on(C.ModeChanged, this._emitModeChange), this.player.on(C.WarpEnded, (function() {
- var t = n.player.currentPano;
- n._emitPanoChange(t, 0)
- })), this.player.on(C.FlyingEnded, this._emitFlyingEnd), this.player.on(C.Ready, (function() {})), this.player.on(C.PanoChosen, this._emitPnaoChosen), this.player.on(C.RulersMove, this._updatePanorameSize), this.player.on(E.RulersWalk, this._updatePanorameSize), this.player.on(C.EditAddTagHighlight, this._EditAddTagHighligh), this.player.on(E.MoveHighlightsBar, this._emitHighlightsBarChange), this.player.on(E.ClickHighlightsBar, this._emitHighlightsBarChange), this.player.on("hide-right-tools", this._emitHideRightTools), this.player.on("show-right-tools", this._emitShowRightTools), this.player.on("addModelListItem", this._emitAddModelListItem), this.player.on("deletePutModelSuccess", this._emitDeletePutModelSuccess), this.player.on("hidePutModelInfoPanel", this._emitHidePutModelInfoPanel), this.player.on("showLoaddingOfLoadPutModel", this._emitShowLoaddingOfLoadPutModel), this.player.on("hideLoaddingOfLoadPutModel", this._emitHideLoaddingOfLoadPutModel), this.player.on("putModelListLoadingIsOver", this._emitPutModelListLoadingIsOver), this.player.on("resetPutModelInfo", this._emitResetPutModelInfo), this.player.on("setPutModelToolsPosition", this._emitSetPutModelToolsPosition), this.player.on("hidePutModelSetTools", this._emitHidePutModelSetTools), this.player.on("showPutModelSetTools", this._emitShowPutModelSetTools), this.player.on("viewModeTransitioning", this._emitViewModeTransitioning), this.player.on("viewModePanorama", this._emitViewModePanorama), this.player.on("showModelListPanel", this._emitShowModelListPanel), this.player.on("hideModelListPanel", this._emitHideModelListPanel), this.player.on("put-model-follow-mouse", this._emitPutModelFollowMouse), this.player.on("put-model-follow-mouse-over", this._emitPutModelFollowMouseOver), this.player.on("put-model-follow-mouse-cancel", this._emitPutModelFollowMouseCancel), this.player.on("quit-put-mode", this._emitQuitPutMode), this.player.on("view-mode-dollhouse", this._emitViewModeDollhouse), this.player.on("handle-control-panorama-move", this._emitHandleControlPanoramaMove), this.player.on("handle-control-dollhouse-move", this._emitHandleControlDollhouseMove), this.player.on("choosedHumanModel", this._emitChoosedHumanModel), this.player.on("humanModelIsLoaded", this._emitHumanModelIsLoaded), this.player.on("add-human-label", this._emitAddHumanLabel), this.player.on("hide-all-human-label", this._emitHideAllHumanLabel), this.player.on("show-virtual-human-info", this._emitShowVirtualHumanInfo), this.player.on("hide-virtual-human-info", this._emitHideVirtualHumanInfo), this.player.on("choosed-weapon", this._emitChoosedWeapon), this.player.on("putProbeModelComplete", this._emitPutProbeModelComplete), this.player.on("choosed-virtual-camera", this._emitChoosedVirtualCamera), this.player.on("add-virtual-camera-label", this._emitAddVirtualCameraLabel), this.player.on("hide-all-virtual-camera-label", this._emitHideAllVirtualCameraLabel), this.player.on("show-virtual-camera-info", this._emitShowVirtualCameraInfo), this.player.on("hide-virtual-camera-info", this._emitHideVirtualCameraInfo), this.player.on("update-ui-rotate", this._emitUpateUiRoate), this.player.on("choosed-postil", this._emitChoosedPostil), this.player.on("add-postil-item", this._emitAddPostilItem), this.player.on("update-postil-ui", this._emitUpdatePostilUI), this.player.on("hide-postil-set-tool", this._emitHidePostilSetTool), this.player.on("show-delete-dialog-of-postil", this._emitShowDeleteDialogOfPostil), this.player.on("delete-postil-success", this._emitDeletePostilSuccess), this.player.on("show-edit-panel-of-postil", this._emitShowEditPanelOfPostil), this.player.on("show-all-postils", this._emitShowAllPostils), this.player.on("hide-all-postils", this._emitHideAllPostils), this.player.on("edit-confirm", this._emitEditConfirm), this.player.on("update-postil-show", this._emitUpdatePostilShow), this.player.on("get-measurement-info", this._emitGetMeasurementInfo), this.player.on("exitMeasureActive", this._emitExitMeasureActive), this.player.controls[l.PANORAMA].on("move", this._emitMoveState), this.player.controls[l.DOLLHOUSE].on("move", this._emitMoveState), this.player.controls[l.FLOORPLAN].on("move", this._emitMoveState), this.sceneRenderer.on("compass", this._emitAngle), this.record.on("recording", (function() {})), this.record.on("readyToRecord", (function() {})), this.record.on("startRecord", (function() {})), this.record.on("stopRecord", (function() {})), this.record.on("countdown", (function(t) {})), this.record.on("stopRecordCountDown", (function(t) {}));
- var r = this;
- this.record.on("emity", (function() {
- r._emitLectureError("emity")
- })), this.record.on("loadAudio", (function() {
- r._emitLectureLoadAudio("load")
- })), this.record.on("loadAudioDone", (function() {
- r._emitLectureLoadAudio("done")
- })), this.record.on("updateView", (function(t, e) {
- r._emitLectureUpdate(t, e)
- })), this.record.on("housedetail", (function(t) {
- r._emitLectureUI("housedetail", t)
- })), this.record.on("stop", (function() {
- r.emit("lecture", "stop")
- })), this.mattertagManager.on("tagActiveEvent", (function(t) {
- r.emit("tag.active", t)
- })), this.on("afterRender", this._emitFirstRender)
- }, z.prototype._emitFirstRender = function() {
- var t = this.player.mode,
- e = this.player.currentPano;
- this._emitModeChange(null, t), this._emitFlyingEnd(null, null, e, null)
- }, z.prototype._emitLectureError = function(t) {
- this.emit("lectureError", t)
- }, z.prototype._emitLectureLoadAudio = function(t) {
- this.emit("lectureLoadaudio", t)
- }, z.prototype._emitLectureUpdate = function(t, e) {
- this.emit("lectureUpdate", t, e)
- }, z.prototype._emitLectureUI = function(t, e) {
- this.emit("lecutreUI", t, e)
- }, z.prototype._updatePanorameSize = function() {
- this.panoramaSize.enable && this.panoramaSize.update(this.player)
- }, z.prototype._updateMeasure = function() {
- this.Measure.enable && this.Measure.update(this.player)
- }, z.prototype._emitAngle = function(t) {
- var e = {
- angle: t,
- director: t
- };
- this.model.data.orientation_correct && (e.angle += this.model.data.orientation_correct), this.angle = e.director, this.emit("compass", e)
- }, z.prototype._emitHighlightsBarChange = function(t) {
- this.emit("highLightsBarChange", t, this.settings)
- }, z.prototype._EditAddTagHighligh = function(t) {
- G.conf.isNewEditVersion && G.sendTag("data")
- }, z.prototype._emitPnaoChosen = function(t) {
- this.player.mode;
- this.emit("panoChosen", this.player)
- }, z.prototype._emitFlyingEnd = function(t, e, i, n) {
- var r = {};
- if (d.delBK) {
- this.model.currentFloor.floorIndex;
- r.floorUrl = this.model.house_type_url
- }
- r.showArea = this.model.floorplan_enable, d.delBK && i && i.areaName && i.areaSize && (r.areaName = i.areaName, r.areaSize = i.areaSize), this.needsUpdateRadar && (this.needsUpdateRadar = !1, r.showRadar = !0, r.pano = i), this.player.mattertagManager.ttflying = !1, this.player.mattertagManager.updatetitletags(), this.emit("flyingEnd", r), this.player.baseControls && this.player.baseControls.onFlyEnd()
- }, z.prototype._emitClickTag = function(t) {
- t && this.emit("clickTag", t)
- }, z.prototype._emitModeChange = function(t, e) {
- this._updatePanorameSize(), "panorama" === e && (this.needsUpdateRadar = !0), this.emit("modeChange", t, e)
- }, z.prototype._emitPanoChange = function(t, e) {
- var i = this.model.floorplan_enable;
- this.emit("panoChange", {
- pano: t,
- time: e,
- showArea: i
- })
- }, z.prototype._emitStopTour = function() {
- this.emit("stopTour")
- }, z.prototype._emitUpdateTour = function() {
- this.emit("updateTour", this.director.describe())
- }, z.prototype._emitSpinnerState = function() {
- var t = "stopSpinner";
- this.model.waitQueue.length < 0 ? t = "stopSpinner" : this.loadingState || (t = "delayStopSpinner"), this.emit("spinner", t)
- }, z.prototype._emitFloorChange = function(t, e) {
- var i = this.getModelScreenSize(),
- n = {
- mode: e,
- model: this.model,
- project: i,
- floorIndex: t.floorIndex,
- imageUrl: "floorplan" === e ? this.model.getCurrentHouseTypeImage() : ""
- };
- this.model.allFloorsVisible && (n.floorIndex = "all"), this.emit("floorChange", n)
- }, z.prototype._emitMoveState = function() {
- (this.emit("move", this.player), this._updatePanorameSize(), this.player.postilControls && this.player.postilControls.POSTIL) && (this.player.postilControls.POSTIL.userData.follow_mouse || this.player.postilControls.destroyPostilChoosedState())
- }, z.prototype._emitChoosedHumanModel = function(t) {
- this.emit("choosedHumanModel", t)
- }, z.prototype._emitHumanModelIsLoaded = function() {
- this.emit("humanModelIsLoaded", !0)
- }, z.prototype._emitAddModelListItem = function(t) {
- this.emit("addModelListItem", t)
- }, z.prototype._emitDeletePutModelSuccess = function(t) {
- this.emit("deletePutModelSuccess", t)
- }, z.prototype._emitHidePutModelInfoPanel = function() {
- this.emit("hidePutModelInfoPanel")
- }, z.prototype._emitShowLoaddingOfLoadPutModel = function() {
- this.emit("showLoaddingOfLoadPutModel")
- }, z.prototype._emitHideLoaddingOfLoadPutModel = function() {
- this.emit("hideLoaddingOfLoadPutModel")
- }, z.prototype._emitPutModelListLoadingIsOver = function() {
- this.emit("putModelListLoadingIsOver")
- }, z.prototype._emitResetPutModelInfo = function(t) {
- this.emit("resetPutModelInfo", t)
- }, z.prototype._emitSetPutModelToolsPosition = function(t) {
- this.emit("setPutModelToolsPosition", t)
- }, z.prototype._emitShowPutModelSetTools = function(t) {
- this.emit("showPutModelSetTools", t)
- }, z.prototype._emitViewModeTransitioning = function() {
- this.emit("viewModeTransitioning")
- }, z.prototype._emitViewModePanorama = function() {
- this.emit("viewModePanorama")
- }, z.prototype._emitHidePutModelSetTools = function() {
- this.emit("hidePutModelSetTools")
- }, z.prototype._emitShowModelListPanel = function() {
- this.emit("showModelListPanel")
- }, z.prototype._emitHideModelListPanel = function() {
- this.emit("hideModelListPanel")
- }, z.prototype._emitChoosedPostil = function(t) {
- this.emit("choosed-postil", t)
- }, z.prototype._emitAddPostilItem = function(t) {
- this.emit("add-postil-item", t)
- }, z.prototype._emitUpdatePostilUI = function(t) {
- this.emit("update-postil-ui", t)
- }, z.prototype._emitHidePostilSetTool = function() {
- this.emit("hide-postil-set-tool")
- }, z.prototype._emitShowDeleteDialogOfPostil = function(t) {
- this.emit("show-delete-dialog-of-postil", t)
- }, z.prototype._emitDeletePostilSuccess = function(t) {
- this.emit("delete-postil-success", t)
- }, z.prototype._emitShowEditPanelOfPostil = function() {
- this.emit("show-edit-panel-of-postil")
- }, z.prototype._emitShowAllPostils = function(t) {
- this.emit("show-all-postils", t)
- }, z.prototype._emitHideAllPostils = function(t) {
- this.emit("hide-all-postils", t)
- }, z.prototype._emitEditConfirm = function(t) {
- this.emit("edit-confirm", t)
- }, z.prototype._emitEditProbeModel = function(t) {
- this.emit("edit-probe-model", t)
- }, z.prototype._emitPutProbeModelComplete = function(t) {
- this.emit("putProbeModelComplete", t)
- }, z.prototype._emitGetMeasurementInfo = function(t) {
- this.emit("get-measurement-info", t)
- }, z.prototype._emitAddHumanLabel = function(t) {
- this.emit("add-human-label", t)
- }, z.prototype._emitChoosedVirtualCamera = function(t) {
- this.emit("choosed-virtual-camera", t)
- }, z.prototype._emitHideAllHumanLabel = function() {
- this.emit("hide-all-human-label")
- }, z.prototype._emitAddVirtualCameraLabel = function(t) {
- this.emit("add-virtual-camera-label", t)
- }, z.prototype._emitHideAllVirtualCameraLabel = function() {
- this.emit("hide-all-virtual-camera-label")
- }, z.prototype._emitShowVirtualCameraInfo = function(t) {
- this.emit("show-virtual-camera-info", t)
- }, z.prototype._emitHideVirtualCameraInfo = function() {
- this.emit("hide-virtual-camera-info")
- }, z.prototype._emitHideRightTools = function() {
- this.emit("hide-right-tools")
- }, z.prototype._emitShowRightTools = function() {
- this.emit("show-right-tools")
- }, z.prototype._emitPutModelFollowMouse = function() {
- this.emit("put-model-follow-mouse")
- }, z.prototype._emitPutModelFollowMouseOver = function() {
- this.emit("put-model-follow-mouse-over")
- }, z.prototype._emitPutModelFollowMouseCancel = function() {
- this.emit("put-model-follow-mouse-cancel")
- }, z.prototype._emitQuitPutMode = function() {
- this.emit("quit-put-mode")
- }, z.prototype._emitViewModeDollhouse = function() {
- this.emit("view-mode-dollhouse")
- }, z.prototype._emitShowVirtualHumanInfo = function(t) {
- this.emit("show-virtual-human-info", t)
- }, z.prototype._emitHideVirtualHumanInfo = function() {
- this.emit("hide-virtual-human-info")
- }, z.prototype._emitHandleControlPanoramaMove = function() {
- this.emit("handle-control-panorama-move")
- }, z.prototype._emitHandleControlDollhouseMove = function() {
- this.emit("handle-control-dollhouse-move")
- }, z.prototype._emitUpdatePostilShow = function(t) {
- this.emit("update-postil-show", t)
- }, z.prototype._initEvent = function() {
- this.emit("init_UI", this.model), this.emit("load_progress", 100)
- }, z.prototype._emitLoadProgress = function(t) {
- this.emit("load_progress", t)
- }, z.prototype._emitExitMeasureActive = function() {
- this.emit("exitMeasureActive")
- }, z.prototype._emitUpateUiRoate = function(t) {
- this.emit("upateUiRoate", t)
- }, z.prototype._registryKeyEvent = function() {
- var t = this;
- c.isMobile() || (document.addEventListener("keydown", (function(e) {
- switch (e.which) {
- case Keys.ZERO:
- d.debug && t.model.toggleAlpha();
- break;
- case Keys.ONE:
- t.player.model.has360Views && !t.player.isInMode(l.TRANSITIONING) ? t.player.isInMode(l.PANORAMA) && t.player.currentPano.isAligned() || (t.player.controls[l.PANORAMA].emit(E.InteractionKey), t.director.tourIsPlaying ? t.director.stopTour() : t.player.goToLastView(!0)) : t.player.isInMode(l.PANORAMA, l.TRANSITIONING) || t.director.changeMode(l.PANORAMA, "key");
- break;
- case Keys.TWO:
- t.model.outsideAllowed() && !t.player.isInMode(l.DOLLHOUSE, l.TRANSITIONING) && t.director.changeMode(l.DOLLHOUSE, "key");
- break;
- case Keys.THREE:
- t.model.outsideAllowed() && !t.player.isInMode(l.FLOORPLAN, l.TRANSITIONING) && t.director.changeMode(l.FLOORPLAN, "key");
- break;
- case Keys.FOUR:
- t.player.model.has360Views && !t.player.isInMode(l.TRANSITIONING) && (t.player.isInMode(l.PANORAMA) && !t.player.currentPano.isAligned() || (t.player.controls[l.PANORAMA].emit(E.InteractionKey), t.director.tourIsPlaying ? t.director.stopTour() : t.player.goToLastView(!1)));
- break;
- case Keys.SPACE:
- d.debug && t.model.toggleExplode();
- break;
- case Keys.RETURN:
- d.debug && t.model.toggleExplodeUp();
- break;
- case Keys.PLUSEQUALS:
- t.director.player.activatePersistentZooming(!0);
- break;
- case Keys.DASHUNDERSCORE:
- t.director.player.activatePersistentZooming(!1);
- break;
- case Keys.EIGHT:
- t.director.player.decreaseZoomSpeed();
- break;
- case Keys.NINE:
- t.director.player.increaseZoomSpeed()
- }
- return t.player && t.player.reticule.hide(), !0
- })), document.addEventListener("keyup", (function(e) {
- switch (e.which) {
- case Keys.PLUSEQUALS:
- t.director.player.deactivatePersistentZooming();
- break;
- case Keys.DASHUNDERSCORE:
- t.director.player.deactivatePersistentZooming()
- }
- })))
- }, z.prototype.registryOri = function() {
- G.ori = {}, c.isMobile() ? G.ori.flag = !0 : G.ori.flag = !1, G.ori.isHuawei5X = c.detectHUAWEI5X(), G.ori.gamma = -1e3, G.ori.beta = -1e3, G.ori.alpha = -1e3, G.ori.enable = !0, G.ori.orient = n.Math.degToRad(window.orientation || 0), G.orientationHandler = function(t) {
- t.gamma || t.beta || (t.gamma = t.x * (180 / Math.PI), t.beta = t.y * (180 / Math.PI), t.alpha = t.z * (180 / Math.PI));
- var e = t.gamma,
- i = t.beta,
- n = t.alpha;
- t.accelerationIncludingGravity && (e = 10 * event.accelerationIncludingGravity.x, i = 10 * -event.accelerationIncludingGravity.y, n = 10 * event.accelerationIncludingGravity.z), G.ori.gamma = e, G.ori.beta = i, G.ori.alpha = n
- }, G.HorientationChange = function() {
- G.ori.orient = n.Math.degToRad(window.orientation || 0)
- }, G.HdeviceOrientation = function(t) {
- var e = n.Math.degToRad(t.alpha),
- i = n.Math.degToRad(t.beta),
- r = n.Math.degToRad(t.gamma);
- G.ori.isHuawei5X ? (-1e3 == G.ori.alpha && (G.ori.alpha = e), -1e3 == G.ori.beta && (G.ori.beta = i), -1e3 == G.ori.gamma && (G.ori.gamma = r), Math.abs(e - G.ori.alpha) > .06 && (G.ori.alpha = e), Math.abs(i - G.ori.beta) > .006 && (G.ori.beta = i), Math.abs(r - G.ori.gamma) > .006 && (G.ori.gamma = r)) : (G.ori.alpha = e, G.ori.beta = i, G.ori.gamma = r)
- }, window.addEventListener("orientationchange", G.HorientationChange), window.addEventListener("deviceorientation", G.HdeviceOrientation)
- }, z.prototype.getModelScreenSize = function() {
- function t(t, e) {
- var i = (window.renderWidth || window.innerWidth) / 2,
- r = (window.renderHeight || window.innerHeight) / 2,
- o = t.project(e),
- a = Math.round(o.x * i + i),
- s = Math.round(-o.y * r + r);
- return new n.Vector2(a, s)
- }
- var e = this.model.boundingBox,
- i = this.player.camera,
- r = new n.Vector3(e.max.x, 0, e.max.z),
- o = new n.Vector3(e.min.x, 0, e.min.z),
- a = new n.Vector3(e.max.x, 0, e.min.z),
- s = new n.Vector3(e.min.x, 0, e.max.z),
- l = t(r, i),
- u = t(o, i),
- h = t(a, i),
- c = t(s, i),
- d = Math.max(l.x, u.x, h.x, c.x),
- p = Math.min(l.x, u.x, h.x, c.x),
- f = Math.max(l.y, u.y, h.y, c.y),
- m = Math.min(l.y, u.y, h.y, c.y);
- return {
- width: d - p,
- height: f - m,
- top: m,
- left: p
- }
- }, z.prototype.getFloorPlanParam = function() {
- var t = this.getModelScreenSize(),
- e = {
- model: this.model,
- project: t,
- floorIndex: this.model.currentFloor.floorIndex
- };
- return this.player.currentPano && this.player.currentPano.u && (e.radar = {
- uv: {
- u: this.player.currentPano.u,
- v: this.player.currentPano.v
- },
- angle: this.lastCompassAngle
- }), e
- }, z.prototype.loadHumanModel = function(t) {
- this.player.loadHumanModel(t)
- }, z.prototype.loadProbeModel = function() {
- this.player.loadProbeModel(1)
- }, z.prototype.selectPutModel = function(t) {
- this.player.selectPutModel(t)
- }, z.prototype.updatePutModelColor = function(t) {
- this.player.updatePutModelColor(t)
- }, z.prototype.showPutModel = function(t) {
- this.player.showPutModel(t)
- }, z.prototype.hidePutModel = function(t) {
- this.player.hidePutModel(t)
- }, z.prototype.handleClickCompleteBtn = function() {
- this.player.handleClickCompleteBtn()
- }, z.prototype.removePutModel = function(t) {
- this.player.removePutModel(t)
- }, z.prototype.getSettingsDataOfPutModel = function() {
- return JSON.stringify(this.player.SETTINGS_DATA_PUT)
- }, z.prototype.updateCollision = function(t) {
- this.player.updateCollision(t)
- }, z.prototype.loadModelList = function(t, e) {
- this.player.showModelList(t, e)
- }, z.prototype.showModelList = function(t) {
- this.player.showModelList(t)
- }, z.prototype.hideModelList = function() {
- this.player.hideModelList()
- }, z.prototype.updatePutModelName = function(t) {
- this.player.updatePutModelName(t)
- }, z.prototype.resetPutModel = function() {
- this.player.resetPutModel()
- }, z.prototype.updateSizeOfPutModel = function(t) {
- this.player.updateSizeOfPutModel(t)
- }, z.prototype.updatePutModelGroundClearance = function(t) {
- this.player.updatePutModelGroundClearance(t)
- }, z.prototype.updateControlOfPutModel = function(t) {
- this.player.updateControlOfPutModel(t)
- }, z.prototype.showHumanModelBonesNode = function() {
- this.player.showHumanModelBonesNode()
- }, z.prototype.bundleTranslateControlOfPutModel = function() {
- this.player.bundleTranslateControlOfPutModel()
- }, z.prototype.bundleRotateControlOfPutModel = function() {
- this.player.bundleRotateControlOfPutModel()
- }, z.prototype.virtualSetSlideStop = function(t) {
- this.player.virtualSetSlideStop(t)
- }, z.prototype.handleClickModelItem = function(t) {
- this.player.handleClickModelItem(t)
- }, z.prototype.onIntoPutMode = function() {
- this.player.onIntoPutMode()
- }, z.prototype.onQuitPutMode = function() {
- this.player.onQuitPutMode()
- }, z.prototype.onApiQuitPutMode = function() {
- this.player.onApiQuitPutMode()
- }, z.prototype.onIntoEditMode = function() {
- this.player.onIntoEditMode()
- }, z.prototype.onQuitEditMode = function() {
- this.player.onQuitEditMode()
- }, z.prototype.onQuitEditMeasure = function() {
- this.player.onQuitEditMeasure()
- }, z.prototype.onIntoEditMeasure = function() {
- this.player.onIntoEditMeasure()
- }, z.prototype.loadPostilModel = function(t) {
- this.player.loadPostilModel(t)
- }, z.prototype.updatePostilInfo = function(t) {
- this.player.updatePostilInfo(t)
- }, z.prototype.loadPostilsOfSave = function(t) {
- this.player.loadPostilsOfSave(t)
- }, z.prototype.handleDeletePostil = function(t) {
- this.player.removePostil(t)
- }, z.prototype.deletePostilOfConfirm = function(t) {
- this.player.deletePostilOfConfirm(t)
- }, z.prototype.hidePostilsOfSave = function() {
- this.player.hidePostilsOfSave()
- }, z.prototype.loadCameraModel = function(t) {
- this.player.loadVirtualCamera(t)
- }, z.prototype.updateCameraFov = function(t) {
- this.player.updateVirtualCameraFov(t)
- }, z.prototype.updateCameraDistance = function(t) {
- this.player.updateVirtualCameraDistance(t)
- }, z.prototype.updateMiniCameraPosition = function(t) {
- this.player.updateMiniCameraPosition(t)
- }, z.prototype.miniCameraScreenShot = function(t) {
- this.player.miniCameraScreenShot(t)
- }, z.prototype.changeMode = function(t) {
- if (!1 === this.model.data.player_options.show3d) return !1;
- "floorplan" === t && (this.lastCompassAngle = this.angle), this.director.changeMode(t)
- }, z.prototype.play = function(t) {
- if (this.disablePanramaSize(), "Lecture" === this.playType) this.record.pplay(t);
- else if (this.settings.nestscenes && this.settings.nestscenes.scenes && this.settings.nestscenes.scenes.length > 0) {
- var e = 0;
- this.model.enableTagMovie && (e = 1), G.playing = !0, this.director.currentScript = e, this.director.playTour()
- }
- }, z.prototype.pause = function() {
- "Lecture" === this.playType ? this.record.ppause() : this.settings.nestscenes && this.settings.nestscenes.scenes && this.settings.nestscenes.scenes.length > 0 && (this.director.stopTour(), G.playing = !1)
- }, z.prototype.enterVR = function() {
- return "panorama" === this.player.mode && (!!c.isMobile() && (this.sceneRenderer.vrEnabled = !0, G.ori.flag = !0, !0))
- }, z.prototype.exitVR = function() {
- this.sceneRenderer.vrEnabled = !1, G.ori.flag = !1
- }, z.prototype.gotoFloor = function(t) {
- "all" === t ? this.director.allFloors() : this.director.gotoFloor(t)
- }, z.prototype.mute = function() {
- L.setMute(!0)
- }, z.prototype.unmute = function() {
- L.setMute(!1)
- }, z.prototype.disableTag = function() {
- this.player.mattertagManager.showtitletags = !1, this.player.mattertagManager.updatetitletags(), this.player.mattertagManager.hideAllMattertags(10, 10)
- }, z.prototype.enableTag = function() {
- this.player.mattertagManager.showtitletags = !0, this.player.mattertagManager.updatetitletags(), this.player.mattertagManager.showAllMattertags(10, 10)
- }, z.prototype.warpToPanoByTagId = function(t) {
- var e = t.tagId,
- i = t.openTag,
- r = this,
- o = this.player.model.getTagByTagid(e),
- a = this.player.model.panos.index[o.data.locationid];
- if (e) {
- var s = o.position.clone(),
- l = new n.Matrix4;
- l.lookAt(a.position, s, new n.Vector3(0, 0, -1)), a.quaternion = (new n.Quaternion)
- .setFromRotationMatrix(l)
- }
- var u = null;
- i && (u = function() {
- r.openTag(o)
- }), this.player.warpToPanoById(o.data.locationid, a.quaternion, null, null, "black", 1, 500, u)
- }, z.prototype.openTag = function(t) {
- var e = this;
- setTimeout((function() {
- e.player.mattertagManager.openTag(t)
- }), 1e3)
- }, z.prototype.disablePanramaSize = function() {
- this.panoramaSize.setEnable(!1)
- }, z.prototype.enablePanramaSize = function() {
- this.panoramaSize.setEnable(!0), this.panoramaSize.update(this.player)
- }, z.prototype.initMeasure = function() {
- this.player.initMeasure()
- }, z.prototype.enableMeasure = function(t) {
- this.player.setMeasureEnable(t)
- }, z.prototype.manipulateMeasure = function(t, e, i) {
- switch (t) {
- case "show":
- this.player.showMeasure(e);
- break;
- case "hide":
- this.player.hideMeasure(e);
- break;
- case "showAll":
- this.player.showAllMeasure();
- break;
- case "hideAll":
- this.player.hideAllMeasure();
- break;
- case "delete":
- this.player.deleteMeasure(e);
- break;
- case "changeName":
- this.player.changeMeasureName(e, i);
- break;
- case "changeUnit":
- this.player.changeUnit(e);
- break;
- case "clicked":
- this.player.clickedOnMeasure(e);
- break;
- case "disClicked":
- this.player.disOnMeasure(e);
- break;
- case "setAutoFit":
- this.player.setAutoFit(e);
- break;
- case "setMeasureArea":
- this.player.setMeasureArea(e)
- }
- }, z.prototype.gotoScenebyId = function(t) {
- this.director.goToHighlight(t)
- }, z.prototype.getCurrentState = function() {
- return {
- panoSize: this.panoramaSize.enable
- }
- }, z.prototype.setPlaySpeed = function(t) {
- var e = "";
- switch (t) {
- case 1:
- e = "0.3x";
- break;
- case 2:
- e = "0.5x";
- break;
- case 3:
- e = "1.0x";
- break;
- case 4:
- e = "1.5x";
- break;
- case 5:
- e = "2.0x";
- break;
- default:
- e = "1.0x"
- }
- this.player.setSpeedMultiplier(e)
- }, z.prototype.screenshot = function(t) {
- var e = this,
- i = this.player.reticule;
- i.hidden = !0, i.material.uniforms.opacity.value = 0, this.model.panos.list.forEach((function(t) {
- t.marker && (t.marker.material.opacity = 0)
- })), setTimeout((function() {
- var i = document.getElementsByTagName("canvas")[0],
- n = document.createElement("canvas");
- n.width = i.width, n.height = i.height;
- var r = n.getContext("2d");
- r.drawImage(i, 0, 0, i.width, i.height), r.scale(.5, .5), t({
- img: n.toDataURL("image/png"),
- location: e.player.currentPano.id,
- position: {
- x: e.player.camera.quaternion.x,
- y: e.player.camera.quaternion.y,
- z: e.player.camera.quaternion.z,
- w: e.player.camera.quaternion.w
- }
- }), e.model.panos.list.forEach((function(t) {
- t.marker && (t.marker.material.opacity = 1)
- }))
- }), 1e3)
- }, z.prototype.gotoScene = function(t) {
- var e = {},
- i = t.position,
- r = t.location,
- o = this.model.panos.index[r];
- e.pano = o;
- var a = new n.Vector3(0, 0, -1);
- a.applyQuaternion(i), a.add(o.position), e.lookAtPoint = a, this.player.flyToPano(e)
- }, z.prototype.addModel = function(t) {
- this.player.addModel(t)
- }, z.prototype.setModelPose = function(t) {
- this.player.addModel(t)
- }, t.exports = z
- })
- .call(this, i(6))
- }, function(t, e, i) {
- ! function(t) {
- "use strict";
- function e(t) {
- return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)
- }
- function i(t, e) {
- return t & e
- }
- function n(t, e) {
- return t | e
- }
- function r(t, e) {
- return t ^ e
- }
- function o(t, e) {
- return t & ~e
- }
- function a(t) {
- if (0 == t) return -1;
- var e = 0;
- return 0 == (65535 & t) && (t >>= 16, e += 16), 0 == (255 & t) && (t >>= 8, e += 8), 0 == (15 & t) && (t >>= 4, e += 4), 0 == (3 & t) && (t >>= 2, e += 2), 0 == (1 & t) && ++e, e
- }
- function s(t) {
- for (var e = 0; 0 != t;) t &= t - 1, ++e;
- return e
- }
- var l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- function u(t) {
- var e, i, n = "";
- for (e = 0; e + 3 <= t.length; e += 3) i = parseInt(t.substring(e, e + 3), 16), n += l.charAt(i >> 6) + l.charAt(63 & i);
- for (e + 1 == t.length ? (i = parseInt(t.substring(e, e + 1), 16), n += l.charAt(i << 2)) : e + 2 == t.length && (i = parseInt(t.substring(e, e + 2), 16), n += l.charAt(i >> 2) + l.charAt((3 & i) << 4));
- (3 & n.length) > 0;) n += "=";
- return n
- }
- function h(t) {
- var i, n = "",
- r = 0,
- o = 0;
- for (i = 0; i < t.length && "=" != t.charAt(i); ++i) {
- var a = l.indexOf(t.charAt(i));
- a < 0 || (0 == r ? (n += e(a >> 2), o = 3 & a, r = 1) : 1 == r ? (n += e(o << 2 | a >> 4), o = 15 & a, r = 2) : 2 == r ? (n += e(o), n += e(a >> 2), o = 3 & a, r = 3) : (n += e(o << 2 | a >> 4), n += e(15 & a), r = 0))
- }
- return 1 == r && (n += e(o << 2)), n
- }
- var c, d, p = function(t, e) {
- return (p = Object.setPrototypeOf || {
- __proto__: []
- }
- instanceof Array && function(t, e) {
- t.__proto__ = e
- } || function(t, e) {
- for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i])
- })(t, e)
- },
- f = function(t) {
- var e;
- if (void 0 === c) {
- var i = "0123456789ABCDEF";
- for (c = {}, e = 0; e < 16; ++e) c[i.charAt(e)] = e;
- for (i = i.toLowerCase(), e = 10; e < 16; ++e) c[i.charAt(e)] = e;
- for (e = 0; e < " \f\n\r\t \u2028\u2029".length; ++e) c[" \f\n\r\t \u2028\u2029".charAt(e)] = -1
- }
- var n = [],
- r = 0,
- o = 0;
- for (e = 0; e < t.length; ++e) {
- var a = t.charAt(e);
- if ("=" == a) break;
- if (-1 != (a = c[a])) {
- if (void 0 === a) throw new Error("Illegal character at offset " + e);
- r |= a, ++o >= 2 ? (n[n.length] = r, r = 0, o = 0) : r <<= 4
- }
- }
- if (o) throw new Error("Hex encoding incomplete: 4 bits missing");
- return n
- },
- m = {
- decode: function(t) {
- var e;
- if (void 0 === d) {
- for (d = Object.create(null), e = 0; e < 64; ++e) d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)] = e;
- for (e = 0; e < "= \f\n\r\t \u2028\u2029".length; ++e) d["= \f\n\r\t \u2028\u2029".charAt(e)] = -1
- }
- var i = [],
- n = 0,
- r = 0;
- for (e = 0; e < t.length; ++e) {
- var o = t.charAt(e);
- if ("=" == o) break;
- if (-1 != (o = d[o])) {
- if (void 0 === o) throw new Error("Illegal character at offset " + e);
- n |= o, ++r >= 4 ? (i[i.length] = n >> 16, i[i.length] = n >> 8 & 255, i[i.length] = 255 & n, n = 0, r = 0) : n <<= 6
- }
- }
- switch (r) {
- case 1:
- throw new Error("Base64 encoding incomplete: at least 2 bits missing");
- case 2:
- i[i.length] = n >> 10;
- break;
- case 3:
- i[i.length] = n >> 16, i[i.length] = n >> 8 & 255
- }
- return i
- },
- re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
- unarmor: function(t) {
- var e = m.re.exec(t);
- if (e)
- if (e[1]) t = e[1];
- else {
- if (!e[2]) throw new Error("RegExp out of sync");
- t = e[2]
- } return m.decode(t)
- }
- },
- g = 1e13,
- v = function() {
- function t(t) {
- this.buf = [+t || 0]
- }
- return t.prototype.mulAdd = function(t, e) {
- var i, n, r = this.buf,
- o = r.length;
- for (i = 0; i < o; ++i)(n = r[i] * t + e) < g ? e = 0 : n -= (e = 0 | n / g) * g, r[i] = n;
- e > 0 && (r[i] = e)
- }, t.prototype.sub = function(t) {
- var e, i, n = this.buf,
- r = n.length;
- for (e = 0; e < r; ++e)(i = n[e] - t) < 0 ? (i += g, t = 1) : t = 0, n[e] = i;
- for (; 0 === n[n.length - 1];) n.pop()
- }, t.prototype.toString = function(t) {
- if (10 != (t || 10)) throw new Error("only base 10 is supported");
- for (var e = this.buf, i = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n) i += (g + e[n])
- .toString()
- .substring(1);
- return i
- }, t.prototype.valueOf = function() {
- for (var t = this.buf, e = 0, i = t.length - 1; i >= 0; --i) e = e * g + t[i];
- return e
- }, t.prototype.simplify = function() {
- var t = this.buf;
- return 1 == t.length ? t[0] : this
- }, t
- }(),
- y = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
- b = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
- function w(t, e) {
- return t.length > e && (t = t.substring(0, e) + "…"), t
- }
- var x, M = function() {
- function t(e, i) {
- this.hexDigits = "0123456789ABCDEF", e instanceof t ? (this.enc = e.enc, this.pos = e.pos) : (this.enc = e, this.pos = i)
- }
- return t.prototype.get = function(t) {
- if (void 0 === t && (t = this.pos++), t >= this.enc.length) throw new Error("Requesting byte offset " + t + " on a stream of length " + this.enc.length);
- return "string" == typeof this.enc ? this.enc.charCodeAt(t) : this.enc[t]
- }, t.prototype.hexByte = function(t) {
- return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
- }, t.prototype.hexDump = function(t, e, i) {
- for (var n = "", r = t; r < e; ++r)
- if (n += this.hexByte(this.get(r)), !0 !== i) switch (15 & r) {
- case 7:
- n += " ";
- break;
- case 15:
- n += "\n";
- break;
- default:
- n += " "
- }
- return n
- }, t.prototype.isASCII = function(t, e) {
- for (var i = t; i < e; ++i) {
- var n = this.get(i);
- if (n < 32 || n > 176) return !1
- }
- return !0
- }, t.prototype.parseStringISO = function(t, e) {
- for (var i = "", n = t; n < e; ++n) i += String.fromCharCode(this.get(n));
- return i
- }, t.prototype.parseStringUTF = function(t, e) {
- for (var i = "", n = t; n < e;) {
- var r = this.get(n++);
- i += r < 128 ? String.fromCharCode(r) : r > 191 && r < 224 ? String.fromCharCode((31 & r) << 6 | 63 & this.get(n++)) : String.fromCharCode((15 & r) << 12 | (63 & this.get(n++)) << 6 | 63 & this.get(n++))
- }
- return i
- }, t.prototype.parseStringBMP = function(t, e) {
- for (var i, n, r = "", o = t; o < e;) i = this.get(o++), n = this.get(o++), r += String.fromCharCode(i << 8 | n);
- return r
- }, t.prototype.parseTime = function(t, e, i) {
- var n = this.parseStringISO(t, e),
- r = (i ? y : b)
- .exec(n);
- return r ? (i && (r[1] = +r[1], r[1] += +r[1] < 70 ? 2e3 : 1900), n = r[1] + "-" + r[2] + "-" + r[3] + " " + r[4], r[5] && (n += ":" + r[5], r[6] && (n += ":" + r[6], r[7] && (n += "." + r[7]))), r[8] && (n += " UTC", "Z" != r[8] && (n += r[8], r[9] && (n += ":" + r[9]))), n) : "Unrecognized time: " + n
- }, t.prototype.parseInteger = function(t, e) {
- for (var i, n = this.get(t), r = n > 127, o = r ? 255 : 0, a = ""; n == o && ++t < e;) n = this.get(t);
- if (0 == (i = e - t)) return r ? -1 : 0;
- if (i > 4) {
- for (a = n, i <<= 3; 0 == (128 & (+a ^ o));) a = +a << 1, --i;
- a = "(" + i + " bit)\n"
- }
- r && (n -= 256);
- for (var s = new v(n), l = t + 1; l < e; ++l) s.mulAdd(256, this.get(l));
- return a + s.toString()
- }, t.prototype.parseBitString = function(t, e, i) {
- for (var n = this.get(t), r = "(" + ((e - t - 1 << 3) - n) + " bit)\n", o = "", a = t + 1; a < e; ++a) {
- for (var s = this.get(a), l = a == e - 1 ? n : 0, u = 7; u >= l; --u) o += s >> u & 1 ? "1" : "0";
- if (o.length > i) return r + w(o, i)
- }
- return r + o
- }, t.prototype.parseOctetString = function(t, e, i) {
- if (this.isASCII(t, e)) return w(this.parseStringISO(t, e), i);
- var n = e - t,
- r = "(" + n + " byte)\n";
- n > (i /= 2) && (e = t + i);
- for (var o = t; o < e; ++o) r += this.hexByte(this.get(o));
- return n > i && (r += "…"), r
- }, t.prototype.parseOID = function(t, e, i) {
- for (var n = "", r = new v, o = 0, a = t; a < e; ++a) {
- var s = this.get(a);
- if (r.mulAdd(128, 127 & s), o += 7, !(128 & s)) {
- if ("" === n)
- if ((r = r.simplify()) instanceof v) r.sub(80), n = "2." + r.toString();
- else {
- var l = r < 80 ? r < 40 ? 0 : 1 : 2;
- n = l + "." + (r - 40 * l)
- }
- else n += "." + r.toString();
- if (n.length > i) return w(n, i);
- r = new v, o = 0
- }
- }
- return o > 0 && (n += ".incomplete"), n
- }, t
- }(),
- T = function() {
- function t(t, e, i, n, r) {
- if (!(n instanceof S)) throw new Error("Invalid tag value.");
- this.stream = t, this.header = e, this.length = i, this.tag = n, this.sub = r
- }
- return t.prototype.typeName = function() {
- switch (this.tag.tagClass) {
- case 0:
- switch (this.tag.tagNumber) {
- case 0:
- return "EOC";
- case 1:
- return "BOOLEAN";
- case 2:
- return "INTEGER";
- case 3:
- return "BIT_STRING";
- case 4:
- return "OCTET_STRING";
- case 5:
- return "NULL";
- case 6:
- return "OBJECT_IDENTIFIER";
- case 7:
- return "ObjectDescriptor";
- case 8:
- return "EXTERNAL";
- case 9:
- return "REAL";
- case 10:
- return "ENUMERATED";
- case 11:
- return "EMBEDDED_PDV";
- case 12:
- return "UTF8String";
- case 16:
- return "SEQUENCE";
- case 17:
- return "SET";
- case 18:
- return "NumericString";
- case 19:
- return "PrintableString";
- case 20:
- return "TeletexString";
- case 21:
- return "VideotexString";
- case 22:
- return "IA5String";
- case 23:
- return "UTCTime";
- case 24:
- return "GeneralizedTime";
- case 25:
- return "GraphicString";
- case 26:
- return "VisibleString";
- case 27:
- return "GeneralString";
- case 28:
- return "UniversalString";
- case 30:
- return "BMPString"
- }
- return "Universal_" + this.tag.tagNumber.toString();
- case 1:
- return "Application_" + this.tag.tagNumber.toString();
- case 2:
- return "[" + this.tag.tagNumber.toString() + "]";
- case 3:
- return "Private_" + this.tag.tagNumber.toString()
- }
- }, t.prototype.content = function(t) {
- if (void 0 === this.tag) return null;
- void 0 === t && (t = 1 / 0);
- var e = this.posContent(),
- i = Math.abs(this.length);
- if (!this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t);
- switch (this.tag.tagNumber) {
- case 1:
- return 0 === this.stream.get(e) ? "false" : "true";
- case 2:
- return this.stream.parseInteger(e, e + i);
- case 3:
- return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(e, e + i, t);
- case 4:
- return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t);
- case 6:
- return this.stream.parseOID(e, e + i, t);
- case 16:
- case 17:
- return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";
- case 12:
- return w(this.stream.parseStringUTF(e, e + i), t);
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 26:
- return w(this.stream.parseStringISO(e, e + i), t);
- case 30:
- return w(this.stream.parseStringBMP(e, e + i), t);
- case 23:
- case 24:
- return this.stream.parseTime(e, e + i, 23 == this.tag.tagNumber)
- }
- return null
- }, t.prototype.toString = function() {
- return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]"
- }, t.prototype.toPrettyString = function(t) {
- void 0 === t && (t = "");
- var e = t + this.typeName() + " @" + this.stream.pos;
- if (this.length >= 0 && (e += "+"), e += this.length, this.tag.tagConstructed ? e += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (e += " (encapsulates)"), e += "\n", null !== this.sub) {
- t += " ";
- for (var i = 0, n = this.sub.length; i < n; ++i) e += this.sub[i].toPrettyString(t)
- }
- return e
- }, t.prototype.posStart = function() {
- return this.stream.pos
- }, t.prototype.posContent = function() {
- return this.stream.pos + this.header
- }, t.prototype.posEnd = function() {
- return this.stream.pos + this.header + Math.abs(this.length)
- }, t.prototype.toHexString = function() {
- return this.stream.hexDump(this.posStart(), this.posEnd(), !0)
- }, t.decodeLength = function(t) {
- var e = t.get(),
- i = 127 & e;
- if (i == e) return i;
- if (i > 6) throw new Error("Length over 48 bits not supported at position " + (t.pos - 1));
- if (0 === i) return null;
- e = 0;
- for (var n = 0; n < i; ++n) e = 256 * e + t.get();
- return e
- }, t.prototype.getHexStringValue = function() {
- var t = this.toHexString(),
- e = 2 * this.header,
- i = 2 * this.length;
- return t.substr(e, i)
- }, t.decode = function(e) {
- var i;
- i = e instanceof M ? e : new M(e, 0);
- var n = new M(i),
- r = new S(i),
- o = t.decodeLength(i),
- a = i.pos,
- s = a - n.pos,
- l = null,
- u = function() {
- var e = [];
- if (null !== o) {
- for (var n = a + o; i.pos < n;) e[e.length] = t.decode(i);
- if (i.pos != n) throw new Error("Content size is not correct for container starting at offset " + a)
- } else try {
- for (;;) {
- var r = t.decode(i);
- if (r.tag.isEOC()) break;
- e[e.length] = r
- }
- o = a - i.pos
- } catch (t) {
- throw new Error("Exception while decoding undefined length content: " + t)
- }
- return e
- };
- if (r.tagConstructed) l = u();
- else if (r.isUniversal() && (3 == r.tagNumber || 4 == r.tagNumber)) try {
- if (3 == r.tagNumber && 0 != i.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
- l = u();
- for (var h = 0; h < l.length; ++h)
- if (l[h].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.")
- } catch (t) {
- l = null
- }
- if (null === l) {
- if (null === o) throw new Error("We can't skip over an invalid tag with undefined length at offset " + a);
- i.pos = a + Math.abs(o)
- }
- return new t(n, s, o, r, l)
- }, t
- }(),
- S = function() {
- function t(t) {
- var e = t.get();
- if (this.tagClass = e >> 6, this.tagConstructed = 0 != (32 & e), this.tagNumber = 31 & e, 31 == this.tagNumber) {
- var i = new v;
- do {
- e = t.get(), i.mulAdd(128, 127 & e)
- } while (128 & e);
- this.tagNumber = i.simplify()
- }
- }
- return t.prototype.isUniversal = function() {
- return 0 === this.tagClass
- }, t.prototype.isEOC = function() {
- return 0 === this.tagClass && 0 === this.tagNumber
- }, t
- }(),
- _ = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
- A = (1 << 26) / _[_.length - 1],
- P = function() {
- function t(t, e, i) {
- null != t && ("number" == typeof t ? this.fromNumber(t, e, i) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
- }
- return t.prototype.toString = function(t) {
- if (this.s < 0) return "-" + this.negate()
- .toString(t);
- var i;
- if (16 == t) i = 4;
- else if (8 == t) i = 3;
- else if (2 == t) i = 1;
- else if (32 == t) i = 5;
- else {
- if (4 != t) return this.toRadix(t);
- i = 2
- }
- var n, r = (1 << i) - 1,
- o = !1,
- a = "",
- s = this.t,
- l = this.DB - s * this.DB % i;
- if (s-- > 0)
- for (l < this.DB && (n = this[s] >> l) > 0 && (o = !0, a = e(n)); s >= 0;) l < i ? (n = (this[s] & (1 << l) - 1) << i - l, n |= this[--s] >> (l += this.DB - i)) : (n = this[s] >> (l -= i) & r, l <= 0 && (l += this.DB, --s)), n > 0 && (o = !0), o && (a += e(n));
- return o ? a : "0"
- }, t.prototype.negate = function() {
- var e = O();
- return t.ZERO.subTo(this, e), e
- }, t.prototype.abs = function() {
- return this.s < 0 ? this.negate() : this
- }, t.prototype.compareTo = function(t) {
- var e = this.s - t.s;
- if (0 != e) return e;
- var i = this.t;
- if (0 != (e = i - t.t)) return this.s < 0 ? -e : e;
- for (; --i >= 0;)
- if (0 != (e = this[i] - t[i])) return e;
- return 0
- }, t.prototype.bitLength = function() {
- return this.t <= 0 ? 0 : this.DB * (this.t - 1) + z(this[this.t - 1] ^ this.s & this.DM)
- }, t.prototype.mod = function(e) {
- var i = O();
- return this.abs()
- .divRemTo(e, null, i), this.s < 0 && i.compareTo(t.ZERO) > 0 && e.subTo(i, i), i
- }, t.prototype.modPowInt = function(t, e) {
- var i;
- return i = t < 256 || e.isEven() ? new E(e) : new D(e), this.exp(t, i)
- }, t.prototype.clone = function() {
- var t = O();
- return this.copyTo(t), t
- }, t.prototype.intValue = function() {
- if (this.s < 0) {
- if (1 == this.t) return this[0] - this.DV;
- if (0 == this.t) return -1
- } else {
- if (1 == this.t) return this[0];
- if (0 == this.t) return 0
- }
- return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
- }, t.prototype.byteValue = function() {
- return 0 == this.t ? this.s : this[0] << 24 >> 24
- }, t.prototype.shortValue = function() {
- return 0 == this.t ? this.s : this[0] << 16 >> 16
- }, t.prototype.signum = function() {
- return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
- }, t.prototype.toByteArray = function() {
- var t = this.t,
- e = [];
- e[0] = this.s;
- var i, n = this.DB - t * this.DB % 8,
- r = 0;
- if (t-- > 0)
- for (n < this.DB && (i = this[t] >> n) != (this.s & this.DM) >> n && (e[r++] = i | this.s << this.DB - n); t >= 0;) n < 8 ? (i = (this[t] & (1 << n) - 1) << 8 - n, i |= this[--t] >> (n += this.DB - 8)) : (i = this[t] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --t)), 0 != (128 & i) && (i |= -256), 0 == r && (128 & this.s) != (128 & i) && ++r, (r > 0 || i != this.s) && (e[r++] = i);
- return e
- }, t.prototype.equals = function(t) {
- return 0 == this.compareTo(t)
- }, t.prototype.min = function(t) {
- return this.compareTo(t) < 0 ? this : t
- }, t.prototype.max = function(t) {
- return this.compareTo(t) > 0 ? this : t
- }, t.prototype.and = function(t) {
- var e = O();
- return this.bitwiseTo(t, i, e), e
- }, t.prototype.or = function(t) {
- var e = O();
- return this.bitwiseTo(t, n, e), e
- }, t.prototype.xor = function(t) {
- var e = O();
- return this.bitwiseTo(t, r, e), e
- }, t.prototype.andNot = function(t) {
- var e = O();
- return this.bitwiseTo(t, o, e), e
- }, t.prototype.not = function() {
- for (var t = O(), e = 0; e < this.t; ++e) t[e] = this.DM & ~this[e];
- return t.t = this.t, t.s = ~this.s, t
- }, t.prototype.shiftLeft = function(t) {
- var e = O();
- return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e
- }, t.prototype.shiftRight = function(t) {
- var e = O();
- return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e
- }, t.prototype.getLowestSetBit = function() {
- for (var t = 0; t < this.t; ++t)
- if (0 != this[t]) return t * this.DB + a(this[t]);
- return this.s < 0 ? this.t * this.DB : -1
- }, t.prototype.bitCount = function() {
- for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i) t += s(this[i] ^ e);
- return t
- }, t.prototype.testBit = function(t) {
- var e = Math.floor(t / this.DB);
- return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB)
- }, t.prototype.setBit = function(t) {
- return this.changeBit(t, n)
- }, t.prototype.clearBit = function(t) {
- return this.changeBit(t, o)
- }, t.prototype.flipBit = function(t) {
- return this.changeBit(t, r)
- }, t.prototype.add = function(t) {
- var e = O();
- return this.addTo(t, e), e
- }, t.prototype.subtract = function(t) {
- var e = O();
- return this.subTo(t, e), e
- }, t.prototype.multiply = function(t) {
- var e = O();
- return this.multiplyTo(t, e), e
- }, t.prototype.divide = function(t) {
- var e = O();
- return this.divRemTo(t, e, null), e
- }, t.prototype.remainder = function(t) {
- var e = O();
- return this.divRemTo(t, null, e), e
- }, t.prototype.divideAndRemainder = function(t) {
- var e = O(),
- i = O();
- return this.divRemTo(t, e, i), [e, i]
- }, t.prototype.modPow = function(t, e) {
- var i, n, r = t.bitLength(),
- o = B(1);
- if (r <= 0) return o;
- i = r < 18 ? 1 : r < 48 ? 3 : r < 144 ? 4 : r < 768 ? 5 : 6, n = r < 8 ? new E(e) : e.isEven() ? new L(e) : new D(e);
- var a = [],
- s = 3,
- l = i - 1,
- u = (1 << i) - 1;
- if (a[1] = n.convert(this), i > 1) {
- var h = O();
- for (n.sqrTo(a[1], h); s <= u;) a[s] = O(), n.mulTo(h, a[s - 2], a[s]), s += 2
- }
- var c, d, p = t.t - 1,
- f = !0,
- m = O();
- for (r = z(t[p]) - 1; p >= 0;) {
- for (r >= l ? c = t[p] >> r - l & u : (c = (t[p] & (1 << r + 1) - 1) << l - r, p > 0 && (c |= t[p - 1] >> this.DB + r - l)), s = i; 0 == (1 & c);) c >>= 1, --s;
- if ((r -= s) < 0 && (r += this.DB, --p), f) a[c].copyTo(o), f = !1;
- else {
- for (; s > 1;) n.sqrTo(o, m), n.sqrTo(m, o), s -= 2;
- s > 0 ? n.sqrTo(o, m) : (d = o, o = m, m = d), n.mulTo(m, a[c], o)
- }
- for (; p >= 0 && 0 == (t[p] & 1 << r);) n.sqrTo(o, m), d = o, o = m, m = d, --r < 0 && (r = this.DB - 1, --p)
- }
- return n.revert(o)
- }, t.prototype.modInverse = function(e) {
- var i = e.isEven();
- if (this.isEven() && i || 0 == e.signum()) return t.ZERO;
- for (var n = e.clone(), r = this.clone(), o = B(1), a = B(0), s = B(0), l = B(1); 0 != n.signum();) {
- for (; n.isEven();) n.rShiftTo(1, n), i ? (o.isEven() && a.isEven() || (o.addTo(this, o), a.subTo(e, a)), o.rShiftTo(1, o)) : a.isEven() || a.subTo(e, a), a.rShiftTo(1, a);
- for (; r.isEven();) r.rShiftTo(1, r), i ? (s.isEven() && l.isEven() || (s.addTo(this, s), l.subTo(e, l)), s.rShiftTo(1, s)) : l.isEven() || l.subTo(e, l), l.rShiftTo(1, l);
- n.compareTo(r) >= 0 ? (n.subTo(r, n), i && o.subTo(s, o), a.subTo(l, a)) : (r.subTo(n, r), i && s.subTo(o, s), l.subTo(a, l))
- }
- return 0 != r.compareTo(t.ONE) ? t.ZERO : l.compareTo(e) >= 0 ? l.subtract(e) : l.signum() < 0 ? (l.addTo(e, l), l.signum() < 0 ? l.add(e) : l) : l
- }, t.prototype.pow = function(t) {
- return this.exp(t, new C)
- }, t.prototype.gcd = function(t) {
- var e = this.s < 0 ? this.negate() : this.clone(),
- i = t.s < 0 ? t.negate() : t.clone();
- if (e.compareTo(i) < 0) {
- var n = e;
- e = i, i = n
- }
- var r = e.getLowestSetBit(),
- o = i.getLowestSetBit();
- if (o < 0) return e;
- for (r < o && (o = r), o > 0 && (e.rShiftTo(o, e), i.rShiftTo(o, i)); e.signum() > 0;)(r = e.getLowestSetBit()) > 0 && e.rShiftTo(r, e), (r = i.getLowestSetBit()) > 0 && i.rShiftTo(r, i), e.compareTo(i) >= 0 ? (e.subTo(i, e), e.rShiftTo(1, e)) : (i.subTo(e, i), i.rShiftTo(1, i));
- return o > 0 && i.lShiftTo(o, i), i
- }, t.prototype.isProbablePrime = function(t) {
- var e, i = this.abs();
- if (1 == i.t && i[0] <= _[_.length - 1]) {
- for (e = 0; e < _.length; ++e)
- if (i[0] == _[e]) return !0;
- return !1
- }
- if (i.isEven()) return !1;
- for (e = 1; e < _.length;) {
- for (var n = _[e], r = e + 1; r < _.length && n < A;) n *= _[r++];
- for (n = i.modInt(n); e < r;)
- if (n % _[e++] == 0) return !1
- }
- return i.millerRabin(t)
- }, t.prototype.copyTo = function(t) {
- for (var e = this.t - 1; e >= 0; --e) t[e] = this[e];
- t.t = this.t, t.s = this.s
- }, t.prototype.fromInt = function(t) {
- this.t = 1, this.s = t < 0 ? -1 : 0, t > 0 ? this[0] = t : t < -1 ? this[0] = t + this.DV : this.t = 0
- }, t.prototype.fromString = function(e, i) {
- var n;
- if (16 == i) n = 4;
- else if (8 == i) n = 3;
- else if (256 == i) n = 8;
- else if (2 == i) n = 1;
- else if (32 == i) n = 5;
- else {
- if (4 != i) return void this.fromRadix(e, i);
- n = 2
- }
- this.t = 0, this.s = 0;
- for (var r = e.length, o = !1, a = 0; --r >= 0;) {
- var s = 8 == n ? 255 & +e[r] : F(e, r);
- s < 0 ? "-" == e.charAt(r) && (o = !0) : (o = !1, 0 == a ? this[this.t++] = s : a + n > this.DB ? (this[this.t - 1] |= (s & (1 << this.DB - a) - 1) << a, this[this.t++] = s >> this.DB - a) : this[this.t - 1] |= s << a, (a += n) >= this.DB && (a -= this.DB))
- }
- 8 == n && 0 != (128 & +e[0]) && (this.s = -1, a > 0 && (this[this.t - 1] |= (1 << this.DB - a) - 1 << a)), this.clamp(), o && t.ZERO.subTo(this, this)
- }, t.prototype.clamp = function() {
- for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t;) --this.t
- }, t.prototype.dlShiftTo = function(t, e) {
- var i;
- for (i = this.t - 1; i >= 0; --i) e[i + t] = this[i];
- for (i = t - 1; i >= 0; --i) e[i] = 0;
- e.t = this.t + t, e.s = this.s
- }, t.prototype.drShiftTo = function(t, e) {
- for (var i = t; i < this.t; ++i) e[i - t] = this[i];
- e.t = Math.max(this.t - t, 0), e.s = this.s
- }, t.prototype.lShiftTo = function(t, e) {
- for (var i = t % this.DB, n = this.DB - i, r = (1 << n) - 1, o = Math.floor(t / this.DB), a = this.s << i & this.DM, s = this.t - 1; s >= 0; --s) e[s + o + 1] = this[s] >> n | a, a = (this[s] & r) << i;
- for (s = o - 1; s >= 0; --s) e[s] = 0;
- e[o] = a, e.t = this.t + o + 1, e.s = this.s, e.clamp()
- }, t.prototype.rShiftTo = function(t, e) {
- e.s = this.s;
- var i = Math.floor(t / this.DB);
- if (i >= this.t) e.t = 0;
- else {
- var n = t % this.DB,
- r = this.DB - n,
- o = (1 << n) - 1;
- e[0] = this[i] >> n;
- for (var a = i + 1; a < this.t; ++a) e[a - i - 1] |= (this[a] & o) << r, e[a - i] = this[a] >> n;
- n > 0 && (e[this.t - i - 1] |= (this.s & o) << r), e.t = this.t - i, e.clamp()
- }
- }, t.prototype.subTo = function(t, e) {
- for (var i = 0, n = 0, r = Math.min(t.t, this.t); i < r;) n += this[i] - t[i], e[i++] = n & this.DM, n >>= this.DB;
- if (t.t < this.t) {
- for (n -= t.s; i < this.t;) n += this[i], e[i++] = n & this.DM, n >>= this.DB;
- n += this.s
- } else {
- for (n += this.s; i < t.t;) n -= t[i], e[i++] = n & this.DM, n >>= this.DB;
- n -= t.s
- }
- e.s = n < 0 ? -1 : 0, n < -1 ? e[i++] = this.DV + n : n > 0 && (e[i++] = n), e.t = i, e.clamp()
- }, t.prototype.multiplyTo = function(e, i) {
- var n = this.abs(),
- r = e.abs(),
- o = n.t;
- for (i.t = o + r.t; --o >= 0;) i[o] = 0;
- for (o = 0; o < r.t; ++o) i[o + n.t] = n.am(0, r[o], i, o, 0, n.t);
- i.s = 0, i.clamp(), this.s != e.s && t.ZERO.subTo(i, i)
- }, t.prototype.squareTo = function(t) {
- for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0;) t[i] = 0;
- for (i = 0; i < e.t - 1; ++i) {
- var n = e.am(i, e[i], t, 2 * i, 0, 1);
- (t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, n, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV, t[i + e.t + 1] = 1)
- }
- t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)), t.s = 0, t.clamp()
- }, t.prototype.divRemTo = function(e, i, n) {
- var r = e.abs();
- if (!(r.t <= 0)) {
- var o = this.abs();
- if (o.t < r.t) return null != i && i.fromInt(0), void(null != n && this.copyTo(n));
- null == n && (n = O());
- var a = O(),
- s = this.s,
- l = e.s,
- u = this.DB - z(r[r.t - 1]);
- u > 0 ? (r.lShiftTo(u, a), o.lShiftTo(u, n)) : (r.copyTo(a), o.copyTo(n));
- var h = a.t,
- c = a[h - 1];
- if (0 != c) {
- var d = c * (1 << this.F1) + (h > 1 ? a[h - 2] >> this.F2 : 0),
- p = this.FV / d,
- f = (1 << this.F1) / d,
- m = 1 << this.F2,
- g = n.t,
- v = g - h,
- y = null == i ? O() : i;
- for (a.dlShiftTo(v, y), n.compareTo(y) >= 0 && (n[n.t++] = 1, n.subTo(y, n)), t.ONE.dlShiftTo(h, y), y.subTo(a, a); a.t < h;) a[a.t++] = 0;
- for (; --v >= 0;) {
- var b = n[--g] == c ? this.DM : Math.floor(n[g] * p + (n[g - 1] + m) * f);
- if ((n[g] += a.am(0, b, n, v, 0, h)) < b)
- for (a.dlShiftTo(v, y), n.subTo(y, n); n[g] < --b;) n.subTo(y, n)
- }
- null != i && (n.drShiftTo(h, i), s != l && t.ZERO.subTo(i, i)), n.t = h, n.clamp(), u > 0 && n.rShiftTo(u, n), s < 0 && t.ZERO.subTo(n, n)
- }
- }
- }, t.prototype.invDigit = function() {
- if (this.t < 1) return 0;
- var t = this[0];
- if (0 == (1 & t)) return 0;
- var e = 3 & t;
- return (e = (e = (e = (e = e * (2 - (15 & t) * e) & 15) * (2 - (255 & t) * e) & 255) * (2 - ((65535 & t) * e & 65535)) & 65535) * (2 - t * e % this.DV) % this.DV) > 0 ? this.DV - e : -e
- }, t.prototype.isEven = function() {
- return 0 == (this.t > 0 ? 1 & this[0] : this.s)
- }, t.prototype.exp = function(e, i) {
- if (e > 4294967295 || e < 1) return t.ONE;
- var n = O(),
- r = O(),
- o = i.convert(this),
- a = z(e) - 1;
- for (o.copyTo(n); --a >= 0;)
- if (i.sqrTo(n, r), (e & 1 << a) > 0) i.mulTo(r, o, n);
- else {
- var s = n;
- n = r, r = s
- } return i.revert(n)
- }, t.prototype.chunkSize = function(t) {
- return Math.floor(Math.LN2 * this.DB / Math.log(t))
- }, t.prototype.toRadix = function(t) {
- if (null == t && (t = 10), 0 == this.signum() || t < 2 || t > 36) return "0";
- var e = this.chunkSize(t),
- i = Math.pow(t, e),
- n = B(i),
- r = O(),
- o = O(),
- a = "";
- for (this.divRemTo(n, r, o); r.signum() > 0;) a = (i + o.intValue())
- .toString(t)
- .substr(1) + a, r.divRemTo(n, r, o);
- return o.intValue()
- .toString(t) + a
- }, t.prototype.fromRadix = function(e, i) {
- this.fromInt(0), null == i && (i = 10);
- for (var n = this.chunkSize(i), r = Math.pow(i, n), o = !1, a = 0, s = 0, l = 0; l < e.length; ++l) {
- var u = F(e, l);
- u < 0 ? "-" == e.charAt(l) && 0 == this.signum() && (o = !0) : (s = i * s + u, ++a >= n && (this.dMultiply(r), this.dAddOffset(s, 0), a = 0, s = 0))
- }
- a > 0 && (this.dMultiply(Math.pow(i, a)), this.dAddOffset(s, 0)), o && t.ZERO.subTo(this, this)
- }, t.prototype.fromNumber = function(e, i, r) {
- if ("number" == typeof i)
- if (e < 2) this.fromInt(1);
- else
- for (this.fromNumber(e, r), this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), n, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(i);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(t.ONE.shiftLeft(e - 1), this);
- else {
- var o = [],
- a = 7 & e;
- o.length = 1 + (e >> 3), i.nextBytes(o), a > 0 ? o[0] &= (1 << a) - 1 : o[0] = 0, this.fromString(o, 256)
- }
- }, t.prototype.bitwiseTo = function(t, e, i) {
- var n, r, o = Math.min(t.t, this.t);
- for (n = 0; n < o; ++n) i[n] = e(this[n], t[n]);
- if (t.t < this.t) {
- for (r = t.s & this.DM, n = o; n < this.t; ++n) i[n] = e(this[n], r);
- i.t = this.t
- } else {
- for (r = this.s & this.DM, n = o; n < t.t; ++n) i[n] = e(r, t[n]);
- i.t = t.t
- }
- i.s = e(this.s, t.s), i.clamp()
- }, t.prototype.changeBit = function(e, i) {
- var n = t.ONE.shiftLeft(e);
- return this.bitwiseTo(n, i, n), n
- }, t.prototype.addTo = function(t, e) {
- for (var i = 0, n = 0, r = Math.min(t.t, this.t); i < r;) n += this[i] + t[i], e[i++] = n & this.DM, n >>= this.DB;
- if (t.t < this.t) {
- for (n += t.s; i < this.t;) n += this[i], e[i++] = n & this.DM, n >>= this.DB;
- n += this.s
- } else {
- for (n += this.s; i < t.t;) n += t[i], e[i++] = n & this.DM, n >>= this.DB;
- n += t.s
- }
- e.s = n < 0 ? -1 : 0, n > 0 ? e[i++] = n : n < -1 && (e[i++] = this.DV + n), e.t = i, e.clamp()
- }, t.prototype.dMultiply = function(t) {
- this[this.t] = this.am(0, t - 1, this, 0, 0, this.t), ++this.t, this.clamp()
- }, t.prototype.dAddOffset = function(t, e) {
- if (0 != t) {
- for (; this.t <= e;) this[this.t++] = 0;
- for (this[e] += t; this[e] >= this.DV;) this[e] -= this.DV, ++e >= this.t && (this[this.t++] = 0), ++this[e]
- }
- }, t.prototype.multiplyLowerTo = function(t, e, i) {
- var n = Math.min(this.t + t.t, e);
- for (i.s = 0, i.t = n; n > 0;) i[--n] = 0;
- for (var r = i.t - this.t; n < r; ++n) i[n + this.t] = this.am(0, t[n], i, n, 0, this.t);
- for (r = Math.min(t.t, e); n < r; ++n) this.am(0, t[n], i, n, 0, e - n);
- i.clamp()
- }, t.prototype.multiplyUpperTo = function(t, e, i) {
- --e;
- var n = i.t = this.t + t.t - e;
- for (i.s = 0; --n >= 0;) i[n] = 0;
- for (n = Math.max(e - this.t, 0); n < t.t; ++n) i[this.t + n - e] = this.am(e - n, t[n], i, 0, 0, this.t + n - e);
- i.clamp(), i.drShiftTo(1, i)
- }, t.prototype.modInt = function(t) {
- if (t <= 0) return 0;
- var e = this.DV % t,
- i = this.s < 0 ? t - 1 : 0;
- if (this.t > 0)
- if (0 == e) i = this[0] % t;
- else
- for (var n = this.t - 1; n >= 0; --n) i = (e * i + this[n]) % t;
- return i
- }, t.prototype.millerRabin = function(e) {
- var i = this.subtract(t.ONE),
- n = i.getLowestSetBit();
- if (n <= 0) return !1;
- var r = i.shiftRight(n);
- (e = e + 1 >> 1) > _.length && (e = _.length);
- for (var o = O(), a = 0; a < e; ++a) {
- o.fromInt(_[Math.floor(Math.random() * _.length)]);
- var s = o.modPow(r, this);
- if (0 != s.compareTo(t.ONE) && 0 != s.compareTo(i)) {
- for (var l = 1; l++ < n && 0 != s.compareTo(i);)
- if (0 == (s = s.modPowInt(2, this))
- .compareTo(t.ONE)) return !1;
- if (0 != s.compareTo(i)) return !1
- }
- }
- return !0
- }, t.prototype.square = function() {
- var t = O();
- return this.squareTo(t), t
- }, t.prototype.gcda = function(t, e) {
- var i = this.s < 0 ? this.negate() : this.clone(),
- n = t.s < 0 ? t.negate() : t.clone();
- if (i.compareTo(n) < 0) {
- var r = i;
- i = n, n = r
- }
- var o = i.getLowestSetBit(),
- a = n.getLowestSetBit();
- if (a < 0) e(i);
- else {
- o < a && (a = o), a > 0 && (i.rShiftTo(a, i), n.rShiftTo(a, n));
- var s = function() {
- (o = i.getLowestSetBit()) > 0 && i.rShiftTo(o, i), (o = n.getLowestSetBit()) > 0 && n.rShiftTo(o, n), i.compareTo(n) >= 0 ? (i.subTo(n, i), i.rShiftTo(1, i)) : (n.subTo(i, n), n.rShiftTo(1, n)), i.signum() > 0 ? setTimeout(s, 0) : (a > 0 && n.lShiftTo(a, n), setTimeout((function() {
- e(n)
- }), 0))
- };
- setTimeout(s, 10)
- }
- }, t.prototype.fromNumberAsync = function(e, i, r, o) {
- if ("number" == typeof i)
- if (e < 2) this.fromInt(1);
- else {
- this.fromNumber(e, r), this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), n, this), this.isEven() && this.dAddOffset(1, 0);
- var a = this,
- s = function() {
- a.dAddOffset(2, 0), a.bitLength() > e && a.subTo(t.ONE.shiftLeft(e - 1), a), a.isProbablePrime(i) ? setTimeout((function() {
- o()
- }), 0) : setTimeout(s, 0)
- };
- setTimeout(s, 0)
- }
- else {
- var l = [],
- u = 7 & e;
- l.length = 1 + (e >> 3), i.nextBytes(l), u > 0 ? l[0] &= (1 << u) - 1 : l[0] = 0, this.fromString(l, 256)
- }
- }, t
- }(),
- C = function() {
- function t() {}
- return t.prototype.convert = function(t) {
- return t
- }, t.prototype.revert = function(t) {
- return t
- }, t.prototype.mulTo = function(t, e, i) {
- t.multiplyTo(e, i)
- }, t.prototype.sqrTo = function(t, e) {
- t.squareTo(e)
- }, t
- }(),
- E = function() {
- function t(t) {
- this.m = t
- }
- return t.prototype.convert = function(t) {
- return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
- }, t.prototype.revert = function(t) {
- return t
- }, t.prototype.reduce = function(t) {
- t.divRemTo(this.m, null, t)
- }, t.prototype.mulTo = function(t, e, i) {
- t.multiplyTo(e, i), this.reduce(i)
- }, t.prototype.sqrTo = function(t, e) {
- t.squareTo(e), this.reduce(e)
- }, t
- }(),
- D = function() {
- function t(t) {
- this.m = t, this.mp = t.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t
- }
- return t.prototype.convert = function(t) {
- var e = O();
- return t.abs()
- .dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(P.ZERO) > 0 && this.m.subTo(e, e), e
- }, t.prototype.revert = function(t) {
- var e = O();
- return t.copyTo(e), this.reduce(e), e
- }, t.prototype.reduce = function(t) {
- for (; t.t <= this.mt2;) t[t.t++] = 0;
- for (var e = 0; e < this.m.t; ++e) {
- var i = 32767 & t[e],
- n = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
- for (t[i = e + this.m.t] += this.m.am(0, n, t, e, 0, this.m.t); t[i] >= t.DV;) t[i] -= t.DV, t[++i]++
- }
- t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
- }, t.prototype.mulTo = function(t, e, i) {
- t.multiplyTo(e, i), this.reduce(i)
- }, t.prototype.sqrTo = function(t, e) {
- t.squareTo(e), this.reduce(e)
- }, t
- }(),
- L = function() {
- function t(t) {
- this.m = t, this.r2 = O(), this.q3 = O(), P.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t)
- }
- return t.prototype.convert = function(t) {
- if (t.s < 0 || t.t > 2 * this.m.t) return t.mod(this.m);
- if (t.compareTo(this.m) < 0) return t;
- var e = O();
- return t.copyTo(e), this.reduce(e), e
- }, t.prototype.revert = function(t) {
- return t
- }, t.prototype.reduce = function(t) {
- for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0;) t.dAddOffset(1, this.m.t + 1);
- for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0;) t.subTo(this.m, t)
- }, t.prototype.mulTo = function(t, e, i) {
- t.multiplyTo(e, i), this.reduce(i)
- }, t.prototype.sqrTo = function(t, e) {
- t.squareTo(e), this.reduce(e)
- }, t
- }();
- function O() {
- return new P(null)
- }
- function I(t, e) {
- return new P(t, e)
- }
- "Microsoft Internet Explorer" == navigator.appName ? (P.prototype.am = function(t, e, i, n, r, o) {
- for (var a = 32767 & e, s = e >> 15; --o >= 0;) {
- var l = 32767 & this[t],
- u = this[t++] >> 15,
- h = s * l + u * a;
- r = ((l = a * l + ((32767 & h) << 15) + i[n] + (1073741823 & r)) >>> 30) + (h >>> 15) + s * u + (r >>> 30), i[n++] = 1073741823 & l
- }
- return r
- }, x = 30) : "Netscape" != navigator.appName ? (P.prototype.am = function(t, e, i, n, r, o) {
- for (; --o >= 0;) {
- var a = e * this[t++] + i[n] + r;
- r = Math.floor(a / 67108864), i[n++] = 67108863 & a
- }
- return r
- }, x = 26) : (P.prototype.am = function(t, e, i, n, r, o) {
- for (var a = 16383 & e, s = e >> 14; --o >= 0;) {
- var l = 16383 & this[t],
- u = this[t++] >> 14,
- h = s * l + u * a;
- r = ((l = a * l + ((16383 & h) << 14) + i[n] + r) >> 28) + (h >> 14) + s * u, i[n++] = 268435455 & l
- }
- return r
- }, x = 28), P.prototype.DB = x, P.prototype.DM = (1 << x) - 1, P.prototype.DV = 1 << x, P.prototype.FV = Math.pow(2, 52), P.prototype.F1 = 52 - x, P.prototype.F2 = 2 * x - 52;
- var R, N, k = [];
- for (R = "0".charCodeAt(0), N = 0; N <= 9; ++N) k[R++] = N;
- for (R = "a".charCodeAt(0), N = 10; N < 36; ++N) k[R++] = N;
- for (R = "A".charCodeAt(0), N = 10; N < 36; ++N) k[R++] = N;
- function F(t, e) {
- var i = k[t.charCodeAt(e)];
- return null == i ? -1 : i
- }
- function B(t) {
- var e = O();
- return e.fromInt(t), e
- }
- function z(t) {
- var e, i = 1;
- return 0 != (e = t >>> 16) && (t = e, i += 16), 0 != (e = t >> 8) && (t = e, i += 8), 0 != (e = t >> 4) && (t = e, i += 4), 0 != (e = t >> 2) && (t = e, i += 2), 0 != (e = t >> 1) && (t = e, i += 1), i
- }
- P.ZERO = B(0), P.ONE = B(1);
- var U, V, j = function() {
- function t() {
- this.i = 0, this.j = 0, this.S = []
- }
- return t.prototype.init = function(t) {
- var e, i, n;
- for (e = 0; e < 256; ++e) this.S[e] = e;
- for (i = 0, e = 0; e < 256; ++e) i = i + this.S[e] + t[e % t.length] & 255, n = this.S[e], this.S[e] = this.S[i], this.S[i] = n;
- this.i = 0, this.j = 0
- }, t.prototype.next = function() {
- var t;
- return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255]
- }, t
- }(),
- H = null;
- if (null == H) {
- H = [], V = 0;
- var G = void 0;
- if (window.crypto && window.crypto.getRandomValues) {
- var W = new Uint32Array(256);
- for (window.crypto.getRandomValues(W), G = 0; G < W.length; ++G) H[V++] = 255 & W[G]
- }
- var q = function(t) {
- if (this.count = this.count || 0, this.count >= 256 || V >= 256) window.removeEventListener ? window.removeEventListener("mousemove", q, !1) : window.detachEvent && window.detachEvent("onmousemove", q);
- else try {
- var e = t.x + t.y;
- H[V++] = 255 & e, this.count += 1
- } catch (t) {}
- };
- window.addEventListener ? window.addEventListener("mousemove", q, !1) : window.attachEvent && window.attachEvent("onmousemove", q)
- }
- function Y() {
- if (null == U) {
- for (U = new j; V < 256;) {
- var t = Math.floor(65536 * Math.random());
- H[V++] = 255 & t
- }
- for (U.init(H), V = 0; V < H.length; ++V) H[V] = 0;
- V = 0
- }
- return U.next()
- }
- var X = function() {
- function t() {}
- return t.prototype.nextBytes = function(t) {
- for (var e = 0; e < t.length; ++e) t[e] = Y()
- }, t
- }(),
- Z = function() {
- function t() {
- this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null
- }
- return t.prototype.doPublic = function(t) {
- return t.modPowInt(this.e, this.n)
- }, t.prototype.doPrivate = function(t) {
- if (null == this.p || null == this.q) return t.modPow(this.d, this.n);
- for (var e = t.mod(this.p)
- .modPow(this.dmp1, this.p), i = t.mod(this.q)
- .modPow(this.dmq1, this.q); e.compareTo(i) < 0;) e = e.add(this.p);
- return e.subtract(i)
- .multiply(this.coeff)
- .mod(this.p)
- .multiply(this.q)
- .add(i)
- }, t.prototype.setPublic = function(t, e) {
- null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16))
- }, t.prototype.encrypt = function(t) {
- var e = function(t, e) {
- if (e < t.length + 11) return null;
- for (var i = [], n = t.length - 1; n >= 0 && e > 0;) {
- var r = t.charCodeAt(n--);
- r < 128 ? i[--e] = r : r > 127 && r < 2048 ? (i[--e] = 63 & r | 128, i[--e] = r >> 6 | 192) : (i[--e] = 63 & r | 128, i[--e] = r >> 6 & 63 | 128, i[--e] = r >> 12 | 224)
- }
- i[--e] = 0;
- for (var o = new X, a = []; e > 2;) {
- for (a[0] = 0; 0 == a[0];) o.nextBytes(a);
- i[--e] = a[0]
- }
- return i[--e] = 2, i[--e] = 0, new P(i)
- }(t, this.n.bitLength() + 7 >> 3);
- if (null == e) return null;
- var i = this.doPublic(e);
- if (null == i) return null;
- var n = i.toString(16);
- return 0 == (1 & n.length) ? n : "0" + n
- }, t.prototype.setPrivate = function(t, e, i) {
- null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16), this.d = I(i, 16))
- }, t.prototype.setPrivateEx = function(t, e, i, n, r, o, a, s) {
- null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16), this.d = I(i, 16), this.p = I(n, 16), this.q = I(r, 16), this.dmp1 = I(o, 16), this.dmq1 = I(a, 16), this.coeff = I(s, 16))
- }, t.prototype.generate = function(t, e) {
- var i = new X,
- n = t >> 1;
- this.e = parseInt(e, 16);
- for (var r = new P(e, 16);;) {
- for (; this.p = new P(t - n, 1, i), 0 != this.p.subtract(P.ONE)
- .gcd(r)
- .compareTo(P.ONE) || !this.p.isProbablePrime(10););
- for (; this.q = new P(n, 1, i), 0 != this.q.subtract(P.ONE)
- .gcd(r)
- .compareTo(P.ONE) || !this.q.isProbablePrime(10););
- if (this.p.compareTo(this.q) <= 0) {
- var o = this.p;
- this.p = this.q, this.q = o
- }
- var a = this.p.subtract(P.ONE),
- s = this.q.subtract(P.ONE),
- l = a.multiply(s);
- if (0 == l.gcd(r)
- .compareTo(P.ONE)) {
- this.n = this.p.multiply(this.q), this.d = r.modInverse(l), this.dmp1 = this.d.mod(a), this.dmq1 = this.d.mod(s), this.coeff = this.q.modInverse(this.p);
- break
- }
- }
- }, t.prototype.decrypt = function(t) {
- var e = I(t, 16),
- i = this.doPrivate(e);
- return null == i ? null : function(t, e) {
- for (var i = t.toByteArray(), n = 0; n < i.length && 0 == i[n];) ++n;
- if (i.length - n != e - 1 || 2 != i[n]) return null;
- for (++n; 0 != i[n];)
- if (++n >= i.length) return null;
- for (var r = ""; ++n < i.length;) {
- var o = 255 & i[n];
- o < 128 ? r += String.fromCharCode(o) : o > 191 && o < 224 ? (r += String.fromCharCode((31 & o) << 6 | 63 & i[n + 1]), ++n) : (r += String.fromCharCode((15 & o) << 12 | (63 & i[n + 1]) << 6 | 63 & i[n + 2]), n += 2)
- }
- return r
- }(i, this.n.bitLength() + 7 >> 3)
- }, t.prototype.generateAsync = function(t, e, i) {
- var n = new X,
- r = t >> 1;
- this.e = parseInt(e, 16);
- var o = new P(e, 16),
- a = this,
- s = function() {
- var e = function() {
- if (a.p.compareTo(a.q) <= 0) {
- var t = a.p;
- a.p = a.q, a.q = t
- }
- var e = a.p.subtract(P.ONE),
- n = a.q.subtract(P.ONE),
- r = e.multiply(n);
- 0 == r.gcd(o)
- .compareTo(P.ONE) ? (a.n = a.p.multiply(a.q), a.d = o.modInverse(r), a.dmp1 = a.d.mod(e), a.dmq1 = a.d.mod(n), a.coeff = a.q.modInverse(a.p), setTimeout((function() {
- i()
- }), 0)) : setTimeout(s, 0)
- },
- l = function() {
- a.q = O(), a.q.fromNumberAsync(r, 1, n, (function() {
- a.q.subtract(P.ONE)
- .gcda(o, (function(t) {
- 0 == t.compareTo(P.ONE) && a.q.isProbablePrime(10) ? setTimeout(e, 0) : setTimeout(l, 0)
- }))
- }))
- },
- u = function() {
- a.p = O(), a.p.fromNumberAsync(t - r, 1, n, (function() {
- a.p.subtract(P.ONE)
- .gcda(o, (function(t) {
- 0 == t.compareTo(P.ONE) && a.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(u, 0)
- }))
- }))
- };
- setTimeout(u, 0)
- };
- setTimeout(s, 0)
- }, t.prototype.sign = function(t, e, i) {
- var n = function(t, e) {
- if (e < t.length + 22) return null;
- for (var i = e - t.length - 6, n = "", r = 0; r < i; r += 2) n += "ff";
- return I("0001" + n + "00" + t, 16)
- }((K[i] || "") + e(t)
- .toString(), this.n.bitLength() / 4);
- if (null == n) return null;
- var r = this.doPrivate(n);
- if (null == r) return null;
- var o = r.toString(16);
- return 0 == (1 & o.length) ? o : "0" + o
- }, t.prototype.verify = function(t, e, i) {
- var n = I(e, 16),
- r = this.doPublic(n);
- return null == r ? null : function(t) {
- for (var e in K)
- if (K.hasOwnProperty(e)) {
- var i = K[e],
- n = i.length;
- if (t.substr(0, n) == i) return t.substr(n)
- } return t
- }(r.toString(16)
- .replace(/^1f+00/, "")) == i(t)
- .toString()
- }, t
- }(),
- K = {
- md2: "3020300c06082a864886f70d020205000410",
- md5: "3020300c06082a864886f70d020505000410",
- sha1: "3021300906052b0e03021a05000414",
- sha224: "302d300d06096086480165030402040500041c",
- sha256: "3031300d060960864801650304020105000420",
- sha384: "3041300d060960864801650304020205000430",
- sha512: "3051300d060960864801650304020305000440",
- ripemd160: "3021300906052b2403020105000414"
- },
- Q = {};
- Q.lang = {
- extend: function(t, e, i) {
- if (!e || !t) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
- var n = function() {};
- if (n.prototype = e.prototype, t.prototype = new n, t.prototype.constructor = t, t.superclass = e.prototype, e.prototype.constructor == Object.prototype.constructor && (e.prototype.constructor = e), i) {
- var r;
- for (r in i) t.prototype[r] = i[r];
- var o = function() {},
- a = ["toString", "valueOf"];
- try {
- /MSIE/.test(navigator.userAgent) && (o = function(t, e) {
- for (r = 0; r < a.length; r += 1) {
- var i = a[r],
- n = e[i];
- "function" == typeof n && n != Object.prototype[i] && (t[i] = n)
- }
- })
- } catch (t) {}
- o(t.prototype, i)
- }
- }
- };
- var J = {};
- void 0 !== J.asn1 && J.asn1 || (J.asn1 = {}), J.asn1.ASN1Util = new function() {
- this.integerToByteHex = function(t) {
- var e = t.toString(16);
- return e.length % 2 == 1 && (e = "0" + e), e
- }, this.bigIntToMinTwosComplementsHex = function(t) {
- var e = t.toString(16);
- if ("-" != e.substr(0, 1)) e.length % 2 == 1 ? e = "0" + e : e.match(/^[0-7]/) || (e = "00" + e);
- else {
- var i = e.substr(1)
- .length;
- i % 2 == 1 ? i += 1 : e.match(/^[0-7]/) || (i += 2);
- for (var n = "", r = 0; r < i; r++) n += "f";
- e = new P(n, 16)
- .xor(t)
- .add(P.ONE)
- .toString(16)
- .replace(/^-/, "")
- }
- return e
- }, this.getPEMStringFromHex = function(t, e) {
- return hextopem(t, e)
- }, this.newObject = function(t) {
- var e = J.asn1,
- i = e.DERBoolean,
- n = e.DERInteger,
- r = e.DERBitString,
- o = e.DEROctetString,
- a = e.DERNull,
- s = e.DERObjectIdentifier,
- l = e.DEREnumerated,
- u = e.DERUTF8String,
- h = e.DERNumericString,
- c = e.DERPrintableString,
- d = e.DERTeletexString,
- p = e.DERIA5String,
- f = e.DERUTCTime,
- m = e.DERGeneralizedTime,
- g = e.DERSequence,
- v = e.DERSet,
- y = e.DERTaggedObject,
- b = e.ASN1Util.newObject,
- w = Object.keys(t);
- if (1 != w.length) throw "key of param shall be only one.";
- var x = w[0];
- if (-1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + x + ":")) throw "undefined key: " + x;
- if ("bool" == x) return new i(t[x]);
- if ("int" == x) return new n(t[x]);
- if ("bitstr" == x) return new r(t[x]);
- if ("octstr" == x) return new o(t[x]);
- if ("null" == x) return new a(t[x]);
- if ("oid" == x) return new s(t[x]);
- if ("enum" == x) return new l(t[x]);
- if ("utf8str" == x) return new u(t[x]);
- if ("numstr" == x) return new h(t[x]);
- if ("prnstr" == x) return new c(t[x]);
- if ("telstr" == x) return new d(t[x]);
- if ("ia5str" == x) return new p(t[x]);
- if ("utctime" == x) return new f(t[x]);
- if ("gentime" == x) return new m(t[x]);
- if ("seq" == x) {
- for (var M = t[x], T = [], S = 0; S < M.length; S++) {
- var _ = b(M[S]);
- T.push(_)
- }
- return new g({
- array: T
- })
- }
- if ("set" == x) {
- for (M = t[x], T = [], S = 0; S < M.length; S++) _ = b(M[S]), T.push(_);
- return new v({
- array: T
- })
- }
- if ("tag" == x) {
- var A = t[x];
- if ("[object Array]" === Object.prototype.toString.call(A) && 3 == A.length) {
- var P = b(A[2]);
- return new y({
- tag: A[0],
- explicit: A[1],
- obj: P
- })
- }
- var C = {};
- if (void 0 !== A.explicit && (C.explicit = A.explicit), void 0 !== A.tag && (C.tag = A.tag), void 0 === A.obj) throw "obj shall be specified for 'tag'.";
- return C.obj = b(A.obj), new y(C)
- }
- }, this.jsonToASN1HEX = function(t) {
- return this.newObject(t)
- .getEncodedHex()
- }
- }, J.asn1.ASN1Util.oidHexToInt = function(t) {
- for (var e = "", i = parseInt(t.substr(0, 2), 16), n = (e = Math.floor(i / 40) + "." + i % 40, ""), r = 2; r < t.length; r += 2) {
- var o = ("00000000" + parseInt(t.substr(r, 2), 16)
- .toString(2))
- .slice(-8);
- n += o.substr(1, 7), "0" == o.substr(0, 1) && (e = e + "." + new P(n, 2)
- .toString(10), n = "")
- }
- return e
- }, J.asn1.ASN1Util.oidIntToHex = function(t) {
- var e = function(t) {
- var e = t.toString(16);
- return 1 == e.length && (e = "0" + e), e
- },
- i = function(t) {
- var i = "",
- n = new P(t, 10)
- .toString(2),
- r = 7 - n.length % 7;
- 7 == r && (r = 0);
- for (var o = "", a = 0; a < r; a++) o += "0";
- for (n = o + n, a = 0; a < n.length - 1; a += 7) {
- var s = n.substr(a, 7);
- a != n.length - 7 && (s = "1" + s), i += e(parseInt(s, 2))
- }
- return i
- };
- if (!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t;
- var n = "",
- r = t.split("."),
- o = 40 * parseInt(r[0]) + parseInt(r[1]);
- n += e(o), r.splice(0, 2);
- for (var a = 0; a < r.length; a++) n += i(r[a]);
- return n
- }, J.asn1.ASN1Object = function() {
- this.getLengthHexFromValue = function() {
- if (void 0 === this.hV || null == this.hV) throw "this.hV is null or undefined.";
- if (this.hV.length % 2 == 1) throw "value hex must be even length: n=" + "".length + ",v=" + this.hV;
- var t = this.hV.length / 2,
- e = t.toString(16);
- if (e.length % 2 == 1 && (e = "0" + e), t < 128) return e;
- var i = e.length / 2;
- if (i > 15) throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16);
- return (128 + i)
- .toString(16) + e
- }, this.getEncodedHex = function() {
- return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV
- }, this.getValueHex = function() {
- return this.getEncodedHex(), this.hV
- }, this.getFreshValueHex = function() {
- return ""
- }
- }, J.asn1.DERAbstractString = function(t) {
- J.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
- return this.s
- }, this.setString = function(t) {
- this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s)
- }, this.setStringHex = function(t) {
- this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t
- }, this.getFreshValueHex = function() {
- return this.hV
- }, void 0 !== t && ("string" == typeof t ? this.setString(t) : void 0 !== t.str ? this.setString(t.str) : void 0 !== t.hex && this.setStringHex(t.hex))
- }, Q.lang.extend(J.asn1.DERAbstractString, J.asn1.ASN1Object), J.asn1.DERAbstractTime = function(t) {
- J.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(t) {
- return utc = t.getTime() + 6e4 * t.getTimezoneOffset(), new Date(utc)
- }, this.formatDate = function(t, e, i) {
- var n = this.zeroPadding,
- r = this.localDateToUTC(t),
- o = String(r.getFullYear());
- "utc" == e && (o = o.substr(2, 2));
- var a = o + n(String(r.getMonth() + 1), 2) + n(String(r.getDate()), 2) + n(String(r.getHours()), 2) + n(String(r.getMinutes()), 2) + n(String(r.getSeconds()), 2);
- if (!0 === i) {
- var s = r.getMilliseconds();
- if (0 != s) {
- var l = n(String(s), 3);
- a = a + "." + (l = l.replace(/[0]+$/, ""))
- }
- }
- return a + "Z"
- }, this.zeroPadding = function(t, e) {
- return t.length >= e ? t : new Array(e - t.length + 1)
- .join("0") + t
- }, this.getString = function() {
- return this.s
- }, this.setString = function(t) {
- this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(t)
- }, this.setByDateValue = function(t, e, i, n, r, o) {
- var a = new Date(Date.UTC(t, e - 1, i, n, r, o, 0));
- this.setByDate(a)
- }, this.getFreshValueHex = function() {
- return this.hV
- }
- }, Q.lang.extend(J.asn1.DERAbstractTime, J.asn1.ASN1Object), J.asn1.DERAbstractStructured = function(t) {
- J.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(t) {
- this.hTLV = null, this.isModified = !0, this.asn1Array = t
- }, this.appendASN1Object = function(t) {
- this.hTLV = null, this.isModified = !0, this.asn1Array.push(t)
- }, this.asn1Array = new Array, void 0 !== t && void 0 !== t.array && (this.asn1Array = t.array)
- }, Q.lang.extend(J.asn1.DERAbstractStructured, J.asn1.ASN1Object), J.asn1.DERBoolean = function() {
- J.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff"
- }, Q.lang.extend(J.asn1.DERBoolean, J.asn1.ASN1Object), J.asn1.DERInteger = function(t) {
- J.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) {
- this.hTLV = null, this.isModified = !0, this.hV = J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
- }, this.setByInteger = function(t) {
- var e = new P(String(t), 10);
- this.setByBigInteger(e)
- }, this.setValueHex = function(t) {
- this.hV = t
- }, this.getFreshValueHex = function() {
- return this.hV
- }, void 0 !== t && (void 0 !== t.bigint ? this.setByBigInteger(t.bigint) : void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex))
- }, Q.lang.extend(J.asn1.DERInteger, J.asn1.ASN1Object), J.asn1.DERBitString = function(t) {
- if (void 0 !== t && void 0 !== t.obj) {
- var e = J.asn1.ASN1Util.newObject(t.obj);
- t.hex = "00" + e.getEncodedHex()
- }
- J.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(t) {
- this.hTLV = null, this.isModified = !0, this.hV = t
- }, this.setUnusedBitsAndHexValue = function(t, e) {
- if (t < 0 || 7 < t) throw "unused bits shall be from 0 to 7: u = " + t;
- var i = "0" + t;
- this.hTLV = null, this.isModified = !0, this.hV = i + e
- }, this.setByBinaryString = function(t) {
- var e = 8 - (t = t.replace(/0+$/, ""))
- .length % 8;
- 8 == e && (e = 0);
- for (var i = 0; i <= e; i++) t += "0";
- var n = "";
- for (i = 0; i < t.length - 1; i += 8) {
- var r = t.substr(i, 8),
- o = parseInt(r, 2)
- .toString(16);
- 1 == o.length && (o = "0" + o), n += o
- }
- this.hTLV = null, this.isModified = !0, this.hV = "0" + e + n
- }, this.setByBooleanArray = function(t) {
- for (var e = "", i = 0; i < t.length; i++) 1 == t[i] ? e += "1" : e += "0";
- this.setByBinaryString(e)
- }, this.newFalseArray = function(t) {
- for (var e = new Array(t), i = 0; i < t; i++) e[i] = !1;
- return e
- }, this.getFreshValueHex = function() {
- return this.hV
- }, void 0 !== t && ("string" == typeof t && t.toLowerCase()
- .match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(t) : void 0 !== t.hex ? this.setHexValueIncludingUnusedBits(t.hex) : void 0 !== t.bin ? this.setByBinaryString(t.bin) : void 0 !== t.array && this.setByBooleanArray(t.array))
- }, Q.lang.extend(J.asn1.DERBitString, J.asn1.ASN1Object), J.asn1.DEROctetString = function(t) {
- if (void 0 !== t && void 0 !== t.obj) {
- var e = J.asn1.ASN1Util.newObject(t.obj);
- t.hex = e.getEncodedHex()
- }
- J.asn1.DEROctetString.superclass.constructor.call(this, t), this.hT = "04"
- }, Q.lang.extend(J.asn1.DEROctetString, J.asn1.DERAbstractString), J.asn1.DERNull = function() {
- J.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500"
- }, Q.lang.extend(J.asn1.DERNull, J.asn1.ASN1Object), J.asn1.DERObjectIdentifier = function(t) {
- var e = function(t) {
- var e = t.toString(16);
- return 1 == e.length && (e = "0" + e), e
- },
- i = function(t) {
- var i = "",
- n = new P(t, 10)
- .toString(2),
- r = 7 - n.length % 7;
- 7 == r && (r = 0);
- for (var o = "", a = 0; a < r; a++) o += "0";
- for (n = o + n, a = 0; a < n.length - 1; a += 7) {
- var s = n.substr(a, 7);
- a != n.length - 7 && (s = "1" + s), i += e(parseInt(s, 2))
- }
- return i
- };
- J.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(t) {
- this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t
- }, this.setValueOidString = function(t) {
- if (!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t;
- var n = "",
- r = t.split("."),
- o = 40 * parseInt(r[0]) + parseInt(r[1]);
- n += e(o), r.splice(0, 2);
- for (var a = 0; a < r.length; a++) n += i(r[a]);
- this.hTLV = null, this.isModified = !0, this.s = null, this.hV = n
- }, this.setValueName = function(t) {
- var e = J.asn1.x509.OID.name2oid(t);
- if ("" === e) throw "DERObjectIdentifier oidName undefined: " + t;
- this.setValueOidString(e)
- }, this.getFreshValueHex = function() {
- return this.hV
- }, void 0 !== t && ("string" == typeof t ? t.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(t) : this.setValueName(t) : void 0 !== t.oid ? this.setValueOidString(t.oid) : void 0 !== t.hex ? this.setValueHex(t.hex) : void 0 !== t.name && this.setValueName(t.name))
- }, Q.lang.extend(J.asn1.DERObjectIdentifier, J.asn1.ASN1Object), J.asn1.DEREnumerated = function(t) {
- J.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(t) {
- this.hTLV = null, this.isModified = !0, this.hV = J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
- }, this.setByInteger = function(t) {
- var e = new P(String(t), 10);
- this.setByBigInteger(e)
- }, this.setValueHex = function(t) {
- this.hV = t
- }, this.getFreshValueHex = function() {
- return this.hV
- }, void 0 !== t && (void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex))
- }, Q.lang.extend(J.asn1.DEREnumerated, J.asn1.ASN1Object), J.asn1.DERUTF8String = function(t) {
- J.asn1.DERUTF8String.superclass.constructor.call(this, t), this.hT = "0c"
- }, Q.lang.extend(J.asn1.DERUTF8String, J.asn1.DERAbstractString), J.asn1.DERNumericString = function(t) {
- J.asn1.DERNumericString.superclass.constructor.call(this, t), this.hT = "12"
- }, Q.lang.extend(J.asn1.DERNumericString, J.asn1.DERAbstractString), J.asn1.DERPrintableString = function(t) {
- J.asn1.DERPrintableString.superclass.constructor.call(this, t), this.hT = "13"
- }, Q.lang.extend(J.asn1.DERPrintableString, J.asn1.DERAbstractString), J.asn1.DERTeletexString = function(t) {
- J.asn1.DERTeletexString.superclass.constructor.call(this, t), this.hT = "14"
- }, Q.lang.extend(J.asn1.DERTeletexString, J.asn1.DERAbstractString), J.asn1.DERIA5String = function(t) {
- J.asn1.DERIA5String.superclass.constructor.call(this, t), this.hT = "16"
- }, Q.lang.extend(J.asn1.DERIA5String, J.asn1.DERAbstractString), J.asn1.DERUTCTime = function(t) {
- J.asn1.DERUTCTime.superclass.constructor.call(this, t), this.hT = "17", this.setByDate = function(t) {
- this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)
- }, this.getFreshValueHex = function() {
- return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV
- }, void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{12}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date))
- }, Q.lang.extend(J.asn1.DERUTCTime, J.asn1.DERAbstractTime), J.asn1.DERGeneralizedTime = function(t) {
- J.asn1.DERGeneralizedTime.superclass.constructor.call(this, t), this.hT = "18", this.withMillis = !1, this.setByDate = function(t) {
- this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)
- }, this.getFreshValueHex = function() {
- return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV
- }, void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{14}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date), !0 === t.millis && (this.withMillis = !0))
- }, Q.lang.extend(J.asn1.DERGeneralizedTime, J.asn1.DERAbstractTime), J.asn1.DERSequence = function(t) {
- J.asn1.DERSequence.superclass.constructor.call(this, t), this.hT = "30", this.getFreshValueHex = function() {
- for (var t = "", e = 0; e < this.asn1Array.length; e++) t += this.asn1Array[e].getEncodedHex();
- return this.hV = t, this.hV
- }
- }, Q.lang.extend(J.asn1.DERSequence, J.asn1.DERAbstractStructured), J.asn1.DERSet = function(t) {
- J.asn1.DERSet.superclass.constructor.call(this, t), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() {
- for (var t = new Array, e = 0; e < this.asn1Array.length; e++) {
- var i = this.asn1Array[e];
- t.push(i.getEncodedHex())
- }
- return 1 == this.sortFlag && t.sort(), this.hV = t.join(""), this.hV
- }, void 0 !== t && void 0 !== t.sortflag && 0 == t.sortflag && (this.sortFlag = !1)
- }, Q.lang.extend(J.asn1.DERSet, J.asn1.DERAbstractStructured), J.asn1.DERTaggedObject = function(t) {
- J.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, i) {
- this.hT = e, this.isExplicit = t, this.asn1Object = i, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1)
- }, this.getFreshValueHex = function() {
- return this.hV
- }, void 0 !== t && (void 0 !== t.tag && (this.hT = t.tag), void 0 !== t.explicit && (this.isExplicit = t.explicit), void 0 !== t.obj && (this.asn1Object = t.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)))
- }, Q.lang.extend(J.asn1.DERTaggedObject, J.asn1.ASN1Object);
- var $ = function(t) {
- function e(i) {
- var n = t.call(this) || this;
- return i && ("string" == typeof i ? n.parseKey(i) : (e.hasPrivateKeyProperty(i) || e.hasPublicKeyProperty(i)) && n.parsePropertiesFrom(i)), n
- }
- return function(t, e) {
- function i() {
- this.constructor = t
- }
- p(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i)
- }(e, t), e.prototype.parseKey = function(t) {
- try {
- var e = 0,
- i = 0,
- n = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t) ? f(t) : m.unarmor(t),
- r = T.decode(n);
- if (3 === r.sub.length && (r = r.sub[2].sub[0]), 9 === r.sub.length) {
- e = r.sub[1].getHexStringValue(), this.n = I(e, 16), i = r.sub[2].getHexStringValue(), this.e = parseInt(i, 16);
- var o = r.sub[3].getHexStringValue();
- this.d = I(o, 16);
- var a = r.sub[4].getHexStringValue();
- this.p = I(a, 16);
- var s = r.sub[5].getHexStringValue();
- this.q = I(s, 16);
- var l = r.sub[6].getHexStringValue();
- this.dmp1 = I(l, 16);
- var u = r.sub[7].getHexStringValue();
- this.dmq1 = I(u, 16);
- var h = r.sub[8].getHexStringValue();
- this.coeff = I(h, 16)
- } else {
- if (2 !== r.sub.length) return !1;
- var c = r.sub[1].sub[0];
- e = c.sub[0].getHexStringValue(), this.n = I(e, 16), i = c.sub[1].getHexStringValue(), this.e = parseInt(i, 16)
- }
- return !0
- } catch (t) {
- return !1
- }
- }, e.prototype.getPrivateBaseKey = function() {
- var t = {
- array: [new J.asn1.DERInteger({
- int: 0
- }), new J.asn1.DERInteger({
- bigint: this.n
- }), new J.asn1.DERInteger({
- int: this.e
- }), new J.asn1.DERInteger({
- bigint: this.d
- }), new J.asn1.DERInteger({
- bigint: this.p
- }), new J.asn1.DERInteger({
- bigint: this.q
- }), new J.asn1.DERInteger({
- bigint: this.dmp1
- }), new J.asn1.DERInteger({
- bigint: this.dmq1
- }), new J.asn1.DERInteger({
- bigint: this.coeff
- })]
- };
- return new J.asn1.DERSequence(t)
- .getEncodedHex()
- }, e.prototype.getPrivateBaseKeyB64 = function() {
- return u(this.getPrivateBaseKey())
- }, e.prototype.getPublicBaseKey = function() {
- var t = new J.asn1.DERSequence({
- array: [new J.asn1.DERObjectIdentifier({
- oid: "1.2.840.113549.1.1.1"
- }), new J.asn1.DERNull]
- }),
- e = new J.asn1.DERSequence({
- array: [new J.asn1.DERInteger({
- bigint: this.n
- }), new J.asn1.DERInteger({
- int: this.e
- })]
- }),
- i = new J.asn1.DERBitString({
- hex: "00" + e.getEncodedHex()
- });
- return new J.asn1.DERSequence({
- array: [t, i]
- })
- .getEncodedHex()
- }, e.prototype.getPublicBaseKeyB64 = function() {
- return u(this.getPublicBaseKey())
- }, e.wordwrap = function(t, e) {
- if (!t) return t;
- var i = "(.{1," + (e = e || 64) + "})( +|$\n?)|(.{1," + e + "})";
- return t.match(RegExp(i, "g"))
- .join("\n")
- }, e.prototype.getPrivateKey = function() {
- var t = "-----BEGIN RSA PRIVATE KEY-----\n";
- return t += e.wordwrap(this.getPrivateBaseKeyB64()) + "\n", t += "-----END RSA PRIVATE KEY-----"
- }, e.prototype.getPublicKey = function() {
- var t = "-----BEGIN PUBLIC KEY-----\n";
- return t += e.wordwrap(this.getPublicBaseKeyB64()) + "\n", t += "-----END PUBLIC KEY-----"
- }, e.hasPublicKeyProperty = function(t) {
- return (t = t || {})
- .hasOwnProperty("n") && t.hasOwnProperty("e")
- }, e.hasPrivateKeyProperty = function(t) {
- return (t = t || {})
- .hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff")
- }, e.prototype.parsePropertiesFrom = function(t) {
- this.n = t.n, this.e = t.e, t.hasOwnProperty("d") && (this.d = t.d, this.p = t.p, this.q = t.q, this.dmp1 = t.dmp1, this.dmq1 = t.dmq1, this.coeff = t.coeff)
- }, e
- }(Z),
- tt = function() {
- function t(t) {
- t = t || {}, this.default_key_size = parseInt(t.default_key_size, 10) || 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = null
- }
- return t.prototype.setKey = function(t) {
- this.log && this.key, this.key = new $(t)
- }, t.prototype.setPrivateKey = function(t) {
- this.setKey(t)
- }, t.prototype.setPublicKey = function(t) {
- this.setKey(t)
- }, t.prototype.decrypt = function(t) {
- try {
- return this.getKey()
- .decrypt(h(t))
- } catch (t) {
- return !1
- }
- }, t.prototype.encrypt = function(t) {
- try {
- return u(this.getKey()
- .encrypt(t))
- } catch (t) {
- return !1
- }
- }, t.prototype.encryptLong = function(t) {
- var e = this.getKey(),
- i = (e.n.bitLength() + 7 >> 3) - 11;
- try {
- var n = "";
- return t.length > i ? t.match(/.{1,117}/g)
- .forEach((function(t) {
- var i = e.encrypt(t);
- n += i
- })) : n = e.encrypt(t), u(n)
- } catch (t) {
- return !1
- }
- }, t.prototype.sign = function(t, e, i) {
- try {
- return u(this.getKey()
- .sign(t, e, i))
- } catch (t) {
- return !1
- }
- }, t.prototype.verify = function(t, e, i) {
- try {
- return this.getKey()
- .verify(t, h(e), i)
- } catch (t) {
- return !1
- }
- }, t.prototype.getKey = function(t) {
- if (!this.key) {
- if (this.key = new $, t && "[object Function]" === {}.toString.call(t)) return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
- this.key.generate(this.default_key_size, this.default_public_exponent)
- }
- return this.key
- }, t.prototype.getPrivateKey = function() {
- return this.getKey()
- .getPrivateKey()
- }, t.prototype.getPrivateKeyB64 = function() {
- return this.getKey()
- .getPrivateBaseKeyB64()
- }, t.prototype.getPublicKey = function() {
- return this.getKey()
- .getPublicKey()
- }, t.prototype.getPublicKeyB64 = function() {
- return this.getKey()
- .getPublicBaseKeyB64()
- }, t.version = "3.0.0-rc.1", t
- }();
- window.JSEncrypt = tt, t.JSEncrypt = tt, t.default = tt, Object.defineProperty(t, "__esModule", {
- value: !0
- })
- }(e)
- }, function(t, e, i) {
- var n;
- ! function(e, i) {
- "object" == typeof t.exports ? t.exports = e.document ? i(e, !0) : function(t) {
- if (!t.document) throw new Error("jQuery requires a window with a document");
- return i(t)
- } : i(e)
- }("undefined" != typeof window ? window : this, (function(i, r) {
- var o = [],
- a = o.slice,
- s = o.concat,
- l = o.push,
- u = o.indexOf,
- h = {},
- c = h.toString,
- d = h.hasOwnProperty,
- p = {},
- f = i.document,
- m = "2.1.1",
- g = function(t, e) {
- return new g.fn.init(t, e)
- },
- v = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
- y = /^-ms-/,
- b = /-([\da-z])/gi,
- w = function(t, e) {
- return e.toUpperCase()
- };
- function x(t) {
- var e = t.length,
- i = g.type(t);
- return "function" !== i && !g.isWindow(t) && (!(1 !== t.nodeType || !e) || ("array" === i || 0 === e || "number" == typeof e && e > 0 && e - 1 in t))
- }
- g.fn = g.prototype = {
- jquery: m,
- constructor: g,
- selector: "",
- length: 0,
- toArray: function() {
- return a.call(this)
- },
- get: function(t) {
- return null != t ? 0 > t ? this[t + this.length] : this[t] : a.call(this)
- },
- pushStack: function(t) {
- var e = g.merge(this.constructor(), t);
- return e.prevObject = this, e.context = this.context, e
- },
- each: function(t, e) {
- return g.each(this, t, e)
- },
- map: function(t) {
- return this.pushStack(g.map(this, (function(e, i) {
- return t.call(e, i, e)
- })))
- },
- slice: function() {
- return this.pushStack(a.apply(this, arguments))
- },
- first: function() {
- return this.eq(0)
- },
- last: function() {
- return this.eq(-1)
- },
- eq: function(t) {
- var e = this.length,
- i = +t + (0 > t ? e : 0);
- return this.pushStack(i >= 0 && e > i ? [this[i]] : [])
- },
- end: function() {
- return this.prevObject || this.constructor(null)
- },
- push: l,
- sort: o.sort,
- splice: o.splice
- }, g.extend = g.fn.extend = function() {
- var t, e, i, n, r, o, a = arguments[0] || {},
- s = 1,
- l = arguments.length,
- u = !1;
- for ("boolean" == typeof a && (u = a, a = arguments[s] || {}, s++), "object" == typeof a || g.isFunction(a) || (a = {}), s === l && (a = this, s--); l > s; s++)
- if (null != (t = arguments[s]))
- for (e in t) i = a[e], a !== (n = t[e]) && (u && n && (g.isPlainObject(n) || (r = g.isArray(n))) ? (r ? (r = !1, o = i && g.isArray(i) ? i : []) : o = i && g.isPlainObject(i) ? i : {}, a[e] = g.extend(u, o, n)) : void 0 !== n && (a[e] = n));
- return a
- }, g.extend({
- expando: "jQuery" + (m + Math.random())
- .replace(/\D/g, ""),
- isReady: !0,
- error: function(t) {
- throw new Error(t)
- },
- noop: function() {},
- isFunction: function(t) {
- return "function" === g.type(t)
- },
- isArray: Array.isArray,
- isWindow: function(t) {
- return null != t && t === t.window
- },
- isNumeric: function(t) {
- return !g.isArray(t) && t - parseFloat(t) >= 0
- },
- isPlainObject: function(t) {
- return "object" === g.type(t) && !t.nodeType && !g.isWindow(t) && !(t.constructor && !d.call(t.constructor.prototype, "isPrototypeOf"))
- },
- isEmptyObject: function(t) {
- var e;
- for (e in t) return !1;
- return !0
- },
- type: function(t) {
- return null == t ? t + "" : "object" == typeof t || "function" == typeof t ? h[c.call(t)] || "object" : typeof t
- },
- globalEval: function(t) {
- var e, i = eval;
- (t = g.trim(t)) && (1 === t.indexOf("use strict") ? ((e = f.createElement("script"))
- .text = t, f.head.appendChild(e)
- .parentNode.removeChild(e)) : i(t))
- },
- camelCase: function(t) {
- return t.replace(y, "ms-")
- .replace(b, w)
- },
- nodeName: function(t, e) {
- return t.nodeName && t.nodeName.toLowerCase() === e.toLowerCase()
- },
- each: function(t, e, i) {
- var n = 0,
- r = t.length,
- o = x(t);
- if (i) {
- if (o)
- for (; r > n && !1 !== e.apply(t[n], i); n++);
- else
- for (n in t)
- if (!1 === e.apply(t[n], i)) break
- } else if (o)
- for (; r > n && !1 !== e.call(t[n], n, t[n]); n++);
- else
- for (n in t)
- if (!1 === e.call(t[n], n, t[n])) break;
- return t
- },
- trim: function(t) {
- return null == t ? "" : (t + "")
- .replace(v, "")
- },
- makeArray: function(t, e) {
- var i = e || [];
- return null != t && (x(Object(t)) ? g.merge(i, "string" == typeof t ? [t] : t) : l.call(i, t)), i
- },
- inArray: function(t, e, i) {
- return null == e ? -1 : u.call(e, t, i)
- },
- merge: function(t, e) {
- for (var i = +e.length, n = 0, r = t.length; i > n; n++) t[r++] = e[n];
- return t.length = r, t
- },
- grep: function(t, e, i) {
- for (var n = [], r = 0, o = t.length, a = !i; o > r; r++) !e(t[r], r) !== a && n.push(t[r]);
- return n
- },
- map: function(t, e, i) {
- var n, r = 0,
- o = t.length,
- a = [];
- if (x(t))
- for (; o > r; r++) null != (n = e(t[r], r, i)) && a.push(n);
- else
- for (r in t) null != (n = e(t[r], r, i)) && a.push(n);
- return s.apply([], a)
- },
- guid: 1,
- proxy: function(t, e) {
- var i, n, r;
- return "string" == typeof e && (i = t[e], e = t, t = i), g.isFunction(t) ? (n = a.call(arguments, 2), (r = function() {
- return t.apply(e || this, n.concat(a.call(arguments)))
- })
- .guid = t.guid = t.guid || g.guid++, r) : void 0
- },
- now: Date.now,
- support: p
- }), g.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), (function(t, e) {
- h["[object " + e + "]"] = e.toLowerCase()
- }));
- var M = function(t) {
- var e, i, n, r, o, a, s, l, u, h, c, d, p, f, m, g, v, y, b, w = "sizzle" + -new Date,
- x = t.document,
- M = 0,
- T = 0,
- S = rt(),
- _ = rt(),
- A = rt(),
- P = function(t, e) {
- return t === e && (c = !0), 0
- },
- C = "undefined",
- E = {}.hasOwnProperty,
- D = [],
- L = D.pop,
- O = D.push,
- I = D.push,
- R = D.slice,
- N = D.indexOf || function(t) {
- for (var e = 0, i = this.length; i > e; e++)
- if (this[e] === t) return e;
- return -1
- },
- k = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
- F = "[\\x20\\t\\r\\n\\f]",
- B = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
- z = B.replace("w", "w#"),
- U = "\\[" + F + "*(" + B + ")(?:" + F + "*([*^$|!~]?=)" + F + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + z + "))|)" + F + "*\\]",
- V = ":(" + B + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + U + ")*)|.*)\\)|)",
- j = new RegExp("^" + F + "+|((?:^|[^\\\\])(?:\\\\.)*)" + F + "+$", "g"),
- H = new RegExp("^" + F + "*," + F + "*"),
- G = new RegExp("^" + F + "*([>+~]|" + F + ")" + F + "*"),
- W = new RegExp("=" + F + "*([^\\]'\"]*?)" + F + "*\\]", "g"),
- q = new RegExp(V),
- Y = new RegExp("^" + z + "$"),
- X = {
- ID: new RegExp("^#(" + B + ")"),
- CLASS: new RegExp("^\\.(" + B + ")"),
- TAG: new RegExp("^(" + B.replace("w", "w*") + ")"),
- ATTR: new RegExp("^" + U),
- PSEUDO: new RegExp("^" + V),
- CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + F + "*(even|odd|(([+-]|)(\\d*)n|)" + F + "*(?:([+-]|)" + F + "*(\\d+)|))" + F + "*\\)|)", "i"),
- bool: new RegExp("^(?:" + k + ")$", "i"),
- needsContext: new RegExp("^" + F + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + F + "*((?:-\\d)?\\d*)" + F + "*\\)|)(?=[^-]|$)", "i")
- },
- Z = /^(?:input|select|textarea|button)$/i,
- K = /^h\d$/i,
- Q = /^[^{]+\{\s*\[native \w/,
- J = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
- $ = /[+~]/,
- tt = /'|\\/g,
- et = new RegExp("\\\\([\\da-f]{1,6}" + F + "?|(" + F + ")|.)", "ig"),
- it = function(t, e, i) {
- var n = "0x" + e - 65536;
- return n != n || i ? e : 0 > n ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320)
- };
- try {
- I.apply(D = R.call(x.childNodes), x.childNodes), D[x.childNodes.length].nodeType
- } catch (t) {
- I = {
- apply: D.length ? function(t, e) {
- O.apply(t, R.call(e))
- } : function(t, e) {
- for (var i = t.length, n = 0; t[i++] = e[n++];);
- t.length = i - 1
- }
- }
- }
- function nt(t, e, n, r) {
- var o, s, u, h, c, f, v, y, M, T;
- if ((e ? e.ownerDocument || e : x) !== p && d(e), n = n || [], !t || "string" != typeof t) return n;
- if (1 !== (h = (e = e || p)
- .nodeType) && 9 !== h) return [];
- if (m && !r) {
- if (o = J.exec(t))
- if (u = o[1]) {
- if (9 === h) {
- if (!(s = e.getElementById(u)) || !s.parentNode) return n;
- if (s.id === u) return n.push(s), n
- } else if (e.ownerDocument && (s = e.ownerDocument.getElementById(u)) && b(e, s) && s.id === u) return n.push(s), n
- } else {
- if (o[2]) return I.apply(n, e.getElementsByTagName(t)), n;
- if ((u = o[3]) && i.getElementsByClassName && e.getElementsByClassName) return I.apply(n, e.getElementsByClassName(u)), n
- } if (i.qsa && (!g || !g.test(t))) {
- if (y = v = w, M = e, T = 9 === h && t, 1 === h && "object" !== e.nodeName.toLowerCase()) {
- for (f = a(t), (v = e.getAttribute("id")) ? y = v.replace(tt, "\\$&") : e.setAttribute("id", y), y = "[id='" + y + "'] ", c = f.length; c--;) f[c] = y + ft(f[c]);
- M = $.test(t) && dt(e.parentNode) || e, T = f.join(",")
- }
- if (T) try {
- return I.apply(n, M.querySelectorAll(T)), n
- } catch (t) {} finally {
- v || e.removeAttribute("id")
- }
- }
- }
- return l(t.replace(j, "$1"), e, n, r)
- }
- function rt() {
- var t = [];
- return function e(i, r) {
- return t.push(i + " ") > n.cacheLength && delete e[t.shift()], e[i + " "] = r
- }
- }
- function ot(t) {
- return t[w] = !0, t
- }
- function at(t) {
- var e = p.createElement("div");
- try {
- return !!t(e)
- } catch (t) {
- return !1
- } finally {
- e.parentNode && e.parentNode.removeChild(e), e = null
- }
- }
- function st(t, e) {
- for (var i = t.split("|"), r = t.length; r--;) n.attrHandle[i[r]] = e
- }
- function lt(t, e) {
- var i = e && t,
- n = i && 1 === t.nodeType && 1 === e.nodeType && (~e.sourceIndex || 1 << 31) - (~t.sourceIndex || 1 << 31);
- if (n) return n;
- if (i)
- for (; i = i.nextSibling;)
- if (i === e) return -1;
- return t ? 1 : -1
- }
- function ut(t) {
- return function(e) {
- return "input" === e.nodeName.toLowerCase() && e.type === t
- }
- }
- function ht(t) {
- return function(e) {
- var i = e.nodeName.toLowerCase();
- return ("input" === i || "button" === i) && e.type === t
- }
- }
- function ct(t) {
- return ot((function(e) {
- return e = +e, ot((function(i, n) {
- for (var r, o = t([], i.length, e), a = o.length; a--;) i[r = o[a]] && (i[r] = !(n[r] = i[r]))
- }))
- }))
- }
- function dt(t) {
- return t && typeof t.getElementsByTagName !== C && t
- }
- for (e in i = nt.support = {}, o = nt.isXML = function(t) {
- var e = t && (t.ownerDocument || t)
- .documentElement;
- return !!e && "HTML" !== e.nodeName
- }, d = nt.setDocument = function(t) {
- var e, r = t ? t.ownerDocument || t : x,
- a = r.defaultView;
- return r !== p && 9 === r.nodeType && r.documentElement ? (p = r, f = r.documentElement, m = !o(r), a && a !== a.top && (a.addEventListener ? a.addEventListener("unload", (function() {
- d()
- }), !1) : a.attachEvent && a.attachEvent("onunload", (function() {
- d()
- }))), i.attributes = at((function(t) {
- return t.className = "i", !t.getAttribute("className")
- })), i.getElementsByTagName = at((function(t) {
- return t.appendChild(r.createComment("")), !t.getElementsByTagName("*")
- .length
- })), i.getElementsByClassName = Q.test(r.getElementsByClassName) && at((function(t) {
- return t.innerHTML = "<div class='a'></div><div class='a i'></div>", t.firstChild.className = "i", 2 === t.getElementsByClassName("i")
- .length
- })), i.getById = at((function(t) {
- return f.appendChild(t)
- .id = w, !r.getElementsByName || !r.getElementsByName(w)
- .length
- })), i.getById ? (n.find.ID = function(t, e) {
- if (typeof e.getElementById !== C && m) {
- var i = e.getElementById(t);
- return i && i.parentNode ? [i] : []
- }
- }, n.filter.ID = function(t) {
- var e = t.replace(et, it);
- return function(t) {
- return t.getAttribute("id") === e
- }
- }) : (delete n.find.ID, n.filter.ID = function(t) {
- var e = t.replace(et, it);
- return function(t) {
- var i = typeof t.getAttributeNode !== C && t.getAttributeNode("id");
- return i && i.value === e
- }
- }), n.find.TAG = i.getElementsByTagName ? function(t, e) {
- return typeof e.getElementsByTagName !== C ? e.getElementsByTagName(t) : void 0
- } : function(t, e) {
- var i, n = [],
- r = 0,
- o = e.getElementsByTagName(t);
- if ("*" === t) {
- for (; i = o[r++];) 1 === i.nodeType && n.push(i);
- return n
- }
- return o
- }, n.find.CLASS = i.getElementsByClassName && function(t, e) {
- return typeof e.getElementsByClassName !== C && m ? e.getElementsByClassName(t) : void 0
- }, v = [], g = [], (i.qsa = Q.test(r.querySelectorAll)) && (at((function(t) {
- t.innerHTML = "<select msallowclip=''><option selected=''></option></select>", t.querySelectorAll("[msallowclip^='']")
- .length && g.push("[*^$]=" + F + "*(?:''|\"\")"), t.querySelectorAll("[selected]")
- .length || g.push("\\[" + F + "*(?:value|" + k + ")"), t.querySelectorAll(":checked")
- .length || g.push(":checked")
- })), at((function(t) {
- var e = r.createElement("input");
- e.setAttribute("type", "hidden"), t.appendChild(e)
- .setAttribute("name", "D"), t.querySelectorAll("[name=d]")
- .length && g.push("name" + F + "*[*^$|!~]?="), t.querySelectorAll(":enabled")
- .length || g.push(":enabled", ":disabled"), t.querySelectorAll("*,:x"), g.push(",.*:")
- }))), (i.matchesSelector = Q.test(y = f.matches || f.webkitMatchesSelector || f.mozMatchesSelector || f.oMatchesSelector || f.msMatchesSelector)) && at((function(t) {
- i.disconnectedMatch = y.call(t, "div"), y.call(t, "[s!='']:x"), v.push("!=", V)
- })), g = g.length && new RegExp(g.join("|")), v = v.length && new RegExp(v.join("|")), e = Q.test(f.compareDocumentPosition), b = e || Q.test(f.contains) ? function(t, e) {
- var i = 9 === t.nodeType ? t.documentElement : t,
- n = e && e.parentNode;
- return t === n || !(!n || 1 !== n.nodeType || !(i.contains ? i.contains(n) : t.compareDocumentPosition && 16 & t.compareDocumentPosition(n)))
- } : function(t, e) {
- if (e)
- for (; e = e.parentNode;)
- if (e === t) return !0;
- return !1
- }, P = e ? function(t, e) {
- if (t === e) return c = !0, 0;
- var n = !t.compareDocumentPosition - !e.compareDocumentPosition;
- return n || (1 & (n = (t.ownerDocument || t) === (e.ownerDocument || e) ? t.compareDocumentPosition(e) : 1) || !i.sortDetached && e.compareDocumentPosition(t) === n ? t === r || t.ownerDocument === x && b(x, t) ? -1 : e === r || e.ownerDocument === x && b(x, e) ? 1 : h ? N.call(h, t) - N.call(h, e) : 0 : 4 & n ? -1 : 1)
- } : function(t, e) {
- if (t === e) return c = !0, 0;
- var i, n = 0,
- o = t.parentNode,
- a = e.parentNode,
- s = [t],
- l = [e];
- if (!o || !a) return t === r ? -1 : e === r ? 1 : o ? -1 : a ? 1 : h ? N.call(h, t) - N.call(h, e) : 0;
- if (o === a) return lt(t, e);
- for (i = t; i = i.parentNode;) s.unshift(i);
- for (i = e; i = i.parentNode;) l.unshift(i);
- for (; s[n] === l[n];) n++;
- return n ? lt(s[n], l[n]) : s[n] === x ? -1 : l[n] === x ? 1 : 0
- }, r) : p
- }, nt.matches = function(t, e) {
- return nt(t, null, null, e)
- }, nt.matchesSelector = function(t, e) {
- if ((t.ownerDocument || t) !== p && d(t), e = e.replace(W, "='$1']"), !(!i.matchesSelector || !m || v && v.test(e) || g && g.test(e))) try {
- var n = y.call(t, e);
- if (n || i.disconnectedMatch || t.document && 11 !== t.document.nodeType) return n
- } catch (t) {}
- return nt(e, p, null, [t])
- .length > 0
- }, nt.contains = function(t, e) {
- return (t.ownerDocument || t) !== p && d(t), b(t, e)
- }, nt.attr = function(t, e) {
- (t.ownerDocument || t) !== p && d(t);
- var r = n.attrHandle[e.toLowerCase()],
- o = r && E.call(n.attrHandle, e.toLowerCase()) ? r(t, e, !m) : void 0;
- return void 0 !== o ? o : i.attributes || !m ? t.getAttribute(e) : (o = t.getAttributeNode(e)) && o.specified ? o.value : null
- }, nt.error = function(t) {
- throw new Error("Syntax error, unrecognized expression: " + t)
- }, nt.uniqueSort = function(t) {
- var e, n = [],
- r = 0,
- o = 0;
- if (c = !i.detectDuplicates, h = !i.sortStable && t.slice(0), t.sort(P), c) {
- for (; e = t[o++];) e === t[o] && (r = n.push(o));
- for (; r--;) t.splice(n[r], 1)
- }
- return h = null, t
- }, r = nt.getText = function(t) {
- var e, i = "",
- n = 0,
- o = t.nodeType;
- if (o) {
- if (1 === o || 9 === o || 11 === o) {
- if ("string" == typeof t.textContent) return t.textContent;
- for (t = t.firstChild; t; t = t.nextSibling) i += r(t)
- } else if (3 === o || 4 === o) return t.nodeValue
- } else
- for (; e = t[n++];) i += r(e);
- return i
- }, (n = nt.selectors = {
- cacheLength: 50,
- createPseudo: ot,
- match: X,
- attrHandle: {},
- find: {},
- relative: {
- ">": {
- dir: "parentNode",
- first: !0
- },
- " ": {
- dir: "parentNode"
- },
- "+": {
- dir: "previousSibling",
- first: !0
- },
- "~": {
- dir: "previousSibling"
- }
- },
- preFilter: {
- ATTR: function(t) {
- return t[1] = t[1].replace(et, it), t[3] = (t[3] || t[4] || t[5] || "")
- .replace(et, it), "~=" === t[2] && (t[3] = " " + t[3] + " "), t.slice(0, 4)
- },
- CHILD: function(t) {
- return t[1] = t[1].toLowerCase(), "nth" === t[1].slice(0, 3) ? (t[3] || nt.error(t[0]), t[4] = +(t[4] ? t[5] + (t[6] || 1) : 2 * ("even" === t[3] || "odd" === t[3])), t[5] = +(t[7] + t[8] || "odd" === t[3])) : t[3] && nt.error(t[0]), t
- },
- PSEUDO: function(t) {
- var e, i = !t[6] && t[2];
- return X.CHILD.test(t[0]) ? null : (t[3] ? t[2] = t[4] || t[5] || "" : i && q.test(i) && (e = a(i, !0)) && (e = i.indexOf(")", i.length - e) - i.length) && (t[0] = t[0].slice(0, e), t[2] = i.slice(0, e)), t.slice(0, 3))
- }
- },
- filter: {
- TAG: function(t) {
- var e = t.replace(et, it)
- .toLowerCase();
- return "*" === t ? function() {
- return !0
- } : function(t) {
- return t.nodeName && t.nodeName.toLowerCase() === e
- }
- },
- CLASS: function(t) {
- var e = S[t + " "];
- return e || (e = new RegExp("(^|" + F + ")" + t + "(" + F + "|$)")) && S(t, (function(t) {
- return e.test("string" == typeof t.className && t.className || typeof t.getAttribute !== C && t.getAttribute("class") || "")
- }))
- },
- ATTR: function(t, e, i) {
- return function(n) {
- var r = nt.attr(n, t);
- return null == r ? "!=" === e : !e || (r += "", "=" === e ? r === i : "!=" === e ? r !== i : "^=" === e ? i && 0 === r.indexOf(i) : "*=" === e ? i && r.indexOf(i) > -1 : "$=" === e ? i && r.slice(-i.length) === i : "~=" === e ? (" " + r + " ")
- .indexOf(i) > -1 : "|=" === e && (r === i || r.slice(0, i.length + 1) === i + "-"))
- }
- },
- CHILD: function(t, e, i, n, r) {
- var o = "nth" !== t.slice(0, 3),
- a = "last" !== t.slice(-4),
- s = "of-type" === e;
- return 1 === n && 0 === r ? function(t) {
- return !!t.parentNode
- } : function(e, i, l) {
- var u, h, c, d, p, f, m = o !== a ? "nextSibling" : "previousSibling",
- g = e.parentNode,
- v = s && e.nodeName.toLowerCase(),
- y = !l && !s;
- if (g) {
- if (o) {
- for (; m;) {
- for (c = e; c = c[m];)
- if (s ? c.nodeName.toLowerCase() === v : 1 === c.nodeType) return !1;
- f = m = "only" === t && !f && "nextSibling"
- }
- return !0
- }
- if (f = [a ? g.firstChild : g.lastChild], a && y) {
- for (p = (u = (h = g[w] || (g[w] = {}))[t] || [])[0] === M && u[1], d = u[0] === M && u[2], c = p && g.childNodes[p]; c = ++p && c && c[m] || (d = p = 0) || f.pop();)
- if (1 === c.nodeType && ++d && c === e) {
- h[t] = [M, p, d];
- break
- }
- } else if (y && (u = (e[w] || (e[w] = {}))[t]) && u[0] === M) d = u[1];
- else
- for (;
- (c = ++p && c && c[m] || (d = p = 0) || f.pop()) && ((s ? c.nodeName.toLowerCase() !== v : 1 !== c.nodeType) || !++d || (y && ((c[w] || (c[w] = {}))[t] = [M, d]), c !== e)););
- return (d -= r) === n || d % n == 0 && d / n >= 0
- }
- }
- },
- PSEUDO: function(t, e) {
- var i, r = n.pseudos[t] || n.setFilters[t.toLowerCase()] || nt.error("unsupported pseudo: " + t);
- return r[w] ? r(e) : r.length > 1 ? (i = [t, t, "", e], n.setFilters.hasOwnProperty(t.toLowerCase()) ? ot((function(t, i) {
- for (var n, o = r(t, e), a = o.length; a--;) t[n = N.call(t, o[a])] = !(i[n] = o[a])
- })) : function(t) {
- return r(t, 0, i)
- }) : r
- }
- },
- pseudos: {
- not: ot((function(t) {
- var e = [],
- i = [],
- n = s(t.replace(j, "$1"));
- return n[w] ? ot((function(t, e, i, r) {
- for (var o, a = n(t, null, r, []), s = t.length; s--;)(o = a[s]) && (t[s] = !(e[s] = o))
- })) : function(t, r, o) {
- return e[0] = t, n(e, null, o, i), !i.pop()
- }
- })),
- has: ot((function(t) {
- return function(e) {
- return nt(t, e)
- .length > 0
- }
- })),
- contains: ot((function(t) {
- return function(e) {
- return (e.textContent || e.innerText || r(e))
- .indexOf(t) > -1
- }
- })),
- lang: ot((function(t) {
- return Y.test(t || "") || nt.error("unsupported lang: " + t), t = t.replace(et, it)
- .toLowerCase(),
- function(e) {
- var i;
- do {
- if (i = m ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang")) return (i = i.toLowerCase()) === t || 0 === i.indexOf(t + "-")
- } while ((e = e.parentNode) && 1 === e.nodeType);
- return !1
- }
- })),
- target: function(e) {
- var i = t.location && t.location.hash;
- return i && i.slice(1) === e.id
- },
- root: function(t) {
- return t === f
- },
- focus: function(t) {
- return t === p.activeElement && (!p.hasFocus || p.hasFocus()) && !!(t.type || t.href || ~t.tabIndex)
- },
- enabled: function(t) {
- return !1 === t.disabled
- },
- disabled: function(t) {
- return !0 === t.disabled
- },
- checked: function(t) {
- var e = t.nodeName.toLowerCase();
- return "input" === e && !!t.checked || "option" === e && !!t.selected
- },
- selected: function(t) {
- return t.parentNode && t.parentNode.selectedIndex, !0 === t.selected
- },
- empty: function(t) {
- for (t = t.firstChild; t; t = t.nextSibling)
- if (t.nodeType < 6) return !1;
- return !0
- },
- parent: function(t) {
- return !n.pseudos.empty(t)
- },
- header: function(t) {
- return K.test(t.nodeName)
- },
- input: function(t) {
- return Z.test(t.nodeName)
- },
- button: function(t) {
- var e = t.nodeName.toLowerCase();
- return "input" === e && "button" === t.type || "button" === e
- },
- text: function(t) {
- var e;
- return "input" === t.nodeName.toLowerCase() && "text" === t.type && (null == (e = t.getAttribute("type")) || "text" === e.toLowerCase())
- },
- first: ct((function() {
- return [0]
- })),
- last: ct((function(t, e) {
- return [e - 1]
- })),
- eq: ct((function(t, e, i) {
- return [0 > i ? i + e : i]
- })),
- even: ct((function(t, e) {
- for (var i = 0; e > i; i += 2) t.push(i);
- return t
- })),
- odd: ct((function(t, e) {
- for (var i = 1; e > i; i += 2) t.push(i);
- return t
- })),
- lt: ct((function(t, e, i) {
- for (var n = 0 > i ? i + e : i; --n >= 0;) t.push(n);
- return t
- })),
- gt: ct((function(t, e, i) {
- for (var n = 0 > i ? i + e : i; ++n < e;) t.push(n);
- return t
- }))
- }
- })
- .pseudos.nth = n.pseudos.eq, {
- radio: !0,
- checkbox: !0,
- file: !0,
- password: !0,
- image: !0
- }) n.pseudos[e] = ut(e);
- for (e in {
- submit: !0,
- reset: !0
- }) n.pseudos[e] = ht(e);
- function pt() {}
- function ft(t) {
- for (var e = 0, i = t.length, n = ""; i > e; e++) n += t[e].value;
- return n
- }
- function mt(t, e, i) {
- var n = e.dir,
- r = i && "parentNode" === n,
- o = T++;
- return e.first ? function(e, i, o) {
- for (; e = e[n];)
- if (1 === e.nodeType || r) return t(e, i, o)
- } : function(e, i, a) {
- var s, l, u = [M, o];
- if (a) {
- for (; e = e[n];)
- if ((1 === e.nodeType || r) && t(e, i, a)) return !0
- } else
- for (; e = e[n];)
- if (1 === e.nodeType || r) {
- if ((s = (l = e[w] || (e[w] = {}))[n]) && s[0] === M && s[1] === o) return u[2] = s[2];
- if (l[n] = u, u[2] = t(e, i, a)) return !0
- }
- }
- }
- function gt(t) {
- return t.length > 1 ? function(e, i, n) {
- for (var r = t.length; r--;)
- if (!t[r](e, i, n)) return !1;
- return !0
- } : t[0]
- }
- function vt(t, e, i, n, r) {
- for (var o, a = [], s = 0, l = t.length, u = null != e; l > s; s++)(o = t[s]) && (!i || i(o, n, r)) && (a.push(o), u && e.push(s));
- return a
- }
- function yt(t, e, i, n, r, o) {
- return n && !n[w] && (n = yt(n)), r && !r[w] && (r = yt(r, o)), ot((function(o, a, s, l) {
- var u, h, c, d = [],
- p = [],
- f = a.length,
- m = o || function(t, e, i) {
- for (var n = 0, r = e.length; r > n; n++) nt(t, e[n], i);
- return i
- }(e || "*", s.nodeType ? [s] : s, []),
- g = !t || !o && e ? m : vt(m, d, t, s, l),
- v = i ? r || (o ? t : f || n) ? [] : a : g;
- if (i && i(g, v, s, l), n)
- for (u = vt(v, p), n(u, [], s, l), h = u.length; h--;)(c = u[h]) && (v[p[h]] = !(g[p[h]] = c));
- if (o) {
- if (r || t) {
- if (r) {
- for (u = [], h = v.length; h--;)(c = v[h]) && u.push(g[h] = c);
- r(null, v = [], u, l)
- }
- for (h = v.length; h--;)(c = v[h]) && (u = r ? N.call(o, c) : d[h]) > -1 && (o[u] = !(a[u] = c))
- }
- } else v = vt(v === a ? v.splice(f, v.length) : v), r ? r(null, a, v, l) : I.apply(a, v)
- }))
- }
- function bt(t) {
- for (var e, i, r, o = t.length, a = n.relative[t[0].type], s = a || n.relative[" "], l = a ? 1 : 0, h = mt((function(t) {
- return t === e
- }), s, !0), c = mt((function(t) {
- return N.call(e, t) > -1
- }), s, !0), d = [function(t, i, n) {
- return !a && (n || i !== u) || ((e = i)
- .nodeType ? h(t, i, n) : c(t, i, n))
- }]; o > l; l++)
- if (i = n.relative[t[l].type]) d = [mt(gt(d), i)];
- else {
- if ((i = n.filter[t[l].type].apply(null, t[l].matches))[w]) {
- for (r = ++l; o > r && !n.relative[t[r].type]; r++);
- return yt(l > 1 && gt(d), l > 1 && ft(t.slice(0, l - 1)
- .concat({
- value: " " === t[l - 2].type ? "*" : ""
- }))
- .replace(j, "$1"), i, r > l && bt(t.slice(l, r)), o > r && bt(t = t.slice(r)), o > r && ft(t))
- }
- d.push(i)
- } return gt(d)
- }
- function wt(t, e) {
- var i = e.length > 0,
- r = t.length > 0,
- o = function(o, a, s, l, h) {
- var c, d, f, m = 0,
- g = "0",
- v = o && [],
- y = [],
- b = u,
- w = o || r && n.find.TAG("*", h),
- x = M += null == b ? 1 : Math.random() || .1,
- T = w.length;
- for (h && (u = a !== p && a); g !== T && null != (c = w[g]); g++) {
- if (r && c) {
- for (d = 0; f = t[d++];)
- if (f(c, a, s)) {
- l.push(c);
- break
- } h && (M = x)
- }
- i && ((c = !f && c) && m--, o && v.push(c))
- }
- if (m += g, i && g !== m) {
- for (d = 0; f = e[d++];) f(v, y, a, s);
- if (o) {
- if (m > 0)
- for (; g--;) v[g] || y[g] || (y[g] = L.call(l));
- y = vt(y)
- }
- I.apply(l, y), h && !o && y.length > 0 && m + e.length > 1 && nt.uniqueSort(l)
- }
- return h && (M = x, u = b), v
- };
- return i ? ot(o) : o
- }
- return pt.prototype = n.filters = n.pseudos, n.setFilters = new pt, a = nt.tokenize = function(t, e) {
- var i, r, o, a, s, l, u, h = _[t + " "];
- if (h) return e ? 0 : h.slice(0);
- for (s = t, l = [], u = n.preFilter; s;) {
- for (a in (!i || (r = H.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(o = [])), i = !1, (r = G.exec(s)) && (i = r.shift(), o.push({
- value: i,
- type: r[0].replace(j, " ")
- }), s = s.slice(i.length)), n.filter) !(r = X[a].exec(s)) || u[a] && !(r = u[a](r)) || (i = r.shift(), o.push({
- value: i,
- type: a,
- matches: r
- }), s = s.slice(i.length));
- if (!i) break
- }
- return e ? s.length : s ? nt.error(t) : _(t, l)
- .slice(0)
- }, s = nt.compile = function(t, e) {
- var i, n = [],
- r = [],
- o = A[t + " "];
- if (!o) {
- for (e || (e = a(t)), i = e.length; i--;)(o = bt(e[i]))[w] ? n.push(o) : r.push(o);
- (o = A(t, wt(r, n)))
- .selector = t
- }
- return o
- }, l = nt.select = function(t, e, r, o) {
- var l, u, h, c, d, p = "function" == typeof t && t,
- f = !o && a(t = p.selector || t);
- if (r = r || [], 1 === f.length) {
- if ((u = f[0] = f[0].slice(0))
- .length > 2 && "ID" === (h = u[0])
- .type && i.getById && 9 === e.nodeType && m && n.relative[u[1].type]) {
- if (!(e = (n.find.ID(h.matches[0].replace(et, it), e) || [])[0])) return r;
- p && (e = e.parentNode), t = t.slice(u.shift()
- .value.length)
- }
- for (l = X.needsContext.test(t) ? 0 : u.length; l-- && (h = u[l], !n.relative[c = h.type]);)
- if ((d = n.find[c]) && (o = d(h.matches[0].replace(et, it), $.test(u[0].type) && dt(e.parentNode) || e))) {
- if (u.splice(l, 1), !(t = o.length && ft(u))) return I.apply(r, o), r;
- break
- }
- }
- return (p || s(t, f))(o, e, !m, r, $.test(t) && dt(e.parentNode) || e), r
- }, i.sortStable = w.split("")
- .sort(P)
- .join("") === w, i.detectDuplicates = !!c, d(), i.sortDetached = at((function(t) {
- return 1 & t.compareDocumentPosition(p.createElement("div"))
- })), at((function(t) {
- return t.innerHTML = "<a href='#'></a>", "#" === t.firstChild.getAttribute("href")
- })) || st("type|href|height|width", (function(t, e, i) {
- return i ? void 0 : t.getAttribute(e, "type" === e.toLowerCase() ? 1 : 2)
- })), i.attributes && at((function(t) {
- return t.innerHTML = "<input/>", t.firstChild.setAttribute("value", ""), "" === t.firstChild.getAttribute("value")
- })) || st("value", (function(t, e, i) {
- return i || "input" !== t.nodeName.toLowerCase() ? void 0 : t.defaultValue
- })), at((function(t) {
- return null == t.getAttribute("disabled")
- })) || st(k, (function(t, e, i) {
- var n;
- return i ? void 0 : !0 === t[e] ? e.toLowerCase() : (n = t.getAttributeNode(e)) && n.specified ? n.value : null
- })), nt
- }(i);
- g.find = M, g.expr = M.selectors, g.expr[":"] = g.expr.pseudos, g.unique = M.uniqueSort, g.text = M.getText, g.isXMLDoc = M.isXML, g.contains = M.contains;
- var T = g.expr.match.needsContext,
- S = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
- _ = /^.[^:#\[\.,]*$/;
- function A(t, e, i) {
- if (g.isFunction(e)) return g.grep(t, (function(t, n) {
- return !!e.call(t, n, t) !== i
- }));
- if (e.nodeType) return g.grep(t, (function(t) {
- return t === e !== i
- }));
- if ("string" == typeof e) {
- if (_.test(e)) return g.filter(e, t, i);
- e = g.filter(e, t)
- }
- return g.grep(t, (function(t) {
- return u.call(e, t) >= 0 !== i
- }))
- }
- g.filter = function(t, e, i) {
- var n = e[0];
- return i && (t = ":not(" + t + ")"), 1 === e.length && 1 === n.nodeType ? g.find.matchesSelector(n, t) ? [n] : [] : g.find.matches(t, g.grep(e, (function(t) {
- return 1 === t.nodeType
- })))
- }, g.fn.extend({
- find: function(t) {
- var e, i = this.length,
- n = [],
- r = this;
- if ("string" != typeof t) return this.pushStack(g(t)
- .filter((function() {
- for (e = 0; i > e; e++)
- if (g.contains(r[e], this)) return !0
- })));
- for (e = 0; i > e; e++) g.find(t, r[e], n);
- return (n = this.pushStack(i > 1 ? g.unique(n) : n))
- .selector = this.selector ? this.selector + " " + t : t, n
- },
- filter: function(t) {
- return this.pushStack(A(this, t || [], !1))
- },
- not: function(t) {
- return this.pushStack(A(this, t || [], !0))
- },
- is: function(t) {
- return !!A(this, "string" == typeof t && T.test(t) ? g(t) : t || [], !1)
- .length
- }
- });
- var P, C = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
- (g.fn.init = function(t, e) {
- var i, n;
- if (!t) return this;
- if ("string" == typeof t) {
- if (!(i = "<" === t[0] && ">" === t[t.length - 1] && t.length >= 3 ? [null, t, null] : C.exec(t)) || !i[1] && e) return !e || e.jquery ? (e || P)
- .find(t) : this.constructor(e)
- .find(t);
- if (i[1]) {
- if (e = e instanceof g ? e[0] : e, g.merge(this, g.parseHTML(i[1], e && e.nodeType ? e.ownerDocument || e : f, !0)), S.test(i[1]) && g.isPlainObject(e))
- for (i in e) g.isFunction(this[i]) ? this[i](e[i]) : this.attr(i, e[i]);
- return this
- }
- return (n = f.getElementById(i[2])) && n.parentNode && (this.length = 1, this[0] = n), this.context = f, this.selector = t, this
- }
- return t.nodeType ? (this.context = this[0] = t, this.length = 1, this) : g.isFunction(t) ? void 0 !== P.ready ? P.ready(t) : t(g) : (void 0 !== t.selector && (this.selector = t.selector, this.context = t.context), g.makeArray(t, this))
- })
- .prototype = g.fn, P = g(f);
- var E = /^(?:parents|prev(?:Until|All))/,
- D = {
- children: !0,
- contents: !0,
- next: !0,
- prev: !0
- };
- function L(t, e) {
- for (;
- (t = t[e]) && 1 !== t.nodeType;);
- return t
- }
- g.extend({
- dir: function(t, e, i) {
- for (var n = [], r = void 0 !== i;
- (t = t[e]) && 9 !== t.nodeType;)
- if (1 === t.nodeType) {
- if (r && g(t)
- .is(i)) break;
- n.push(t)
- } return n
- },
- sibling: function(t, e) {
- for (var i = []; t; t = t.nextSibling) 1 === t.nodeType && t !== e && i.push(t);
- return i
- }
- }), g.fn.extend({
- has: function(t) {
- var e = g(t, this),
- i = e.length;
- return this.filter((function() {
- for (var t = 0; i > t; t++)
- if (g.contains(this, e[t])) return !0
- }))
- },
- closest: function(t, e) {
- for (var i, n = 0, r = this.length, o = [], a = T.test(t) || "string" != typeof t ? g(t, e || this.context) : 0; r > n; n++)
- for (i = this[n]; i && i !== e; i = i.parentNode)
- if (i.nodeType < 11 && (a ? a.index(i) > -1 : 1 === i.nodeType && g.find.matchesSelector(i, t))) {
- o.push(i);
- break
- } return this.pushStack(o.length > 1 ? g.unique(o) : o)
- },
- index: function(t) {
- return t ? "string" == typeof t ? u.call(g(t), this[0]) : u.call(this, t.jquery ? t[0] : t) : this[0] && this[0].parentNode ? this.first()
- .prevAll()
- .length : -1
- },
- add: function(t, e) {
- return this.pushStack(g.unique(g.merge(this.get(), g(t, e))))
- },
- addBack: function(t) {
- return this.add(null == t ? this.prevObject : this.prevObject.filter(t))
- }
- }), g.each({
- parent: function(t) {
- var e = t.parentNode;
- return e && 11 !== e.nodeType ? e : null
- },
- parents: function(t) {
- return g.dir(t, "parentNode")
- },
- parentsUntil: function(t, e, i) {
- return g.dir(t, "parentNode", i)
- },
- next: function(t) {
- return L(t, "nextSibling")
- },
- prev: function(t) {
- return L(t, "previousSibling")
- },
- nextAll: function(t) {
- return g.dir(t, "nextSibling")
- },
- prevAll: function(t) {
- return g.dir(t, "previousSibling")
- },
- nextUntil: function(t, e, i) {
- return g.dir(t, "nextSibling", i)
- },
- prevUntil: function(t, e, i) {
- return g.dir(t, "previousSibling", i)
- },
- siblings: function(t) {
- return g.sibling((t.parentNode || {})
- .firstChild, t)
- },
- children: function(t) {
- return g.sibling(t.firstChild)
- },
- contents: function(t) {
- return t.contentDocument || g.merge([], t.childNodes)
- }
- }, (function(t, e) {
- g.fn[t] = function(i, n) {
- var r = g.map(this, e, i);
- return "Until" !== t.slice(-5) && (n = i), n && "string" == typeof n && (r = g.filter(n, r)), this.length > 1 && (D[t] || g.unique(r), E.test(t) && r.reverse()), this.pushStack(r)
- }
- }));
- var O, I = /\S+/g,
- R = {};
- function N() {
- f.removeEventListener("DOMContentLoaded", N, !1), i.removeEventListener("load", N, !1), g.ready()
- }
- g.Callbacks = function(t) {
- t = "string" == typeof t ? R[t] || function(t) {
- var e = R[t] = {};
- return g.each(t.match(I) || [], (function(t, i) {
- e[i] = !0
- })), e
- }(t) : g.extend({}, t);
- var e, i, n, r, o, a, s = [],
- l = !t.once && [],
- u = function(c) {
- for (e = t.memory && c, i = !0, a = r || 0, r = 0, o = s.length, n = !0; s && o > a; a++)
- if (!1 === s[a].apply(c[0], c[1]) && t.stopOnFalse) {
- e = !1;
- break
- } n = !1, s && (l ? l.length && u(l.shift()) : e ? s = [] : h.disable())
- },
- h = {
- add: function() {
- if (s) {
- var i = s.length;
- ! function e(i) {
- g.each(i, (function(i, n) {
- var r = g.type(n);
- "function" === r ? t.unique && h.has(n) || s.push(n) : n && n.length && "string" !== r && e(n)
- }))
- }(arguments), n ? o = s.length : e && (r = i, u(e))
- }
- return this
- },
- remove: function() {
- return s && g.each(arguments, (function(t, e) {
- for (var i;
- (i = g.inArray(e, s, i)) > -1;) s.splice(i, 1), n && (o >= i && o--, a >= i && a--)
- })), this
- },
- has: function(t) {
- return t ? g.inArray(t, s) > -1 : !(!s || !s.length)
- },
- empty: function() {
- return s = [], o = 0, this
- },
- disable: function() {
- return s = l = e = void 0, this
- },
- disabled: function() {
- return !s
- },
- lock: function() {
- return l = void 0, e || h.disable(), this
- },
- locked: function() {
- return !l
- },
- fireWith: function(t, e) {
- return !s || i && !l || (e = [t, (e = e || [])
- .slice ? e.slice() : e
- ], n ? l.push(e) : u(e)), this
- },
- fire: function() {
- return h.fireWith(this, arguments), this
- },
- fired: function() {
- return !!i
- }
- };
- return h
- }, g.extend({
- Deferred: function(t) {
- var e = [
- ["resolve", "done", g.Callbacks("once memory"), "resolved"],
- ["reject", "fail", g.Callbacks("once memory"), "rejected"],
- ["notify", "progress", g.Callbacks("memory")]
- ],
- i = "pending",
- n = {
- state: function() {
- return i
- },
- always: function() {
- return r.done(arguments)
- .fail(arguments), this
- },
- then: function() {
- var t = arguments;
- return g.Deferred((function(i) {
- g.each(e, (function(e, o) {
- var a = g.isFunction(t[e]) && t[e];
- r[o[1]]((function() {
- var t = a && a.apply(this, arguments);
- t && g.isFunction(t.promise) ? t.promise()
- .done(i.resolve)
- .fail(i.reject)
- .progress(i.notify) : i[o[0] + "With"](this === n ? i.promise() : this, a ? [t] : arguments)
- }))
- })), t = null
- }))
- .promise()
- },
- promise: function(t) {
- return null != t ? g.extend(t, n) : n
- }
- },
- r = {};
- return n.pipe = n.then, g.each(e, (function(t, o) {
- var a = o[2],
- s = o[3];
- n[o[1]] = a.add, s && a.add((function() {
- i = s
- }), e[1 ^ t][2].disable, e[2][2].lock), r[o[0]] = function() {
- return r[o[0] + "With"](this === r ? n : this, arguments), this
- }, r[o[0] + "With"] = a.fireWith
- })), n.promise(r), t && t.call(r, r), r
- },
- when: function(t) {
- var e, i, n, r = 0,
- o = a.call(arguments),
- s = o.length,
- l = 1 !== s || t && g.isFunction(t.promise) ? s : 0,
- u = 1 === l ? t : g.Deferred(),
- h = function(t, i, n) {
- return function(r) {
- i[t] = this, n[t] = arguments.length > 1 ? a.call(arguments) : r, n === e ? u.notifyWith(i, n) : --l || u.resolveWith(i, n)
- }
- };
- if (s > 1)
- for (e = new Array(s), i = new Array(s), n = new Array(s); s > r; r++) o[r] && g.isFunction(o[r].promise) ? o[r].promise()
- .done(h(r, n, o))
- .fail(u.reject)
- .progress(h(r, i, e)) : --l;
- return l || u.resolveWith(n, o), u.promise()
- }
- }), g.fn.ready = function(t) {
- return g.ready.promise()
- .done(t), this
- }, g.extend({
- isReady: !1,
- readyWait: 1,
- holdReady: function(t) {
- t ? g.readyWait++ : g.ready(!0)
- },
- ready: function(t) {
- (!0 === t ? --g.readyWait : g.isReady) || (g.isReady = !0, !0 !== t && --g.readyWait > 0 || (O.resolveWith(f, [g]), g.fn.triggerHandler && (g(f)
- .triggerHandler("ready"), g(f)
- .off("ready"))))
- }
- }), g.ready.promise = function(t) {
- return O || (O = g.Deferred(), "complete" === f.readyState ? setTimeout(g.ready) : (f.addEventListener("DOMContentLoaded", N, !1), i.addEventListener("load", N, !1))), O.promise(t)
- }, g.ready.promise();
- var k = g.access = function(t, e, i, n, r, o, a) {
- var s = 0,
- l = t.length,
- u = null == i;
- if ("object" === g.type(i))
- for (s in r = !0, i) g.access(t, e, s, i[s], !0, o, a);
- else if (void 0 !== n && (r = !0, g.isFunction(n) || (a = !0), u && (a ? (e.call(t, n), e = null) : (u = e, e = function(t, e, i) {
- return u.call(g(t), i)
- })), e))
- for (; l > s; s++) e(t[s], i, a ? n : n.call(t[s], s, e(t[s], i)));
- return r ? t : u ? e.call(t) : l ? e(t[0], i) : o
- };
- function F() {
- Object.defineProperty(this.cache = {}, 0, {
- get: function() {
- return {}
- }
- }), this.expando = g.expando + Math.random()
- }
- g.acceptData = function(t) {
- return 1 === t.nodeType || 9 === t.nodeType || !+t.nodeType
- }, F.uid = 1, F.accepts = g.acceptData, F.prototype = {
- key: function(t) {
- if (!F.accepts(t)) return 0;
- var e = {},
- i = t[this.expando];
- if (!i) {
- i = F.uid++;
- try {
- e[this.expando] = {
- value: i
- }, Object.defineProperties(t, e)
- } catch (n) {
- e[this.expando] = i, g.extend(t, e)
- }
- }
- return this.cache[i] || (this.cache[i] = {}), i
- },
- set: function(t, e, i) {
- var n, r = this.key(t),
- o = this.cache[r];
- if ("string" == typeof e) o[e] = i;
- else if (g.isEmptyObject(o)) g.extend(this.cache[r], e);
- else
- for (n in e) o[n] = e[n];
- return o
- },
- get: function(t, e) {
- var i = this.cache[this.key(t)];
- return void 0 === e ? i : i[e]
- },
- access: function(t, e, i) {
- var n;
- return void 0 === e || e && "string" == typeof e && void 0 === i ? void 0 !== (n = this.get(t, e)) ? n : this.get(t, g.camelCase(e)) : (this.set(t, e, i), void 0 !== i ? i : e)
- },
- remove: function(t, e) {
- var i, n, r, o = this.key(t),
- a = this.cache[o];
- if (void 0 === e) this.cache[o] = {};
- else {
- g.isArray(e) ? n = e.concat(e.map(g.camelCase)) : (r = g.camelCase(e), e in a ? n = [e, r] : n = (n = r) in a ? [n] : n.match(I) || []), i = n.length;
- for (; i--;) delete a[n[i]]
- }
- },
- hasData: function(t) {
- return !g.isEmptyObject(this.cache[t[this.expando]] || {})
- },
- discard: function(t) {
- t[this.expando] && delete this.cache[t[this.expando]]
- }
- };
- var B = new F,
- z = new F,
- U = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- V = /([A-Z])/g;
- function j(t, e, i) {
- var n;
- if (void 0 === i && 1 === t.nodeType)
- if (n = "data-" + e.replace(V, "-$1")
- .toLowerCase(), "string" == typeof(i = t.getAttribute(n))) {
- try {
- i = "true" === i || "false" !== i && ("null" === i ? null : +i + "" === i ? +i : U.test(i) ? g.parseJSON(i) : i)
- } catch (t) {}
- z.set(t, e, i)
- } else i = void 0;
- return i
- }
- g.extend({
- hasData: function(t) {
- return z.hasData(t) || B.hasData(t)
- },
- data: function(t, e, i) {
- return z.access(t, e, i)
- },
- removeData: function(t, e) {
- z.remove(t, e)
- },
- _data: function(t, e, i) {
- return B.access(t, e, i)
- },
- _removeData: function(t, e) {
- B.remove(t, e)
- }
- }), g.fn.extend({
- data: function(t, e) {
- var i, n, r, o = this[0],
- a = o && o.attributes;
- if (void 0 === t) {
- if (this.length && (r = z.get(o), 1 === o.nodeType && !B.get(o, "hasDataAttrs"))) {
- for (i = a.length; i--;) a[i] && (0 === (n = a[i].name)
- .indexOf("data-") && (n = g.camelCase(n.slice(5)), j(o, n, r[n])));
- B.set(o, "hasDataAttrs", !0)
- }
- return r
- }
- return "object" == typeof t ? this.each((function() {
- z.set(this, t)
- })) : k(this, (function(e) {
- var i, n = g.camelCase(t);
- if (o && void 0 === e) {
- if (void 0 !== (i = z.get(o, t))) return i;
- if (void 0 !== (i = z.get(o, n))) return i;
- if (void 0 !== (i = j(o, n, void 0))) return i
- } else this.each((function() {
- var i = z.get(this, n);
- z.set(this, n, e), -1 !== t.indexOf("-") && void 0 !== i && z.set(this, t, e)
- }))
- }), null, e, arguments.length > 1, null, !0)
- },
- removeData: function(t) {
- return this.each((function() {
- z.remove(this, t)
- }))
- }
- }), g.extend({
- queue: function(t, e, i) {
- var n;
- return t ? (e = (e || "fx") + "queue", n = B.get(t, e), i && (!n || g.isArray(i) ? n = B.access(t, e, g.makeArray(i)) : n.push(i)), n || []) : void 0
- },
- dequeue: function(t, e) {
- e = e || "fx";
- var i = g.queue(t, e),
- n = i.length,
- r = i.shift(),
- o = g._queueHooks(t, e);
- "inprogress" === r && (r = i.shift(), n--), r && ("fx" === e && i.unshift("inprogress"), delete o.stop, r.call(t, (function() {
- g.dequeue(t, e)
- }), o)), !n && o && o.empty.fire()
- },
- _queueHooks: function(t, e) {
- var i = e + "queueHooks";
- return B.get(t, i) || B.access(t, i, {
- empty: g.Callbacks("once memory")
- .add((function() {
- B.remove(t, [e + "queue", i])
- }))
- })
- }
- }), g.fn.extend({
- queue: function(t, e) {
- var i = 2;
- return "string" != typeof t && (e = t, t = "fx", i--), arguments.length < i ? g.queue(this[0], t) : void 0 === e ? this : this.each((function() {
- var i = g.queue(this, t, e);
- g._queueHooks(this, t), "fx" === t && "inprogress" !== i[0] && g.dequeue(this, t)
- }))
- },
- dequeue: function(t) {
- return this.each((function() {
- g.dequeue(this, t)
- }))
- },
- clearQueue: function(t) {
- return this.queue(t || "fx", [])
- },
- promise: function(t, e) {
- var i, n = 1,
- r = g.Deferred(),
- o = this,
- a = this.length,
- s = function() {
- --n || r.resolveWith(o, [o])
- };
- for ("string" != typeof t && (e = t, t = void 0), t = t || "fx"; a--;)(i = B.get(o[a], t + "queueHooks")) && i.empty && (n++, i.empty.add(s));
- return s(), r.promise(e)
- }
- });
- var H = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
- G = ["Top", "Right", "Bottom", "Left"],
- W = function(t, e) {
- return t = e || t, "none" === g.css(t, "display") || !g.contains(t.ownerDocument, t)
- },
- q = /^(?:checkbox|radio)$/i;
- ! function() {
- var t = f.createDocumentFragment()
- .appendChild(f.createElement("div")),
- e = f.createElement("input");
- e.setAttribute("type", "radio"), e.setAttribute("checked", "checked"), e.setAttribute("name", "t"), t.appendChild(e), p.checkClone = t.cloneNode(!0)
- .cloneNode(!0)
- .lastChild.checked, t.innerHTML = "<textarea>x</textarea>", p.noCloneChecked = !!t.cloneNode(!0)
- .lastChild.defaultValue
- }();
- var Y = "undefined";
- p.focusinBubbles = "onfocusin" in i;
- var X = /^key/,
- Z = /^(?:mouse|pointer|contextmenu)|click/,
- K = /^(?:focusinfocus|focusoutblur)$/,
- Q = /^([^.]*)(?:\.(.+)|)$/;
- function J() {
- return !0
- }
- function $() {
- return !1
- }
- function tt() {
- try {
- return f.activeElement
- } catch (t) {}
- }
- g.event = {
- global: {},
- add: function(t, e, i, n, r) {
- var o, a, s, l, u, h, c, d, p, f, m, v = B.get(t);
- if (v)
- for (i.handler && (i = (o = i)
- .handler, r = o.selector), i.guid || (i.guid = g.guid++), (l = v.events) || (l = v.events = {}), (a = v.handle) || (a = v.handle = function(e) {
- return typeof g !== Y && g.event.triggered !== e.type ? g.event.dispatch.apply(t, arguments) : void 0
- }), u = (e = (e || "")
- .match(I) || [""])
- .length; u--;) p = m = (s = Q.exec(e[u]) || [])[1], f = (s[2] || "")
- .split(".")
- .sort(), p && (c = g.event.special[p] || {}, p = (r ? c.delegateType : c.bindType) || p, c = g.event.special[p] || {}, h = g.extend({
- type: p,
- origType: m,
- data: n,
- handler: i,
- guid: i.guid,
- selector: r,
- needsContext: r && g.expr.match.needsContext.test(r),
- namespace: f.join(".")
- }, o), (d = l[p]) || ((d = l[p] = [])
- .delegateCount = 0, c.setup && !1 !== c.setup.call(t, n, f, a) || t.addEventListener && t.addEventListener(p, a, !1)), c.add && (c.add.call(t, h), h.handler.guid || (h.handler.guid = i.guid)), r ? d.splice(d.delegateCount++, 0, h) : d.push(h), g.event.global[p] = !0)
- },
- remove: function(t, e, i, n, r) {
- var o, a, s, l, u, h, c, d, p, f, m, v = B.hasData(t) && B.get(t);
- if (v && (l = v.events)) {
- for (u = (e = (e || "")
- .match(I) || [""])
- .length; u--;)
- if (p = m = (s = Q.exec(e[u]) || [])[1], f = (s[2] || "")
- .split(".")
- .sort(), p) {
- for (c = g.event.special[p] || {}, d = l[p = (n ? c.delegateType : c.bindType) || p] || [], s = s[2] && new RegExp("(^|\\.)" + f.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = d.length; o--;) h = d[o], !r && m !== h.origType || i && i.guid !== h.guid || s && !s.test(h.namespace) || n && n !== h.selector && ("**" !== n || !h.selector) || (d.splice(o, 1), h.selector && d.delegateCount--, c.remove && c.remove.call(t, h));
- a && !d.length && (c.teardown && !1 !== c.teardown.call(t, f, v.handle) || g.removeEvent(t, p, v.handle), delete l[p])
- } else
- for (p in l) g.event.remove(t, p + e[u], i, n, !0);
- g.isEmptyObject(l) && (delete v.handle, B.remove(t, "events"))
- }
- },
- trigger: function(t, e, n, r) {
- var o, a, s, l, u, h, c, p = [n || f],
- m = d.call(t, "type") ? t.type : t,
- v = d.call(t, "namespace") ? t.namespace.split(".") : [];
- if (a = s = n = n || f, 3 !== n.nodeType && 8 !== n.nodeType && !K.test(m + g.event.triggered) && (m.indexOf(".") >= 0 && (v = m.split("."), m = v.shift(), v.sort()), u = m.indexOf(":") < 0 && "on" + m, (t = t[g.expando] ? t : new g.Event(m, "object" == typeof t && t))
- .isTrigger = r ? 2 : 3, t.namespace = v.join("."), t.namespace_re = t.namespace ? new RegExp("(^|\\.)" + v.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = n), e = null == e ? [t] : g.makeArray(e, [t]), c = g.event.special[m] || {}, r || !c.trigger || !1 !== c.trigger.apply(n, e))) {
- if (!r && !c.noBubble && !g.isWindow(n)) {
- for (l = c.delegateType || m, K.test(l + m) || (a = a.parentNode); a; a = a.parentNode) p.push(a), s = a;
- s === (n.ownerDocument || f) && p.push(s.defaultView || s.parentWindow || i)
- }
- for (o = 0;
- (a = p[o++]) && !t.isPropagationStopped();) t.type = o > 1 ? l : c.bindType || m, (h = (B.get(a, "events") || {})[t.type] && B.get(a, "handle")) && h.apply(a, e), (h = u && a[u]) && h.apply && g.acceptData(a) && (t.result = h.apply(a, e), !1 === t.result && t.preventDefault());
- return t.type = m, r || t.isDefaultPrevented() || c._default && !1 !== c._default.apply(p.pop(), e) || !g.acceptData(n) || u && g.isFunction(n[m]) && !g.isWindow(n) && ((s = n[u]) && (n[u] = null), g.event.triggered = m, n[m](), g.event.triggered = void 0, s && (n[u] = s)), t.result
- }
- },
- dispatch: function(t) {
- t = g.event.fix(t);
- var e, i, n, r, o, s = [],
- l = a.call(arguments),
- u = (B.get(this, "events") || {})[t.type] || [],
- h = g.event.special[t.type] || {};
- if (l[0] = t, t.delegateTarget = this, !h.preDispatch || !1 !== h.preDispatch.call(this, t)) {
- for (s = g.event.handlers.call(this, t, u), e = 0;
- (r = s[e++]) && !t.isPropagationStopped();)
- for (t.currentTarget = r.elem, i = 0;
- (o = r.handlers[i++]) && !t.isImmediatePropagationStopped();)(!t.namespace_re || t.namespace_re.test(o.namespace)) && (t.handleObj = o, t.data = o.data, void 0 !== (n = ((g.event.special[o.origType] || {})
- .handle || o.handler)
- .apply(r.elem, l)) && !1 === (t.result = n) && (t.preventDefault(), t.stopPropagation()));
- return h.postDispatch && h.postDispatch.call(this, t), t.result
- }
- },
- handlers: function(t, e) {
- var i, n, r, o, a = [],
- s = e.delegateCount,
- l = t.target;
- if (s && l.nodeType && (!t.button || "click" !== t.type))
- for (; l !== this; l = l.parentNode || this)
- if (!0 !== l.disabled || "click" !== t.type) {
- for (n = [], i = 0; s > i; i++) void 0 === n[r = (o = e[i])
- .selector + " "] && (n[r] = o.needsContext ? g(r, this)
- .index(l) >= 0 : g.find(r, this, null, [l])
- .length), n[r] && n.push(o);
- n.length && a.push({
- elem: l,
- handlers: n
- })
- } return s < e.length && a.push({
- elem: this,
- handlers: e.slice(s)
- }), a
- },
- props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks: {},
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function(t, e) {
- return null == t.which && (t.which = null != e.charCode ? e.charCode : e.keyCode), t
- }
- },
- mouseHooks: {
- props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function(t, e) {
- var i, n, r, o = e.button;
- return null == t.pageX && null != e.clientX && (n = (i = t.target.ownerDocument || f)
- .documentElement, r = i.body, t.pageX = e.clientX + (n && n.scrollLeft || r && r.scrollLeft || 0) - (n && n.clientLeft || r && r.clientLeft || 0), t.pageY = e.clientY + (n && n.scrollTop || r && r.scrollTop || 0) - (n && n.clientTop || r && r.clientTop || 0)), t.which || void 0 === o || (t.which = 1 & o ? 1 : 2 & o ? 3 : 4 & o ? 2 : 0), t
- }
- },
- fix: function(t) {
- if (t[g.expando]) return t;
- var e, i, n, r = t.type,
- o = t,
- a = this.fixHooks[r];
- for (a || (this.fixHooks[r] = a = Z.test(r) ? this.mouseHooks : X.test(r) ? this.keyHooks : {}), n = a.props ? this.props.concat(a.props) : this.props, t = new g.Event(o), e = n.length; e--;) t[i = n[e]] = o[i];
- return t.target || (t.target = f), 3 === t.target.nodeType && (t.target = t.target.parentNode), a.filter ? a.filter(t, o) : t
- },
- special: {
- load: {
- noBubble: !0
- },
- focus: {
- trigger: function() {
- return this !== tt() && this.focus ? (this.focus(), !1) : void 0
- },
- delegateType: "focusin"
- },
- blur: {
- trigger: function() {
- return this === tt() && this.blur ? (this.blur(), !1) : void 0
- },
- delegateType: "focusout"
- },
- click: {
- trigger: function() {
- return "checkbox" === this.type && this.click && g.nodeName(this, "input") ? (this.click(), !1) : void 0
- },
- _default: function(t) {
- return g.nodeName(t.target, "a")
- }
- },
- beforeunload: {
- postDispatch: function(t) {
- void 0 !== t.result && t.originalEvent && (t.originalEvent.returnValue = t.result)
- }
- }
- },
- simulate: function(t, e, i, n) {
- var r = g.extend(new g.Event, i, {
- type: t,
- isSimulated: !0,
- originalEvent: {}
- });
- n ? g.event.trigger(r, null, e) : g.event.dispatch.call(e, r), r.isDefaultPrevented() && i.preventDefault()
- }
- }, g.removeEvent = function(t, e, i) {
- t.removeEventListener && t.removeEventListener(e, i, !1)
- }, g.Event = function(t, e) {
- return this instanceof g.Event ? (t && t.type ? (this.originalEvent = t, this.type = t.type, this.isDefaultPrevented = t.defaultPrevented || void 0 === t.defaultPrevented && !1 === t.returnValue ? J : $) : this.type = t, e && g.extend(this, e), this.timeStamp = t && t.timeStamp || g.now(), void(this[g.expando] = !0)) : new g.Event(t, e)
- }, g.Event.prototype = {
- isDefaultPrevented: $,
- isPropagationStopped: $,
- isImmediatePropagationStopped: $,
- preventDefault: function() {
- var t = this.originalEvent;
- this.isDefaultPrevented = J, t && t.preventDefault && t.preventDefault()
- },
- stopPropagation: function() {
- var t = this.originalEvent;
- this.isPropagationStopped = J, t && t.stopPropagation && t.stopPropagation()
- },
- stopImmediatePropagation: function() {
- var t = this.originalEvent;
- this.isImmediatePropagationStopped = J, t && t.stopImmediatePropagation && t.stopImmediatePropagation(), this.stopPropagation()
- }
- }, g.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, (function(t, e) {
- g.event.special[t] = {
- delegateType: e,
- bindType: e,
- handle: function(t) {
- var i, n = this,
- r = t.relatedTarget,
- o = t.handleObj;
- return (!r || r !== n && !g.contains(n, r)) && (t.type = o.origType, i = o.handler.apply(this, arguments), t.type = e), i
- }
- }
- })), p.focusinBubbles || g.each({
- focus: "focusin",
- blur: "focusout"
- }, (function(t, e) {
- var i = function(t) {
- g.event.simulate(e, t.target, g.event.fix(t), !0)
- };
- g.event.special[e] = {
- setup: function() {
- var n = this.ownerDocument || this,
- r = B.access(n, e);
- r || n.addEventListener(t, i, !0), B.access(n, e, (r || 0) + 1)
- },
- teardown: function() {
- var n = this.ownerDocument || this,
- r = B.access(n, e) - 1;
- r ? B.access(n, e, r) : (n.removeEventListener(t, i, !0), B.remove(n, e))
- }
- }
- })), g.fn.extend({
- on: function(t, e, i, n, r) {
- var o, a;
- if ("object" == typeof t) {
- for (a in "string" != typeof e && (i = i || e, e = void 0), t) this.on(a, e, i, t[a], r);
- return this
- }
- if (null == i && null == n ? (n = e, i = e = void 0) : null == n && ("string" == typeof e ? (n = i, i = void 0) : (n = i, i = e, e = void 0)), !1 === n) n = $;
- else if (!n) return this;
- return 1 === r && (o = n, (n = function(t) {
- return g()
- .off(t), o.apply(this, arguments)
- })
- .guid = o.guid || (o.guid = g.guid++)), this.each((function() {
- g.event.add(this, t, n, i, e)
- }))
- },
- one: function(t, e, i, n) {
- return this.on(t, e, i, n, 1)
- },
- off: function(t, e, i) {
- var n, r;
- if (t && t.preventDefault && t.handleObj) return n = t.handleObj, g(t.delegateTarget)
- .off(n.namespace ? n.origType + "." + n.namespace : n.origType, n.selector, n.handler), this;
- if ("object" == typeof t) {
- for (r in t) this.off(r, e, t[r]);
- return this
- }
- return (!1 === e || "function" == typeof e) && (i = e, e = void 0), !1 === i && (i = $), this.each((function() {
- g.event.remove(this, t, i, e)
- }))
- },
- trigger: function(t, e) {
- return this.each((function() {
- g.event.trigger(t, e, this)
- }))
- },
- triggerHandler: function(t, e) {
- var i = this[0];
- return i ? g.event.trigger(t, e, i, !0) : void 0
- }
- });
- var et = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- it = /<([\w:]+)/,
- nt = /<|&#?\w+;/,
- rt = /<(?:script|style|link)/i,
- ot = /checked\s*(?:[^=]|=\s*.checked.)/i,
- at = /^$|\/(?:java|ecma)script/i,
- st = /^true\/(.*)/,
- lt = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
- ut = {
- option: [1, "<select multiple='multiple'>", "</select>"],
- thead: [1, "<table>", "</table>"],
- col: [2, "<table><colgroup>", "</colgroup></table>"],
- tr: [2, "<table><tbody>", "</tbody></table>"],
- td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
- _default: [0, "", ""]
- };
- function ht(t, e) {
- return g.nodeName(t, "table") && g.nodeName(11 !== e.nodeType ? e : e.firstChild, "tr") ? t.getElementsByTagName("tbody")[0] || t.appendChild(t.ownerDocument.createElement("tbody")) : t
- }
- function ct(t) {
- return t.type = (null !== t.getAttribute("type")) + "/" + t.type, t
- }
- function dt(t) {
- var e = st.exec(t.type);
- return e ? t.type = e[1] : t.removeAttribute("type"), t
- }
- function pt(t, e) {
- for (var i = 0, n = t.length; n > i; i++) B.set(t[i], "globalEval", !e || B.get(e[i], "globalEval"))
- }
- function ft(t, e) {
- var i, n, r, o, a, s, l, u;
- if (1 === e.nodeType) {
- if (B.hasData(t) && (o = B.access(t), a = B.set(e, o), u = o.events))
- for (r in delete a.handle, a.events = {}, u)
- for (i = 0, n = u[r].length; n > i; i++) g.event.add(e, r, u[r][i]);
- z.hasData(t) && (s = z.access(t), l = g.extend({}, s), z.set(e, l))
- }
- }
- function mt(t, e) {
- var i = t.getElementsByTagName ? t.getElementsByTagName(e || "*") : t.querySelectorAll ? t.querySelectorAll(e || "*") : [];
- return void 0 === e || e && g.nodeName(t, e) ? g.merge([t], i) : i
- }
- function gt(t, e) {
- var i = e.nodeName.toLowerCase();
- "input" === i && q.test(t.type) ? e.checked = t.checked : ("input" === i || "textarea" === i) && (e.defaultValue = t.defaultValue)
- }
- ut.optgroup = ut.option, ut.tbody = ut.tfoot = ut.colgroup = ut.caption = ut.thead, ut.th = ut.td, g.extend({
- clone: function(t, e, i) {
- var n, r, o, a, s = t.cloneNode(!0),
- l = g.contains(t.ownerDocument, t);
- if (!(p.noCloneChecked || 1 !== t.nodeType && 11 !== t.nodeType || g.isXMLDoc(t)))
- for (a = mt(s), n = 0, r = (o = mt(t))
- .length; r > n; n++) gt(o[n], a[n]);
- if (e)
- if (i)
- for (o = o || mt(t), a = a || mt(s), n = 0, r = o.length; r > n; n++) ft(o[n], a[n]);
- else ft(t, s);
- return (a = mt(s, "script"))
- .length > 0 && pt(a, !l && mt(t, "script")), s
- },
- buildFragment: function(t, e, i, n) {
- for (var r, o, a, s, l, u, h = e.createDocumentFragment(), c = [], d = 0, p = t.length; p > d; d++)
- if ((r = t[d]) || 0 === r)
- if ("object" === g.type(r)) g.merge(c, r.nodeType ? [r] : r);
- else if (nt.test(r)) {
- for (o = o || h.appendChild(e.createElement("div")), a = (it.exec(r) || ["", ""])[1].toLowerCase(), s = ut[a] || ut._default, o.innerHTML = s[1] + r.replace(et, "<$1></$2>") + s[2], u = s[0]; u--;) o = o.lastChild;
- g.merge(c, o.childNodes), (o = h.firstChild)
- .textContent = ""
- } else c.push(e.createTextNode(r));
- for (h.textContent = "", d = 0; r = c[d++];)
- if ((!n || -1 === g.inArray(r, n)) && (l = g.contains(r.ownerDocument, r), o = mt(h.appendChild(r), "script"), l && pt(o), i))
- for (u = 0; r = o[u++];) at.test(r.type || "") && i.push(r);
- return h
- },
- cleanData: function(t) {
- for (var e, i, n, r, o = g.event.special, a = 0; void 0 !== (i = t[a]); a++) {
- if (g.acceptData(i) && ((r = i[B.expando]) && (e = B.cache[r]))) {
- if (e.events)
- for (n in e.events) o[n] ? g.event.remove(i, n) : g.removeEvent(i, n, e.handle);
- B.cache[r] && delete B.cache[r]
- }
- delete z.cache[i[z.expando]]
- }
- }
- }), g.fn.extend({
- text: function(t) {
- return k(this, (function(t) {
- return void 0 === t ? g.text(this) : this.empty()
- .each((function() {
- (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = t)
- }))
- }), null, t, arguments.length)
- },
- append: function() {
- return this.domManip(arguments, (function(t) {
- 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || ht(this, t)
- .appendChild(t)
- }))
- },
- prepend: function() {
- return this.domManip(arguments, (function(t) {
- if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
- var e = ht(this, t);
- e.insertBefore(t, e.firstChild)
- }
- }))
- },
- before: function() {
- return this.domManip(arguments, (function(t) {
- this.parentNode && this.parentNode.insertBefore(t, this)
- }))
- },
- after: function() {
- return this.domManip(arguments, (function(t) {
- this.parentNode && this.parentNode.insertBefore(t, this.nextSibling)
- }))
- },
- remove: function(t, e) {
- for (var i, n = t ? g.filter(t, this) : this, r = 0; null != (i = n[r]); r++) e || 1 !== i.nodeType || g.cleanData(mt(i)), i.parentNode && (e && g.contains(i.ownerDocument, i) && pt(mt(i, "script")), i.parentNode.removeChild(i));
- return this
- },
- empty: function() {
- for (var t, e = 0; null != (t = this[e]); e++) 1 === t.nodeType && (g.cleanData(mt(t, !1)), t.textContent = "");
- return this
- },
- clone: function(t, e) {
- return t = null != t && t, e = null == e ? t : e, this.map((function() {
- return g.clone(this, t, e)
- }))
- },
- html: function(t) {
- return k(this, (function(t) {
- var e = this[0] || {},
- i = 0,
- n = this.length;
- if (void 0 === t && 1 === e.nodeType) return e.innerHTML;
- if ("string" == typeof t && !rt.test(t) && !ut[(it.exec(t) || ["", ""])[1].toLowerCase()]) {
- t = t.replace(et, "<$1></$2>");
- try {
- for (; n > i; i++) 1 === (e = this[i] || {})
- .nodeType && (g.cleanData(mt(e, !1)), e.innerHTML = t);
- e = 0
- } catch (t) {}
- }
- e && this.empty()
- .append(t)
- }), null, t, arguments.length)
- },
- replaceWith: function() {
- var t = arguments[0];
- return this.domManip(arguments, (function(e) {
- t = this.parentNode, g.cleanData(mt(this)), t && t.replaceChild(e, this)
- })), t && (t.length || t.nodeType) ? this : this.remove()
- },
- detach: function(t) {
- return this.remove(t, !0)
- },
- domManip: function(t, e) {
- t = s.apply([], t);
- var i, n, r, o, a, l, u = 0,
- h = this.length,
- c = this,
- d = h - 1,
- f = t[0],
- m = g.isFunction(f);
- if (m || h > 1 && "string" == typeof f && !p.checkClone && ot.test(f)) return this.each((function(i) {
- var n = c.eq(i);
- m && (t[0] = f.call(this, i, n.html())), n.domManip(t, e)
- }));
- if (h && (n = (i = g.buildFragment(t, this[0].ownerDocument, !1, this))
- .firstChild, 1 === i.childNodes.length && (i = n), n)) {
- for (o = (r = g.map(mt(i, "script"), ct))
- .length; h > u; u++) a = i, u !== d && (a = g.clone(a, !0, !0), o && g.merge(r, mt(a, "script"))), e.call(this[u], a, u);
- if (o)
- for (l = r[r.length - 1].ownerDocument, g.map(r, dt), u = 0; o > u; u++) a = r[u], at.test(a.type || "") && !B.access(a, "globalEval") && g.contains(l, a) && (a.src ? g._evalUrl && g._evalUrl(a.src) : g.globalEval(a.textContent.replace(lt, "")))
- }
- return this
- }
- }), g.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, (function(t, e) {
- g.fn[t] = function(t) {
- for (var i, n = [], r = g(t), o = r.length - 1, a = 0; o >= a; a++) i = a === o ? this : this.clone(!0), g(r[a])[e](i), l.apply(n, i.get());
- return this.pushStack(n)
- }
- }));
- var vt, yt = {};
- function bt(t, e) {
- var n, r = g(e.createElement(t))
- .appendTo(e.body),
- o = i.getDefaultComputedStyle && (n = i.getDefaultComputedStyle(r[0])) ? n.display : g.css(r[0], "display");
- return r.detach(), o
- }
- function wt(t) {
- var e = f,
- i = yt[t];
- return i || ("none" !== (i = bt(t, e)) && i || ((e = (vt = (vt || g("<iframe frameborder='0' width='0' height='0'/>"))
- .appendTo(e.documentElement))[0].contentDocument)
- .write(), e.close(), i = bt(t, e), vt.detach()), yt[t] = i), i
- }
- var xt = /^margin/,
- Mt = new RegExp("^(" + H + ")(?!px)[a-z%]+$", "i"),
- Tt = function(t) {
- return t.ownerDocument.defaultView.getComputedStyle(t, null)
- };
- function St(t, e, i) {
- var n, r, o, a, s = t.style;
- return (i = i || Tt(t)) && (a = i.getPropertyValue(e) || i[e]), i && ("" !== a || g.contains(t.ownerDocument, t) || (a = g.style(t, e)), Mt.test(a) && xt.test(e) && (n = s.width, r = s.minWidth, o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = i.width, s.width = n, s.minWidth = r, s.maxWidth = o)), void 0 !== a ? a + "" : a
- }
- function _t(t, e) {
- return {
- get: function() {
- return t() ? void delete this.get : (this.get = e)
- .apply(this, arguments)
- }
- }
- }! function() {
- var t, e, n = f.documentElement,
- r = f.createElement("div"),
- o = f.createElement("div");
- if (o.style) {
- function a() {
- o.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", o.innerHTML = "", n.appendChild(r);
- var a = i.getComputedStyle(o, null);
- t = "1%" !== a.top, e = "4px" === a.width, n.removeChild(r)
- }
- o.style.backgroundClip = "content-box", o.cloneNode(!0)
- .style.backgroundClip = "", p.clearCloneStyle = "content-box" === o.style.backgroundClip, r.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute", r.appendChild(o), i.getComputedStyle && g.extend(p, {
- pixelPosition: function() {
- return a(), t
- },
- boxSizingReliable: function() {
- return null == e && a(), e
- },
- reliableMarginRight: function() {
- var t, e = o.appendChild(f.createElement("div"));
- return e.style.cssText = o.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", e.style.marginRight = e.style.width = "0", o.style.width = "1px", n.appendChild(r), t = !parseFloat(i.getComputedStyle(e, null)
- .marginRight), n.removeChild(r), t
- }
- })
- }
- }(), g.swap = function(t, e, i, n) {
- var r, o, a = {};
- for (o in e) a[o] = t.style[o], t.style[o] = e[o];
- for (o in r = i.apply(t, n || []), e) t.style[o] = a[o];
- return r
- };
- var At = /^(none|table(?!-c[ea]).+)/,
- Pt = new RegExp("^(" + H + ")(.*)$", "i"),
- Ct = new RegExp("^([+-])=(" + H + ")", "i"),
- Et = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
- },
- Dt = {
- letterSpacing: "0",
- fontWeight: "400"
- },
- Lt = ["Webkit", "O", "Moz", "ms"];
- function Ot(t, e) {
- if (e in t) return e;
- for (var i = e[0].toUpperCase() + e.slice(1), n = e, r = Lt.length; r--;)
- if ((e = Lt[r] + i) in t) return e;
- return n
- }
- function It(t, e, i) {
- var n = Pt.exec(e);
- return n ? Math.max(0, n[1] - (i || 0)) + (n[2] || "px") : e
- }
- function Rt(t, e, i, n, r) {
- for (var o = i === (n ? "border" : "content") ? 4 : "width" === e ? 1 : 0, a = 0; 4 > o; o += 2) "margin" === i && (a += g.css(t, i + G[o], !0, r)), n ? ("content" === i && (a -= g.css(t, "padding" + G[o], !0, r)), "margin" !== i && (a -= g.css(t, "border" + G[o] + "Width", !0, r))) : (a += g.css(t, "padding" + G[o], !0, r), "padding" !== i && (a += g.css(t, "border" + G[o] + "Width", !0, r)));
- return a
- }
- function Nt(t, e, i) {
- var n = !0,
- r = "width" === e ? t.offsetWidth : t.offsetHeight,
- o = Tt(t),
- a = "border-box" === g.css(t, "boxSizing", !1, o);
- if (0 >= r || null == r) {
- if ((0 > (r = St(t, e, o)) || null == r) && (r = t.style[e]), Mt.test(r)) return r;
- n = a && (p.boxSizingReliable() || r === t.style[e]), r = parseFloat(r) || 0
- }
- return r + Rt(t, e, i || (a ? "border" : "content"), n, o) + "px"
- }
- function kt(t, e) {
- for (var i, n, r, o = [], a = 0, s = t.length; s > a; a++)(n = t[a])
- .style && (o[a] = B.get(n, "olddisplay"), i = n.style.display, e ? (o[a] || "none" !== i || (n.style.display = ""), "" === n.style.display && W(n) && (o[a] = B.access(n, "olddisplay", wt(n.nodeName)))) : (r = W(n), "none" === i && r || B.set(n, "olddisplay", r ? i : g.css(n, "display"))));
- for (a = 0; s > a; a++)(n = t[a])
- .style && (e && "none" !== n.style.display && "" !== n.style.display || (n.style.display = e ? o[a] || "" : "none"));
- return t
- }
- function Ft(t, e, i, n, r) {
- return new Ft.prototype.init(t, e, i, n, r)
- }
- g.extend({
- cssHooks: {
- opacity: {
- get: function(t, e) {
- if (e) {
- var i = St(t, "opacity");
- return "" === i ? "1" : i
- }
- }
- }
- },
- cssNumber: {
- columnCount: !0,
- fillOpacity: !0,
- flexGrow: !0,
- flexShrink: !0,
- fontWeight: !0,
- lineHeight: !0,
- opacity: !0,
- order: !0,
- orphans: !0,
- widows: !0,
- zIndex: !0,
- zoom: !0
- },
- cssProps: {
- float: "cssFloat"
- },
- style: function(t, e, i, n) {
- if (t && 3 !== t.nodeType && 8 !== t.nodeType && t.style) {
- var r, o, a, s = g.camelCase(e),
- l = t.style;
- return e = g.cssProps[s] || (g.cssProps[s] = Ot(l, s)), a = g.cssHooks[e] || g.cssHooks[s], void 0 === i ? a && "get" in a && void 0 !== (r = a.get(t, !1, n)) ? r : l[e] : ("string" === (o = typeof i) && (r = Ct.exec(i)) && (i = (r[1] + 1) * r[2] + parseFloat(g.css(t, e)), o = "number"), void(null != i && i == i && ("number" !== o || g.cssNumber[s] || (i += "px"), p.clearCloneStyle || "" !== i || 0 !== e.indexOf("background") || (l[e] = "inherit"), a && "set" in a && void 0 === (i = a.set(t, i, n)) || (l[e] = i))))
- }
- },
- css: function(t, e, i, n) {
- var r, o, a, s = g.camelCase(e);
- return e = g.cssProps[s] || (g.cssProps[s] = Ot(t.style, s)), (a = g.cssHooks[e] || g.cssHooks[s]) && "get" in a && (r = a.get(t, !0, i)), void 0 === r && (r = St(t, e, n)), "normal" === r && e in Dt && (r = Dt[e]), "" === i || i ? (o = parseFloat(r), !0 === i || g.isNumeric(o) ? o || 0 : r) : r
- }
- }), g.each(["height", "width"], (function(t, e) {
- g.cssHooks[e] = {
- get: function(t, i, n) {
- return i ? At.test(g.css(t, "display")) && 0 === t.offsetWidth ? g.swap(t, Et, (function() {
- return Nt(t, e, n)
- })) : Nt(t, e, n) : void 0
- },
- set: function(t, i, n) {
- var r = n && Tt(t);
- return It(0, i, n ? Rt(t, e, n, "border-box" === g.css(t, "boxSizing", !1, r), r) : 0)
- }
- }
- })), g.cssHooks.marginRight = _t(p.reliableMarginRight, (function(t, e) {
- return e ? g.swap(t, {
- display: "inline-block"
- }, St, [t, "marginRight"]) : void 0
- })), g.each({
- margin: "",
- padding: "",
- border: "Width"
- }, (function(t, e) {
- g.cssHooks[t + e] = {
- expand: function(i) {
- for (var n = 0, r = {}, o = "string" == typeof i ? i.split(" ") : [i]; 4 > n; n++) r[t + G[n] + e] = o[n] || o[n - 2] || o[0];
- return r
- }
- }, xt.test(t) || (g.cssHooks[t + e].set = It)
- })), g.fn.extend({
- css: function(t, e) {
- return k(this, (function(t, e, i) {
- var n, r, o = {},
- a = 0;
- if (g.isArray(e)) {
- for (n = Tt(t), r = e.length; r > a; a++) o[e[a]] = g.css(t, e[a], !1, n);
- return o
- }
- return void 0 !== i ? g.style(t, e, i) : g.css(t, e)
- }), t, e, arguments.length > 1)
- },
- show: function() {
- return kt(this, !0)
- },
- hide: function() {
- return kt(this)
- },
- toggle: function(t) {
- return "boolean" == typeof t ? t ? this.show() : this.hide() : this.each((function() {
- W(this) ? g(this)
- .show() : g(this)
- .hide()
- }))
- }
- }), g.Tween = Ft, Ft.prototype = {
- constructor: Ft,
- init: function(t, e, i, n, r, o) {
- this.elem = t, this.prop = i, this.easing = r || "swing", this.options = e, this.start = this.now = this.cur(), this.end = n, this.unit = o || (g.cssNumber[i] ? "" : "px")
- },
- cur: function() {
- var t = Ft.propHooks[this.prop];
- return t && t.get ? t.get(this) : Ft.propHooks._default.get(this)
- },
- run: function(t) {
- var e, i = Ft.propHooks[this.prop];
- return this.pos = e = this.options.duration ? g.easing[this.easing](t, this.options.duration * t, 0, 1, this.options.duration) : t, this.now = (this.end - this.start) * e + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), i && i.set ? i.set(this) : Ft.propHooks._default.set(this), this
- }
- }, Ft.prototype.init.prototype = Ft.prototype, Ft.propHooks = {
- _default: {
- get: function(t) {
- var e;
- return null == t.elem[t.prop] || t.elem.style && null != t.elem.style[t.prop] ? (e = g.css(t.elem, t.prop, "")) && "auto" !== e ? e : 0 : t.elem[t.prop]
- },
- set: function(t) {
- g.fx.step[t.prop] ? g.fx.step[t.prop](t) : t.elem.style && (null != t.elem.style[g.cssProps[t.prop]] || g.cssHooks[t.prop]) ? g.style(t.elem, t.prop, t.now + t.unit) : t.elem[t.prop] = t.now
- }
- }
- }, Ft.propHooks.scrollTop = Ft.propHooks.scrollLeft = {
- set: function(t) {
- t.elem.nodeType && t.elem.parentNode && (t.elem[t.prop] = t.now)
- }
- }, g.easing = {
- linear: function(t) {
- return t
- },
- swing: function(t) {
- return .5 - Math.cos(t * Math.PI) / 2
- }
- }, g.fx = Ft.prototype.init, g.fx.step = {};
- var Bt, zt, Ut = /^(?:toggle|show|hide)$/,
- Vt = new RegExp("^(?:([+-])=|)(" + H + ")([a-z%]*)$", "i"),
- jt = /queueHooks$/,
- Ht = [function(t, e, i) {
- var n, r, o, a, s, l, u, h = this,
- c = {},
- d = t.style,
- p = t.nodeType && W(t),
- f = B.get(t, "fxshow");
- for (n in i.queue || (null == (s = g._queueHooks(t, "fx"))
- .unqueued && (s.unqueued = 0, l = s.empty.fire, s.empty.fire = function() {
- s.unqueued || l()
- }), s.unqueued++, h.always((function() {
- h.always((function() {
- s.unqueued--, g.queue(t, "fx")
- .length || s.empty.fire()
- }))
- }))), 1 === t.nodeType && ("height" in e || "width" in e) && (i.overflow = [d.overflow, d.overflowX, d.overflowY], u = g.css(t, "display"), "inline" === ("none" === u ? B.get(t, "olddisplay") || wt(t.nodeName) : u) && "none" === g.css(t, "float") && (d.display = "inline-block")), i.overflow && (d.overflow = "hidden", h.always((function() {
- d.overflow = i.overflow[0], d.overflowX = i.overflow[1], d.overflowY = i.overflow[2]
- }))), e)
- if (r = e[n], Ut.exec(r)) {
- if (delete e[n], o = o || "toggle" === r, r === (p ? "hide" : "show")) {
- if ("show" !== r || !f || void 0 === f[n]) continue;
- p = !0
- }
- c[n] = f && f[n] || g.style(t, n)
- } else u = void 0;
- if (g.isEmptyObject(c)) "inline" === ("none" === u ? wt(t.nodeName) : u) && (d.display = u);
- else
- for (n in f ? "hidden" in f && (p = f.hidden) : f = B.access(t, "fxshow", {}), o && (f.hidden = !p), p ? g(t)
- .show() : h.done((function() {
- g(t)
- .hide()
- })), h.done((function() {
- var e;
- for (e in B.remove(t, "fxshow"), c) g.style(t, e, c[e])
- })), c) a = Yt(p ? f[n] : 0, n, h), n in f || (f[n] = a.start, p && (a.end = a.start, a.start = "width" === n || "height" === n ? 1 : 0))
- }],
- Gt = {
- "*": [function(t, e) {
- var i = this.createTween(t, e),
- n = i.cur(),
- r = Vt.exec(e),
- o = r && r[3] || (g.cssNumber[t] ? "" : "px"),
- a = (g.cssNumber[t] || "px" !== o && +n) && Vt.exec(g.css(i.elem, t)),
- s = 1,
- l = 20;
- if (a && a[3] !== o) {
- o = o || a[3], r = r || [], a = +n || 1;
- do {
- a /= s = s || ".5", g.style(i.elem, t, a + o)
- } while (s !== (s = i.cur() / n) && 1 !== s && --l)
- }
- return r && (a = i.start = +a || +n || 0, i.unit = o, i.end = r[1] ? a + (r[1] + 1) * r[2] : +r[2]), i
- }]
- };
- function Wt() {
- return setTimeout((function() {
- Bt = void 0
- })), Bt = g.now()
- }
- function qt(t, e) {
- var i, n = 0,
- r = {
- height: t
- };
- for (e = e ? 1 : 0; 4 > n; n += 2 - e) r["margin" + (i = G[n])] = r["padding" + i] = t;
- return e && (r.opacity = r.width = t), r
- }
- function Yt(t, e, i) {
- for (var n, r = (Gt[e] || [])
- .concat(Gt["*"]), o = 0, a = r.length; a > o; o++)
- if (n = r[o].call(i, e, t)) return n
- }
- function Xt(t, e, i) {
- var n, r, o = 0,
- a = Ht.length,
- s = g.Deferred()
- .always((function() {
- delete l.elem
- })),
- l = function() {
- if (r) return !1;
- for (var e = Bt || Wt(), i = Math.max(0, u.startTime + u.duration - e), n = 1 - (i / u.duration || 0), o = 0, a = u.tweens.length; a > o; o++) u.tweens[o].run(n);
- return s.notifyWith(t, [u, n, i]), 1 > n && a ? i : (s.resolveWith(t, [u]), !1)
- },
- u = s.promise({
- elem: t,
- props: g.extend({}, e),
- opts: g.extend(!0, {
- specialEasing: {}
- }, i),
- originalProperties: e,
- originalOptions: i,
- startTime: Bt || Wt(),
- duration: i.duration,
- tweens: [],
- createTween: function(e, i) {
- var n = g.Tween(t, u.opts, e, i, u.opts.specialEasing[e] || u.opts.easing);
- return u.tweens.push(n), n
- },
- stop: function(e) {
- var i = 0,
- n = e ? u.tweens.length : 0;
- if (r) return this;
- for (r = !0; n > i; i++) u.tweens[i].run(1);
- return e ? s.resolveWith(t, [u, e]) : s.rejectWith(t, [u, e]), this
- }
- }),
- h = u.props;
- for (function(t, e) {
- var i, n, r, o, a;
- for (i in t)
- if (r = e[n = g.camelCase(i)], o = t[i], g.isArray(o) && (r = o[1], o = t[i] = o[0]), i !== n && (t[n] = o, delete t[i]), (a = g.cssHooks[n]) && "expand" in a)
- for (i in o = a.expand(o), delete t[n], o) i in t || (t[i] = o[i], e[i] = r);
- else e[n] = r
- }(h, u.opts.specialEasing); a > o; o++)
- if (n = Ht[o].call(u, t, h, u.opts)) return n;
- return g.map(h, Yt, u), g.isFunction(u.opts.start) && u.opts.start.call(t, u), g.fx.timer(g.extend(l, {
- elem: t,
- anim: u,
- queue: u.opts.queue
- })), u.progress(u.opts.progress)
- .done(u.opts.done, u.opts.complete)
- .fail(u.opts.fail)
- .always(u.opts.always)
- }
- g.Animation = g.extend(Xt, {
- tweener: function(t, e) {
- g.isFunction(t) ? (e = t, t = ["*"]) : t = t.split(" ");
- for (var i, n = 0, r = t.length; r > n; n++) i = t[n], Gt[i] = Gt[i] || [], Gt[i].unshift(e)
- },
- prefilter: function(t, e) {
- e ? Ht.unshift(t) : Ht.push(t)
- }
- }), g.speed = function(t, e, i) {
- var n = t && "object" == typeof t ? g.extend({}, t) : {
- complete: i || !i && e || g.isFunction(t) && t,
- duration: t,
- easing: i && e || e && !g.isFunction(e) && e
- };
- return n.duration = g.fx.off ? 0 : "number" == typeof n.duration ? n.duration : n.duration in g.fx.speeds ? g.fx.speeds[n.duration] : g.fx.speeds._default, (null == n.queue || !0 === n.queue) && (n.queue = "fx"), n.old = n.complete, n.complete = function() {
- g.isFunction(n.old) && n.old.call(this), n.queue && g.dequeue(this, n.queue)
- }, n
- }, g.fn.extend({
- fadeTo: function(t, e, i, n) {
- return this.filter(W)
- .css("opacity", 0)
- .show()
- .end()
- .animate({
- opacity: e
- }, t, i, n)
- },
- animate: function(t, e, i, n) {
- var r = g.isEmptyObject(t),
- o = g.speed(e, i, n),
- a = function() {
- var e = Xt(this, g.extend({}, t), o);
- (r || B.get(this, "finish")) && e.stop(!0)
- };
- return a.finish = a, r || !1 === o.queue ? this.each(a) : this.queue(o.queue, a)
- },
- stop: function(t, e, i) {
- var n = function(t) {
- var e = t.stop;
- delete t.stop, e(i)
- };
- return "string" != typeof t && (i = e, e = t, t = void 0), e && !1 !== t && this.queue(t || "fx", []), this.each((function() {
- var e = !0,
- r = null != t && t + "queueHooks",
- o = g.timers,
- a = B.get(this);
- if (r) a[r] && a[r].stop && n(a[r]);
- else
- for (r in a) a[r] && a[r].stop && jt.test(r) && n(a[r]);
- for (r = o.length; r--;) o[r].elem !== this || null != t && o[r].queue !== t || (o[r].anim.stop(i), e = !1, o.splice(r, 1));
- (e || !i) && g.dequeue(this, t)
- }))
- },
- finish: function(t) {
- return !1 !== t && (t = t || "fx"), this.each((function() {
- var e, i = B.get(this),
- n = i[t + "queue"],
- r = i[t + "queueHooks"],
- o = g.timers,
- a = n ? n.length : 0;
- for (i.finish = !0, g.queue(this, t, []), r && r.stop && r.stop.call(this, !0), e = o.length; e--;) o[e].elem === this && o[e].queue === t && (o[e].anim.stop(!0), o.splice(e, 1));
- for (e = 0; a > e; e++) n[e] && n[e].finish && n[e].finish.call(this);
- delete i.finish
- }))
- }
- }), g.each(["toggle", "show", "hide"], (function(t, e) {
- var i = g.fn[e];
- g.fn[e] = function(t, n, r) {
- return null == t || "boolean" == typeof t ? i.apply(this, arguments) : this.animate(qt(e, !0), t, n, r)
- }
- })), g.each({
- slideDown: qt("show"),
- slideUp: qt("hide"),
- slideToggle: qt("toggle"),
- fadeIn: {
- opacity: "show"
- },
- fadeOut: {
- opacity: "hide"
- },
- fadeToggle: {
- opacity: "toggle"
- }
- }, (function(t, e) {
- g.fn[t] = function(t, i, n) {
- return this.animate(e, t, i, n)
- }
- })), g.timers = [], g.fx.tick = function() {
- var t, e = 0,
- i = g.timers;
- for (Bt = g.now(); e < i.length; e++)(t = i[e])() || i[e] !== t || i.splice(e--, 1);
- i.length || g.fx.stop(), Bt = void 0
- }, g.fx.timer = function(t) {
- g.timers.push(t), t() ? g.fx.start() : g.timers.pop()
- }, g.fx.interval = 13, g.fx.start = function() {
- zt || (zt = setInterval(g.fx.tick, g.fx.interval))
- }, g.fx.stop = function() {
- clearInterval(zt), zt = null
- }, g.fx.speeds = {
- slow: 600,
- fast: 200,
- _default: 400
- }, g.fn.delay = function(t, e) {
- return t = g.fx && g.fx.speeds[t] || t, e = e || "fx", this.queue(e, (function(e, i) {
- var n = setTimeout(e, t);
- i.stop = function() {
- clearTimeout(n)
- }
- }))
- },
- function() {
- var t = f.createElement("input"),
- e = f.createElement("select"),
- i = e.appendChild(f.createElement("option"));
- t.type = "checkbox", p.checkOn = "" !== t.value, p.optSelected = i.selected, e.disabled = !0, p.optDisabled = !i.disabled, (t = f.createElement("input"))
- .value = "t", t.type = "radio", p.radioValue = "t" === t.value
- }();
- var Zt, Kt = g.expr.attrHandle;
- g.fn.extend({
- attr: function(t, e) {
- return k(this, g.attr, t, e, arguments.length > 1)
- },
- removeAttr: function(t) {
- return this.each((function() {
- g.removeAttr(this, t)
- }))
- }
- }), g.extend({
- attr: function(t, e, i) {
- var n, r, o = t.nodeType;
- if (t && 3 !== o && 8 !== o && 2 !== o) return typeof t.getAttribute === Y ? g.prop(t, e, i) : (1 === o && g.isXMLDoc(t) || (e = e.toLowerCase(), n = g.attrHooks[e] || (g.expr.match.bool.test(e) ? Zt : void 0)), void 0 === i ? n && "get" in n && null !== (r = n.get(t, e)) ? r : null == (r = g.find.attr(t, e)) ? void 0 : r : null !== i ? n && "set" in n && void 0 !== (r = n.set(t, i, e)) ? r : (t.setAttribute(e, i + ""), i) : void g.removeAttr(t, e))
- },
- removeAttr: function(t, e) {
- var i, n, r = 0,
- o = e && e.match(I);
- if (o && 1 === t.nodeType)
- for (; i = o[r++];) n = g.propFix[i] || i, g.expr.match.bool.test(i) && (t[n] = !1), t.removeAttribute(i)
- },
- attrHooks: {
- type: {
- set: function(t, e) {
- if (!p.radioValue && "radio" === e && g.nodeName(t, "input")) {
- var i = t.value;
- return t.setAttribute("type", e), i && (t.value = i), e
- }
- }
- }
- }
- }), Zt = {
- set: function(t, e, i) {
- return !1 === e ? g.removeAttr(t, i) : t.setAttribute(i, i), i
- }
- }, g.each(g.expr.match.bool.source.match(/\w+/g), (function(t, e) {
- var i = Kt[e] || g.find.attr;
- Kt[e] = function(t, e, n) {
- var r, o;
- return n || (o = Kt[e], Kt[e] = r, r = null != i(t, e, n) ? e.toLowerCase() : null, Kt[e] = o), r
- }
- }));
- var Qt = /^(?:input|select|textarea|button)$/i;
- g.fn.extend({
- prop: function(t, e) {
- return k(this, g.prop, t, e, arguments.length > 1)
- },
- removeProp: function(t) {
- return this.each((function() {
- delete this[g.propFix[t] || t]
- }))
- }
- }), g.extend({
- propFix: {
- for: "htmlFor",
- class: "className"
- },
- prop: function(t, e, i) {
- var n, r, o = t.nodeType;
- if (t && 3 !== o && 8 !== o && 2 !== o) return (1 !== o || !g.isXMLDoc(t)) && (e = g.propFix[e] || e, r = g.propHooks[e]), void 0 !== i ? r && "set" in r && void 0 !== (n = r.set(t, i, e)) ? n : t[e] = i : r && "get" in r && null !== (n = r.get(t, e)) ? n : t[e]
- },
- propHooks: {
- tabIndex: {
- get: function(t) {
- return t.hasAttribute("tabindex") || Qt.test(t.nodeName) || t.href ? t.tabIndex : -1
- }
- }
- }
- }), p.optSelected || (g.propHooks.selected = {
- get: function(t) {
- var e = t.parentNode;
- return e && e.parentNode && e.parentNode.selectedIndex, null
- }
- }), g.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], (function() {
- g.propFix[this.toLowerCase()] = this
- }));
- var Jt = /[\t\r\n\f]/g;
- g.fn.extend({
- addClass: function(t) {
- var e, i, n, r, o, a, s = "string" == typeof t && t,
- l = 0,
- u = this.length;
- if (g.isFunction(t)) return this.each((function(e) {
- g(this)
- .addClass(t.call(this, e, this.className))
- }));
- if (s)
- for (e = (t || "")
- .match(I) || []; u > l; l++)
- if (n = 1 === (i = this[l])
- .nodeType && (i.className ? (" " + i.className + " ")
- .replace(Jt, " ") : " ")) {
- for (o = 0; r = e[o++];) n.indexOf(" " + r + " ") < 0 && (n += r + " ");
- a = g.trim(n), i.className !== a && (i.className = a)
- } return this
- },
- removeClass: function(t) {
- var e, i, n, r, o, a, s = 0 === arguments.length || "string" == typeof t && t,
- l = 0,
- u = this.length;
- if (g.isFunction(t)) return this.each((function(e) {
- g(this)
- .removeClass(t.call(this, e, this.className))
- }));
- if (s)
- for (e = (t || "")
- .match(I) || []; u > l; l++)
- if (n = 1 === (i = this[l])
- .nodeType && (i.className ? (" " + i.className + " ")
- .replace(Jt, " ") : "")) {
- for (o = 0; r = e[o++];)
- for (; n.indexOf(" " + r + " ") >= 0;) n = n.replace(" " + r + " ", " ");
- a = t ? g.trim(n) : "", i.className !== a && (i.className = a)
- } return this
- },
- toggleClass: function(t, e) {
- var i = typeof t;
- return "boolean" == typeof e && "string" === i ? e ? this.addClass(t) : this.removeClass(t) : this.each(g.isFunction(t) ? function(i) {
- g(this)
- .toggleClass(t.call(this, i, this.className, e), e)
- } : function() {
- if ("string" === i)
- for (var e, n = 0, r = g(this), o = t.match(I) || []; e = o[n++];) r.hasClass(e) ? r.removeClass(e) : r.addClass(e);
- else(i === Y || "boolean" === i) && (this.className && B.set(this, "__className__", this.className), this.className = this.className || !1 === t ? "" : B.get(this, "__className__") || "")
- })
- },
- hasClass: function(t) {
- for (var e = " " + t + " ", i = 0, n = this.length; n > i; i++)
- if (1 === this[i].nodeType && (" " + this[i].className + " ")
- .replace(Jt, " ")
- .indexOf(e) >= 0) return !0;
- return !1
- }
- });
- var $t = /\r/g;
- g.fn.extend({
- val: function(t) {
- var e, i, n, r = this[0];
- return arguments.length ? (n = g.isFunction(t), this.each((function(i) {
- var r;
- 1 === this.nodeType && (null == (r = n ? t.call(this, i, g(this)
- .val()) : t) ? r = "" : "number" == typeof r ? r += "" : g.isArray(r) && (r = g.map(r, (function(t) {
- return null == t ? "" : t + ""
- }))), (e = g.valHooks[this.type] || g.valHooks[this.nodeName.toLowerCase()]) && "set" in e && void 0 !== e.set(this, r, "value") || (this.value = r))
- }))) : r ? (e = g.valHooks[r.type] || g.valHooks[r.nodeName.toLowerCase()]) && "get" in e && void 0 !== (i = e.get(r, "value")) ? i : "string" == typeof(i = r.value) ? i.replace($t, "") : null == i ? "" : i : void 0
- }
- }), g.extend({
- valHooks: {
- option: {
- get: function(t) {
- var e = g.find.attr(t, "value");
- return null != e ? e : g.trim(g.text(t))
- }
- },
- select: {
- get: function(t) {
- for (var e, i, n = t.options, r = t.selectedIndex, o = "select-one" === t.type || 0 > r, a = o ? null : [], s = o ? r + 1 : n.length, l = 0 > r ? s : o ? r : 0; s > l; l++)
- if (!(!(i = n[l])
- .selected && l !== r || (p.optDisabled ? i.disabled : null !== i.getAttribute("disabled")) || i.parentNode.disabled && g.nodeName(i.parentNode, "optgroup"))) {
- if (e = g(i)
- .val(), o) return e;
- a.push(e)
- } return a
- },
- set: function(t, e) {
- for (var i, n, r = t.options, o = g.makeArray(e), a = r.length; a--;)((n = r[a])
- .selected = g.inArray(n.value, o) >= 0) && (i = !0);
- return i || (t.selectedIndex = -1), o
- }
- }
- }
- }), g.each(["radio", "checkbox"], (function() {
- g.valHooks[this] = {
- set: function(t, e) {
- return g.isArray(e) ? t.checked = g.inArray(g(t)
- .val(), e) >= 0 : void 0
- }
- }, p.checkOn || (g.valHooks[this].get = function(t) {
- return null === t.getAttribute("value") ? "on" : t.value
- })
- })), g.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), (function(t, e) {
- g.fn[e] = function(t, i) {
- return arguments.length > 0 ? this.on(e, null, t, i) : this.trigger(e)
- }
- })), g.fn.extend({
- hover: function(t, e) {
- return this.mouseenter(t)
- .mouseleave(e || t)
- },
- bind: function(t, e, i) {
- return this.on(t, null, e, i)
- },
- unbind: function(t, e) {
- return this.off(t, null, e)
- },
- delegate: function(t, e, i, n) {
- return this.on(e, t, i, n)
- },
- undelegate: function(t, e, i) {
- return 1 === arguments.length ? this.off(t, "**") : this.off(e, t || "**", i)
- }
- });
- var te = g.now(),
- ee = /\?/;
- g.parseJSON = function(t) {
- return JSON.parse(t + "")
- }, g.parseXML = function(t) {
- var e;
- if (!t || "string" != typeof t) return null;
- try {
- e = (new DOMParser)
- .parseFromString(t, "text/xml")
- } catch (t) {
- e = void 0
- }
- return (!e || e.getElementsByTagName("parsererror")
- .length) && g.error("Invalid XML: " + t), e
- };
- var ie, ne, re = /#.*$/,
- oe = /([?&])_=[^&]*/,
- ae = /^(.*?):[ \t]*([^\r\n]*)$/gm,
- se = /^(?:GET|HEAD)$/,
- le = /^\/\//,
- ue = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
- he = {},
- ce = {},
- de = "*/".concat("*");
- try {
- ne = location.href
- } catch (t) {
- (ne = f.createElement("a"))
- .href = "", ne = ne.href
- }
- function pe(t) {
- return function(e, i) {
- "string" != typeof e && (i = e, e = "*");
- var n, r = 0,
- o = e.toLowerCase()
- .match(I) || [];
- if (g.isFunction(i))
- for (; n = o[r++];) "+" === n[0] ? (n = n.slice(1) || "*", (t[n] = t[n] || [])
- .unshift(i)) : (t[n] = t[n] || [])
- .push(i)
- }
- }
- function fe(t, e, i, n) {
- var r = {},
- o = t === ce;
- function a(s) {
- var l;
- return r[s] = !0, g.each(t[s] || [], (function(t, s) {
- var u = s(e, i, n);
- return "string" != typeof u || o || r[u] ? o ? !(l = u) : void 0 : (e.dataTypes.unshift(u), a(u), !1)
- })), l
- }
- return a(e.dataTypes[0]) || !r["*"] && a("*")
- }
- function me(t, e) {
- var i, n, r = g.ajaxSettings.flatOptions || {};
- for (i in e) void 0 !== e[i] && ((r[i] ? t : n || (n = {}))[i] = e[i]);
- return n && g.extend(!0, t, n), t
- }
- ie = ue.exec(ne.toLowerCase()) || [], g.extend({
- active: 0,
- lastModified: {},
- etag: {},
- ajaxSettings: {
- url: ne,
- type: "GET",
- isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ie[1]),
- global: !0,
- processData: !0,
- async: !0,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- accepts: {
- "*": de,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
- converters: {
- "* text": String,
- "text html": !0,
- "text json": g.parseJSON,
- "text xml": g.parseXML
- },
- flatOptions: {
- url: !0,
- context: !0
- }
- },
- ajaxSetup: function(t, e) {
- return e ? me(me(t, g.ajaxSettings), e) : me(g.ajaxSettings, t)
- },
- ajaxPrefilter: pe(he),
- ajaxTransport: pe(ce),
- ajax: function(t, e) {
- "object" == typeof t && (e = t, t = void 0), e = e || {};
- var i, n, r, o, a, s, l, u, h = g.ajaxSetup({}, e),
- c = h.context || h,
- d = h.context && (c.nodeType || c.jquery) ? g(c) : g.event,
- p = g.Deferred(),
- f = g.Callbacks("once memory"),
- m = h.statusCode || {},
- v = {},
- y = {},
- b = 0,
- w = "canceled",
- x = {
- readyState: 0,
- getResponseHeader: function(t) {
- var e;
- if (2 === b) {
- if (!o)
- for (o = {}; e = ae.exec(r);) o[e[1].toLowerCase()] = e[2];
- e = o[t.toLowerCase()]
- }
- return null == e ? null : e
- },
- getAllResponseHeaders: function() {
- return 2 === b ? r : null
- },
- setRequestHeader: function(t, e) {
- var i = t.toLowerCase();
- return b || (t = y[i] = y[i] || t, v[t] = e), this
- },
- overrideMimeType: function(t) {
- return b || (h.mimeType = t), this
- },
- statusCode: function(t) {
- var e;
- if (t)
- if (2 > b)
- for (e in t) m[e] = [m[e], t[e]];
- else x.always(t[x.status]);
- return this
- },
- abort: function(t) {
- var e = t || w;
- return i && i.abort(e), M(0, e), this
- }
- };
- if (p.promise(x)
- .complete = f.add, x.success = x.done, x.error = x.fail, h.url = ((t || h.url || ne) + "")
- .replace(re, "")
- .replace(le, ie[1] + "//"), h.type = e.method || e.type || h.method || h.type, h.dataTypes = g.trim(h.dataType || "*")
- .toLowerCase()
- .match(I) || [""], null == h.crossDomain && (s = ue.exec(h.url.toLowerCase()), h.crossDomain = !(!s || s[1] === ie[1] && s[2] === ie[2] && (s[3] || ("http:" === s[1] ? "80" : "443")) === (ie[3] || ("http:" === ie[1] ? "80" : "443")))), h.data && h.processData && "string" != typeof h.data && (h.data = g.param(h.data, h.traditional)), fe(he, h, e, x), 2 === b) return x;
- for (u in (l = h.global) && 0 == g.active++ && g.event.trigger("ajaxStart"), h.type = h.type.toUpperCase(), h.hasContent = !se.test(h.type), n = h.url, h.hasContent || (h.data && (n = h.url += (ee.test(n) ? "&" : "?") + h.data, delete h.data), !1 === h.cache && (h.url = oe.test(n) ? n.replace(oe, "$1_=" + te++) : n + (ee.test(n) ? "&" : "?") + "_=" + te++)), h.ifModified && (g.lastModified[n] && x.setRequestHeader("If-Modified-Since", g.lastModified[n]), g.etag[n] && x.setRequestHeader("If-None-Match", g.etag[n])), (h.data && h.hasContent && !1 !== h.contentType || e.contentType) && x.setRequestHeader("Content-Type", h.contentType), x.setRequestHeader("Accept", h.dataTypes[0] && h.accepts[h.dataTypes[0]] ? h.accepts[h.dataTypes[0]] + ("*" !== h.dataTypes[0] ? ", " + de + "; q=0.01" : "") : h.accepts["*"]), h.headers) x.setRequestHeader(u, h.headers[u]);
- if (h.beforeSend && (!1 === h.beforeSend.call(c, x, h) || 2 === b)) return x.abort();
- for (u in w = "abort", {
- success: 1,
- error: 1,
- complete: 1
- }) x[u](h[u]);
- if (i = fe(ce, h, e, x)) {
- x.readyState = 1, l && d.trigger("ajaxSend", [x, h]), h.async && h.timeout > 0 && (a = setTimeout((function() {
- x.abort("timeout")
- }), h.timeout));
- try {
- b = 1, i.send(v, M)
- } catch (t) {
- if (!(2 > b)) throw t;
- M(-1, t)
- }
- } else M(-1, "No Transport");
- function M(t, e, o, s) {
- var u, v, y, w, M, T = e;
- 2 !== b && (b = 2, a && clearTimeout(a), i = void 0, r = s || "", x.readyState = t > 0 ? 4 : 0, u = t >= 200 && 300 > t || 304 === t, o && (w = function(t, e, i) {
- for (var n, r, o, a, s = t.contents, l = t.dataTypes;
- "*" === l[0];) l.shift(), void 0 === n && (n = t.mimeType || e.getResponseHeader("Content-Type"));
- if (n)
- for (r in s)
- if (s[r] && s[r].test(n)) {
- l.unshift(r);
- break
- } if (l[0] in i) o = l[0];
- else {
- for (r in i) {
- if (!l[0] || t.converters[r + " " + l[0]]) {
- o = r;
- break
- }
- a || (a = r)
- }
- o = o || a
- }
- return o ? (o !== l[0] && l.unshift(o), i[o]) : void 0
- }(h, x, o)), w = function(t, e, i, n) {
- var r, o, a, s, l, u = {},
- h = t.dataTypes.slice();
- if (h[1])
- for (a in t.converters) u[a.toLowerCase()] = t.converters[a];
- for (o = h.shift(); o;)
- if (t.responseFields[o] && (i[t.responseFields[o]] = e), !l && n && t.dataFilter && (e = t.dataFilter(e, t.dataType)), l = o, o = h.shift())
- if ("*" === o) o = l;
- else if ("*" !== l && l !== o) {
- if (!(a = u[l + " " + o] || u["* " + o]))
- for (r in u)
- if ((s = r.split(" "))[1] === o && (a = u[l + " " + s[0]] || u["* " + s[0]])) {
- !0 === a ? a = u[r] : !0 !== u[r] && (o = s[0], h.unshift(s[1]));
- break
- } if (!0 !== a)
- if (a && t.throws) e = a(e);
- else try {
- e = a(e)
- } catch (t) {
- return {
- state: "parsererror",
- error: a ? t : "No conversion from " + l + " to " + o
- }
- }
- }
- return {
- state: "success",
- data: e
- }
- }(h, w, x, u), u ? (h.ifModified && ((M = x.getResponseHeader("Last-Modified")) && (g.lastModified[n] = M), (M = x.getResponseHeader("etag")) && (g.etag[n] = M)), 204 === t || "HEAD" === h.type ? T = "nocontent" : 304 === t ? T = "notmodified" : (T = w.state, v = w.data, u = !(y = w.error))) : (y = T, (t || !T) && (T = "error", 0 > t && (t = 0))), x.status = t, x.statusText = (e || T) + "", u ? p.resolveWith(c, [v, T, x]) : p.rejectWith(c, [x, T, y]), x.statusCode(m), m = void 0, l && d.trigger(u ? "ajaxSuccess" : "ajaxError", [x, h, u ? v : y]), f.fireWith(c, [x, T]), l && (d.trigger("ajaxComplete", [x, h]), --g.active || g.event.trigger("ajaxStop")))
- }
- return x
- },
- getJSON: function(t, e, i) {
- return g.get(t, e, i, "json")
- },
- getScript: function(t, e) {
- return g.get(t, void 0, e, "script")
- }
- }), g.each(["get", "post"], (function(t, e) {
- g[e] = function(t, i, n, r) {
- return g.isFunction(i) && (r = r || n, n = i, i = void 0), g.ajax({
- url: t,
- type: e,
- dataType: r,
- data: i,
- success: n
- })
- }
- })), g.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], (function(t, e) {
- g.fn[e] = function(t) {
- return this.on(e, t)
- }
- })), g._evalUrl = function(t) {
- return g.ajax({
- url: t,
- type: "GET",
- dataType: "script",
- async: !1,
- global: !1,
- throws: !0
- })
- }, g.fn.extend({
- wrapAll: function(t) {
- var e;
- return g.isFunction(t) ? this.each((function(e) {
- g(this)
- .wrapAll(t.call(this, e))
- })) : (this[0] && (e = g(t, this[0].ownerDocument)
- .eq(0)
- .clone(!0), this[0].parentNode && e.insertBefore(this[0]), e.map((function() {
- for (var t = this; t.firstElementChild;) t = t.firstElementChild;
- return t
- }))
- .append(this)), this)
- },
- wrapInner: function(t) {
- return this.each(g.isFunction(t) ? function(e) {
- g(this)
- .wrapInner(t.call(this, e))
- } : function() {
- var e = g(this),
- i = e.contents();
- i.length ? i.wrapAll(t) : e.append(t)
- })
- },
- wrap: function(t) {
- var e = g.isFunction(t);
- return this.each((function(i) {
- g(this)
- .wrapAll(e ? t.call(this, i) : t)
- }))
- },
- unwrap: function() {
- return this.parent()
- .each((function() {
- g.nodeName(this, "body") || g(this)
- .replaceWith(this.childNodes)
- }))
- .end()
- }
- }), g.expr.filters.hidden = function(t) {
- return t.offsetWidth <= 0 && t.offsetHeight <= 0
- }, g.expr.filters.visible = function(t) {
- return !g.expr.filters.hidden(t)
- };
- var ge = /%20/g,
- ve = /\[\]$/,
- ye = /\r?\n/g,
- be = /^(?:submit|button|image|reset|file)$/i,
- we = /^(?:input|select|textarea|keygen)/i;
- function xe(t, e, i, n) {
- var r;
- if (g.isArray(e)) g.each(e, (function(e, r) {
- i || ve.test(t) ? n(t, r) : xe(t + "[" + ("object" == typeof r ? e : "") + "]", r, i, n)
- }));
- else if (i || "object" !== g.type(e)) n(t, e);
- else
- for (r in e) xe(t + "[" + r + "]", e[r], i, n)
- }
- g.param = function(t, e) {
- var i, n = [],
- r = function(t, e) {
- e = g.isFunction(e) ? e() : null == e ? "" : e, n[n.length] = encodeURIComponent(t) + "=" + encodeURIComponent(e)
- };
- if (void 0 === e && (e = g.ajaxSettings && g.ajaxSettings.traditional), g.isArray(t) || t.jquery && !g.isPlainObject(t)) g.each(t, (function() {
- r(this.name, this.value)
- }));
- else
- for (i in t) xe(i, t[i], e, r);
- return n.join("&")
- .replace(ge, "+")
- }, g.fn.extend({
- serialize: function() {
- return g.param(this.serializeArray())
- },
- serializeArray: function() {
- return this.map((function() {
- var t = g.prop(this, "elements");
- return t ? g.makeArray(t) : this
- }))
- .filter((function() {
- var t = this.type;
- return this.name && !g(this)
- .is(":disabled") && we.test(this.nodeName) && !be.test(t) && (this.checked || !q.test(t))
- }))
- .map((function(t, e) {
- var i = g(this)
- .val();
- return null == i ? null : g.isArray(i) ? g.map(i, (function(t) {
- return {
- name: e.name,
- value: t.replace(ye, "\r\n")
- }
- })) : {
- name: e.name,
- value: i.replace(ye, "\r\n")
- }
- }))
- .get()
- }
- }), g.ajaxSettings.xhr = function() {
- try {
- return new XMLHttpRequest
- } catch (t) {}
- };
- var Me = 0,
- Te = {},
- Se = {
- 0: 200,
- 1223: 204
- },
- _e = g.ajaxSettings.xhr();
- i.ActiveXObject && g(i)
- .on("unload", (function() {
- for (var t in Te) Te[t]()
- })), p.cors = !!_e && "withCredentials" in _e, p.ajax = _e = !!_e, g.ajaxTransport((function(t) {
- var e;
- return p.cors || _e && !t.crossDomain ? {
- send: function(i, n) {
- var r, o = t.xhr(),
- a = ++Me;
- if (o.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields)
- for (r in t.xhrFields) o[r] = t.xhrFields[r];
- for (r in t.mimeType && o.overrideMimeType && o.overrideMimeType(t.mimeType), t.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest"), i) o.setRequestHeader(r, i[r]);
- e = function(t) {
- return function() {
- e && (delete Te[a], e = o.onload = o.onerror = null, "abort" === t ? o.abort() : "error" === t ? n(o.status, o.statusText) : n(Se[o.status] || o.status, o.statusText, "string" == typeof o.responseText ? {
- text: o.responseText
- } : void 0, o.getAllResponseHeaders()))
- }
- }, o.onload = e(), o.onerror = e("error"), e = Te[a] = e("abort");
- try {
- o.send(t.hasContent && t.data || null)
- } catch (t) {
- if (e) throw t
- }
- },
- abort: function() {
- e && e()
- }
- } : void 0
- })), g.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /(?:java|ecma)script/
- },
- converters: {
- "text script": function(t) {
- return g.globalEval(t), t
- }
- }
- }), g.ajaxPrefilter("script", (function(t) {
- void 0 === t.cache && (t.cache = !1), t.crossDomain && (t.type = "GET")
- })), g.ajaxTransport("script", (function(t) {
- var e, i;
- if (t.crossDomain) return {
- send: function(n, r) {
- e = g("<script>")
- .prop({
- async: !0,
- charset: t.scriptCharset,
- src: t.url
- })
- .on("load error", i = function(t) {
- e.remove(), i = null, t && r("error" === t.type ? 404 : 200, t.type)
- }), f.head.appendChild(e[0])
- },
- abort: function() {
- i && i()
- }
- }
- }));
- var Ae = [],
- Pe = /(=)\?(?=&|$)|\?\?/;
- g.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var t = Ae.pop() || g.expando + "_" + te++;
- return this[t] = !0, t
- }
- }), g.ajaxPrefilter("json jsonp", (function(t, e, n) {
- var r, o, a, s = !1 !== t.jsonp && (Pe.test(t.url) ? "url" : "string" == typeof t.data && !(t.contentType || "")
- .indexOf("application/x-www-form-urlencoded") && Pe.test(t.data) && "data");
- return s || "jsonp" === t.dataTypes[0] ? (r = t.jsonpCallback = g.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, s ? t[s] = t[s].replace(Pe, "$1" + r) : !1 !== t.jsonp && (t.url += (ee.test(t.url) ? "&" : "?") + t.jsonp + "=" + r), t.converters["script json"] = function() {
- return a || g.error(r + " was not called"), a[0]
- }, t.dataTypes[0] = "json", o = i[r], i[r] = function() {
- a = arguments
- }, n.always((function() {
- i[r] = o, t[r] && (t.jsonpCallback = e.jsonpCallback, Ae.push(r)), a && g.isFunction(o) && o(a[0]), a = o = void 0
- })), "script") : void 0
- })), g.parseHTML = function(t, e, i) {
- if (!t || "string" != typeof t) return null;
- "boolean" == typeof e && (i = e, e = !1), e = e || f;
- var n = S.exec(t),
- r = !i && [];
- return n ? [e.createElement(n[1])] : (n = g.buildFragment([t], e, r), r && r.length && g(r)
- .remove(), g.merge([], n.childNodes))
- };
- var Ce = g.fn.load;
- g.fn.load = function(t, e, i) {
- if ("string" != typeof t && Ce) return Ce.apply(this, arguments);
- var n, r, o, a = this,
- s = t.indexOf(" ");
- return s >= 0 && (n = g.trim(t.slice(s)), t = t.slice(0, s)), g.isFunction(e) ? (i = e, e = void 0) : e && "object" == typeof e && (r = "POST"), a.length > 0 && g.ajax({
- url: t,
- type: r,
- dataType: "html",
- data: e
- })
- .done((function(t) {
- o = arguments, a.html(n ? g("<div>")
- .append(g.parseHTML(t))
- .find(n) : t)
- }))
- .complete(i && function(t, e) {
- a.each(i, o || [t.responseText, e, t])
- }), this
- }, g.expr.filters.animated = function(t) {
- return g.grep(g.timers, (function(e) {
- return t === e.elem
- }))
- .length
- };
- var Ee = i.document.documentElement;
- function De(t) {
- return g.isWindow(t) ? t : 9 === t.nodeType && t.defaultView
- }
- g.offset = {
- setOffset: function(t, e, i) {
- var n, r, o, a, s, l, u = g.css(t, "position"),
- h = g(t),
- c = {};
- "static" === u && (t.style.position = "relative"), s = h.offset(), o = g.css(t, "top"), l = g.css(t, "left"), ("absolute" === u || "fixed" === u) && (o + l)
- .indexOf("auto") > -1 ? (a = (n = h.position())
- .top, r = n.left) : (a = parseFloat(o) || 0, r = parseFloat(l) || 0), g.isFunction(e) && (e = e.call(t, i, s)), null != e.top && (c.top = e.top - s.top + a), null != e.left && (c.left = e.left - s.left + r), "using" in e ? e.using.call(t, c) : h.css(c)
- }
- }, g.fn.extend({
- offset: function(t) {
- if (arguments.length) return void 0 === t ? this : this.each((function(e) {
- g.offset.setOffset(this, t, e)
- }));
- var e, i, n = this[0],
- r = {
- top: 0,
- left: 0
- },
- o = n && n.ownerDocument;
- return o ? (e = o.documentElement, g.contains(e, n) ? (typeof n.getBoundingClientRect !== Y && (r = n.getBoundingClientRect()), i = De(o), {
- top: r.top + i.pageYOffset - e.clientTop,
- left: r.left + i.pageXOffset - e.clientLeft
- }) : r) : void 0
- },
- position: function() {
- if (this[0]) {
- var t, e, i = this[0],
- n = {
- top: 0,
- left: 0
- };
- return "fixed" === g.css(i, "position") ? e = i.getBoundingClientRect() : (t = this.offsetParent(), e = this.offset(), g.nodeName(t[0], "html") || (n = t.offset()), n.top += g.css(t[0], "borderTopWidth", !0), n.left += g.css(t[0], "borderLeftWidth", !0)), {
- top: e.top - n.top - g.css(i, "marginTop", !0),
- left: e.left - n.left - g.css(i, "marginLeft", !0)
- }
- }
- },
- offsetParent: function() {
- return this.map((function() {
- for (var t = this.offsetParent || Ee; t && !g.nodeName(t, "html") && "static" === g.css(t, "position");) t = t.offsetParent;
- return t || Ee
- }))
- }
- }), g.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
- }, (function(t, e) {
- var n = "pageYOffset" === e;
- g.fn[t] = function(r) {
- return k(this, (function(t, r, o) {
- var a = De(t);
- return void 0 === o ? a ? a[e] : t[r] : void(a ? a.scrollTo(n ? i.pageXOffset : o, n ? o : i.pageYOffset) : t[r] = o)
- }), t, r, arguments.length, null)
- }
- })), g.each(["top", "left"], (function(t, e) {
- g.cssHooks[e] = _t(p.pixelPosition, (function(t, i) {
- return i ? (i = St(t, e), Mt.test(i) ? g(t)
- .position()[e] + "px" : i) : void 0
- }))
- })), g.each({
- Height: "height",
- Width: "width"
- }, (function(t, e) {
- g.each({
- padding: "inner" + t,
- content: e,
- "": "outer" + t
- }, (function(i, n) {
- g.fn[n] = function(n, r) {
- var o = arguments.length && (i || "boolean" != typeof n),
- a = i || (!0 === n || !0 === r ? "margin" : "border");
- return k(this, (function(e, i, n) {
- var r;
- return g.isWindow(e) ? e.document.documentElement["client" + t] : 9 === e.nodeType ? (r = e.documentElement, Math.max(e.body["scroll" + t], r["scroll" + t], e.body["offset" + t], r["offset" + t], r["client" + t])) : void 0 === n ? g.css(e, i, a) : g.style(e, i, n, a)
- }), e, o ? n : void 0, o, null)
- }
- }))
- })), g.fn.size = function() {
- return this.length
- }, g.fn.andSelf = g.fn.addBack, void 0 === (n = function() {
- return g
- }.apply(e, [])) || (t.exports = n);
- var Le = i.jQuery,
- Oe = i.$;
- return g.noConflict = function(t) {
- return i.$ === g && (i.$ = Oe), t && i.jQuery === g && (i.jQuery = Le), g
- }, typeof r === Y && (i.jQuery = i.$ = g), g
- }))
- }, function(t, e, i) {
- var n = i(0);
- ! function() {
- if ("performance" in window == 0 && (window.performance = {}), "now" in window.performance == 0) {
- var t = Date.now();
- performance.timing && performance.timing.navigationStart && (t = performance.timing.navigationStart), window.performance.now = function() {
- return Date.now() - t
- }
- }
- }(), n.WebGLRenderer.prototype.paramThreeToGL = function(t) {
- var e, i = this.extensions,
- r = this.context;
- if (t === n.RepeatWrapping) return r.REPEAT;
- if (t === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE;
- if (t === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT;
- if (t === n.NearestFilter) return r.NEAREST;
- if (t === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST;
- if (t === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR;
- if (t === n.LinearFilter) return r.LINEAR;
- if (t === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST;
- if (t === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR;
- if (t === n.UnsignedByteType) return r.UNSIGNED_BYTE;
- if (t === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4;
- if (t === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1;
- if (t === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5;
- if (t === n.ByteType) return r.BYTE;
- if (t === n.ShortType) return r.SHORT;
- if (t === n.UnsignedShortType) return r.UNSIGNED_SHORT;
- if (t === n.IntType) return r.INT;
- if (t === n.UnsignedIntType) return r.UNSIGNED_INT;
- if (t === n.FloatType) return r.FLOAT;
- if (null !== (e = i.get("OES_texture_half_float")) && t === n.HalfFloatType) return e.HALF_FLOAT_OES;
- if (t === n.AlphaFormat) return r.ALPHA;
- if (t === n.RGBFormat) return r.RGB;
- if (t === n.RGBAFormat) return r.RGBA;
- if (t === n.LuminanceFormat) return r.LUMINANCE;
- if (t === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA;
- if (t === n.AddEquation) return r.FUNC_ADD;
- if (t === n.SubtractEquation) return r.FUNC_SUBTRACT;
- if (t === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT;
- if (t === n.ZeroFactor) return r.ZERO;
- if (t === n.OneFactor) return r.ONE;
- if (t === n.SrcColorFactor) return r.SRC_COLOR;
- if (t === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR;
- if (t === n.SrcAlphaFactor) return r.SRC_ALPHA;
- if (t === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA;
- if (t === n.DstAlphaFactor) return r.DST_ALPHA;
- if (t === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA;
- if (t === n.DstColorFactor) return r.DST_COLOR;
- if (t === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR;
- if (t === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE;
- if (null !== (e = i.get("WEBGL_compressed_texture_s3tc"))) {
- if (t === n.RGB_S3TC_DXT1_Format) return e.COMPRESSED_RGB_S3TC_DXT1_EXT;
- if (t === n.RGBA_S3TC_DXT1_Format) return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;
- if (t === n.RGBA_S3TC_DXT3_Format) return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;
- if (t === n.RGBA_S3TC_DXT5_Format) return e.COMPRESSED_RGBA_S3TC_DXT5_EXT
- }
- if (null !== (e = i.get("WEBGL_compressed_texture_pvrtc"))) {
- if (t === n.RGB_PVRTC_4BPPV1_Format) return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
- if (t === n.RGB_PVRTC_2BPPV1_Format) return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
- if (t === n.RGBA_PVRTC_4BPPV1_Format) return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
- if (t === n.RGBA_PVRTC_2BPPV1_Format) return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
- }
- if (null !== (e = i.get("WEBGL_compressed_texture_etc1")) && t === n.RGB_ETC1_Format) return e.COMPRESSED_RGB_ETC1_WEBGL;
- if (null !== (e = i.get("EXT_blend_minmax"))) {
- if (t === n.MinEquation) return e.MIN_EXT;
- if (t === n.MaxEquation) return e.MAX_EXT
- }
- return 0
- }, n.WebGLState = function(t, e, i) {
- var r = this,
- o = new n.Vector4,
- a = t.getParameter(t.MAX_VERTEX_ATTRIBS),
- s = new Uint8Array(a),
- l = new Uint8Array(a),
- u = new Uint8Array(a),
- h = {},
- c = null,
- d = null,
- p = null,
- f = null,
- m = null,
- g = null,
- v = null,
- y = null,
- b = !1,
- w = null,
- x = null,
- M = null,
- T = null,
- S = null,
- _ = null,
- A = null,
- P = null,
- C = null,
- E = null,
- D = null,
- L = null,
- O = null,
- I = null,
- R = null,
- N = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
- k = void 0,
- F = {},
- B = new n.Vector4,
- z = null,
- U = null,
- V = new n.Vector4,
- j = new n.Vector4;
- this.init = function() {
- this.clearColor(0, 0, 0, 1), this.clearDepth(1), this.clearStencil(0), this.enable(t.DEPTH_TEST), t.depthFunc(t.LEQUAL), t.frontFace(t.CCW), t.cullFace(t.BACK), this.enable(t.CULL_FACE), this.enable(t.BLEND), t.blendEquation(t.FUNC_ADD), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA)
- }, this.initAttributes = function() {
- for (var t = 0, e = s.length; t < e; t++) s[t] = 0
- }, this.enableAttribute = function(i) {
- if (s[i] = 1, 0 === l[i] && (t.enableVertexAttribArray(i), l[i] = 1), 0 !== u[i]) {
- e.get("ANGLE_instanced_arrays");
- n.vertexAttribDivisorANGLE(i, 0), u[i] = 0
- }
- }, this.enableAttributeAndDivisor = function(e, i, r) {
- s[e] = 1, 0 === l[e] && (t.enableVertexAttribArray(e), l[e] = 1), u[e] !== i && (n.vertexAttribDivisorANGLE(e, i), u[e] = i)
- }, this.disableUnusedAttributes = function() {
- for (var e = 0, i = l.length; e < i; e++) l[e] !== s[e] && (t.disableVertexAttribArray(e), l[e] = 0)
- }, this.enable = function(e) {
- !0 !== h[e] && (t.enable(e), h[e] = !0)
- }, this.disable = function(e) {
- !1 !== h[e] && (t.disable(e), h[e] = !1)
- }, this.getCompressedTextureFormats = function() {
- if (null === c && (c = [], e.get("WEBGL_compressed_texture_pvrtc") || e.get("WEBGL_compressed_texture_s3tc") || e.get("WEBGL_compressed_texture_etc1")))
- for (var i = t.getParameter(t.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++) c.push(i[n]);
- return c
- }, this.setBlending = function(e, r, o, a, s, l, u, h) {
- e === n.NoBlending ? this.disable(t.BLEND) : this.enable(t.BLEND), e === d && h === b || (e === n.AdditiveBlending ? h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ONE, t.ONE, t.ONE, t.ONE)) : (t.blendEquation(t.FUNC_ADD), t.blendFunc(t.SRC_ALPHA, t.ONE)) : e === n.SubtractiveBlending ? h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ZERO, t.ZERO, t.ONE_MINUS_SRC_COLOR, t.ONE_MINUS_SRC_ALPHA)) : (t.blendEquation(t.FUNC_ADD), t.blendFunc(t.ZERO, t.ONE_MINUS_SRC_COLOR)) : e === n.MultiplyBlending ? h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ZERO, t.ZERO, t.SRC_COLOR, t.SRC_ALPHA)) : (t.blendEquation(t.FUNC_ADD), t.blendFunc(t.ZERO, t.SRC_COLOR)) : h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ONE, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA)) : (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA)), d = e, b = h), e === n.CustomBlending ? (s = s || r, l = l || o, u = u || a, r === p && s === g || (t.blendEquationSeparate(i(r), i(s)), p = r, g = s), o === f && a === m && l === v && u === y || (t.blendFuncSeparate(i(o), i(a), i(l), i(u)), f = o, m = a, v = l, y = u)) : (p = null, f = null, m = null, g = null, v = null, y = null)
- }, this.setDepthFunc = function(e) {
- if (w !== e) {
- if (e) switch (e) {
- case n.NeverDepth:
- t.depthFunc(t.NEVER);
- break;
- case n.AlwaysDepth:
- t.depthFunc(t.ALWAYS);
- break;
- case n.LessDepth:
- t.depthFunc(t.LESS);
- break;
- case n.LessEqualDepth:
- t.depthFunc(t.LEQUAL);
- break;
- case n.EqualDepth:
- t.depthFunc(t.EQUAL);
- break;
- case n.GreaterEqualDepth:
- t.depthFunc(t.GEQUAL);
- break;
- case n.GreaterDepth:
- t.depthFunc(t.GREATER);
- break;
- case n.NotEqualDepth:
- t.depthFunc(t.NOTEQUAL);
- break;
- default:
- t.depthFunc(t.LEQUAL)
- } else t.depthFunc(t.LEQUAL);
- w = e
- }
- }, this.setDepthTest = function(e) {
- e ? this.enable(t.DEPTH_TEST) : this.disable(t.DEPTH_TEST)
- }, this.setDepthWrite = function(e) {
- x !== e && (t.depthMask(e), x = e)
- }, this.setColorWrite = function(e) {
- M !== e && (t.colorMask(e, e, e, e), M = e)
- }, this.setStencilFunc = function(e, i, n) {
- S === e && _ === i && A === n || (t.stencilFunc(e, i, n), S = e, _ = i, A = n)
- }, this.setStencilOp = function(e, i, n) {
- P === e && C === i && E === n || (t.stencilOp(e, i, n), P = e, C = i, E = n)
- }, this.setStencilTest = function(e) {
- e ? this.enable(t.STENCIL_TEST) : this.disable(t.STENCIL_TEST)
- }, this.setStencilWrite = function(e) {
- T !== e && (t.stencilMask(e), T = e)
- }, this.setFlipSided = function(e) {
- D !== e && (e ? t.frontFace(t.CW) : t.frontFace(t.CCW), D = e)
- }, this.setLineWidth = function(e) {
- e !== L && (t.lineWidth(e), L = e)
- }, this.setPolygonOffset = function(e, i, n) {
- e ? this.enable(t.POLYGON_OFFSET_FILL) : this.disable(t.POLYGON_OFFSET_FILL), !e || O === i && I === n || (t.polygonOffset(i, n), O = i, I = n)
- }, this.getScissorTest = function() {
- return R
- }, this.setScissorTest = function(e) {
- R = e, e ? this.enable(t.SCISSOR_TEST) : this.disable(t.SCISSOR_TEST)
- }, this.activeTexture = function(e) {
- void 0 === e && (e = t.TEXTURE0 + N - 1), k !== e && (t.activeTexture(e), k = e)
- }, this.bindTexture = function(e, i) {
- void 0 === k && r.activeTexture();
- var o = F[k];
- void 0 === o && (o = {
- type: void 0,
- texture: void 0
- }, F[k] = o), n.type === e && n.texture === i || (t.bindTexture(e, i), n.type = e, n.texture = i)
- }, this.compressedTexImage2D = function() {
- try {
- t.compressedTexImage2D.apply(t, arguments)
- } catch (t) {}
- }, this.texImage2D = function() {
- try {
- t.texImage2D.apply(t, arguments)
- } catch (t) {}
- }, this.clearColor = function(e, i, n, r) {
- o.set(e, i, n, r), !1 === B.equals(o) && (t.clearColor(e, i, n, r), B.copy(o))
- }, this.clearDepth = function(e) {
- z !== e && (t.clearDepth(e), z = e)
- }, this.clearStencil = function(e) {
- U !== e && (t.clearStencil(e), U = e)
- }, this.scissor = function(e) {
- !1 === V.equals(e) && (t.scissor(e.x, e.y, e.z, e.w), V.copy(e))
- }, this.viewport = function(e) {
- !1 === j.equals(e) && (t.viewport(e.x, e.y, e.z, e.w), j.copy(e))
- }, this.reset = function() {
- for (var e = 0; e < l.length; e++) 1 === l[e] && (t.disableVertexAttribArray(e), l[e] = 0);
- h = {}, c = null, k = void 0, F = {}, d = null, M = null, x = null, T = null, D = null
- }
- }
- }, function(t, e) {
- Array.prototype.findIndex || (Array.prototype.findIndex = function(t) {
- if (null == this) throw new TypeError("Array.prototype.findIndex called on null or undefined");
- if ("function" != typeof t) throw new TypeError("predicate must be a function");
- for (var e, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
- if (e = i[o], t.call(r, e, o, i)) return o;
- return -1
- })
- }, function(t, e, i) {
- i(0)
- .CopyShader = {}
- }, function(t, e, i) {
- i(0)
- .HorizontalBlurShader = {}
- }, function(t, e, i) {
- i(0).VerticalBlurShader = {}
- }, function(t, e, i) {
- var n = i(0);
- n.SMAAShader = []
- }, function(t, e, i) {
- var n = i(0);
- n.EffectComposer = function(t, e) {}
- }, function(t, e, i) {
- var n = i(0);
- n.RenderPass = function(t, e, i, r, o) {}
- }, function(t, e, i) {
- var n = i(0);
- n.OutlinePass = function(t, e, i, r) {}
- }, function(t, e, i) {
- var n = i(0);
- n.ShaderPass = function(t, e) {}
- }, function(t, e, i) {
- var n = i(0);
- n.MaskPass = function(t, e) {}
- }, function(t, e, i) {
- var n = i(0);
- n.SMAAPass = () => {}
- }, function(t, e, i) {
- var n, r, o = i(0);
- o.LineSegmentsGeometry = function() {}
- }, function(t, e, i) {
- var n = i(0);
- n.LineGeometry = function() {}
- }, function(t, e, i) {
- var n = i(0);
- n.UniformsLib.line = {},
- n.ShaderLib.line = {},
- n.LineMaterial = function(t) {},
- n.LineMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
- n.LineMaterial.prototype.constructor = n.LineMaterial,
- n.LineMaterial.prototype.isLineMaterial = !0,
- n.LineMaterial.prototype.copy = function(t) {
- }
- }, function(t, e, i) {
- var n, r, o = i(0);
- o.LineSegments2 = function(t, e) {}
- }, function(t, e, i) {
- var n = i(0);
- n.Line2 = function(t, e) {}
- }, function(t, e, i) {
- "use strict";
- (function(e) {
- i(49);
- var n = i(0),
- r = i(2),
- o = i(51),
- a = i(103),
- s = i(35),
- l = i(52),
- u = i(54),
- h = i(19),
- c = i(108),
- d = i(58),
- p = i(109),
- f = i(5),
- m = i(18),
- g = i(32),
- v = i(1),
- y = i(7),
- b = i(9),
- w = i(10),
- x = i(15),
- M = i(8),
- T = i(4)
- .EventEmitter,
- S = i(37),
- _ = i(61),
- A = i(62),
- P = i(110),
- C = i(63),
- E = i(64),
- D = i(20),
- L = i(27),
- O = i(21),
- I = i(24),
- R = i(31),
- N = i(14),
- k = i(23),
- F = i(38),
- B = i(112),
- z = i(113),
- U = i(26),
- V = i(66),
- j = i(3),
- H = i(39),
- W = i(114),
- q = (i(13), new r("/js/player.js")),
- Y = (window.devicePixelRatio, Object.freeze({
- FlyToPano: M.getUniqueId(),
- FlyToNewMode: M.getUniqueId(),
- FlyToSameMode: M.getUniqueId(),
- FlyToViewFloor: M.getUniqueId(),
- LookTransition: M.getUniqueId(),
- ZoomTransition: M.getUniqueId()
- })),
- X = i(22),
- Z = i(16),
- K = i(28),
- Q = i(117),
- J = i(118),
- $ = i(133),
- tt = i(134),
- et = i(136),
- it = i(137),
- nt = i(69),
- rt = i(139),
- ot = i(141),
- at = i(143),
- st = i(67);
- function lt(t) {
- G.player = this, this.currentPano = null, this.currentPanoQuaternion = null, this.nextPano = null, this.camera = null, this.paused = !1, this.flying = !1, this.sceneIntersectionPlane = null, this.target = new n.Vector3, this.mouse = new n.Vector3(1.1, 1.1, .5), this.mouseAtMouseDown = new n.Vector2, this.mouseCouldBeClickToMove = !1, this.inMeasureMode = !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 o(this), this.addTagReticule = new a(this), this.panoMarkers = [], this.spider = new p(this), this.quaternion = new n.Quaternion, this.position = new n.Vector3(15, 10, 15), this.previousState = null, this.lastInsideView = new d, this.last360View = new d, this.raycaster = new n.Raycaster, this.raycasterP = new n.Raycaster, this.intersect = null, this.lastChangeTime = Date.now(), this.history = new P, this.control = null, this.controls = {}, this.cameras = {}, 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.speedmultiplier = 1, this.baseFov = v.insideFOV, this.zoomFov = this.baseFov, this.zoomEnabled = !0, this.preRenderingEnabled = !1, this.setupCustomProperties(t), this.urlPoint = "/pc/add_label.html?", this.urlPoint3 = "/nest/ifaddtag/?", this.urlHighlights = "/nest/ifaddscenes/?", this.normal_length = .1, this.zoomStats = new z, this.scene = null, this.clock = new n.Clock, this.walkOnPano = !1, this.measurementTool = null, this.measureTexture = null, this.connect = K(), this.handleOperation = this.handleOperation.bind(this), this.getCurrentState = this.getCurrentState.bind(this), this.connect.on("operation", this.handleOperation), this.disableNavigator = !1, this.lockedFlyToPano = !1, this.putModelTypes = {
- human: !1,
- weapon: !1,
- camera: !1
- }, this.isShowModelList = null, this.isLoadedSaveModel = !1, this.panoramaStartRotationFrom = !1
- }
- lt.prototype = Object.create(T.prototype), lt.prototype.init = function(t) {
- this.modelManager = t.modelManager, this.tileDownloader = t.tileDownloader, this.panoRenderer = t.panoRenderer, this.sRender = this.panoRenderer.sceneRenderer, this.qualityManager = t.qualityManager, this.domElement = t.container, this.camera = t.camera, this.mattertagManager = t.mattertagManager, this.setUpControls(), this.path = new c(t.director, this), this.basePanoSize = this.qualityManager.getPanoSize(k.BASE), this.standardPanoSize = this.qualityManager.getPanoSize(k.STANDARD), this.highPanoSize = this.qualityManager.getPanoSize(k.HIGH), this.ultraHighPanoSize = this.qualityManager.getPanoSize(k.ULTRAHIGH), this.tileDownloader.processPriorityQueue = !1, this.tileDownloader.tilePrioritizer = new F(this.qualityManager, this.basePanoSize, this.standardPanoSize, this.highPanoSize, this.ultraHighPanoSize), this.aiding = new Q(this), this.humanModelControls = new tt(this), this.humanModelControls.canbeUsed = !0, this.weaponModelControls = new et(this), this.weaponModelControls.canbeUsed = !0, this.postilControls = new it(this), this.postilControls.canbeUsed = !0, this.virtualCameraFovControls = new rt(this), this.virtualCameraFovControls.canbeUsed = !0, this.humanModelAnimationControls = new ot(this), this.humanModelAnimationControls.canbeUsed = !0, this.measuringToolControls = new at(this), this.measuringToolControls.canbeUsed = !0, this.baseControls = new J(this), this.putModelUIControls = new $(this), this.sRender.addComponent(this.baseControls), this.bindEvents(t.container), this.updateModel()
- }, lt.prototype.setupCustomProperties = function(t) {
- var e = t || f.PANORAMA;
- Object.defineProperty(this, "mode", {
- get: function() {
- return e
- },
- set: function(t) {
- var i = e;
- e = t, this.onModeUpdated(i, e), this.changeSteeringWheelState(e)
- }
- })
- }, lt.prototype.isInMode = function() {
- for (var t = 0; t < arguments.length; t++)
- if (this.mode === arguments[t]) return !0;
- return !1
- }, lt.prototype.isOutsideMode = function(t) {
- return (t = t || this.mode) === f.DOLLHOUSE || t === f.FLOORPLAN
- }, lt.prototype.is360View = function(t, e) {
- return t === f.PANORAMA && e && !e.isAligned()
- }, lt.prototype.setScene = function(t) {
- this.scene = t, this.sceneIntersectionPlane = t.plane, this.path.setScene(t), this.moveReticuleToScene(t)
- }, lt.prototype.moveReticuleToScene = function(t) {}, lt.prototype.updateModel = function() {
- function t(t) {
- var e = this.cameras[f.DOLLHOUSE],
- i = this.controls[f.DOLLHOUSE],
- n = e.position.y + (t - i.target.y),
- r = v.showFloorDuration + v.showFloorDelay;
- M.start(w.property(i.target, "y", t), r, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToViewFloor), M.start(w.property(e.position, "y", n), r, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToViewFloor)
- }
- this.model = this.modelManager.getActiveModel(), this.model.on("floor.changed", function(e, i, n) {
- this.mode === f.DOLLHOUSE && e !== n && t.call(this, e.center.y)
- }.bind(this)), this.model.on("allfloors.toggled", function(e, i) {
- if (this.mode === f.DOLLHOUSE) {
- var n = e ? this.model.center.y : lt = i.center.y;
- t.call(this, n)
- }
- }.bind(this)), this.on(D.PanoChosen, this.model.setProjectedPanos.bind(this.model));
- var e = this;
- this.model.panos.list.forEach((function(t) {
- t.vrMarker.addEventListener("click", (function() {
- e.flyToPano({
- pano: t
- })
- }))
- }))
- }, lt.prototype.updateModelDependentData = function() {
- this.setModelForControls(this.model), this.getPanoMarkersFromModel(this.model)
- }, lt.prototype.onModelChanged = function() {
- this.updateModel(), this.updateModelDependentData()
- }, lt.prototype.getPanoMarkersFromModel = function(t) {
- this.panoMarkers = t.panos.list.reduce((function(t, e) {
- return e.marker ? t.concat(e.marker) : t
- }), [])
- }, lt.prototype.setModelForControls = function(t) {
- this.controls[f.DOLLHOUSE].setZoomBounds(t.boundingBox);
- var e = this.model.boundingBox.clone()
- .expandByScalar(v.modelBoundsPadding);
- [f.DOLLHOUSE, f.FLOORPLAN].forEach(function(t) {
- this.controls[t].setBounds(e)
- }.bind(this))
- }, lt.prototype.updateControlsForNewMode = function(t, e) {
- this.controls[t] && (this.controls[t].reset(), this.controls[t].enabled = !1), this.controls[e] && (this.controls[e].enabled = !0), this.control = this.controls[e]
- }, lt.prototype.getCurrentState = function() {
- var t = this.mode,
- e = {
- mode: t,
- location: this.currentPano.id
- };
- return "panorama" === t ? (e.position = {
- x: this.camera.position.x,
- y: this.camera.position.y,
- z: this.camera.position.z
- }, e.rotation = {
- x: this.camera.quaternion.x,
- y: this.camera.quaternion.y,
- z: this.camera.quaternion.z,
- w: this.camera.quaternion.w
- }) : "floorplan" === t ? (e.position = {
- x: this.camera.position.x,
- y: this.camera.position.y,
- z: this.camera.position.z
- }, e.rotation = {
- x: this.camera.quaternion.x,
- y: this.camera.quaternion.y,
- z: this.camera.quaternion.z,
- w: this.camera.quaternion.w
- }, e.zoom = 3) : "dollhouse" === t && (e.position = {
- x: this.camera.position.x,
- y: this.camera.position.y,
- z: this.camera.position.z
- }, e.rotation = {
- x: this.camera.quaternion.x,
- y: this.camera.quaternion.y,
- z: this.camera.quaternion.z,
- w: this.camera.quaternion.w
- }), e
- }, lt.prototype.setUpControls = function() {
- var t = {};
- t[f.PANORAMA] = new S, t[f.DOLLHOUSE] = new _, t[f.FLOORPLAN] = new A;
- var e = {};
- e[f.PANORAMA] = new s(t[f.PANORAMA]), e[f.DOLLHOUSE] = new l(t[f.DOLLHOUSE]), e[f.FLOORPLAN] = new u(t[f.FLOORPLAN]);
- var i = this.handleControlMove.bind(this),
- n = this.handleControlInputStart.bind(this);
- e[f.PANORAMA].on(L.Move, i), e[f.PANORAMA].on(L.Pinch, this.handleControlPinch.bind(this)), e[f.PANORAMA].on(L.Scroll, this.handleControlScroll.bind(this)), e[f.PANORAMA].on(L.RulersMove, this.handleControlRulersMove.bind(this)), e[f.PANORAMA].on(L.TtagsMove, this.handleControlTtagsMove.bind(this)), e[f.PANORAMA].on(L.InputStart, n), e[f.PANORAMA].on(L.PanoramaMove, this.handleControlPanoramaMove.bind(this)), e[f.PANORAMA].on(L.PanoramaMoveStop, this.handleControlPanoramaMoveStop.bind(this)), e[f.DOLLHOUSE].on(L.Move, i), e[f.DOLLHOUSE].on(L.InputStart, n), e[f.DOLLHOUSE].on("dollhouse-move", this.handleDollhouseMove.bind(this)), e[f.DOLLHOUSE].on("dollhouse-move-stop", this.handleDollhouseMoveStop.bind(this)), e[f.FLOORPLAN].on(L.Move, i), e[f.FLOORPLAN].on(L.InputStart, n), this.controls = e, this.cameras = t
- };
- var ut, ht, ct = !1,
- dt = !0;
- lt.prototype.handleControlPanoramaMove = function() {
- !1 !== dt && (ct = !1, this.baseControls && this.baseControls.onHandleControlPanoramaMove())
- }, lt.prototype.handleControlPanoramaMoveStop = function() {
- !0 !== ct && (dt = !1, ct = !0, this.baseControls && this.baseControls.onHandleControlPanoramaMoveStop(), setTimeout((function() {
- dt = !0
- }), 0))
- }, lt.prototype.handleDollhouseMove = function() {
- this.baseControls && this.baseControls.onHandleDollhouseMove()
- }, lt.prototype.handleDollhouseMoveStop = function() {
- this.baseControls && this.baseControls.onHandleDollhouseMoveStop()
- }, lt.prototype.handleControlRulersMove = function() {
- this.emit(D.RulersMove)
- }, lt.prototype.handleControlTtagsMove = function() {
- this.mattertagManager.ttposition(), !1 !== dt && this.baseControls && this.baseControls.onHandleControlTtagsMove()
- }, lt.prototype.handleControlMove = function(t) {
- this.emit(D.Move, t), "panorama" === this.mode && this.baseControls && this.baseControls.onPlayerHandleControlPanoramaMove()
- }, lt.prototype.handleControlInputStart = function(t) {
- this.emit(D.InputStart, t)
- }, lt.prototype.onModeUpdated = function(t, e) {
- this.updateControlsForNewMode(t, e), this.emit(D.ModeChanged, t, e)
- }, lt.prototype.isWarping = function() {
- return this.path.warping
- }, lt.prototype.getLabelScaleFactor = function() {
- if (this.isOutsideMode()) {
- return Math.sqrt(this.controls[f.FLOORPLAN].currentScale / 10)
- }
- return .5
- }, lt.prototype.bindEvents = function(t) {
- for (var e in t !== document && t.setAttribute("tabindex", -1), this.controls[f.PANORAMA].on(L.FlyInDirection, this.flyLocalDirection.bind(this)), t.addEventListener("mousedown", this.onMouseDown.bind(this), !1), t.addEventListener("mousemove", this.onMouseMove.bind(this), !1), t.addEventListener("mouseover", this.onMouseOver.bind(this)), t.addEventListener("mouseout", this.onMouseOut.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this), !1), t.addEventListener("mouseleave", this.onMouseLeave.bind(this)), this.modelManager.on(O.ActiveModelChanged, this.onModelChanged.bind(this)), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerOut.bind(this)), t.addEventListener("pointercancel", this.onPointerCancel.bind(this)), t.addEventListener("keyup", this.onKeyUpOfPlayerContainer.bind(this)), document.addEventListener("keydown", this.onKeyDown.bind(this)), document.addEventListener("keyup", this.onKeyUp.bind(this)), this.controls) this.controls[e].bindEvents(t);
- this.on(D.WarpEnded, this.updateWarpEnded.bind(this))
- }, lt.prototype.updateWarpEnded = function() {
- this.mattertagManager.updateRegionalJumpTags(this.currentPano), this.steeringWheelPos(this.currentPano, null, 50)
- }, lt.prototype.onMouseDown = function(t) {
- var i = this;
- if (this.disableNavigator = !1, this.lockedFlyToPano = !1, this.baseControls && this.baseControls.onPlayerMouseDown(t), this.measuringToolControls.canbeUsed && this.measuringToolControls.onPlayerMouseDown(t), this.measurementTool.onMouseDown(t), !this.disableNavigator && (!this.humanModelControls.HUMANMODEL || this.humanModelControls.HUMANMODEL.userData.follow_mouse) && (!this.weaponModelControls.CONTROLMODEL || this.weaponModelControls.CONTROLMODEL.userData.follow_mouse) && (!this.virtualCameraFovControls.VIRTUAL_CAMERA || this.virtualCameraFovControls.VIRTUAL_CAMERA.userData.follow_mouse)) {
- if (this.mattertagManager.intersectTag && (this.mattertagManager.intersectTag.type === H.Tag360T1 || 1 === this.mattertagManager.intersectTag.subtype)) return t.preventDefault(), t.stopImmediatePropagation(), t.currentTarget !== document && t.currentTarget.focus(), void(0 === t.button && (this.handleInputStart.call(this, t.clientX, t.clientY, !1), this.updateIntersect()));
- if (this.mattertagManager.intersectTag && this.mattertagManager.intersectTag.type == H.Pano) {
- var n = this.mattertagManager.intersectTag,
- r = function() {
- i.model.panos.index[n.locationId].marker.material.map = Z.loadurl(X.splitUrl("./images/texture/location/location_512x512.png")), n.materials.free.map = Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")), n.materials.hover.map = Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")), n.disc.material.map = Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")), i.model.panos.index[n.locationId].enable = !0
- },
- o = function() {
- i.model.panos.index[n.locationId].marker.material.map = Z.loadurl(X.splitUrl("./images/texture/location/disable_512x512.png")), n.materials.free.map = Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")), n.materials.hover.map = Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")), n.disc.material.map = Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")), i.model.panos.index[n.locationId].enable = !1
- };
- if (this.model.panos.index[n.locationId].enable) {
- ! function(t) {
- if (G.settings.nestscenes && G.settings.nestscenes.scenes && G.settings.nestscenes.scenes.length) {
- for (var e = G.settings.nestscenes.scenes, n = 0; n < e.length; n++)
- if (e[n]._camera._locationid === t) return !1
- } else {
- var r = i.model.data.orientationkey;
- if (r) {
- var o = !1;
- if (model.data.orientations.forEach((function(e, i) {
- e.key === r && e.location_id === t && (o = !0)
- })), o) return !1
- }
- var a = i.model.panos;
- for (n = 0; n < a.length; n++)
- if (2 != a.list[n].alignmentType) return a.list[n].id !== t
- }
- return !0
- }(n.locationId) ? G.toast("已设置为场景点或初始点,不能隐藏"): "sms" === G.u[window.location.host].type ? G.conf.isNewEditVersion ? e.ajax({
- url: "/model/roam/hiddenpoint/",
- type: "POST",
- data: {
- point: n.locationId,
- enable: 0
- }
- })
- .success((function(t) {
- o()
- }))
- .fail((function(t) {
- alert("连接服务器失败")
- })) : e.ajax({
- url: "/nest/hiddenpoint/",
- type: "POST",
- data: {
- point: n.locationId,
- enable: 0
- }
- })
- .success((function(t) {
- o()
- }))
- .fail((function(t) {
- alert("连接服务器失败")
- })) : o()
- } else "sms" === G.u[window.location.host].type ? G.conf.isNewEditVersion ? e.ajax({
- url: "/model/roam/hiddenpoint/",
- type: "POST",
- data: {
- point: n.locationId,
- enable: 1
- }
- })
- .success((function(t) {
- r()
- }))
- .fail((function(t) {
- alert("连接服务器失败")
- })) : e.ajax({
- url: "/nest/hiddenpoint/",
- type: "POST",
- data: {
- point: n.locationId,
- enable: 1
- }
- })
- .success((function(t) {
- r()
- }))
- .fail((function(t) {
- alert("连接服务器失败")
- })) : r()
- }
- t.currentTarget !== document && t.currentTarget.focus(), 0 === t.button && (this.handleInputStart.call(this, t.clientX, t.clientY, !1), this.updateIntersect())
- }
- }, lt.prototype.onMouseLeave = function(t) {}, lt.prototype.onMouseMove = function(t) {
- if (this.baseControls && this.baseControls.onPlayerMouseMove(t), (G.conf.modelMeasure || G.conf.publicity || G.measureMode) && this.measuringToolControls.canbeUsed && this.measuringToolControls.onPlayerMouseMove(t), this.isTouchEvent = !1, this.handleInputMove.call(this, t.clientX, t.clientY, !1), this.inMeasureMode) {
- var e = b.convertWorldPositionToScreen(this.intersect.point, this.camera),
- i = new n.Vector2(e.x, (window.renderHeight || window.innerHeight) - e.y);
- i && (this.measurementTool.onMouseMove(t), this.measureTexture.onMouseMove(t, this.model, i))
- } else this.model.chunks.forEach((function(t) {
- t.material.uniforms.measureMode && (t.material.uniforms.measureMode.value = 0)
- }))
- }, lt.prototype.onMouseOver = function(t) {
- this.containsMouse = !0, !this.mouseDown || 0 !== t.which && 0 !== t.buttons || (this.mouseDown = !1)
- }, lt.prototype.onMouseOut = function(t) {
- this.containsMouse = !1
- }, lt.prototype.onMouseUp = function(t) {
- this.baseControls && this.baseControls.onPlayerMouseUp(t), this.inMeasureMode && (this.measuringToolControls.canbeUsed && this.measuringToolControls.onPlayerMouseUp(t), this.measurementTool.onMouseUp(t)), this.handleInputEnd.call(this, t.clientX, t.clientY, !1, t)
- }, lt.prototype.monitorSelect = function(t, e) {
- var i = new Object;
- if (i.type = this.currentPano.alignmentType, 2 != this.currentPano.alignmentType) {
- if (!t) return;
- (g = {})
- .point = t.point.clone(), g.normal = t.normal.clone();
- var r = g.point.x,
- o = g.point.y,
- a = g.point.z,
- s = g.normal.x,
- l = g.normal.y,
- u = g.normal.z;
- this.spot = new n.Vector3(r, o, a), this.spot.add(g.normal.clone()
- .multiplyScalar(this.normal_length));
- var h = this.spot.x - r,
- c = this.spot.y - o,
- d = this.spot.z - a,
- p = this.currentPano.id,
- f = this.camera.quaternion;
- i.locationid = p, i.x = r, i.y = o, i.z = a, i.nx = s, i.ny = l, i.nz = u, i.dx = h, i.dy = c, i.dz = d, i.qw = f.y, i.qx = f.z, i.qy = f.w, i.qz = f.x
- } else {
- var m = this.getMouseDirection(),
- g = Math.sqrt(4 / (m.x * m.x + m.y * m.y + m.z * m.z));
- m.multiplyScalar(g), i.x = m.x, i.y = m.y, i.z = m.z, i.panoid = this.currentPano.id
- }
- this.emit(D.EditAddTagHighlight, i)
- }, lt.prototype.onTouchStart = function(t) {
- if (t.currentTarget !== document && t.currentTarget.focus(), !this.mouseDown) {
- var e = y.average(t.changedTouches, "clientX"),
- i = y.average(t.changedTouches, "clientY");
- this.handleInputStart.call(this, e, i, !0)
- }
- }, lt.prototype.onTouchMove = function(t) {
- var e = y.average(t.changedTouches, "clientX"),
- i = y.average(t.changedTouches, "clientY");
- this.handleInputMove.call(this, e, i, !0)
- }, lt.prototype.onTouchEnd = function(t) {
- this.updateIntersect(!0);
- var e = y.average(t.changedTouches, "clientX"),
- i = y.average(t.changedTouches, "clientY");
- this.handleInputEnd.call(this, e, i, !0, t)
- }, lt.prototype.onPointerDown = function(t) {}, lt.prototype.onPointerMove = function(t) {}, lt.prototype.onPointerUp = function(t) {}, lt.prototype.onPointerOut = function(t) {}, lt.prototype.onPointerCancel = function(t) {}, lt.prototype.onKeyUpOfPlayerContainer = function(t) {
- this.baseControls && this.baseControls.onPlayerKeyUpPlayerContainer(t)
- }, lt.prototype.onKeyUp = function(t) {
- this.baseControls && this.baseControls.onPlayerKeyUp(t)
- }, lt.prototype.onKeyDown = function(t) {
- if (this.mode !== f.FLOORPLAN) {
- var e = function() {
- this.control && this.control.emit(L.Move, "key")
- }.bind(this),
- i = t.which;
- switch (i) {
- case g.F:
- e(), this.changeFloor(-1);
- break;
- case g.R:
- e(), this.changeFloor(1);
- case g.ESC:
- e(), G.measureMode && (this.setMeasureEnable(!1), this.emit("exitMeasureActive"), this.measurementTool && this.measurementTool.singleMeasuring, window.parent.cancelMeasure && window.parent.cancelMeasure())
- }
- }
- }, lt.prototype.handleScrollPinchZoom = function(t) {
- var e = t,
- i = this.zoomLevel;
- this.zoomBy(e), this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
- }, lt.prototype.handleControlPinch = function(t) {
- v.zoom.enabled ? this.handleScrollPinchZoom(1 - t) : this.flyLocalDirection(new n.Vector3(0, 0, t)
- .normalize())
- }, lt.prototype.handleControlScroll = function(t) {
- v.zoom.enabled ? (t > 0 ? t = 1 + this.scrollZoomSpeed : t < 0 && (t = 1 - this.scrollZoomSpeed), 0 !== t && this.handleScrollPinchZoom(t)) : this.flyLocalDirection(new n.Vector3(0, 0, -t)
- .normalize())
- }, lt.prototype.handleInputStart = function(t, e, i) {
- this.isTouchEvent = i, b.convertScreenPositionToNDC(t, e, this.mouse), b.convertScreenPositionToNDC(t, e, this.mouseAtMouseDown), this.mouseCouldBeClickToMove = !0, this.mouseDown = !0
- }, lt.prototype.handleInputMove = function(t, e, i) {
- this.isTouchEvent = i, b.convertScreenPositionToNDC(t, e, this.mouse), !this.inMeasureMode && this.mouseAtMouseDown.distanceTo(this.mouse) > .02 && (this.mouseCouldBeClickToMove = !1), this.mouseLastMoveTime = Date.now(), this.reticule.move(t, e, i)
- }, lt.prototype.handleInputEnd = function(t, e, i, n) {
- if (this.isTouchEvent = i, this.mouseDown = !1, this.inMeasureMode) this.control && this.control.emit(L.Move, this.isTouchEvent ? "touch" : "mouse"), this.history.invalidate();
- else if (this.controls[f.PANORAMA].emit("interaction.direct"), this.mouseCouldBeClickToMove) {
- if (this.checkMattertagClick(n)) return this.control && (this.control.enabled = !0, this.control.onMouseUp(n)), !0;
- if (this.control && this.control.emit(L.Move, this.isTouchEvent ? "touch" : "mouse"), this.history.invalidate(), this.intersect) return this.flyToPanoClosestToMouse();
- if (this.mode === f.PANORAMA) {
- var r = this.closestPanoInDirection(this.getMouseDirection());
- return r ? this.flyToPano({
- pano: r
- }) : this.bump(this.getMouseDirection())
- }
- }
- }, lt.prototype.checkMattertagClick = function(t) {
- if (this.mattertagManager.intersectTag) {
- var e = this.isTouchEvent,
- i = this.mattertagManager.clickedOnTag(e, this, t);
- return this.mattertagManager.intersectTag.tagid && this.emit(D.ClickTag, this.mattertagManager.intersectTag.tagid), e || i || M.cancelById(Y.LookTransition), !0
- }
- if (this.mattertagManager.activeTag) return !1
- }, lt.prototype.rankedMattertagInDirection = function(t, e) {
- return this.mattertagManager.rankedMattertagInDirection(t, this.position, this.camera, e)
- }, lt.prototype.start = function(t) {
- var i = t.mode,
- r = t.pano,
- o = t.position,
- a = t.quaternion,
- s = t.tag,
- l = t.quickstart,
- u = e.Deferred(),
- h = new n.Quaternion;
- h.setFromAxisAngle(new n.Vector3(0, -1, 0), Math.PI / 4), G.p = {
- position: new n.Vector3(1, 1, 1),
- quaternion: h
- }, this.updateModelDependentData(), this.updateFromControls(), this.model.has360Views && this.findDefaultViews();
- var c = this.is360View(i, r);
- return !this.model.outsideAllowed() || c || l ? this.startInside(r, o, a, s, u) : this.startOutside(t, u), u.done(function(t) {
- this.emit(D.Ready, c, t, s)
- }.bind(this)), u.promise()
- }, lt.prototype.startOutside = function(t, e) {
- var i = t.mode,
- n = t.pano,
- r = t.position,
- o = t.quaternion,
- a = t.zoom,
- s = t.floorVisibility,
- l = t.tag;
- this.emit(D.StartOutside, v[i].transitionTime), this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0), M.cancelById(Y.FlyToViewFloor), i === f.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o), e.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, e)
- }, lt.prototype.startInside = function(t, i, n, r, o) {
- o = o || e.Deferred(), this.currentPano = t;
- var a = t && !t.isAligned();
- if (i = a ? t.position : i || t.position, n = n || t.quaternion, t) {
- a && this.mattertagManager.update360Tags(t.id);
- var s = this.startInside.bind(this, t, i, n, r, o);
- if (this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, s)) return
- }
- return this.mode = f.PANORAMA, t.floor.enter(this.mode), this.emit(D.PanoChosen, this.currentPano, this.currentPano), this.switchCameraMode(this.mode, n), this.emit(D.StartInside, a), o.resolve(!0), o
- }, lt.prototype.startInsideWithFlyin = function(t, i, n, r, o) {
- if (o = o || e.Deferred(), this.dollhouseMode(), !t) return q.warn("Player.startInsideWithFlyin() -> targetPano is invalid."), o.resolve(!1), o;
- i = i || t.position;
- var a = n || t.quaternionAutoScene || this.control.camera.quaternion;
- t.position;
- return setTimeout(function(e) {
- this.control && (this.control.maxDistance = e);
- var i = {
- mode: f.PANORAMA,
- pano: t,
- quaternion: a,
- callback: function() {
- o.resolve(!0)
- }.bind(this)
- };
- this.model.data.player_options.show3d && this.model.startup_type === V.STAY3D && "" == j.valueFromHash("o", "") && "" == j.valueFromHash("l", "") ? o.resolve(!0) : this.flyToNewMode(i)
- }.bind(this, this.control.maxDistance), v.startupFlyinDelay), o
- }, lt.prototype.checkAndWaitForPanoLoad = function(t, e, i, n, r, o, a, s, l, u) {
- return null != s || (s = !0), this.model.supportsTiles ? this.checkAndWaitForTiledPanoLoad(t, n, r, o, a, s, l, u) : this.checkAndWaitForWholePanoLoad(t, e, i, r, s)
- }, lt.prototype.checkAndWaitForWholePanoLoad = function(t, e, i, n, r) {
- if (!t) throw new N("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
- return r && this.model.waitForLoad(t, (function() {
- return t.isLoaded(i)
- })), !t.isLoaded(e) && (t.loadCube(e)
- .done(n), !0)
- }, lt.prototype.checkAndWaitForTiledPanoLoad = (ut = new n.Vector3, ht = [], function(t, e, i, n, r, o, a, s) {
- if (!t) throw new N("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
- if (ut.copy(m.FORWARD), this.getDirection(ut), t.isLoaded(e)) return !1;
- var l = e + ":" + t.id;
- return ht[l] || (ht[l] = !0, o && this.model.waitForLoad(t, (function() {
- return t.isLoaded(e)
- })), t.loadTiledPano(e, ut, null, a, s)
- .done(function(t, e) {
- ht[l] = !1, i && i(t, e)
- }.bind(this))
- .fail(function(t) {
- ht[l] = !1, n && n(t)
- }.bind(this))
- .progress(function(t, e, i) {
- r && r(t, e, i)
- }.bind(this))), !0
- }), lt.prototype.resetDC = function() {
- var t = G.p.position.clone(),
- e = this.model.boundingBox.min.distanceTo(this.model.boundingBox.max);
- t.add(new n.Vector3(.5 * e, .7 * e, .5 * e))
- .add(this.getDirection(null, !0)
- .multiplyScalar(-6)), this.controls.dollhouse.lookAt(t, new n.Vector3(0, 0, 0), G.p.quaternion)
- }, lt.prototype.switchCameraMode = function(t, e) {
- var i = this.controls[t],
- n = i.camera;
- switch (t) {
- case f.PANORAMA:
- n.position.copy(this.currentPano.position);
- var r = e ? m.FORWARD.clone()
- .applyQuaternion(e) : this.getDirection()
- .setY(0)
- .normalize();
- i.lookAt(r.add(n.position));
- break;
- case f.DOLLHOUSE:
- this.resetDC();
- break;
- case f.FLOORPLAN:
- n.position.copy(this.model.center)
- .setY(10), i.target.copy(this.model.center)
- .setY(0), i.zoomToContain(this.model.size), i.rotateToView(this.model.size, this.getDirection())
- }
- i.update(0)
- }, lt.prototype.update = function() {
- var t = {},
- e = [];
- return function(i) {
- this.updatePersistentZooming(i), this.updateFromControls(i), this.getCurrentNodePanos(e), this.hasChanged(t) && (this.lastChangeTime = Date.now(), !this.mouseDown && this.containsMouse && this.updateIntersect(), this.model.supportsTiles && this.updateTileDownloader(e), this.emit(D.ViewChanged)), this.model.supportsTiles && (this.updateTileDownloader(t), this.updatePanoRenderer(t), this.updateZoomPano()), this.updatePreRendering(e), this.reticule.update(), this.path.update(), this.spider.update(), this.cachedPanoCandidates && v.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates), this.updateControlLocks(), this.updateMeasureTexture()
- }
- }(), lt.prototype.updatePersistentZooming = function(t) {
- 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * t) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * t)
- }, lt.prototype.updateControlLocks = function() {
- this.currentPano && this.model.supportsTiles && (this.controls[f.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
- }, lt.prototype.updatePanoRenderer = function() {
- var t = new n.Vector3;
- return function(e) {
- (this.nextPano || this.currentPano) && (t.copy(m.FORWARD), this.getDirection(t), this.panoRenderer.updateDirection(t))
- }
- }(), lt.prototype.cleanupInactivePanos = function() {
- var t = [],
- e = [];
- return function() {
- t.length = 0, t.push(this.currentPano), this.nextPano && t.push(this.nextPano), e.length = 0;
- for (var i = 0; i < this.panoRenderer.activePanos.length; i++) e.push(this.panoRenderer.activePanos[i]);
- for (var n = 0; n < e.length; n++) {
- for (var r = e[n], o = !0, a = 0; a < t.length; a++) r.id === t[a].id && (o = !1);
- o && r.exit()
- }
- }
- }(), lt.prototype.updatePreRendering = function() {
- var t = {};
- return function(e) {
- if (1 === v.tiling.preRenderTourPanos && this.preRenderingEnabled) {
- var i = this.nextPano || this.currentPano;
- if (i && e && e.length > 1) {
- var n = e.findIndex((function(t) {
- if (t.id === i.id) return !0
- }));
- if (n >= 0 && n + 1 < e.length) {
- var r = e[n + 1];
- r.isLoaded(this.basePanoSize) || t[r.id] || (window.setTimeout(function(e) {
- this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1), window.setTimeout(function(e) {
- t[e.id] = !1
- }.bind(this, e), v.tiling.panoPreRenderRepeatDelay)
- }.bind(this, r), v.tiling.panoPreRenderDelay), t[r.id] = !0)
- }
- }
- }
- }
- }(), lt.prototype.enablePreRendering = function() {
- this.preRenderingEnabled = !0
- }, lt.prototype.disablePreRendering = function() {
- this.preRenderingEnabled = !1, this.cleanupInactivePanos()
- }, lt.prototype.updateTileDownloader = function() {
- var t = new n.Vector3;
- return function(e) {
- var i = this.nextPano || this.currentPano;
- i && (t.copy(m.FORWARD), this.getDirection(t), this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, t, e.length > 0 ? e : null), this.tileDownloader.tilePrioritizer.zoomingActivated = this.zoomLevel > 1, this.tileDownloader.processPriorityQueue = !0)
- }
- }(), lt.prototype.updateFromControls = function(t) {
- null != t || (t = 0), this.control && (this.control.update(t), this.quaternion.copy(this.control.camera.quaternion), this.position.copy(this.control.camera.position), this.target.copy(this.control.target), this.control.camera.updateProjectionMatrix(), this.camera.projectionMatrix.copy(this.control.camera.projectionMatrix)), this.camera.position.copy(this.position), this.camera.quaternion.copy(this.quaternion), this.camera.updateMatrix(), this.camera.updateMatrixWorld()
- }, lt.prototype.hasChanged = function(t) {
- if (!this.previousState) return this.previousState = {
- allFloorsVisible: this.model.allFloorsVisible,
- position: this.position.clone(),
- quaternion: this.quaternion.clone(),
- mouse: this.mouse.clone(),
- zoom: this.getLabelScaleFactor(),
- currentFloor: this.model.currentFloor,
- projectionMatrix: this.camera.projectionMatrix.clone(),
- worldMatrix: this.camera.matrixWorld.clone(),
- mode: this.mode,
- modelPosition: this.model.position.clone(),
- modelCenter: this.model.center.clone(),
- zooming: this.zooming
- }, !0;
- var e = 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.zoom && 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.zooming === this.previousState.zooming;
- return t.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible, t.moved = !this.position.equals(this.previousState.position), t.rotated = !this.quaternion.equals(this.previousState.quaternion), t.mouseMoved = !this.mouse.equals(this.previousState.mouse), t.zoomed = this.getLabelScaleFactor() !== this.previousState.zoom, t.floorChanged = this.model.currentFloor !== this.previousState.currentFloor, t.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix), t.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix), t.modeChanged = this.mode !== this.previousState.mode, t.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition), t.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter), t.nextPanoActive = null !== this.nextPano, t.zooming = this.zooming !== this.previousState.zooming, 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.zoom = 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.zooming = this.zooming, !e
- }, lt.prototype.updateIntersect = function(t) {
- if (!j.isMobile() || t) {
- var e = this.flying || this.isWarping(),
- i = this.isOutsideMode() && this.controls[this.mode].isEngaged(),
- n = M.getById(Y.LookTransition),
- r = !(e || i || this.isTouchEvent || n.length && n[0].running);
- this.inMeasureMode && this.intersectPoints(this.mouse, this.camera), this.mattertagManager.intersectMattertag(this.mouse, r, this.camera) || (this.intersect = this.getMouseIntersect(), this.intersect && this.updateClosestPano(this.intersect), this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect), v.navigation.panoScores && !v.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : (this.reticule.updatePosition(this.position, this.intersect), v.isEditVersion && this.addTagReticule.hide()))
- }
- }, lt.prototype.intersectPoints = function(t, e) {
- var i = this.mouse.clone(),
- r = this.model.floors.reduce((function(t, e) {
- return e.hidden ? t : t.concat(e.collider.children)
- }), this.mode === f.PANORAMA ? this.panoMarkers : []),
- o = new n.Vector3(i.x, i.y, -1)
- .unproject(this.camera);
- this.raycasterP.set(o, this.getMouseDirection(i));
- var a = r.concat(G.MT.allSpheres),
- s = this.raycasterP.intersectObjects(a);
- if (s.length > 0 && "SphereGeometry" == s[0].object.geometry.type) {
- this.raycasterP.set(this.intersect.point, this.intersect.face.normal);
- this.raycasterP.intersectObjects(r)
- .length
- }
- this.intersect && (this.intersect.point.add(this.intersect.face.normal.clone()
- .multiplyScalar(.01)), G.pointsIntersect = {
- point: this.intersect.point,
- normal: this.intersect.normal
- })
- }, lt.prototype.getMouseDirection = function(t) {
- t = t || this.mouse;
- var e = new n.Vector3(t.x, t.y, -1)
- .unproject(this.camera);
- return new n.Vector3(t.x, t.y, 1)
- .unproject(this.camera)
- .sub(e)
- .normalize()
- }, lt.prototype.getMouseOnWholeIntersect = function(t) {}, lt.prototype.computeIntersectWithFloor = function(t, e, i) {
- return i = i || this.model.floors.reduce((function(t, e) {
- return e.hidden ? t : t.concat(e.collider.children)
- }), this.mode === f.PANORAMA ? this.panoMarkers : []), this.raycaster.set(t, e, 1), this.raycaster.intersectObjects(i)
- }, lt.prototype.getMouseIntersect = function(t, e) {
- t = t || this.mouse.clone(), e = e || this.model.floors.reduce((function(t, e) {
- return e.hidden ? t : t.concat(e.collider.children)
- }), this.mode === f.PANORAMA ? this.panoMarkers : []);
- var i = new n.Vector3(t.x, t.y, -1)
- .unproject(this.camera),
- r = this.computeIntersectWithFloor(i, this.getMouseDirection(t), e);
- if (0 === r.length) return null;
- var o = r[0];
- 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 = o.normal.y > .8);
- return o
- }, lt.prototype.updateClosestPano = function(t) {
- if (this.currentPano) {
- var e = [h.filters.isPanoAligned()];
- this.mode === f.PANORAMA ? (e.push(h.filters.not(this.currentPano)), e.push(h.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)), e.push(h.filters.isNeighbourPanoTo(this.currentPano)), e.push(h.filters.isCloseEnoughTo(t.point, v.panoFloorClickRadius)), e.push(h.filters.isNotBehindNormal(t.point, t.normal))) : (e.push(h.filters.isOnVisibleFloor()), this.mode !== f.FLOORPLAN && e.push(h.filters.inDirection(this.position, this.getDirection(), .25)));
- var i = this.model.panos.find(e, [h.sortFunctions.floorDistanceToPoint(t.point)]);
- i != this.closestPano && (this.emit(D.ClosestPanoChanging, this.closestPano, i, this.mode), this.closestPano = i)
- }
- }, lt.prototype.dollhouseMode = function(t, e) {
- this.emit(D.ModeChanging, this.mode, f.DOLLHOUSE), this.mode = f.DOLLHOUSE, this.controls[f.DOLLHOUSE].reset();
- new n.Vector3(this.model.center.x, 0, this.model.center.z), new n.Vector3(15, 20, 15);
- this.controls[f.DOLLHOUSE].resetRanges(0, !0), this.resetDC(), this.updateFromControls(), this.model.alpha = 1, this.model.skybox.material.uniforms.opacity.value = 0
- }, lt.prototype.insideMode = function(t, e) {
- if (e = e || null, this.mode !== f.PANORAMA && this.mode !== f.TRANSITIONING) {
- var i = [h.filters.isPanoAligned()];
- this.model.currentFloor && i.push(h.filters.atFloor(this.model.currentFloor)), t = t || this.currentPano || this.model.panos.find(i, [h.sortFunctions.distanceToPoint(this.control.target)]);
- var n = null !== this.currentPanoQuaternion ? this.currentPanoQuaternion : void 0;
- this.flyToNewMode({
- mode: f.PANORAMA,
- pano: t,
- callback: e,
- quaternion: n
- })
- }
- }, lt.prototype.fitDollhouse = function(t, e, i) {
- var r = m.FORWARD.clone()
- .applyQuaternion(i);
- this.control.target.copy(r)
- .add(t);
- var o = m.RIGHT.clone()
- .applyQuaternion(i),
- a = m.UP.clone(),
- s = o.clone()
- .applyAxisAngle(a, Math.PI / 2),
- l = this.model.boundingBox.max.clone(),
- u = this.model.boundingBox.min.clone(),
- h = [new n.Vector3(l.x, 0, l.z)
- .sub(t), new n.Vector3(l.x, 0, u.z)
- .sub(t), new n.Vector3(u.x, 0, l.z)
- .sub(t), new n.Vector3(u.x, 0, u.z)
- .sub(t)
- ],
- c = 0,
- d = 0,
- p = 0;
- h.forEach((function(t, e, i) {
- var n = Math.abs(t.dot(o)),
- r = t.dot(s);
- n > c && (c = n, d = r), r > p && (p = r)
- }));
- var f = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.z - u.z, 2)),
- g = f + 1 / Math.max(2 * f, 1);
- this.modellen = f;
- var y = Math.max(Math.abs(new n.Vector3(0, l.y, 0)
- .sub(t)
- .dot(a)), Math.abs(new n.Vector3(0, u.y, 0)
- .sub(t)
- .dot(a))),
- b = s.clone()
- .multiplyScalar(d)
- .add(e),
- w = s.clone()
- .multiplyScalar(p)
- .add(e);
- d = c / Math.tan(this.control.camera.fov / 2 * this.control.camera.aspect * (Math.PI / 180)), p = y / Math.tan(this.control.camera.fov / 2 * (Math.PI / 180)), d = Math.max(.5 * d, g), p = Math.max(.5 * p, g);
- var x = r.clone()
- .multiplyScalar(-d)
- .add(b)
- .sub(e)
- .length(),
- M = r.clone()
- .multiplyScalar(-p)
- .add(b)
- .sub(e)
- .length();
- this.control.maxDistance = v.skyboxRadius - 1, x >= M ? this.control.camera.position.set(0, 6, 0)
- .add(b)
- .add(r.multiplyScalar(1.1 * -d)) : this.control.camera.position.set(0, 6, 0)
- .add(w)
- .add(r.multiplyScalar(1.1 * -p))
- }, lt.prototype.floorplanMode = function(t, e, i) {
- this.mode = f.FLOORPLAN;
- var n = this.controls[f.FLOORPLAN];
- n.reset();
- var r = t || this.model.center;
- if (n.target.copy(r)
- .setY(0), n.camera.position.copy(r)
- .setY(10), i ? (n.currentScale = i / ((window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight)), n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size), e) {
- var o = m.LEFT.clone()
- .applyQuaternion(e);
- n.rotateLeft(-Math.atan2(o.x, o.z))
- } else n.rotateToView(this.model.size, this.getDirection());
- n.update(0)
- }, lt.prototype.nonInterruptingFlyToPano = function(t, e) {
- return t.skipWarpingCheck = !0, this.flyToPano(t, e)
- }, lt.prototype.handleOperation = function(t) {
- if ("flytopano" === t.type) {
- var e = t.id,
- i = this.model.panos.get(e);
- this.remoteFlyToPano({
- pano: i
- })
- }
- }, lt.prototype.flyToPano = function(t, e) {
- this.lockedFlyToPano || this.connect.getSyncState() && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
- type: "flytopano",
- id: t.pano.id
- }), this.evalFlyToPano(t, e))
- }, lt.prototype.remoteFlyToPano = function(t, e) {
- this.evalFlyToPano(t, e)
- }, lt.prototype.evalFlyToPano = function(t, e) {
- var i = this,
- r = t.pano,
- o = t.lookAtPoint,
- a = t.duration,
- s = t.maxDistanceOverride,
- l = t.skipWarpingCheck,
- u = t.constantMoveSpeed,
- h = null,
- c = null;
- if (this.isWarping() && !l) {
- if (this.path.activeTransType === I.BLACK) return q.warn("Player.flyToPano() -> Cannot fly when warping"), e && e(), !1;
- (h = y.deepExtend(t))
- .skipWarpingCheck = !0;
- var d = this.evalFlyToPano.bind(this, h, null);
- return this.emit(D.WarpInterruptedWithFlyTo, this.path.activeTransType, d), e && e(), !1
- }
- if (this.updateLastView(), this.mode === f.PANORAMA) {
- if (!r || (h = y.deepExtend(t), c = this.evalFlyToPano.bind(this, h, e), !this.checkAndWaitForPanoLoad(r, "high", "low", this.basePanoSize, c))) {
- var p = function(t) {
- e && e(t)
- }.bind(this);
- this.currentPano || (this.currentPano = r, this.path.placeCpm(), this.path.fadeOutCpm(v.path.fadeOutTime), this.spider.draw());
- var g = a;
- if ("number" != typeof a) {
- var b = s || v.transition.flytimeMaxDistanceThreshold;
- g = (Math.min(this.currentPano.position.distanceTo(r.position), b) * v.transition.flytimeDistanceMultiplier + v.transition.flyTime) * this.speedmultiplier
- }
- if (v.transition.flySpeed > .01 && (g = 1e3 * this.currentPano.position.distanceTo(r.position) / v.transition.flySpeed), 1 !== this.zoomLevel) switch (v.zoom.transitionStyle) {
- case 1:
- this.smoothZoomToDefault(g / 2);
- break;
- case 2:
- return h = y.deepExtend(t), c = this.evalFlyToPano.bind(this, h, e), void this.smoothZoomToDefault(v.zoom.restoreTime * (this.zoomLevel - 1), c)
- }
- if (o) {
- M.cancelById(Y.LookTransition), g *= v.transition.aimSlowFactor;
- var T = this.control.camera.quaternion.clone(),
- S = (new n.Matrix4)
- .lookAt(r.position, o, m.UP),
- _ = (new n.Quaternion)
- .setFromRotationMatrix(S),
- A = T.clone(),
- P = new n.Vector3;
- if (r === this.currentPano) {
- var C = m.FORWARD.clone()
- .applyQuaternion(T),
- E = m.FORWARD.clone()
- .applyQuaternion(_),
- O = C.angleTo(E),
- R = 1 * Math.sqrt(O) / v.mattertags.navigate.rotateSpeedFactor * 1e3;
- return void M.start(function(t) {
- A.copy(T), w.quaternion(A, _)(t), P.copy(m.FORWARD)
- .applyQuaternion(A)
- .add(this.control.camera.position), this.control.lookAt(P), i.handleControlPanoramaMove()
- }.bind(this), R, p, 0, x[v.transition.movementEasing], null, Y.LookTransition)
- }
- }
- if (r === this.currentPano || this.flying) return void p();
- this.flying = !0;
- var N = this.position.clone(),
- k = this.currentPano;
- q.debug("Flying to pano ", r.position), this.emit(D.PanoChosen, this.currentPano, r), this.emit(D.FlyingStarted, r.position, N, r, k), o && M.start(function(t) {
- A.copy(T), w.quaternion(A, _)(t), P.copy(m.FORWARD)
- .applyQuaternion(A)
- .add(this.control.camera.position), this.control.lookAt(P)
- }.bind(this), g, null, 0, x[v.transition.movementEasing], null, Y.LookTransition);
- var F = u ? null : x[v.transition.movementEasing];
- this.updateRulers(g), this.steeringWheelPos(r, this.currentPano, g), this.measurementTool.updateMeasureVisible(r), this.nextPano = r, this.emit("PanoAnimation", this.nextPano, g), G.R.recording && this.record(this.currentPano, this.nextPano), M.start(w.uniform(this.model.skybox, "progress", 1), g, null, 0, x[v.transition.blendEasing], "skyFly", Y.FlyToPano), M.start(w.allUniforms(this.model.chunks, "progress", 1), g, null, 0, x[v.transition.blendEasing], "chunkFly", Y.FlyToPano), M.start(w.vector(this.cameras[f.PANORAMA].position, r.position), g, function(t) {
- this.flying = !1, this.currentPano.exit(), r.enter(), this.currentPano = r, this.nextPano = null, this.path.placeCpm(), this.path.fadeOutCpm(v.path.fadeOutTime), this.spider.draw(), this.emit(D.FlyingEnded, r.position, N, r, k), p(t), i.currentPano && (this.walkOnPano || this.emit(L.MoveHighlightsBar, i.currentPano.roomid), this.mattertagManager.updateRegionalJumpTags(r))
- }.bind(this), 0, F, "camFly", Y.FlyToPano)
- }
- } else this.flyToNewMode({
- mode: f.PANORAMA,
- pano: r,
- callback: e
- })
- }, lt.prototype.record = function(t, e) {
- G.R.last && G.R.last.time + .05 > parseFloat(G.R.time.getElapsedTime()
- .toFixed(5)) && G.R.save2({
- tap: G.R.last.tap,
- panoid: G.R.last.panoid,
- action: G.R.last.action,
- lon: parseFloat(G.R.last.lon.toFixed(5)),
- lat: parseFloat(G.R.last.lat.toFixed(5)),
- time: parseFloat(G.R.last.time.toFixed(5))
- }), G.R.save({
- tap: "panorama",
- panoid: t.id,
- action: "move",
- destid: e.id
- })
- }, lt.prototype.updateRulers = function(t) {
- var e = 0,
- i = Math.ceil(t / 20),
- n = this,
- r = setInterval((function() {
- ++e > i && clearInterval(r), n.emit(L.RulersWalk)
- }), 20)
- }, lt.prototype.steeringWheelPos = function(t, e, i) {
- if (this.model.steeringWheel && t.id && t.position) {
- var n = t.id,
- r = (G.model.panos.list, this),
- o = i || 400;
- this.model.steeringWheel.position.copy(t.position), this.model.steeringWheel.material.opacity = 0, M.start(w.property(this.model.steeringWheel.material, "opacity", .6), o), this.model.settings.locations.points.forEach((function(t, e) {
- if (t.locationid === n) return r.model.steeringWheel.position.y = t.spot.z + .1, !1
- }))
- }
- }, lt.prototype.changeSteeringWheelState = function(t) {
- t === f.PANORAMA ? this.model.showSteeringWheel() : t !== f.DOLLHOUSE && t !== f.FLOORPLAN || this.model.hideSteeringWheel()
- }, lt.prototype.fastForwardActivePanoFlight = function(t) {
- t = t || v.transition.fastForwardFactor / 10 * 4 + 1;
- for (var e = M.getById(Y.FlyToPano), i = 0; i < e.length; i++) M.adjustSpeed(e[i], t)
- }, lt.prototype.setSpeedMultiplier = function(t) {
- var e = 1,
- i = 1200;
- switch (t) {
- case "0.3×":
- e = 3, i *= 1.5, v.warp.minWarpTime = i;
- break;
- case "0.5×":
- e = 2, i *= 1.2, v.warp.minWarpTime = i;
- break;
- case "1.0×":
- e = 1;
- break;
- case "1.5×":
- e = .67;
- break;
- case "2.0×":
- e = .5;
- break;
- default:
- e = 1
- }
- this.speedmultiplier = e
- }, lt.prototype.flyToPanoClosestToMouse = function() {
- if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(), this.intersect && this.updateClosestPano(this.intersect)), this.closestPano) return this.flyToPano({
- pano: this.closestPano
- });
- var t = this.getMouseDirection();
- this.flyDirection(t) || this.flyToPano({
- pano: this.currentPano
- })
- }, lt.prototype.flyLocalDirection = function(t) {
- var e = this.getDirection(t),
- i = 1 === t.z ? .4 : .75,
- n = 1 === Math.abs(t.x);
- this.flyDirection(e, i, n)
- }, lt.prototype.flyDirection = function(t, e, i) {
- this.history.invalidate();
- var n = this.closestPanoInDirection(t, e, i);
- return n ? (this.flyToPano({
- pano: n
- }), !0) : (this.bump(t), !1)
- }, lt.prototype.closestPanoInDirection = function(t, e, i) {
- return this.rankedPanoInDirection(0, t, e, i)
- }, lt.prototype.rankedPanoInDirection = function() {
- var t = {
- pano: null,
- candidates: []
- };
- return function(e, i, n, r) {
- e || (e = 0), n = void 0 !== n ? n : .75;
- var o = r ? "angle" : "direction";
- return this.model.panos.findRankedByScore(e, [h.filters.isPanoAligned(), h.filters.inPanoDirection(this.position, i, n), h.filters.isNeighbourPanoTo(this.currentPano), h.filters.not(this.currentPano)], [h.scoreFunctions.distanceSquared(this.currentPano), h.scoreFunctions[o](this.position, i)], t), this.cachedPanoCandidates = t.candidates, t.pano
- }
- }(), lt.prototype.bump = function(t) {
- if (this.mode === f.PANORAMA && !this.flying && !this.isWarping()) {
- var e, i, r, o = v.transition,
- a = (o.flytimeMaxDistanceThreshold * o.flytimeDistanceMultiplier + o.flyTime) / 8,
- s = this.camera.getWorldDirection(new n.Vector3)
- .dot(t);
- if (Math.abs(s) > .5) e = function() {
- M.start(w.property(this.cameras[f.PANORAMA], "zoom", s > 0 ? 1.04 : .96), a, i, 0, x.easeInOutSine, "bumpZStart")
- }.bind(this), i = function() {
- M.start(w.property(this.cameras[f.PANORAMA], "zoom", 1), 5 * a, r, 0, x.easeInOutSine, "bumpZRelax")
- }.bind(this);
- else {
- var l = this.camera.position.clone(),
- u = t.clone();
- this.raycaster.set(l, u);
- var h = this.model.floors.reduce((function(t, e) {
- return t.concat(e.collider.children)
- }), []),
- c = this.raycaster.intersectObjects(h),
- d = c.length > 0 ? c[0].distance / 25 : .04,
- p = l.clone()
- .add(u.multiplyScalar(d));
- e = function() {
- M.start(w.vector(this.cameras[f.PANORAMA].position, p), a, i, 0, x.easeInOutSine, "bumpTStart")
- }.bind(this), i = function() {
- M.start(w.vector(this.cameras[f.PANORAMA].position, l), 5 * a, r, 0, x.easeInOutSine, "bumpTRelax")
- }.bind(this)
- }
- r = function() {
- this.flying = !1
- }.bind(this), this.flying = !0, e()
- }
- }, lt.prototype.changeFloor = function(t, e) {
- var i = this.controls[this.mode];
- if (i && i.emit(L.Move, e), e && this.controls[f.PANORAMA].emit(L.InteractionGui, "floor-control"), !this.is360View(this.mode, this.currentPano))
- if (this.mode === f.PANORAMA) {
- var n = this.history.reversePano(t);
- n && n.isAligned() ? this.flyToPano({
- pano: n
- }) : this.changeFloorByScore(t)
- } else this.model.setFloor(this.model.nextFloor(t) || this.model.currentFloor)
- }, lt.prototype.changeFloorByScore = function() {
- var t = {
- pano: null,
- candidates: []
- };
- return function(e) {
- var i = this.model.nextFloor(e);
- return i ? (this.model.panos.lowestByScore([h.filters.atFloor(i), h.filters.isPanoAligned()], [h.scoreFunctions.distance(this.currentPano), h.scoreFunctions.direction(this.position, new n.Vector3(0, e, 0)), h.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], t), void(t.pano ? (this.cachedPanoCandidates = t.candidates, this.history.push(e, this.currentPano), this.flyToPano({
- pano: t.pano
- })) : q.warn("No pano found on selected floor, not moving there."))) : void q.debug("player.changeFloor(" + e + "): no such floor")
- }
- }(), lt.prototype.gotoFloor = function(t, e) {
- var i = t - this.model.currentFloor.floorIndex;
- this.changeFloor(i, e)
- }, lt.prototype.getDirection = function(t, e) {
- return t = t || (new n.Vector3)
- .copy(m.FORWARD), e ? t.applyQuaternion(G.p.quaternion) : t.applyQuaternion(this.camera.quaternion)
- }, lt.prototype.getHighlightDirection = function(t) {
- return (t = t || (new n.Vector3)
- .copy(m.FORWARD))
- .applyQuaternion(this.model.heroImage._camera._rotation)
- }, lt.prototype.flyToSameMode = function(t, e, i, r) {
- var o = this;
- if (this.mode === f.TRANSITIONING) return q.warn("should not be transitioning here"), void(r && r(!1));
- var a = i || !1,
- s = i ? i.position : this.position,
- l = this.position.clone(),
- u = this.currentPano;
- if (q.debug("New pose in mode " + this.mode), t) {
- var h = this.flyToSameMode.bind(this, t, e, i, r);
- if (this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, h)) return
- }
- var c = function() {
- this.emit(D.FlyingEnded, s, l, t, u), r && r(!0), o.currentPano
- }.bind(this),
- d = v[this.mode],
- p = void 0 !== e ? e : d.transitionTime,
- m = new n.Vector3,
- g = new n.Vector3;
- if (this.emit(D.FlyingStarted, s, l, t, u), this.mode === f.PANORAMA) q.warn("we should not be here for panorama views");
- else if (this.mode === f.DOLLHOUSE)
- if (a) {
- var y = new n.Vector3(0, 1, 0);
- this.controls[f.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(i.floorVisibility), g.copy(i.position);
- var b = new n.Vector3(0, 0, -1)
- .applyQuaternion(i.quaternion),
- T = new n.Raycaster(g.clone(), b.clone(), 0, 1 / 0)
- .intersectObjects(this.model.colliders),
- S = 3;
- T.length ? (m.copy(T[0].point), S = .75 * g.distanceTo(m)) : (m.copy(b)
- .multiplyScalar(3)
- .add(g), q.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
- var _ = (new n.Matrix4)
- .lookAt(g, m, y),
- A = (new n.Euler)
- .setFromRotationMatrix(_, v.warp.eOrder),
- P = m.distanceTo(g),
- C = (new n.Matrix4)
- .lookAt(this.cameras[f.DOLLHOUSE].position, this.controls[f.DOLLHOUSE].target, y),
- E = (new n.Euler)
- .setFromRotationMatrix(C, v.warp.eOrder),
- L = this.cameras[f.DOLLHOUSE].position.distanceTo(this.controls[f.DOLLHOUSE].target);
- this.controls[f.DOLLHOUSE].resetRanges(Math.min(L, S), !0);
- var O = new n.Euler(A.x - E.x, A.y - E.y, A.z - E.z, v.warp.eOrder);
- O.y > Math.PI ? O.y -= 2 * Math.PI : O.y < -Math.PI && (O.y += 2 * Math.PI), this.path.burnsDir = Math.sign(O.y);
- var I = new n.Euler(0, 0, 0, v.warp.eOrder),
- R = new n.Vector3;
- M.start(w.vector(this.controls[f.DOLLHOUSE].target, m), p, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToSameMode), M.start(function(t, e) {
- I.x = E.x + t * O.x, I.y = E.y + t * O.y, I.z = E.z + t * O.z;
- var i = L + t * (P - L);
- R.set(0, 0, i)
- .applyEuler(I)
- .add(this.controls[f.DOLLHOUSE].target), this.cameras[f.DOLLHOUSE].position.copy(R)
- .add(this.model.position)
- }.bind(this), p, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToSameMode), M.start(function(t, e) {
- this.controls[f.DOLLHOUSE].update(), this.quaternion.copy(this.cameras[f.DOLLHOUSE].quaternion), this.position.copy(this.cameras[f.DOLLHOUSE].position)
- }.bind(this), p, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToSameMode)
- } else q.warn("invalid warp destination in flyToSameMode()? ignore it then");
- else if (this.path.placeCpm(), this.path.fadeInCpm(v.path.fadeInTime), i) {
- this.model.warpDestFloors(i.floorVisibility);
- var N = this.cameras[f.FLOORPLAN],
- k = this.controls[f.FLOORPLAN],
- F = k.target.clone(),
- B = i.position.clone()
- .sub(F),
- z = N.position.clone()
- .sub(k.target)
- .length(),
- U = new n.Vector3(-1, 0, 0)
- .applyQuaternion(i.quaternion)
- .normalize(),
- V = Math.atan2(k.offset.x, k.offset.z),
- j = Math.atan2(U.x, U.z),
- H = k.absoluteScale,
- G = i.orthoZoom / ((window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight));
- M.start(function(t, e) {
- k.target.copy(B)
- .multiplyScalar(t)
- .add(F);
- var i = V + (j - V) * t;
- k.offset.x = z * Math.sin(i), k.offset.z = z * Math.cos(i), N.position.copy(k.target)
- .add(k.offset), k.absoluteScale = H + t * (G - H), k.update(), this.quaternion.copy(N.quaternion), this.position.copy(N.position), this.target.copy(k.target), this.camera.projectionMatrix.copy(N.projectionMatrix)
- }.bind(this), p, null, 0, x[v.flydown.movementEasing], null, Y.FlyToSameMode)
- } else q.info("flyToSameMode() funny floorplan view? skipping");
- M.setTimeout(function(t) {
- this.mode = t, c()
- }.bind(this, this.mode), p, Y.FlyToSameMode), this.mode = f.TRANSITIONING
- }, lt.prototype.ownFlyToNewMode = function(t) {
- var e = (t = t || {})
- .mode,
- i = t.pano,
- n = t.duration,
- r = t.warpDest,
- o = t.callback,
- a = t.force;
- t.quaternion;
- if (this.isWarping()) return q.warn("Player.flyToNewMode() -> Cannot fly when warping"), void(o || o(!1));
- if (this.mode !== f.TRANSITIONING)
- if (e !== this.mode) {
- q.debug("Switching mode to " + e);
- var s = this.ownFlyToNewMode.bind(this, t);
- if (!i || !this.checkAndWaitForPanoLoad(i, "low", "low", this.basePanoSize, s)) {
- if (!this.model.meshTexturesLoaded && this.isOutsideMode(e)) return q.info("Waiting for model textures to be loaded before going out to dollhouse"), this.model.waitForLoad(this.model, (function() {
- return self.model.meshTexturesLoaded
- })), void this.model.loadMeshTextures()
- .done(s);
- this.history.invalidate(), this.updateLastView();
- var l = this.mode;
- this.cameras[e];
- t = y.deepExtend({}, v[e], v[l + "-" + e]);
- void 0 !== n || t.transitionTime
- }
- } else a ? this.flyToSameMode(i, n, r, o) : o && o(!1);
- else o && o(!1)
- }, lt.prototype.flyToNewMode = function(t) {
- var e = this,
- i = (t = t || {})
- .mode,
- r = t.pano,
- o = t.duration,
- a = t.warpDest,
- s = t.callback,
- l = t.force,
- u = t.quaternion;
- if (this.isWarping()) return q.warn("Player.flyToNewMode() -> Cannot fly when warping"), void(s && s(!1));
- if (this.mode !== f.TRANSITIONING) {
- if (i === this.mode) return l ? void this.flyToSameMode(r, o, a, s) : void(s && s(!1));
- var h = a || !1;
- q.debug("Switching mode to " + i);
- var c = this.flyToNewMode.bind(this, t);
- if (!r || !this.checkAndWaitForPanoLoad(r, "low", "low", this.basePanoSize, c)) {
- if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)) return q.info("Waiting for model textures to be loaded before going out to dollhouse"), this.model.waitForLoad(this.model, function() {
- return this.model.meshTexturesLoaded
- }.bind(this)), void this.model.loadMeshTextures()
- .done(c);
- this.history.invalidate(), this.updateLastView();
- var d = this.mode,
- p = this.cameras[i];
- t = y.deepExtend({}, v[i], v[d + "-" + i]);
- var m = void 0 !== o ? o : t.transitionTime;
- this.emit(D.ModeChanging, d, i, r), r && (this.currentPano = r), d === f.PANORAMA && (this.currentPanoQuaternion = this.quaternion.clone()), this.switchCameraMode(i, u), M.cancelById(Y.LookTransition);
- var g = (new n.Vector3)
- .copy(this.position);
- if (i === f.PANORAMA) this.emit(D.PanoChosen, r, r), setTimeout(function() {
- r.floor.enter(i)
- }.bind(this), m / 2), this.path.fadeOutCpm(v.path.fadeOutTime);
- else if (i === f.DOLLHOUSE) {
- if (h && (this.model.stayPut = !0), a ? (this.controls[f.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0), this.path.placeCpm(), this.path.fadeInCpm(v.path.fadeInTime), h) {
- var b = new n.Vector3(this.model.center.x, 0, this.model.center.z);
- g.set(15, 10, 15);
- var T = new n.Vector3(0, 0, -1)
- .applyQuaternion(a.quaternion),
- S = new n.Raycaster(a.position.clone(), T.clone(), 0, 1 / 0)
- .intersectObjects([this.sceneIntersectionPlane]);
- S.length ? (b.copy(S[0].point), g.copy(a.position), this.controls[f.DOLLHOUSE].resetRanges(.75 * g.distanceTo(b), !0)) : (q.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion), this.controls[f.DOLLHOUSE].resetRanges(3, !0)), this.controls[f.DOLLHOUSE].target.copy(b), g.add(this.model.position), p.position.copy(g), this.controls[f.DOLLHOUSE].update()
- }
- } else if (this.path.placeCpm(), this.path.fadeInCpm(v.path.fadeInTime), a) {
- this.model.warpDestFloors(a.floorVisibility);
- var _ = this.cameras[f.FLOORPLAN],
- A = this.controls[f.FLOORPLAN],
- P = _.position.clone()
- .sub(A.target),
- O = new n.Vector3(-1, 0, 0)
- .applyQuaternion(a.quaternion)
- .normalize(),
- N = Math.atan2(O.x, O.z);
- A.target.copy(a.position);
- var k = P.length();
- A.offset.x = k * Math.sin(N), A.offset.y = 0, A.offset.z = k * Math.cos(N), _.position.copy(A.target)
- .add(A.offset), A.target.clone()
- .sub(p.position), p.quaternion.copy(a.quaternion), A.currentScale = a.orthoZoom / ((window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight)), A.absoluteScale = A.currentScale, A.update()
- } else this.model.currentFloor.enter(i);
- var F = this.currentPano,
- B = this.position.clone();
- this.emit(D.FlyingStarted, g, B, r, this.currentPano), this.flying = !0, this.isOutsideMode(i) && this.is360View(d, F) ? (h || i !== f.DOLLHOUSE || (p.position.set(15, 10, 15), p.controls.target.set(this.model.center.x, 0, this.model.center.z), p.controls.update()), t.blackoutStyle = R.FADEIN, m = v.show360Views.transitionTime, this.fade360View(m, p, t)) : this.isOutsideMode(d) && this.is360View(i, r) ? (h && this.switchCameraMode(i, h.quaternion), this.mode = i, this.path && this.path.popOutCpm(), t.blackoutStyle = R.END, m = v.show360Views.transitionTime, this.fade360View(m, p, t)) : (M.start(w.property(this.model, "alpha", t.modelAlpha, null), m * t.modelAlphaLength, null, t.modelAlphaDelay, null, Y.FlyToNewMode), M.start(w.vector(this.position, p.position), m, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToNewMode), M.start(w.quaternion(this.quaternion, p.quaternion), m * t.rotationDuration, null, t.rotationDelay, x[v.flydown.rotationEasing], null, Y.FlyToNewMode), M.start(w.matrix4(this.camera.projectionMatrix, p.projectionMatrix), m * t.cameraMatrixDuration, null, t.cameraMatrixDelay, t.cameraMatrixEase, null, Y.FlyToNewMode), M.start(w.uniform(this.model.skybox, "opacity", t.skyboxOpacity), m * t.skyboxOpacityLength, null, t.skyboxOpacityDelay, null, Y.FlyToNewMode), M.start(w.property(this.reticule.material.uniforms.opacity, "value", 0), m, null, Y.FlyToNewMode)), M.setTimeout(function() {
- this.flying = !1, d === f.PANORAMA && i !== f.PANORAMA ? this.currentPano.exit() : d !== f.PANORAMA && i === f.PANORAMA && (this.currentPano.enter(), this.path.placeCpm(), this.path.fadeOutCpm(v.path.fadeOutTime), this.spider.draw()), d === f.DOLLHOUSE && this.controls[f.DOLLHOUSE].resetRanges(), this.mode = i, this.emit(D.FlyingEnded, g, B, this.currentPano, F), e.currentPano && ("panorama" === G.player.mode && this.emit(L.MoveHighlightsBar, e.currentPano.roomid), this.steeringWheelPos(e.currentPano), this.mattertagManager.updateRegionalJumpTags(e.currentPano), this.measurementTool && this.measurementTool.updateMeasureVisible(e.currentPano), this.measuringToolControls && this.measuringToolControls.onFlyEnd()), e.model.entranceMesh && (e.mode === f.DOLLHOUSE ? e.model.setEntranceState(!0) : e.model.setEntranceState(!1)), h && d !== f.PANORAMA && i === f.PANORAMA ? this.startWarp(E.Retain, C.Retain, I.BLACK, null, null, s) : s && s()
- }.bind(this), m, Y.FlyToNewMode), this.mode = f.TRANSITIONING
- }
- } else s && s(!1)
- }, lt.prototype.fade360View = function(t, i, n) {
- this.mattertagManager.hideShowTagsForBlackoutStyle(n.blackoutStyle, t), e(this.domElement)
- .fadeOut(.5 * t, function() {
- this.model.skybox.material.uniforms.opacity.value = n.skyboxOpacity, this.model.alpha = n.modelAlpha, this.position.copy(i.position), this.quaternion.copy(i.quaternion), this.camera.projectionMatrix.copy(i.projectionMatrix), e(this.domElement)
- .fadeIn(.5 * t)
- }.bind(this))
- }, lt.prototype.findDefaultViews = function() {
- this.findDefaultView(this.lastInsideView, !0), this.findDefaultView(this.last360View, !1)
- }, lt.prototype.findDefaultView = function(t, e) {
- var i, n = this.model.heroLocations,
- r = this.model.panos,
- o = n.findIndex((function(t) {
- if (t.cameraMode !== f.PANORAMA) return !1;
- var i = r.get(t.panoId);
- return i && i.isAligned() === e
- }));
- o >= 0 ? (i = r.get(n[o].panoId), t.update({
- cameraMode: f.PANORAMA,
- pano: i,
- position: n[o].position,
- quaternion: n[o].quaternion
- })) : (o = r.list.findIndex((function(t) {
- return t.isAligned() === e
- }))) >= 0 ? (i = r.list[o], t.update({
- cameraMode: f.PANORAMA,
- pano: i,
- position: i.position
- })) : q.warn("There are no", e ? "inside" : "360??", "views in this model")
- }, lt.prototype.updateLastView = function() {
- this.mode === f.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View)
- .update({
- pano: this.currentPano,
- position: this.position,
- quaternion: this.quaternion
- })
- }, lt.prototype.goToLastView = function(t) {
- var e = t ? this.lastInsideView : this.last360View;
- this.isInMode(f.PANORAMA) && this.currentPano.isAligned() !== t && this.updateLastView(), this.isInMode(f.PANORAMA) ? (this.path && this.path.popOutCpm(), this.fadeToView(t, e, v.show360Views.transitionTime)) : this.isOutsideMode() && this.flyToNewMode({
- mode: e.cameraMode,
- pano: e.pano,
- quaternion: e.quaternion
- })
- }, lt.prototype.setStateWithAnimation = function(t, e) {
- t && (t.mode && t.mode !== this.mode && this.mode !== f.TRANSITIONING ? t.mode === f.PANORAMA ? this.flyToNewMode({
- pano: this.model.panos.index[t.panoId],
- mode: f.PANORAMA
- }) : (s.prototype._progressNumber = function(t, e, i) {
- return t + (e - t) * i
- }, s.prototype._progressRad = function(t, e, i) {
- var n = 2 * Math.PI,
- r = Math.PI,
- o = function(t) {
- return (t % n + n) % n
- };
- return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
- }) : this.mode !== f.TRANSITIONING && this.controls[this.mode].translateWithAnimation(t.lon, t.lat, e), t.zoomLevel && t.zoomLevel !== this.zoomLevel && this.zoomTo(t.zoomLevel, !0))
- }, lt.prototype.fadeToView = function(t, i, n) {
- if (!i.isValid() || i.cameraMode === f.PANORAMA && !i.pano) return q.warn("Tried to fade to an illegal view", i.cameraMode), !1;
- var r = function() {
- e(this.domElement)
- .fadeIn(.5 * n)
- }.bind(this),
- o = t ? R.FADEIN : R.END;
- this.mattertagManager.hideShowTagsForBlackoutStyle(o, n), e(this.domElement)
- .fadeOut(.5 * n, function() {
- this.model.fadePanoMarkers(t ? v.panorama.markerOpacity : 0), i.cameraMode === f.PANORAMA ? this.flyToPano({
- pano: i.pano,
- lookAtPoint: m.FORWARD.clone()
- .applyQuaternion(i.quaternion)
- .add(i.pano.position),
- duration: 0
- }, r) : this.flyToNewMode({
- mode: i.cameraMode,
- quaternion: i.quaternion,
- duration: 0,
- callback: r
- })
- }.bind(this))
- }, lt.prototype.startWarp = function(t, e, i, n, r, o) {
- if (this.control && (this.control.enabled = !1), this.flying) return q.warn("Player.startWarp() -> Cannot warp when flying"), o && o(), !1;
- null != t || (t = E.Show), this.history.invalidate(), "walk" === i ? this.walkOnPano = !0 : (this.walkOnPano = !1, this.updateRulers(1e3)), t != E.Retain ? this.path.brushToWarpPano(i, I.BLACK) || (i = I.BLACK) : i = this.path.upcomingTransType;
- var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
- return this.emit(D.WarpStarted, a, i, n, r), n = n || R.MIDDLE, this.path.warpToPano(i, n, r, function() {
- e === C.Slow ? this.path.discardSlow() : e === C.Standard && this.path.discardPathObject(), this.emit(D.WarpEnded, i), this.control && (this.control.enabled = !0), o && o()
- }.bind(this)), t === E.Hide && this.path.discardPathObject(), !0
- }, lt.prototype.warpToPanoById = function(t, e, i, n, r, o, a, s) {
- return this.path.setWarpDestinationByPanoId(t, e) ? this.startWarp(i, n, r, o, a, s) : (q.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"), s && s(), !1)
- }, lt.prototype.warpToPanoByHeroIndex = function(t, e, i, n, r, o, a) {
- if (-1 != e) return this.path.setWarpDestinationByHeroIndex(t) ? this.startWarp(e, i, n, r, o, a) : (a && a(), !1);
- this.startWarp(e, i, n, r, o, a)
- }, lt.prototype.warpToPano = function(t, e, i, n, r, o, a, s) {
- return this.warpToPanoById(t.id, e, i, n, r, o, a, s)
- }, lt.prototype.warpToNonPanoByHeroIndex = function(t, e) {
- return this.path.setWarpDestinationByHeroIndex(t) ? (this.path.warpToNonPano(e), !0) : (q.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"), e && e(), !1)
- }, lt.prototype.aimTourCamera = function(t, e, i, n) {
- return this.warpToPanoByHeroIndex(t, e, i, null, null, null, n)
- }, lt.prototype.showPathToHeroLocation = function(t) {
- this.mode !== f.PANORAMA && this.path.setWarpDestinationByHeroIndex(t) && this.path.brushToWarpPano(I.STD, I.BLACK)
- }, lt.prototype.tourInterlude = function(t, e) {
- this.history.invalidate(), this.path.discardSlow(), this.path.waitNextStep(t, (function() {
- e && e()
- }))
- }, lt.prototype.stopInterlude = function() {
- this.interruptAndFastForward(null, 0)
- }, lt.prototype.interruptAndFastForward = function(t, e) {
- this.isWarping() && this.emit(D.WarpInterrupted, this.path.activeTransType, t, e), this.flying && this.emit(D.FlyingInterrupted), this.path.interruptAndFastForward(t, e)
- }, lt.prototype.setSize = function(t, e) {
- var i = t / e;
- for (var n in this.cameras) this.cameras[n].updateAspect(i)
- }, lt.prototype.toJSON = function() {
- var t = {};
- return this.control ? ((t = this.control.toJSON())
- ._type = f.toInt(this.mode), this.isOutsideMode() ? this.model.allFloorsVisible ? t.floor_visibility = [] : t.floor_visibility = this.model.floors.list.map((function(t) {
- return t.hidden ? 0 : 1
- })) : f.PANORAMA && (t._locationid = this.currentPano.id), t) : t
- }, lt.prototype.getCurrentNodePanos = function(t) {
- if (this.model.panos.map, t.length = 0, this.path.nodes)
- for (var e = 0; e < this.path.nodes.length; e++) {
- var i = this.path.nodes[e];
- t.push(this.model.panos.get(i))
- }
- }, lt.prototype.zoomIncrementally = function(t) {
- var e = this.zoomLevel;
- this.zoomTo(this.zoomLevel + t), e !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(e, this.zoomLevel, this.currentPano.id)
- }, lt.prototype.zoomInIncrementally = function(t) {
- t = t || this.defaultZoomIncrement, this.zoomIncrementally(t)
- }, lt.prototype.zoomOutIncrementally = function(t) {
- t = t || -this.defaultZoomIncrement, this.zoomIncrementally(t)
- }, lt.prototype.zoomBy = function(t) {
- this.zoomTo(this.zoomLevel * t)
- }, lt.prototype.zoomIn = function() {
- this.zoomBy(1 + this.zoomSpeed)
- }, lt.prototype.zoomOut = function() {
- this.zoomBy(1 - this.zoomSpeed)
- }, lt.prototype.jumpTo3D = function() {
- G.d.changeMode(f.DOLLHOUSE), G.d.jumpingto3d = !0
- }, lt.prototype.zoomTo = function(t, e) {
- if (e || v.zoom.enabled && this.mode === f.PANORAMA && this.zoomEnabled) {
- if (t < v.zoom.min ? this.zf ? this.clock.getElapsedTime() - this.start > 3 ? this.zf = !1 : (this.len += v.zoom.min - t, this.len > .26 && (this.jump = !0, this.zf = !1)) : (this.start = this.clock.getElapsedTime(), this.zf = !0, this.len = 0, this.jump = !1) : (this.zf = !1, this.len = 0, this.jump = !1), t < v.zoom.min) {
- t = v.zoom.min;
- var i = G.model.outsideAllowed(),
- n = !this.isInMode(f.DOLLHOUSE, f.TRANSITIONING);
- if (this.jump && i && n) return G.R.recording && G.R.save({
- tap: "dollhouse"
- }), void this.jumpTo3D()
- }
- if (t > v.zoom.max && (t = v.zoom.max), t > this.zoomLevel ? (this.emit(B.ZoomIn), t === v.zoom.max && this.emit(B.ZoomMax)) : t < this.zoomLevel && (this.emit(B.ZoomOut), t === v.zoom.min && this.emit(B.ZoomMin)), this.control) {
- G.R.recording && G.R.save({
- tap: "zoom",
- type: "panorama",
- level: t
- });
- var r = this.control.camera;
- this.zoomLevel = t, r.fov = this.baseFov * (1 / this.zoomLevel), r.updateProjectionMatrix(), this.zoomFov = r.fov
- }
- }
- }, lt.prototype.increaseZoomSpeed = function() {
- this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
- }, lt.prototype.decreaseZoomSpeed = function() {
- this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
- }, lt.prototype.clampZoomSpeed = function(t) {
- return t < 0 ? 0 : t
- }, lt.prototype.activatePersistentZooming = function(t) {
- this.zooming = t ? 1 : -1
- }, lt.prototype.deactivatePersistentZooming = function() {
- this.zooming = 0
- }, lt.prototype.zoomDefault = function() {
- this.zoomTo(1, !0)
- }, lt.prototype.smoothZoomToDefault = function(t, e) {
- var i, n = this.zoomLevel,
- r = function(t) {
- t > 1 && (t = 1), i = n * (1 - t) + t, this.zoomTo(i, !0)
- }.bind(this),
- o = function() {
- this.zoomDefault(), e && window.setTimeout(e, 50)
- }.bind(this);
- M.start(r, t, o, null, 0, x[v.transition.blendEasing])
- }, lt.prototype.updateZoomPano = function() {
- if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === f.PANORAMA) {
- var t = this.currentPano;
- if (t) {
- var e = this.zoomLevel > v.zoom.activationThreshold,
- i = !(this.flying && this.nextPano && this.nextPano !== this.currentPano) && !this.isWarping(),
- n = e && i;
- this.tileDownloader.tilePrioritizer.setZoomingActive(n), this.panoRenderer.setZoomingActive(n, t, !0);
- var r = function(t, e) {
- this.panoRenderer.resetRenderStatus(t.id, !1, !0, this.qualityManager.getMaxNavPanoSize()), this.panoRenderer.clearAllQueuedUploadsForPano(t.id), this.panoRenderer.renderPanoTiles(t.id, null, !1, !1), t.setZoomed(e)
- }.bind(this);
- n && !t.zoomed ? (r(t, !0), this.panoRenderer.enableUltraHighQualityMode(function() {
- this.qualityManager.useUltraHighResolutionPanos && !v.zoom.overridemax && (v.zoom.max = U.ultraHighQualityMaxZoom), n && r(t, !0)
- }.bind(this))) : !e && t.zoomed && r(t, !1)
- }
- }
- }, lt.prototype.initMeasure = function() {
- this.measurementTool = new W(this), this.measureTexture = new st(this), this.measureTexture.createNewColliders(), this.measureTexture.createMeasureLens(), this.measurementTool && (this.measurementTool.init(this.model), this.measuringToolControls.init(this.measurementTool), this.measurementTool.updateMeasureVisible(this.currentPano))
- }, lt.prototype.updateMeasureMode = function(t) {
- this.measurementTool.updateMode(t)
- }, lt.prototype.setMeasureEnable = function(t) {
- t ? (G.measureMode = !0, this.reticule.visible = !0, this.measurementTool.startInsertion({
- showDistances: !0,
- showArea: !0,
- closed: !0
- }, !j.isMobile()), this.measurementTool.intoMeasureMode(!j.isMobile()), this.measureTexture.show()) : (G.measureMode = !1, this.reticule.visible = !1, this.measurementTool && (this.measurementTool.exitMeasureMode(), this.model.chunks.forEach((function(t) {
- t.material.uniforms.measureMode && (t.material.uniforms.measureMode.value = 0)
- }))), this.measureTexture.hide())
- }, lt.prototype.updateMeasureTexture = function() {
- this.inMeasureMode && this.measureTexture && this.measureTexture.update()
- }, lt.prototype.removeMeasurement = function() {
- this.measurementTool.removeMeasurement()
- }, lt.prototype.showMeasure = function(t) {
- this.measurementTool.show(t)
- }, lt.prototype.hideMeasure = function(t) {
- this.measurementTool.hide(t)
- }, lt.prototype.showAllMeasure = function() {
- this.measurementTool.showAll()
- }, lt.prototype.hideAllMeasure = function() {
- this.measurementTool.hideAll()
- }, lt.prototype.deleteMeasure = function(t) {
- this.measurementTool.delete(t)
- }, lt.prototype.changeMeasureName = function(t, e) {
- this.measurementTool.changeName(t, e)
- }, lt.prototype.clickedOnMeasure = function(t) {
- var e = null;
- if (this.measurementTool && this.measurementTool.activeMeasurement && (e = this.measurementTool.activeMeasurement.points), !this.measurementTool || !this.measurementTool.measurements || e && e.length > 1) return !1;
- this.measurementTool.selected(t);
- var i = null,
- r = null;
- if (this.measurementTool.measurements.forEach((function(e) {
- e.measureid !== t && e.uuid !== t || (i = e.location_id, r = e.areaDetail.desc_position)
- })), i) {
- var o = {
- pano: this.model.panos.index[i],
- lookAtPoint: new n.Vector3(r.x, r.y, r.z)
- };
- this.flyToPano(o)
- }
- }, lt.prototype.disOnMeasure = function(t) {
- this.measurementTool.disSelected(t)
- }, lt.prototype.changeUnit = function(t) {
- this.measurementTool.changeUnit(t)
- }, lt.prototype.setAutoFit = function(t) {
- this.measurementTool.setAutoFit(t)
- }, lt.prototype.setMeasureArea = function(t) {
- this.measurementTool.setMeasureArea(t)
- }, lt.prototype.loadHumanModel = function(t) {
- this.baseControls && this.baseControls.loadHumanModel(t)
- }, lt.prototype.updatePutModelColor = function(t) {
- this.humanModelControls.HUMANMODEL && this.humanModelControls.updateSkinColor(t), this.weaponModelControls.CONTROLMODEL && this.weaponModelControls.updateModelColor(t)
- }, lt.prototype.hidePutModel = function(t) {
- this.humanModelControls.handleHideHumanModel(t), this.weaponModelControls.handleHideModel(t), this.virtualCameraFovControls.handleHideModel(t)
- }, lt.prototype.showPutModel = function(t) {
- this.putModelUIControls && this.putModelUIControls.showPutModel(t)
- }, lt.prototype.handleClickCompleteBtn = function() {
- this.putModelUIControls && this.putModelUIControls.handleClickCompleteBtn()
- }, lt.prototype.removePutModel = function(t) {
- this.humanModelControls.handleDeleteHumanModel(t), this.weaponModelControls.handleDeleteModel(t), this.virtualCameraFovControls.handleDeleteModel(t)
- }, lt.prototype.showModelList = function(t) {
- this.baseControls && this.baseControls.showModelsList(t)
- }, lt.prototype.hideModelList = function() {
- this.baseControls && this.baseControls.hideModelsList()
- }, lt.prototype.updatePutModelName = function(t) {
- this.putModelUIControls && this.putModelUIControls.updatePutModelName(t)
- }, lt.prototype.resetPutModel = function() {
- this.putModelUIControls && this.putModelUIControls.resetPutModel()
- }, lt.prototype.updatePutModelGroundClearance = function(t) {
- 0 <= 1 * t && (this.emit("hidePutModelSetTools"), this.putModelUIControls && this.putModelUIControls.updateModelGroundClearance(t))
- }, lt.prototype.updateSizeOfPutModel = function(t) {
- this.emit("hidePutModelSetTools"), this.putModelUIControls && this.putModelUIControls.updateSizeOfPutModel(t)
- }, lt.prototype.selectPutModel = function(t) {}, lt.prototype.savePutModel = function() {
- if (this.baseControls) return this.baseControls.savePutModels()
- }, lt.prototype.showHumanModelBonesNode = function() {
- this.putModelUIControls && this.putModelUIControls.showHumanModelBonesNode()
- }, lt.prototype.bundleTranslateControlOfPutModel = function() {
- this.putModelUIControls && this.putModelUIControls.bundleTranslateControlOfPutModel()
- }, lt.prototype.bundleRotateControlOfPutModel = function() {
- this.putModelUIControls && this.putModelUIControls.bundleRotateControlOfPutModel()
- }, lt.prototype.virtualSetSlideStop = function(t) {
- this.putModelUIControls && this.putModelUIControls.onVirtualSetSlideStop(t)
- }, lt.prototype.handleClickModelItem = function(t) {
- this.putModelUIControls && this.putModelUIControls.handleClickModelItem(t)
- }, lt.prototype.loadProbeModel = function(t) {
- this.baseControls && this.baseControls.loadWeaponModel(t)
- }, lt.prototype.updateCollision = function(t) {
- this.putModelUIControls && this.putModelUIControls.updateCollision(t)
- }, lt.prototype.loadPostilModel = function(t) {
- this.baseControls && this.baseControls.loadPostilModel(t)
- }, lt.prototype.updatePostilInfo = function(t) {
- this.putModelUIControls && this.putModelUIControls.updatePostilInfo(t)
- }, lt.prototype.savePostilsInfo = function() {
- var t = {},
- e = "";
- if (this.humanModelControls) {
- for (var i = this.postilControls.PostilOfScene, n = 0; n < i.length; ++n) {
- var r = i[n].userData.setting_item;
- t[i[n].uuid] = r
- }
- return e = JSON.stringify(t), "1" == j.getQueryString("isLocal") && localStorage.setItem("POSTILS_INFO_SAVE", e), e
- }
- }, lt.prototype.loadPostilsOfSave = function(t) {
- this.postilControls.hideAll = !1;
- var e = [];
- if (0 < this.postilControls.PostilOfScene.length) {
- for (var i = 0; i < this.postilControls.PostilOfScene.length; ++i) {
- var n = this.postilControls.PostilOfScene[i];
- n.visible = !0;
- var r = n.userData.setting_item;
- r.visible = !0, e.push(r), this.emit("add-postil-item", r)
- }
- this.emit("show-all-postils", e)
- } else {
- var o = this,
- a = (e = [], []);
- for (var s in t) e.push(t[s]);
- ! function t() {
- var i = e[a.length],
- n = new nt(i.type)
- .init(i),
- r = n.userData.setting_item,
- s = [];
- r.visible = !0, s.push(r);
- var l = o.panoMarkers.filter((function(t) {
- return r.current_location_id === t.pano.id
- }))[0];
- n.userData.marker = l, o.addPostilIntoScene(n), a.push(n.uuid), a.length !== e.length ? t() : o.emit("show-all-postils", s)
- }()
- }
- }, lt.prototype.addPostilIntoScene = function(t) {
- this.postilControls.PostilOfScene.push(t), this.postilControls.PostilOfKV[t.uuid] = t, this.sRender.scene.add(t), this.emit("add-postil-item", t.userData.setting_item), this.postilControls.updateMarkerTexture(t)
- }, lt.prototype.hidePostilsOfSave = function() {
- this.postilControls.hideAll = !0;
- for (var t = [], e = 0; e < this.postilControls.PostilOfScene.length; ++e) {
- var i = this.postilControls.PostilOfScene[e];
- i.visible = !1;
- var n = i.userData.setting_item;
- n.visible = !1, t.push(n)
- }
- this.emit("hide-all-postils", t)
- }, lt.prototype.removePostil = function(t) {
- this.emit("show-delete-dialog-of-postil", t)
- }, lt.prototype.deletePostilOfConfirm = function(t) {
- this.postilControls.handleDeletePostil(t)
- }, lt.prototype.editPostil = function(t) {
- var e = this;
- if (this.postilControls.PostilOfKV[t]) {
- var i = this.postilControls.PostilOfKV[t],
- n = i.userData.setting_item,
- r = n.current_location_id;
- return this.emit("hide-postil-set-tool"), this.flyToPano({
- pano: this.model.panos.index[r],
- lookAtPoint: i.position
- }, (function(t) {
- e.postilControls.POSTIL && e.postilControls.POSTIL.uuid !== i.uuid && (e.postilControls.destroyControl(e.postilControls.POSTIL), e.postilControls.destroyBox(e.postilControls.POSTIL)), e.postilControls.POSTIL = i, e.postilControls.handleChoosedPostil(i), e.emit("show-edit-panel-of-postil")
- })), n
- }
- }, lt.prototype.editConfirm = function(t) {
- if (this.postilControls.PostilOfKV[t]) {
- var e = this.postilControls.PostilOfKV[t].userData.setting_item;
- this.emit("edit-confirm", e)
- }
- }, lt.prototype.loadVirtualCamera = function(t) {
- this.baseControls && this.baseControls.loadVirtualCamera(t)
- }, lt.prototype.updateVirtualCameraFov = function(t) {
- this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.updateVirtualCameraFov(t)
- }, lt.prototype.updateVirtualCameraDistance = function(t) {
- this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.updateVirtualCameraDistance(t)
- }, lt.prototype.onIntoEditMode = function() {
- this.putModelUIControls && this.putModelUIControls.onIntoEditMode()
- }, lt.prototype.onQuitEditMode = function() {
- this.putModelUIControls && this.putModelUIControls.onQuitEditMode()
- }, lt.prototype.onIntoPutMode = function() {
- this.putModelUIControls && this.putModelUIControls.onIntoPutMode()
- }, lt.prototype.onQuitPutMode = function() {
- this.putModelUIControls && this.putModelUIControls.onQuitPutMode()
- }, lt.prototype.onApiQuitPutMode = function() {
- this.baseControls && this.baseControls.handleKeyOfESC(), this.putModelUIControls && this.putModelUIControls.onQuitPutMode()
- }, lt.prototype.onIntoEditMeasure = function() {
- this.measurementTool && this.measurementTool.onIntoEditMeasure()
- }, lt.prototype.onQuitEditMeasure = function() {
- this.measurementTool && this.measurementTool.onQuitEditMeasure()
- }, lt.prototype.showVirtualCameraMeasurement = function(t) {
- this.putModelUIControls && this.putModelUIControls.showVirtualCameraMeasurement(t)
- }, lt.prototype.hideVirtualCameraMeasurement = function(t) {
- this.putModelUIControls && this.putModelUIControls.hideVirtualCameraMeasurement(t)
- }, lt.prototype.addModel = function(t) {
- this.sRender.scene.add(t)
- }, lt.prototype.setModelPose = function(t, e) {}, t.exports = lt
- })
- .call(this, i(6))
- }, function(t, e, i) {
- function n(t) {
- r.call(this, t)
- }
- var r = i(14);
- n.prototype = Object.create(r.prototype), t.exports = n
- }, function(t, e, i) {
- function n(t) {
- r.call(this, t)
- }
- var r = i(14);
- n.prototype = Object.create(r.prototype), t.exports = n
- }, function(t, e) {
- t.exports = {
- NONE: 0,
- CONTEXTUAL: 1,
- ANDROID: 2
- }
- }, function(t, e, i) {
- var n = i(0);
- t.exports = {
- newBlue: new n.Color("#28eff5"),
- altBlue: new n.Color(47355),
- classicBlue: new n.Color(53759),
- mpYellow: new n.Color(16502016),
- mpOrange: new n.Color(16428055),
- mpBlue: new n.Color(12096),
- mpLtGrey: new n.Color(13751252),
- mpDkGrey: new n.Color(10000019),
- mpRed: new n.Color(12525854),
- mpOrangeDesat: new n.Color(16764529),
- mpBlueDesat: new n.Color(4034734),
- mpRedDesat: new n.Color(14705505),
- white: new n.Color(16777215),
- yellow: new n.Color("#FFBF32"),
- black: new n.Color(0),
- _desat: function(t, e) {
- var i = e || .3,
- r = (new n.Color)
- .copy(t)
- .getHSL({
- h: 0,
- s: 0,
- l: 0
- });
- return (new n.Color)
- .setHSL(r.h, r.s * (1 - i), r.l)
- },
- _darken: function(t, e) {
- var i = e || .2,
- r = (new n.Color)
- .copy(t)
- .getHSL({
- h: 0,
- s: 0,
- l: 0
- });
- return (new n.Color)
- .setHSL(r.h, r.s, r.l * (1 - i))
- }
- }
- }, function(t, e, i) {
- var n = i(22);
- function r(t) {
- var e = o.UniformsUtils.clone(h.waypoint.uniforms);
- e.map.value = d, e.opacity.value = 0, e.color.value.set(a.reticuleColor), o.Mesh.call(this, new o.PlaneBufferGeometry(.2, .2, 1, 1), new o.RawShaderMaterial({
- side: o.DoubleSide,
- depthWrite: !1,
- depthTest: !1,
- transparent: !0,
- vertexShader: h.waypoint.vertexShader,
- fragmentShader: h.waypoint.fragmentShader,
- uniforms: e,
- name: "waypoint",
- opacity: 0
- })), this.renderOrder = c.reticule, this.player = t, this.direction = new o.Vector3, this.hidden = !0, this.mouseLastMoveTime = Date.now(), this.lineMaterial = new o.LineBasicMaterial({
- linewidth: a.mattertags.pole.width,
- color: a.mattertags.pole.color,
- opacity: 1,
- transparent: !0,
- alphaTest: a.mattertags.pole.opacity * a.mattertags.visibility.alphaTestLevel
- }), p.addAttribute("position", new o.BufferAttribute(f, 3)), this.line = new o.Line(p, this.lineMaterial), this.line.renderOrder = c.ribbon, this.pObject = new o.Object3D, this.pObject.add(this), this.pObject.add(this.line)
- }
- var o = i(0),
- a = i(1),
- s = i(8),
- l = i(16),
- u = i(10),
- h = i(12),
- c = i(17),
- d = l.loadurl(n.splitUrl("./images/pointermain_512x512.png")),
- p = new o.BufferGeometry,
- f = new Float32Array(6);
- f[0] = f[1] = f[2] = f[3] = f[4] = f[5] = 0, r.prototype = Object.create(o.Mesh.prototype), r.prototype.move = function(t, e, i) {
- this.hidden = i, this.mouseLastMoveTime = Date.now()
- }, r.prototype.hide = function() {
- this.hidden || (this.hidden = !0, s.start(u.property(this.material.uniforms.opacity, "value", 0), a.reticuleOpacityTransitionTime))
- }, r.prototype.show = function() {
- this.hidden = !1, this.material.opacity <= 0 && s.start(u.property(this.material.uniforms.opacity, "value", a[this.player.mode].reticuleOpacity), a.reticuleOpacityTransitionTime)
- }, r.prototype.update = function() {
- Date.now() - this.mouseLastMoveTime > a.hideReticuleTimeout && !this.hidden && this.hide()
- }, r.prototype.updatePosition = function(t, e) {
- if (!this.hidden) {
- if (!e) return this.hide();
- var i = e.point,
- n = t.distanceTo(i),
- r = 1 + .01 * n;
- n < 1 && (r -= 1 - n), this.show(), this.scale.set(r, r, r), this.direction = this.direction.multiplyScalar(.8), this.direction.add(e.face.normal.clone()
- .multiplyScalar(.2)), this.position.copy(i)
- .add(e.face.normal.clone()
- .multiplyScalar(.01)), this.pObject.position.copy(this.position), this.buildPole(e), this.lookAt(this.position.clone()
- .add(this.direction))
- }
- }, r.prototype.buildPole = function(t) {
- f[0] = f[1] = f[2] = 0, f[3] = t.face.normal.x, f[4] = t.face.normal.y, f[5] = t.face.normal.z;
- var e = new o.Vector3(f[3], f[4], f[5]);
- e.normalize()
- .multiplyScalar(.5), f[3] = e.x, f[4] = e.y, f[5] = e.z, p.addAttribute("position", new THREE.BufferAttribute(f, 3))
- }, r.prototype.writeAsMattertag = function() {
- var t = Math.floor(4294967296 * (1 + Math.random()))
- .toString(16) + Math.floor(16 * (1 + Math.random()))
- .toString(16),
- e = new Date;
- this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
- var i = {
- enabled: !0,
- version: "0",
- created: e.toISOString(),
- created_by: "APITest",
- position: this.position.clone(),
- stem: {
- enabled: a.mattertags.pole.enabled,
- direction: this.direction.multiplyScalar(a.mattertags.pole.height)
- },
- label: "Mattertag " + this.tagCount,
- description: "Description " + t,
- floor: function(t) {
- if (t.currentFloor) {
- var e = t.floors.indexOf(t.currentFloor);
- return e > -1 ? e : void 0
- }
- }(this.player.model),
- type: "info",
- metadata: {
- preferred_camera: {
- mode: this.player.mode
- }
- }
- },
- n = this.player.model.addMattertag(t, i)
- .build();
- n && (n.disc && this.player.mattertagDiscs.push(n.disc), n.visible || n.show(a.mattertags.startup.fadeInDuration))
- }, t.exports = r
- }, function(t, e, i) {
- var n = i(105),
- r = i(3),
- o = "";
- r.detectAndroid() ? o = "android" : r.detectIOS() && (o = "ios");
- var a = function(t) {
- n.call(this, t), this.deviceType = o, this.remoteAccid = void 0 !== t.remoteAccid ? t.remoteAccid : ""
- };
- a.getUserInfo = function(t) {
- var e = null,
- i = setTimeout((function() {
- t()
- }), 200);
- "ios" == o && window.NativeClient ? window.NativeClient.getUserInfo && (e = window.NativeClient.getUserInfo((function(n) {
- e = JSON.parse(n), clearTimeout(i), t(e)
- }))) : "android" == o && window.house365js && window.house365js.getUserInfo && (e = window.house365js.getUserInfo(), e = JSON.parse(e), clearTimeout(i), t(e))
- }, (a.prototype = Object.create(n.prototype))
- .init = function() {
- var t = this;
- if ("android" === this.deviceType) {
- if (!window.house365js) return this.emit("platform", "platform-error"), "platform-error"
- } else if ("ios" === this.deviceType && !window.NativeClient) return this.emit("platform", "platform-error"), "platform-error";
- return window.onData = function(e) {
- t.emit("onData", e)
- }, window.updateChatStatus = function(e) {
- switch (e = parseInt(e)) {
- case 1:
- t.emit("calling");
- break;
- case 2:
- case 3:
- t.emit("onCall", e);
- break;
- case 4:
- t.emit("busy");
- break;
- case 5:
- t.emit("refuse");
- break;
- case 6:
- t.emit("timeout");
- break;
- case 7:
- case 8:
- t.emit("hangup");
- break;
- case 9:
- t.emit("voice_error")
- }
- }, this
- }, a.prototype.sendData = function(t) {
- "ios" == this.deviceType ? window.NativeClient.sendData && window.NativeClient.sendData(t) : "android" == this.deviceType && window.house365js.sendData && window.house365js.sendData(t)
- }, a.prototype.call = function() {
- "ios" == this.deviceType ? window.NativeClient.call && window.NativeClient.call() : "android" == this.deviceType && window.house365js.call && window.house365js.call()
- }, a.prototype.mute = function() {
- "ios" == this.deviceType ? window.NativeClient.mute && window.NativeClient.mute() : "android" == this.deviceType && window.house365js.mute && window.house365js.mute()
- }, a.prototype.unmute = function() {
- "ios" == this.deviceType ? window.NativeClient.unmute && window.NativeClient.unmute() : "android" == this.deviceType && window.house365js.unmute && window.house365js.unmute()
- }, a.prototype.hangup = function() {
- "ios" == this.deviceType ? window.NativeClient.hangup && window.NativeClient.hangup() : "android" == this.deviceType && window.house365js.hangup && window.house365js.hangup()
- }, a.prototype.refuse = function() {
- "ios" == this.deviceType ? window.NativeClient.refuse && window.NativeClient.refuse() : "android" == this.deviceType && window.house365js.refuse && window.house365js.refuse()
- }, a.prototype.accept = function() {
- "ios" == this.deviceType ? window.NativeClient.accept && window.NativeClient.accept() : "android" == this.deviceType && window.house365js.accept && window.house365js.accept()
- }, a.prototype.urgeBroker = function() {
- "ios" == this.deviceType ? window.NativeClient.urgeBroker && window.NativeClient.urgeBroker() : "android" == this.deviceType && window.house365js.urgeBroker && window.house365js.urgeBroker()
- }, t.exports = a
- }, function(t, e, i) {
- var n = i(4)
- .EventEmitter,
- r = function() {
- this.instance = null
- };
- (r.prototype = Object.create(n.prototype))
- .construct = r, r.prototype.init = function() {}, r.prototype.sendData = function(t) {}, r.prototype.call = function() {}, r.prototype.mute = function() {}, r.prototype.unmute = function() {}, r.prototype.hangup = function() {}, r.prototype.refuse = function() {}, r.prototype.accept = function() {}, t.exports = r
- }, function(t, e) {
- t.exports = {
- UNKNOWN: 0,
- ALIGNED: 1,
- UNALIGNED: 2,
- PLACED: 3
- }
- }, function(t, e) {
- t.exports = {
- LoadComplete: "panorama.load.complete",
- LoadFailed: "panorama.load.failed",
- TileLoaded: "panorama.tile.loaded"
- }
- }, function(t, e, i) {
- (function(e) {
- var n = i(22);
- function r(t, e) {
- 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 = b.UP.clone(), this.longestStep = 0, this.upcomingTransType = null, this.burnsDir = 1, this.prevNextDist = 0, this.nextI = 0, this.activeTransType = null, this.bunnyObj = null, this.director = t, this.player = e, this.modelManager = e.modelManager, this.updateModel(), this.updateDefaultsFromModelData(), this.bindEvents(), this.warping = !1, this.warpInterrupted = !1, this.warpInterruptionBlackoutStyle = null, this.warpInterruptionTravelTime = null
- }
- var o = i(0),
- a = i(2),
- s = i(5),
- l = i(17),
- u = i(24),
- h = i(1),
- c = i(9),
- d = i(10),
- p = i(15),
- f = i(8),
- m = i(57),
- g = i(59),
- v = i(12),
- y = i(16),
- b = i(18),
- w = (a = (i(60), new a(e)), i(20)),
- x = i(31),
- M = i(21),
- T = {
- path: y.loadurl(n.splitUrl("./images/texture/location/location_512x512.png")),
- pathEnd: y.loadurl(n.splitUrl("./images/texture/location/location_512x512.png")),
- pathStart: y.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==")
- };
- r.prototype.setScene = function(t) {
- this.createCpm(t), this.createBunnyObj(t)
- }, r.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel()
- }, r.prototype.bindEvents = function() {
- this.modelManager.on(M.ActiveModelChanged, this.updateModel.bind(this))
- }, r.prototype.updateDefaultsFromModelData = function() {
- this.model.data
- }, r.prototype.pointPathDistance = function(t) {
- for (var e = 0, i = 1; i < t.length; i += 1) e += t[i - 1].distanceTo(t[i]);
- return e
- }, r.prototype.pointPathLengths = function(t) {
- for (var e = [0], i = 1; i < t.length; i += 1) e.push(e[i - 1] + t[i - 1].distanceTo(t[i]));
- return e
- }, r.prototype.interpAlongPath = function(t, e, i) {
- var n, r = new o.Vector3,
- a = e[e.length - 1];
- if (i < 1) {
- n = i * a;
- for (var s = 1; s < e.length; s += 1)
- if (e[s] > n) {
- var l = (n - e[s - 1]) / (e[s] - e[s - 1]);
- return r.copy(t[s]), r.sub(t[s - 1]), r.multiplyScalar(l), r.add(t[s - 1]), r
- }
- } else r.copy(t[t.length - 1]);
- return r
- }, r.prototype.pathHeight = function() {
- return this.player.mode !== s.FLOORPLAN ? h.path.height : h.path.outsideHeight
- }, r.prototype.createBunnyObj = function(t) {
- this.bunnyObj || (this.bunnyObj = new o.AxesHelper(.1), this.bunnyObj.visible = h.warp.showBunny), this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj), t.add(this.bunnyObj)
- }, r.prototype.createCpm = function(t) {
- if (!this.currentPanoMarker) {
- var e = this.makeWaypointObj(T.pathEnd, "Current");
- e.material.uniforms.opacity.value = 0, this.currentPanoMarker = {
- mesh: e,
- placed: !1
- }
- }
- this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), this.placeCpm(), this.currentPanoMarker.mesh.parent || t.add(this.currentPanoMarker.mesh)
- }, r.prototype.placeCpm = function() {
- h.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned() ? (this.currentPanoMarker.mesh.parent != this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), this.player.currentPano.floor.add(this.currentPanoMarker.mesh)), this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition)
- .sub(this.model.position), this.currentPanoMarker.mesh.position.y += this.pathHeight(), this.currentPanoMarker.placed = !0) : this.popOutCpm()
- }, r.prototype.fadeInCpm = function(t) {
- this.player.mode === s.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || h.path.mapGuides && this.currentPanoMarker.placed && f.start(d.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), t)
- }, r.prototype.fadeOutCpm = function(t) {
- f.start(d.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), t)
- }, r.prototype.popInCpm = function() {
- h.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
- }, r.prototype.popOutCpm = function() {
- this.fadeOutCpm(2)
- }, r.prototype.brushPrefs = {
- linewidth: 7,
- strokeWidth: 15,
- cvSegments: 48,
- paveStep: .1,
- paveWidth: .2,
- lookBlendDist: 3,
- maxTurn: o.Math.degToRad(2)
- }, r.prototype.panoPathDistance = function(t) {
- var e = this.model.panos;
- if (!t || t.length < 2) return 0;
- for (var i = [], n = 0; n < t.length; n += 1) i.push(e.get(t[n])
- .floorPosition);
- return this.pointPathDistance(i)
- }, r.prototype.loadTileTexture = function(t) {
- var e = y.load(t, (function(e) {
- e.wrapS = o.RepeatWrapping, e.wrapT = o.RepeatWrapping, e.needsUpdate = !0, a.debug('path texture "' + t + '" is ready')
- }), (function() {
- a.error('path texture "' + t + '" failed')
- }));
- return e.mapping = o.UVMapping, e
- }, r.prototype.buildWarpDestinationDescriptor = function(t, e, i, n, r, o) {
- return new m({
- cameraMode: n,
- position: t,
- quaternion: e,
- panoId: i,
- orthoZoom: o,
- floorVisibility: r,
- thumbUrl: null,
- name: null,
- isHero: !1
- })
- }, r.prototype.buildWarpDestinationDescriptorFromHero = function(t) {
- return this.buildWarpDestinationDescriptor(t.position, t.quaternion, this.getHeroId(t), t.cameraMode, t.floorVisibility, t.orthoZoom)
- }, r.prototype.setWarpDestination = function(t) {
- this.warpDestHeroLoc = t
- }, r.prototype.setWarpDestinationByHeroIndex = function(t) {
- var e = this.getHeroDescriptorByHeroIndex(t);
- return null !== e && (this.setWarpDestination(e), !0)
- }, r.prototype.setWarpDestinationByPano = function(t, e) {
- return !!this.model.panos.get(t.id) && this.setWarpDestinationByPanoId(t.id, e)
- }, r.prototype.setWarpDestinationByPanoId = function(t, e) {
- var i = this.model.panos.get(t);
- if (i) {
- e = e || new o.Quaternion;
- var n = this.buildWarpDestinationDescriptor(i.position, e, i.id, "panorama", [], -1);
- return this.setWarpDestination(n), !0
- }
- return !1
- }, r.prototype.getHeroDescriptorByHeroIndex = function(t) {
- var e = this.model.heroCount();
- if (null !== this.warpDestHeroLoc && e < 2) return a.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."), this.model.getHeroDescriptorByIndex(0);
- var i = this.model.getHeroDescriptorByIndex(t);
- if (i) {
- var n = i.isPano() ? i.panoId : i.cameraMode;
- a.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + e + " choices.")
- }
- return i
- }, r.prototype.getHeroDescriptorByPano = function(t) {
- return this.model.panos.get(t.id) ? this.getHeroDescriptorByPanoId(t.id) : null
- }, r.prototype.getHeroDescriptorByPanoId = function(t) {
- var e = this.getHeroIndexFromPanoId(t);
- return this.getHeroDescriptorByHeroIndex(e)
- }, r.prototype.getHeroIndexFromPanoId = function(t) {
- for (var e = 0; e < this.model.heroLocations.length; e++) {
- var i = this.model.heroLocations[e],
- n = this.getHeroId(i);
- if (n && n === t) return e
- }
- return -1
- }, r.prototype.getHeroPano = function(t) {
- if (null === t) return a.warn("getHeroPano(): no destination"), null;
- var e = this.getHeroId(t),
- i = this.model.panos.get(e);
- return void 0 === i && (i = null, "" !== e && a.debug('unable to find pano "' + e + '"')), i
- }, r.prototype.getHeroId = function(t) {
- return t.panoId
- }, r.prototype.setWarpDestPano = function() {
- return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc), this.warpDestPano
- }, r.prototype.brushToWarpPano = function(t, e) {
- if (this.discardPathObject(), !this.setWarpDestPano()) return !1;
- if (this.warpDestHeroLoc.cameraMode !== s.PANORAMA && a.warn("Can only brush from pano to pano"), !this.warpDestPano) return a.info("No brush"), !1;
- if (!this.player.currentPano) return a.debug("No current pano, visibility undefined"), !1;
- if (!this.warpDestPano) return a.info("No wPano, visibility undefined"), !1;
- if (!this.warpDestPano.isAligned()) return a.debug("Cannot brush to unaligned pano"), !1;
- var i = (t === u.STD || t === u.WALK) && h.path.mapGuides,
- n = !0;
- if (this.player.currentPano.id === this.warpDestPano.id) a.debug("Already at destination pano");
- else {
- this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano), n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1, this.obj3d = new o.Object3D, a.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"), n ? (a.info('No "walkable" route, using fall-back warp style transition'), t = e) : (this.setPathHulls(this.nodes), this.setFloorCurves(), i && ("chevron" === h.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === h.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))), this.player.currentPano.floor.add(this.obj3d);
- var r = this.player.mode === s.DOLLHOUSE || this.player.mode === s.FLOORPLAN,
- l = t === u.STD;
- if (!n && (i || l)) {
- if (r) {
- var c = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
- this.obj3d.add(c)
- }
- var d = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
- this.obj3d.add(d)
- }
- this.appearSlow()
- }
- return this.upcomingTransType = t, !n
- }, r.prototype.findShortestPath = function(t, e) {
- if (!t || !e) return null;
- var i = h.warp.walkExtraPanosDistance,
- n = t.id + ":" + e.id + ":" + i;
- if (this.shortPaths.hasOwnProperty(n)) return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
- var r = e.id + ":" + t.id + ":" + i;
- if (this.shortPaths.hasOwnProperty(r)) return this.shortPaths[r] ? this.shortPaths[r].slice()
- .reverse() : null;
- var o = this.model.panos.aStarSearch(t, e);
- return this.model.panos.includeNodesNearPath(o, i), this.shortPaths[n] = o ? o.slice() : null, o
- }, r.prototype.makePathHulls = function(t) {
- var e, i, n, r, o, s = 0,
- l = [],
- u = [],
- c = [],
- d = this.model.panos;
- r = (e = d.get(t[0]))
- .floor.floorIndex;
- for (var p = 0; p < t.length; p += 1)(i = (e = d.get(t[p]))
- .floorPosition.clone()
- .sub(this.model.position))
- .y += this.pathHeight(), l.push(i), u.push(e.position.clone()), n = e.floor.floorIndex, c.push(n > r ? h.path.colorUp : n < r ? h.path.colorDown : h.path.color), p > 0 && ((o = u[p].distanceTo(u[p - 1])) > s && (s = o));
- return s > this.longestStep && (this.longestStep = s, a.debug("path contains " + s + " meter segment")), {
- floor: l,
- camera: u,
- color: c
- }
- }, r.prototype.makeFloorCurves = function(t, e, i) {
- var n = this.player.mode === s.PANORAMA ? h.path.waypointIndoorRadius : h.path.waypointRadius,
- r = this.pointPathDistance(t) - 2 * n,
- a = t.slice(0),
- l = a[1].clone()
- .sub(a[0]);
- l.y = 0, l.normalize()
- .multiplyScalar(n), a[0] = (new o.Vector3)
- .copy(a[0])
- .add(l), (l = a[a.length - 2].clone()
- .sub(a[a.length - 1]))
- .y = 0, l.normalize()
- .multiplyScalar(n), a[a.length - 1] = (new o.Vector3)
- .copy(a[a.length - 1])
- .add(l);
- var u = new o.CatmullRomCurve3(a),
- c = Math.floor(r / i);
- c = 4 * Math.floor(c / 4), c = Math.max(4, c);
- for (var d, p, f = u.getSpacedPoints(c), m = [], g = new o.Vector3, v = 0; v < f.length; v += 1) {
- p = 0, d = f[v].distanceTo(t[0]);
- for (var y = 1; y < t.length; y += 1) g.copy(f[v])
- .sub(t[y]), g.y *= 4, g.length() < d && (p = y);
- m.push(e[p])
- }
- return {
- distance: r,
- points: f,
- colors: m
- }
- }, r.prototype.makeCameraCurvePoints = function(t, e) {
- var i = this.pointPathDistance(t);
- return new o.CatmullRomCurve3(t)
- .getSpacedPoints(Math.max(2, Math.floor(i / e)))
- }, r.prototype.makeCameraCurveTangents = function(t, e) {
- var i = this.pointPathDistance(t),
- n = new o.CatmullRomCurve3(t),
- r = Math.max(2, Math.floor(i / e));
- r || (r = 5);
- for (var a = [], s = 0; s <= r; s++) a.push(n.getTangentAt(s / r));
- return a
- }, r.prototype.setPathHulls = function(t) {
- var e = this.makePathHulls(t);
- this.floorHull = e.floor, this.cameraHull = e.camera, this.colorHull = e.color
- }, r.prototype.setFloorCurves = function() {
- var t = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
- this.floorPathDistance = t.distance, this.floorCurvePoints = t.points, this.floorCurveColors = t.colors
- }, r.prototype.setCameraCurvePoints = function() {
- this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, h.warp.stepFactor * this.brushPrefs.paveStep)
- }, r.prototype.chooseWarpPath = function(t) {
- var e, i, n, r = this.player.cameras[s.PANORAMA];
- if (this.player.currentPano === this.warpDestPano || !t) return this.warpPathPoints = null, this.warpLength = 0, !1;
- this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano), void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (a.debug("warp path to unreachable node"), i = (e = this.warpDestPano.position.clone()
- .sub(r.position))
- .clone()
- .negate(), e.multiplyScalar(.15)
- .add(r.position), i.multiplyScalar(.15)
- .add(this.warpDestPano.position), e.y = r.position.y, i.y = this.warpDestPano.position.y, n = new o.CubicBezierCurve3(r.position.clone(), e, i, this.warpDestPano.position.clone()), this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (a.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];
- for (var l = new o.Vector3, u = new o.Vector3, c = Math.cos(o.Math.degToRad(h.warp.minBrakeAngle)), d = Math.cos(o.Math.degToRad(h.warp.maxBrakeAngle)), p = 1; p < this.warpPathPoints.length; p += 1) {
- l.copy(this.warpPathPoints[p - 1])
- .sub(this.warpPathPoints[p]);
- var f = l.length();
- l.y *= h.warp.climbEffort;
- var m = l.length() / f;
- if (p > 1) {
- l.setY(0)
- .normalize(), u.copy(this.warpPathPoints[p - 2])
- .sub(this.warpPathPoints[p - 1])
- .setY(0)
- .normalize();
- var g = Math.min(1, l.dot(u)),
- v = 1 + (h.warp.brakeStrength - 1) * (1 - o.Math.smoothstep(g, d, c));
- m = Math.max(v, m)
- }
- this.warpLength += f * m, this.warpPathLengths[p] = this.warpLength
- }
- return !0
- }, r.prototype.drawPathRibbon = function(t, e) {
- this.bunnyObj.visible = h.warp.showBunny;
- for (var i = .6 * h.path.ribbonWidth * .5, n = new o.Vector3, r = new o.Vector3(0, this.pathHeight(), 0), a = new o.Geometry, u = new o.Vector3, c = 0; c < t.length; c += 1) {
- u.copy(t[c]), 0 === c ? u.sub(t[c + 1]) : u.sub(t[c - 1])
- .negate(), u.normalize(), n.crossVectors(u, b.UP), n.multiplyScalar(i);
- var d = (new o.Vector3)
- .copy(t[c])
- .add(r);
- d.sub(n), a.vertices.push(d), (d = (new o.Vector3)
- .copy(t[c])
- .add(r))
- .add(n), a.vertices.push(d)
- }
- var p, f, m, g = 0;
- for (c = 0; c < t.length - 1; c += 1) {
- var y = 2 * c,
- w = g,
- x = g += t[c + 1].distanceTo(t[c]),
- M = e[c],
- S = e[c + 1];
- (p = new o.Face3(y, y + 1, y + 2))
- .vertexColors = [new o.Color(M), new o.Color(M), new o.Color(S)], a.faces.push(p), a.faceVertexUvs[0].push([new o.Vector2(0, w), new o.Vector2(1, w), new o.Vector2(0, x)]), (p = new o.Face3(y + 2, y + 1, y + 3))
- .vertexColors = [new o.Color(S), new o.Color(M), new o.Color(S)], a.faces.push(p), a.faceVertexUvs[0].push([new o.Vector2(0, x), new o.Vector2(1, w), new o.Vector2(1, x)])
- }
- a.computeFaceNormals(), a.computeVertexNormals(), this.player.mode === s.PANORAMA ? ((m = o.UniformsUtils.clone(v.ribbon.uniforms))
- .map.value = T.path, m.opacity.value = 0, m.color.value.set(h.path.color), f = new o.RawShaderMaterial({
- side: o.DoubleSide,
- depthWrite: !1,
- transparent: !0,
- vertexShader: v.ribbon.vertexShader,
- fragmentShader: v.ribbon.fragmentShader,
- uniforms: m,
- name: "ribbonT",
- opacity: 0
- })) : f = new o.MeshBasicMaterial({
- color: 16777215,
- side: o.DoubleSide,
- name: "ribbonOut",
- vertexColors: o.VertexColors
- });
- var _ = new o.Mesh(a, f);
- return _.name = "ribbon", this.player.mode === s.PANORAMA && (_.renderOrder = l.ribbon), _
- }, r.prototype.drawPathPavement = function(t) {
- for (var e, i = new o.Vector3, n = new o.Geometry, r = new o.Vector3, a = 0; a < t.length; a += 1) r.copy(t[a]), 0 === a ? r.sub(t[a + 1])
- .negate() : r.sub(t[a - 1]), r.normalize(), i.crossVectors(r, b.UP), i.multiplyScalar(this.brushPrefs.paveWidth), (e = (new o.Vector3)
- .copy(t[a]))
- .sub(i), n.vertices.push(e), n.vertices.push((new o.Vector3)
- .copy(t[a])), (e = (new o.Vector3)
- .copy(t[a]))
- .add(i), n.vertices.push(e);
- var l, u, c;
- for (a = 0; a < t.length - 1; a += 1) l = 3 * a + 1, c = (u = .25 * a) + .25, n.faces.push(new o.Face3(l - 1, l, l + 3)), n.faceVertexUvs[0].push([new o.Vector2(0, u), new o.Vector2(.5, u), new o.Vector2(.5, c)]), n.faces.push(new o.Face3(l + 3, l + 2, l - 1)), n.faceVertexUvs[0].push([new o.Vector2(.5, c), new o.Vector2(0, c), new o.Vector2(0, u)]), n.faces.push(new o.Face3(l + 3, l, l + 1)), n.faceVertexUvs[0].push([new o.Vector2(.5, c), new o.Vector2(.5, u), new o.Vector2(1, u)]), n.faces.push(new o.Face3(l + 3, l + 1, l + 4)), n.faceVertexUvs[0].push([new o.Vector2(.5, c), new o.Vector2(1, u), new o.Vector2(1, c)]);
- var d = this.player.mode === s.PANORAMA ? new o.MeshBasicMaterial({
- color: h.path.color,
- side: o.DoubleSide,
- transparent: !0,
- depthWrite: !1,
- opacity: 0,
- name: "paveT",
- map: T.path
- }) : new o.MeshBasicMaterial({
- color: h.path.color,
- side: o.DoubleSide,
- transparent: !0,
- depthWrite: !1,
- opacity: 1,
- name: "paveO",
- map: T.path
- });
- return new o.Mesh(n, d)
- }, r.prototype.hintPrefs = {
- rad: .18,
- width: .0125,
- depth: .0625,
- setBack: -.04,
- markRad: .25,
- markInnerRad: .16
- }, r.prototype.makeWaypointObj = function(t, e) {
- var i = new o.Geometry,
- n = this.player.mode === s.PANORAMA ? h.path.waypointIndoorRadius : h.path.waypointRadius,
- r = this.pathHeight();
- i.vertices.push(new o.Vector3(-n, r, n), new o.Vector3(-n, r, -n), new o.Vector3(n, r, -n), new o.Vector3(n, r, n)), i.faces.push(new o.Face3(0, 1, 2), new o.Face3(2, 3, 0)), i.faceVertexUvs[0].push([new o.Vector2(0, 0), new o.Vector2(1, 0), new o.Vector2(1, 1)]), i.faceVertexUvs[0].push([new o.Vector2(1, 1), new o.Vector2(0, 1), new o.Vector2(0, 0)]);
- var a = o.UniformsUtils.clone(v.waypoint.uniforms);
- a.map.value = t, a.opacity.value = 0, a.color.value.set(h.path.color);
- var l = {
- side: o.DoubleSide,
- depthWrite: !1,
- transparent: !0,
- vertexShader: v.waypoint.vertexShader,
- fragmentShader: v.waypoint.fragmentShader,
- uniforms: a,
- name: "waypoint",
- opacity: 0
- };
- this.player.mode !== s.PANORAMA && (l.depthTest = !1, l.name = "wayPtOut");
- var u = new o.RawShaderMaterial(l),
- c = new o.Mesh(i, u);
- return c.name = e, c
- }, r.prototype.makeStartMarker = function(t, e) {
- var i = (new o.Vector3)
- .copy(e[1])
- .sub(e[0]);
- i.y = 0, i.normalize();
- var n = Math.acos(i.x),
- r = this.makeWaypointObj(T.pathStart, "Start");
- return r.rotateOnAxis(new o.Vector3(0, 1, 0), n), r.position.copy(t), r
- }, r.prototype.makeEndMarker = function(t) {
- var e = this.makeWaypointObj(T.pathEnd, "End"),
- i = this.model.panos.get(this.nodes[0])
- .floor.floorIndex,
- n = this.model.panos.get(this.nodes[this.nodes.length - 1])
- .floor.floorIndex;
- return i < n ? e.material.uniforms.color.value.set(h.path.colorUp) : i > n && e.material.uniforms.color.value.set(h.path.colorDown), e.position.copy(t), e
- }, r.prototype.pathClean = function(t) {
- if (t) {
- for (var e in t.children) this.pathClean(t.children[e]);
- t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
- }
- }, r.prototype.discardPathObject = function() {
- if (this.obj3d) {
- var t = this.obj3d.parent;
- t && t.remove(this.obj3d), this.pathClean(this.obj3d)
- }
- this.obj3d = null, this.popInCpm()
- }, r.prototype.discardSlow = function() {
- if (this.obj3d) {
- if (this.player.mode !== s.PANORAMA) return void this.discardPathObject();
- for (var t, e = 0, i = function() {
- this.discardPathObject()
- }.bind(this), n = 0; n < this.obj3d.children.length; n += 1) void 0 !== (t = this.obj3d.children[n])
- .material && !0 === t.material.transparent && (void 0 !== t.material.uniforms ? f.start(d.property(t.material.uniforms.opacity, "value", 0), h.path.fadeOutTime, i, 0, p[h.warp.blendEasing]) : f.start(d.property(t.material, "opacity", 0), h.path.fadeOutTime, i, 0, p[h.warp.blendEasing]), e += 1, i = null);
- 0 === e && this.discardPathObject(), this.player.mode !== s.PANORAMA && this.fadeInCpm(h.path.fadeInTime - 3)
- }
- }, r.prototype.appearSlow = function() {
- var t;
- this.fadeOutCpm(h.path.fadeInTime);
- for (var e = this.player.mode === s.PANORAMA ? h.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1) void 0 !== (t = this.obj3d.children[i])
- .material && !0 === t.material.transparent && (void 0 !== t.material.uniforms ? f.start(d.property(t.material.uniforms.opacity, "value", e), h.path.fadeInTime, null, 0, p[h.warp.blendEasing]) : f.start(d.property(t.material, "opacity", e), h.path.fadeInTime, null, 0, p[h.warp.blendEasing]))
- }, r.prototype.update = function() {
- this.obj3d && this.obj3d.updateMatrixWorld()
- }, r.prototype.calcBurnsAmount = function(t) {
- var e = o.Math.degToRad(h.warp.burnsAngle);
- if (this.player.mode === s.PANORAMA) {
- var i = this.burnsDir * e;
- if (this.upcomingTransType === u.BLACK) return i;
- var n = t;
- if (null === n) return a.warn("Transition request for non-highlight"), i;
- var r = this.getHeroDescriptorByHeroIndex(n);
- if (null === r) return i;
- if (!r.isPano()) return i;
- var l = this.getHeroPano(r),
- c = this.player.cameras[s.PANORAMA],
- d = b.FORWARD.clone()
- .applyQuaternion(c.quaternion)
- .setY(0)
- .normalize(),
- p = Math.min(o.Math.degToRad(h.warp.minBurnsAngle), e),
- f = function(t) {
- var i = Math.acos(Math.min(1, t.dot(d))),
- n = (new o.Vector3)
- .crossVectors(d, t);
- return Math.max(p, Math.min(Math.abs(i), e)) * Math.sign(n.y)
- };
- if (l == this.player.currentPano) return f(b.FORWARD.clone()
- .applyQuaternion(r.quaternion)
- .setY(0)
- .normalize());
- var m = this.findShortestPath(this.player.currentPano, l);
- if (null == m || m.length < 1) return a.debug("Empty path ahead..."), i;
- var g = this.makePathHulls(m),
- v = new o.CatmullRomCurve3(g.camera),
- y = Math.min(.1, h.warp.lookAheadDist / v.getLength());
- return f(v.getPointAt(y)
- .clone()
- .sub(c.position)
- .setY(0)
- .normalize())
- }
- if (this.player.mode === s.DOLLHOUSE) {
- var w = this.player.cameras[s.DOLLHOUSE];
- return this.burnsDir * Math.min(w.controls.rotationAcceleration.x + .05, .02)
- }
- return this.burnsDir
- }, r.prototype.waitNextStep = function(t, e) {
- var i = new o.Euler,
- n = new o.Vector3;
- if (a.debug("Starting wait: " + (void 0 !== e)), 2 === this.player.currentPano.alignmentType) var r = Math.PI / 8,
- l = h.warp.tourStepDelay * h.warp.waitMultiplier1;
- else r = this.calcBurnsAmount(t), l = h.warp.tourStepDelay;
- var u = function() {
- this.endWarpState(), this.player.mode === s.DOLLHOUSE && (this.player.cameras[s.DOLLHOUSE].controls.rotationAcceleration.x = 0), e && e()
- }.bind(this),
- c = function(t, e) {
- if (this.warpInterrupted) return u(), !0;
- var o = e || 1e3 / 60;
- if (h.warp.doBurns)
- if (this.player.mode === s.PANORAMA) {
- var a = this.player.cameras[s.PANORAMA];
- i.setFromQuaternion(a.quaternion, h.warp.eOrder);
- var l = h.warp.waitMultiplier2 * o * r / h.warp.tourStepDelay;
- i.y += l, n.set(0, 0, -1), n.applyEuler(i), n.add(a.position), a.controls.lookAt(n), a.controls.lookVector.copy(n), a.lookAt(n)
- } else if (this.player.mode === s.DOLLHOUSE) {
- this.player.cameras[s.DOLLHOUSE].controls.rotationAcceleration.x = r
- } else this.player.controls[s.FLOORPLAN].absoluteScale *= .9996
- }.bind(this);
- this.startWarpState(), f.start(c, l, u, 0, p.easeInOutQuad, "wait")
- }, r.prototype.warpToNonPano = function(t) {
- if (this.discardPathObject(), this.warpDestHeroLoc.cameraMode === s.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === s.FLOORPLAN) {
- var e = function() {
- t && t()
- }.bind(this);
- this.player.flyToNewMode({
- mode: this.warpDestHeroLoc.cameraMode,
- duration: h.warp.outsideTime,
- warpDest: this.warpDestHeroLoc,
- callback: e,
- force: !0
- })
- } else a.warn("no warp destination!!!"), t && t()
- }, r.prototype._resetWarpShaderParams = function(t) {
- this.player.mode === s.PANORAMA && (void 0 !== t.material.uniforms.blackout && (t.material.uniforms.blackout.value = 0), void 0 !== t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = 0))
- }, r.prototype._clearWarpShading = function() {
- for (var t = this.model.chunks, e = 0; e < t.length; e += 1) this._resetWarpShaderParams(t[e]), t[e].visible = !0;
- this._resetWarpShaderParams(this.model.skybox)
- }, r.prototype._warpStopFlying = function() {
- this.activeTransType = null, this.placeCpm()
- }, r.prototype._wrapupTravelOnlyBits = function() {
- this._warpStopFlying(), this.warpPathPoints && (this.player.currentPano.exit(), this.warpDestPano.enter(), this.player.currentPano = this.warpDestPano), this.player.spider.draw(), this.placeCpm()
- }, r.prototype._wrapupTravel = function(t) {
- this._wrapupTravelOnlyBits(), this.warpCameraAim(t)
- }, r.prototype._wrapupWarpShading = function(t) {
- this._clearWarpShading(), this._wrapupTravel(t)
- }, r.prototype.wrapupWarpShadingOnly = function(t, e) {
- e !== x.END && this._clearWarpShading(), this._wrapupTravelOnlyBits(), this.upcomingTransType = null, t && t()
- }, r.prototype._warpCameraAim = function(t, e) {
- var i = this.warpDestHeroLoc.quaternion,
- n = this.warpDestHeroLoc;
- n && 2 == n.cameraType && G.model.panos.forEach((function(t) {
- t.id == n.panoId && (i = t.quaternionAutoScene)
- }));
- var r = this.player.cameras[s.PANORAMA],
- l = new o.Vector3(0, 0, 1)
- .applyQuaternion(i)
- .normalize(),
- u = new o.Vector3(0, 0, 1)
- .applyQuaternion(r.quaternion)
- .normalize()
- .dot(l),
- d = o.Math.radToDeg(Math.acos(u)),
- m = new o.Euler(0, 0, 0, h.warp.eOrder)
- .setFromQuaternion(i, h.warp.eOrder),
- g = (new o.Euler)
- .setFromQuaternion(r.quaternion, h.warp.eOrder),
- v = new o.Euler(m.x - g.x, m.y - g.y, m.z - g.z, h.warp.eOrder);
- v.y = c.constrainedTurn(v.y), this.burnsDir = Math.sign(v.y);
- var y = new o.Euler(0, 0, 0, h.warp.eOrder),
- b = new o.Vector3,
- w = function(t, e) {
- return this.warpInterrupted ? void 0 : (y.x = g.x + t * v.x, y.y = g.y + t * v.y, y.z = g.z + t * v.z, b.set(0, 0, -1), b.applyEuler(y), b.add(r.position), r.controls.lookAt(b), r.controls.lookVector.copy(b), r.lookAt(b))
- }.bind(this);
- return d > h.warp.minRotation ? f.start(w, t, e, 0, p[h.warp.movementEasing]) : (a.debug("Aim angle only is " + d.toPrecision(3) + " degrees, skipping explicit re-aim"), void(e && e()))
- }, r.prototype._warpBendAim = function(t, e, i, n) {
- var r = n || 0,
- a = this.player.cameras[s.PANORAMA],
- l = new o.Euler(0, 0, 0, h.warp.eOrder)
- .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
- u = (new o.Euler)
- .setFromQuaternion(a.quaternion, h.warp.eOrder),
- d = new o.Euler(l.x - u.x, l.y - u.y, l.z - u.z, h.warp.eOrder);
- d.y = c.constrainedTurn(d.y);
- var m = Math.min(o.Math.degToRad(h.warp.softBendTilt), Math.abs(d.x));
- d.x = m * Math.sign(d.x), m = Math.min(o.Math.degToRad(Math.max(0, h.warp.softBendAngle)), m), this.burnsDir = Math.sign(d.y), m *= Math.sign(d.y), d.y = m;
- var g = new o.Euler(0, 0, 0, h.warp.eOrder),
- v = new o.Vector3,
- y = function(t, e) {
- if (t < .5) g.x = u.x + t * d.x, g.y = u.y + t * d.y, g.z = u.z + t * d.z;
- else {
- var i = (1 - t) * h.warp.softBendEnd;
- g.x = l.x - i * d.x, g.y = l.y - i * d.y, g.z = l.z - i * d.z
- }
- v.set(0, 0, -1), v.applyEuler(g), v.add(a.position), a.controls.lookAt(v), a.controls.lookVector.copy(v), a.lookAt(v)
- }.bind(this);
- return f.start(y, e, i, r, p[h.warp.movementEasing])
- }, r.prototype._warpStepCameraAim = function(t, e, i) {
- var n = this.player.cameras[s.PANORAMA],
- r = new o.Euler(0, 0, 0, h.warp.eOrder)
- .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
- a = (new o.Euler)
- .setFromQuaternion(n.quaternion, h.warp.eOrder),
- l = new o.Euler(r.x - a.x, r.y - a.y, r.z - a.z, h.warp.eOrder);
- l.y = c.constrainedTurn(l.y), this.burnsDir = Math.sign(l.y);
- var u = new o.Euler(0, 0, 0, h.warp.eOrder),
- d = new o.Vector3,
- m = function(t, e) {
- t < .5 ? u.copy(a) : u.copy(r), d.set(0, 0, -1), d.applyEuler(u), d.add(n.position), n.controls.lookAt(d), n.controls.lookVector.copy(d), n.lookAt(d)
- }.bind(this);
- return f.start(m, e, i, 0, p[h.warp.movementEasing])
- }, r.prototype.setBurnsDir = function() {
- var t = this.player.cameras[s.PANORAMA],
- e = new o.Euler(0, 0, 0, h.warp.eOrder)
- .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
- i = (new o.Euler)
- .setFromQuaternion(t.quaternion, h.warp.eOrder),
- n = new o.Euler(e.x - i.x, e.y - i.y, e.z - i.z, h.warp.eOrder);
- n.y = c.constrainedTurn(n.y), this.burnsDir = Math.sign(n.y)
- }, r.prototype.stepWarpPath = function(t, e) {
- var i = this.player.cameras[s.PANORAMA];
- if (!this.warpPathPoints) return i.position.copy(this.warpDestPano.position), !0;
- var n = this.warpPathPoints[0],
- r = this.warpDestPano.position;
- if (null !== this.nodes && this.cameraHull.length > 1) {
- var a = new o.Vector3;
- t < .5 ? a.copy(this.cameraHull[1])
- .sub(n)
- .normalize()
- .multiplyScalar(h.warp.softPushDist * t)
- .add(n) : a.copy(this.cameraHull[this.cameraHull.length - 2])
- .sub(r)
- .normalize()
- .multiplyScalar(h.warp.softPushDist * h.warp.softPushEnd * (1 - t))
- .add(r), i.position.copy(a)
- } else t < .5 ? i.position.copy(n) : i.position.copy(r)
- }, r.prototype.interruptAndFastForward = function(t, e) {
- this.warping && (this.warpInterrupted = !0, this.warpInterruptionBlackoutStyle = t, this.warpInterruptionTravelTime = e, null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = x.MIDDLE), null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = h.minWarpTime))
- }, r.prototype.warpCameraAim = function(t) {
- var e = h.warp.minWarpTime;
- if (this.upcomingTransType === u.BLACK) e = h.warp.teleportTime;
- else {
- var i = this.player.cameras[s.PANORAMA],
- n = new o.Euler(0, 0, 0, h.warp.eOrder)
- .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
- r = (new o.Euler)
- .setFromQuaternion(i.quaternion, h.warp.eOrder),
- a = new o.Euler(n.x - r.x, n.y - r.y, n.z - r.z, h.warp.eOrder);
- a.y = c.constrainedTurn(a.y);
- var l = 1e3 * Math.abs(a.y) / o.Math.degToRad(h.warp.maxAimPerSec);
- e = Math.max(e, l)
- }
- var d = function() {
- this._warpStopFlying(), this.discardSlow(), t && t()
- }.bind(this);
- this._warpCameraAim(e, d)
- }, r.prototype.warpCommonParameters = function(t, e, i, n) {
- this.model.skybox.material.uniforms.blackout.value = n;
- var r = d.uniform(this.model.skybox, "progress", 1),
- o = d.allUniforms(this.model.chunks, "progress", 1),
- a = !1,
- s = function() {
- if (this.warpInterrupted) return a = !0, !0
- }.bind(this),
- l = function(t, e) {
- return i && a ? (this.model.skybox.material.uniforms.progress.value = 0, !0) : void r(t, e)
- }.bind(this),
- u = function(t, e) {
- return i && a ? (o(0), !0) : void o(t, e)
- }.bind(this);
- f.start(s, t, null, e, null, "safeHaltWatch"), f.start(l, t, null, e, p[h.warp.blendEasing], "skyboxProgress"), f.start(u, t, null, e, p[h.warp.blendEasing], "chunkProgress")
- }, r.prototype.warpTravel_STD = function(t) {
- var e, i = Math.min(h.warp.lookAheadMax, h.warp.lookAheadDist / this.warpLength),
- n = this.player.cameras[s.PANORAMA],
- r = (Math.min(.25, 3 / this.warpLength), Math.min(.35, 7 / this.warpLength)),
- l = new o.Euler(0, 0, 0, h.warp.eOrder),
- m = new o.Vector3,
- v = (new o.Euler)
- .setFromQuaternion(n.quaternion, h.warp.eOrder),
- y = (new o.Euler)
- .copy(v),
- w = n.position.clone(),
- M = new o.Matrix4,
- T = new o.Euler,
- S = h.warp.minWarpTime;
- S += this.warpLength * h.warp.timePerMeter, h.warp.flySpeed > .01 && (S = 1e3 * this.warpLength / h.warp.flySpeed);
- var _ = !1,
- A = this.warpDestHeroLoc.quaternion,
- P = new o.Vector3(0, 0, -1)
- .applyQuaternion(A)
- .normalize(),
- C = this.warpPathPoints[this.warpPathPoints.length - 1].clone()
- .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
- .normalize(),
- E = C.dot(P),
- D = o.Math.radToDeg(Math.acos(E)),
- L = function(t) {
- var e = r;
- return o.Math.smoothstep(t, 0, e) * (1 - o.Math.smoothstep(t, 1 - e, 1))
- },
- O = function() {
- return M.lookAt(w, e, b.UP), l.setFromRotationMatrix(M, h.warp.eOrder), v.setFromQuaternion(n.quaternion, h.warp.eOrder), T.set(l.x - v.x, l.y - v.y, l.z - v.z, h.warp.eOrder), c.constrainedTurn(T.y)
- }.bind(this),
- I = function(t, e) {
- if (this.warpInterrupted) return _ = !0, !0
- }.bind(this),
- R = function(t, e) {
- return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(t)
- }.bind(this),
- N = d.allUniforms(this.model.chunks, "modelAlpha", 1),
- k = function(t, e) {
- return _ || !this.warpPathPoints ? (N(0), !0) : void N(t, e)
- }.bind(this),
- F = function(t, e) {
- if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0;
- if (_) return !0;
- var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, t);
- n.position.copy(i), w = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * t)
- }.bind(this),
- B = function(t, n) {
- return this.warpPathPoints ? !!_ || void(e = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(t + i, 1))) : (a.debug("Lost bunny."), !0)
- }.bind(this),
- z = function(t, r) {
- if (_) return a.debug(">>>> Walkthrough interupted at t=" + t), !0;
- if (!this.warpPathPoints) return !0;
- var s = this.warpLength * t,
- u = o.Math.smoothstep(s, 0, this.brushPrefs.lookBlendDist),
- d = o.Math.smoothstep(s, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
- h.warp.matchCam && (u *= 1 - d), M.lookAt(w, e, b.UP), l.setFromRotationMatrix(M, h.warp.eOrder), v.setFromQuaternion(n.quaternion, h.warp.eOrder), T.set(l.x - v.x, l.y - v.y, l.z - v.z, h.warp.eOrder), T.y = c.constrainedTurn(T.y), l.x = v.x + u * T.x, l.y = v.y + u * T.y, l.z = v.z + u * T.z, T.set(l.x - y.x, l.y - y.y, l.z - y.z, h.warp.eOrder), T.y = c.constrainedTurn(T.y);
- var p = o.Math.degToRad(h.warp.maxTurnPerSec) * r / 1e3;
- T.y = Math.sign(T.y) * Math.min(p, Math.abs(T.y)), y.x = y.x + T.x * h.warp.turnFriction, y.y = y.y + T.y * h.warp.turnFriction, y.z = y.z + T.z * h.warp.turnFriction, y.x = Math.max(o.Math.degToRad(h.warp.minDownAngle), y.x);
- var f = e.clone()
- .sub(w)
- .normalize();
- if (D < h.warp.maxAimRotation && d > 0) {
- var g = 1 - d;
- f.x = f.x * g + d * C.x, f.y = f.y * g + d * C.y, f.z = f.z * g + d * C.z, f.normalize()
- }
- this.bunnyObj.position.copy(n.position)
- .add(f), m.set(0, 0, -1)
- .applyEuler(y)
- .normalize(), m.multiplyScalar(8), m.add(n.position), t > 1 - i && h.warp.matchCam || (n.controls.lookAt(m), n.controls.lookVector.copy(m), n.lookAt(m))
- }.bind(this),
- U = function() {
- _ ? (this.discardSlow(), this.upcomingTransType = u.BLACK, this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, x.BEGINNING, t)) : this._wrapupWarpShading(t)
- }.bind(this);
- B(0);
- var V = h.warp.motionLeadTime + 1e3 * Math.abs(O()) / o.Math.degToRad(h.warp.maxTurnPerSec),
- j = V / (S += V);
- this.warpCommonParameters(S, j, !0, x.NONE), f.start(I, S, null, 0, null, "_haltWatcher"), h.warp.blur > 0 && (g.blurStrength = h.warp.blur, f.start(R, S, null, j, L, "blurring")), f.start(k, S, null, j, L, "modelAlpha"), f.start(F, S, null, j, p[h.warp.blendEasing], "followPath"), f.start(B, S, null, j, p[h.warp.blendEasing], "goBunny"), f.start(z, S, U, 0, p[h.warp.blendEasing], "lookAtBunny")
- }, r.prototype.warpTravel_BLACK = function(t, e, i, n) {
- var r = t || 0;
- null != e || (e = h.warp.teleportTime), this.warpCommonParameters(e, r, !1, i), this.model.chunks.forEach((function(t) {
- t.material.uniforms.blackout.value = i
- })), this._warpBendAim(null, e, null, r);
- var o = function() {
- this.wrapupWarpShadingOnly(n, i)
- }.bind(this);
- f.start(this.stepWarpPath.bind(this), e, o, r, p[h.warp.blendEasing], "stepMotion")
- }, r.prototype.flightStepWalk = function(t, e, i) {
- if (this.warpInterrupted) i && i();
- else if (this.activeTransType !== u.WALK) this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), i && i();
- else if (this.player.currentPano !== t) {
- var n = {
- pano: t,
- lookAtPoint: e,
- duration: null,
- maxDistanceOverride: h.warp.walkMaxDist,
- skipWarpingCheck: !1,
- constantMoveSpeed: !0
- };
- this.player.nonInterruptingFlyToPano(n, i)
- } else i && i()
- }, r.prototype.makeWalkFlightFunc = function(t, e, i) {
- return this.flightStepWalk.bind(this, t, e, i)
- }, r.prototype.warpTravel_WALK = function(t) {
- var e = this.nodes.length,
- i = this.player.model.panos,
- n = i.get(this.nodes[e - 1]),
- r = n.position.clone()
- .multiplyScalar(2)
- .sub(i.get(this.nodes[e - 2])
- .position),
- o = new Array(e + 1);
- o[o.length - 1] = function() {
- t && t()
- }.bind(this);
- for (var a = e - 1, s = o.length - 1; s > 0; s -= 1) {
- var l = this.nodes[a];
- n = i.get(l);
- var u = r.distanceTo(n.position) < .3 ? null : r;
- o[s - 1] = this.makeWalkFlightFunc(n, u, o[s]), r = n.position.clone(), a--
- }
- o[0]()
- }, r.prototype.warpCameraTravel = function(t, e, i, n) {
- if (this.activeTransType = this.upcomingTransType, this.upcomingTransType = null, t) this.activeTransType == u.BLACK ? this.warpTravel_BLACK(null, i, e, n) : this.activeTransType === u.WALK ? this.warpTravel_WALK(function() {
- this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), n && n()
- }.bind(this)) : this.warpTravel_STD(n);
- else {
- var r = function() {
- this._wrapupTravel(n)
- }.bind(this),
- o = {
- pano: this.warpDestPano,
- lookAtPoint: null,
- duration: null,
- maxDistanceOverride: null,
- skipWarpingCheck: !1
- };
- this.player.flyToPano(o, r)
- }
- }, r.prototype.startWarpState = function() {
- this.warping = !0, this.warpInterrupted = !1, this.warpInterruptionBlackoutStyle = null, this.warpInterruptionTravelTime = null
- }, r.prototype.endWarpState = function() {
- this.warping = !1
- }, r.prototype.warpToPano = function(t, e, i, n) {
- if (this.warping) a.warn("Cannot warp when already warping");
- else {
- if (this.upcomingTransType = t, this.activeTransType = null, !this.setWarpDestPano()) return this.upcomingTransType = null, void this.warpToNonPano(n);
- if (this.player.mode !== s.PANORAMA) return this.upcomingTransType = null, this.discardSlow(), void this.player.flyToNewMode({
- mode: s.PANORAMA,
- pano: this.warpDestPano,
- duration: h.warp.outsideTime,
- warpDest: this.warpDestHeroLoc,
- callback: n,
- force: !0
- });
- if (!this.warpDestPano) return a.warn("no warp destination, callback dropped"), void(this.upcomingTransType = null);
- var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < h.warp.nearPanoDist),
- o = this.chooseWarpPath(r);
- if (o && this.upcomingTransType !== u.WALK) {
- var l = function() {
- this.warpToPano(t, e, i, n)
- }.bind(this);
- if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, l)) return
- }
- this.player.currentPano || (a.warn("Arrived at a very strange spot!"), this.player.currentPano = this.warpDestPano, this.placeCpm(), this.fadeOutCpm(h.path.fadeOutTime), this.player.spider.draw()), a.debug("Warping to pano ", this.warpDestPano.position), this.upcomingTransType !== u.WALK && this.player.emit(w.PanoChosen, this.player.currentPano, this.warpDestPano), this.player.activeTag && this.player.dismissActiveTag(), this.startWarpState();
- var c = function() {
- this.endWarpState(), n && n()
- }.bind(this);
- o ? this.warpCameraTravel(r, e, i, c) : this.warpCameraAim(c), this.player.smoothZoomToDefault(h.zoom.restoreTime)
- }
- }, t.exports = r
- })
- .call(this, "/js/objects/ShowPath.js")
- }, function(t, e, i) {
- function n(t) {
- this.player = t, this.obj3d = null, this.UP = new r.Vector3(0, 1, 0)
- }
- var r = i(0),
- o = i(1);
- n.prototype.prefs = {
- linewidth: 3,
- height: .07,
- opacity: .45,
- endScale: .05
- }, n.prototype.discard = function() {
- if (this.obj3d) {
- var t = this.obj3d.parent;
- t && t.remove(this.obj3d)
- }
- this.obj3d = null
- }, n.prototype.draw = function() {
- if (this.discard(), o.showNeighbors) {
- var t = this.player.currentPano.floor;
- this.obj3d = new r.Object3D;
- var e = this.player.model.panos.getNeighbours(this.player.currentPano),
- i = this.player.currentPano.floorPosition.clone()
- .sub(this.player.model.position);
- i.y += this.prefs.height;
- var n = .1525,
- a = .0127,
- s = .255,
- l = new r.Matrix4;
- for (var u in e)
- if (e[u]) {
- var h = this.player.model.panos.get(u),
- c = (h.position.clone()
- .sub(this.player.model.position), h.position.clone()
- .sub(h.floorPosition)),
- d = h.floorPosition.clone()
- .sub(this.player.model.position);
- d.y += this.prefs.height;
- var p = new r.Geometry;
- p.vertices.push(new r.Vector3(0, -a, 0), new r.Vector3(-a, 0, 0), new r.Vector3(0, a, 0), new r.Vector3(a, 0, 0), new r.Vector3(0, -a, 0)), p.vertices.push(new r.Vector3(0, -s, 0), new r.Vector3(s, -s, 0), new r.Vector3(s, n, 0), new r.Vector3(-n, n, 0), new r.Vector3(-n, .127, 0), new r.Vector3(-.19, .1, 0), new r.Vector3(-.19, -.2032, 0), new r.Vector3(-n, -.2286, 0), new r.Vector3(-n, -s, 0), new r.Vector3(0, -s, 0)), l.identity()
- .setPosition(c), p.applyMatrix(l), p.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)), p.vertices.push(new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0), new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0), new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0), new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)), l.lookAt(d, i, this.UP)
- .setPosition(d), p.applyMatrix(l), p.vertices.push(d, i);
- var f = new r.Line(p, new r.LineBasicMaterial({
- color: h.debugColor.getHex(),
- transparent: !0,
- opacity: this.prefs.opacity,
- depthWrite: !1,
- name: "sLine" + u,
- linewidth: this.prefs.linewidth
- }));
- this.obj3d.add(f)
- } t.add(this.obj3d)
- }
- }, n.prototype.update = function() {
- o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
- }, t.exports = n
- }, function(t, e, i) {
- function n() {
- this.events = [], this.valid = !1
- }
- var r = i(111);
- n.prototype.push = function(t, e) {
- this.events.push({
- direction: t,
- pano: e
- }), this.valid = !0
- }, n.prototype.pop = function(t) {
- var e = this.events.pop();
- return this.events.length < 1 && (this.valid = !1), e
- }, n.prototype.peek = function() {
- return this.events.length ? this.events[this.events.length - 1] : {
- direction: null,
- pano: null
- }
- }, n.prototype.invalidate = function() {
- this.events = [], this.valid = !1
- }, n.prototype.reversePano = function(t) {
- if (!this.valid) return null;
- var e = this.peek();
- return r.opposite(t) === e.direction ? (this.pop(), e.pano) : null
- }, t.exports = n
- }, function(t, e) {
- var i = {
- UP: 1,
- DOWN: -1,
- LEFT: "L",
- RIGHT: "R",
- FORWARD: "F",
- BACK: "B",
- reverse: {},
- opposite: function(t) {
- return this.reverse[t.toString()]
- }
- };
- i.reverse[i.UP] = i.DOWN, i.reverse[i.DOWN] = i.UP, i.reverse[i.LEFT] = i.RIGHT, i.reverse[i.RIGHT] = i.LEFT, i.reverse[i.FORWARD] = i.BACK, i.reverse[i.BACK] = i.FORWARD, t.exports = i
- }, function(t, e) {
- t.exports = {
- ZoomIn: "zoom.in",
- ZoomOut: "zoom.out",
- ZoomMax: "zoom.max",
- ZoomMin: "zoom.min"
- }
- }, function(t, e) {
- function i() {
- this.actionSequence = [], this.actionSequenceInProgress = !1
- }
- i.prototype.reset = function(t) {
- this.actionSequenceInProgress = !1, this.actionSequence.length = 0
- }, i.prototype.addZoomAction = function() {
- var t = null,
- e = null,
- i = !1,
- n = function() {
- if (t = null, this.actionSequence.length > 0) this.actionSequence[0].start, this.actionSequence[this.actionSequence.length - 1].end;
- this.reset()
- };
- return function(r, o, a) {
- if (r !== o) {
- i || (n = n.bind(this), i = !0), t && (window.clearTimeout(t), t = null), a === e && this.actionSequenceInProgress || (this.reset(), e = a), this.actionSequenceInProgress = !0;
- var s = {
- start: r,
- end: o
- };
- this.actionSequence.push(s), t = window.setTimeout(n, 150)
- }
- }
- }(), t.exports = i
- }, function(t, e, i) {
- (function(e) {
- var n = i(0),
- r = i(3),
- o = i(115),
- a = i(67),
- s = i(20);
- function l(t) {
- G.MT = this;
- var i = this,
- l = 0,
- u = 1,
- h = t.sRender.scene,
- c = t.sRender.renderer;
- this.enabled = !1, this.camera = t.camera, this.renderer = c, this.player = t, this.domElement = c.domElement, this.mouse = {
- x: 0,
- y: 0
- }, this.allSpheres = [], this.mode = "panorama", this.activeMeasurement = null, this.measurements = [], this.backupDollhouseMeasurements = [], this.backupPanoramaMeasurements = [], this.backupFloorplanMeasurements = [], this.sceneMeasurement = h, this.sceneRoot = new n.Object3D, this.sceneMeasurement.add(this.sceneRoot), this.hoveredElement = null, this.modeScale = 1, this.getPointType = 1, this.inMeasureMode = !1, this.isPC = null, this.movingpointi = -1;
- var d = this.player.modellen;
- this.checkradius = d < 10 ? 1.5 : d > 100 ? 5 : (d - 10) / 90 * 3.5 + 1.5, this.mouseDownFlag = !1, this.mouseMoveFlag = !1, this.clickOnceHandle = null, this.measureState = !1, this.unit = 1, this.mouseDownPos = new n.Vector2, this.pointIntersect = new n.Vector3, this.lockedAddPoint = !1, this.singleMeasuring = !1, this.editMode = !1, this.measureArea = !1, this.measureTexture = new a(this.player), this.oldPoint = null, this.clickMeasureId = null;
- var p = !1,
- f = this;
- function m(t, e, i, n) {
- var r = 1 / Math.tan(e / 2) / i;
- return t * (r = r * n / 2)
- }
- Object.defineProperty(this, "autoFit", {
- get: function() {
- return p
- },
- set: function(t) {
- return p = t, f.activeMeasurement && (f.activeMeasurement.enableAutoFit = t), t
- }
- }), this.init = function(t) {
- var e = t.nestmeasure;
- e && e.info && (e.info.forEach((function(t) {
- i.startInsertion({
- showDistances: !0,
- showArea: !0,
- closed: !0,
- autoFit: i.autoFit
- }, !0, t), i.intoMeasureMode(!r.isMobile());
- for (var e = t.vertex_position.length - 1; e >= 0; e--) {
- var o = new n.Vector3(t.vertex_position[e].x, t.vertex_position[e].y, t.vertex_position[e].z);
- i.addPoint(o)
- }
- i.finishInsertion(!0, t.measureid), i.exitMeasureMode()
- })), this.player.measuringToolControls && this.player.measuringToolControls.updateMeasureInfo(this.measurements), G.conf.modelMeasure && "panorama" === this.player.mode || this.hideAll())
- }, this.onMouseMove = function(t, e) {
- if (i.pointIntersect.copy(i.player.intersect.point), i.mouseDownFlag && (i.mouseMoveFlag = !0), i.pointIntersect && i.activeMeasurement && i.activeMeasurement.points) {
- var n = i.activeMeasurement.points,
- r = i.activeMeasurement.points.length - 1;
- r >= 0 && i.activeMeasurement.setPosition(r, i.pointIntersect), 1 === n.length ? this.singleMeasuring = !0 : this.singleMeasuring = !1
- }
- }, this.updateNormalPoint = function(t) {
- if (t && i.activeMeasurement && i.activeMeasurement.points) {
- var e = i.activeMeasurement.points.length - 1;
- e >= 0 && i.activeMeasurement.setPosition(e, t)
- }
- }, this.onMouseDown = function(t) {
- if (this.lockedAddPoint = !1, this.mouseDownPos.set(t.clientX, t.clientY), "floorplan" === this.player.mode) return !1;
- 0 === t.button && (i.mouseDownFlag = !0, i.mouseMoveFlag = !1), e(".measure-edit-title")
- .hide(), e(".measure-label")
- .removeClass("measureActive"), i.clickMeasureId && (e(".measure-edit-delete")
- .hide(), i.clickMeasureId = null)
- }, this.onMouseUp = function(t) {
- var e = this;
- if (!this.lockedAddPoint) {
- if ("floorplan" === this.player.mode) return !1;
- if (this.mouseDownPos.distanceTo(new n.Vector2(t.clientX, t.clientY)) < 3) {
- if (0 === t.button)
- if (this.clickOnceHandle && this.singleMeasuring) clearTimeout(this.clickOnceHandle), this.clickOnceHandle = null, new n.Vector2(t.clientX, t.clientY)
- .distanceTo(this.oldPoint) < 6 && this.addNormalPoint();
- else this.clickOnceHandle = setTimeout(function(t) {
- e.clickOnceHandle = null, e.addPoint(t), e.measureArea || 3 !== e.activeMeasurement.points.length || e.endAndReMeasure()
- }.bind(this, this.pointIntersect.clone()), 300), this.oldPoint = new n.Vector2(t.clientX, t.clientY);
- i.mouseDownFlag = !1
- }
- 2 === t.button && this.endAndReMeasure()
- }
- }, this.endAndReMeasure = function() {
- this.singleMeasuring = !1, this.finishInsertion(!0), this.exitMeasureMode(), this.startInsertion({
- showDistances: !0,
- showArea: !0,
- closed: !0,
- autoFit: this.autoFit
- }, !0), this.intoMeasureMode(!0), this.player.measuringToolControls && 0 < this.measurements.length && this.player.measuringToolControls.updateMeasureInfo(this.measurements)
- }, this.toast = function(t) {
- setTimeout((function() {
- document.getElementsByClassName("toast-wrap")[0].getElementsByClassName("toast-msg")[0].innerHTML = t;
- var i = document.getElementsByClassName("toast-wrap")[0];
- e(".toast-wrap")
- .addClass("me"), e(".toast-msg")
- .addClass("me"), i.className = i.className.replace("toastAnimate", ""), setTimeout((function() {
- i.className = i.className + " toastAnimate"
- }), 10)
- }), 10)
- }, this.addNormalPoint = function() {
- if (!(this.activeMeasurement.points.length > 1)) {
- var t = G.pointsIntersect.point.clone(),
- e = G.pointsIntersect.normal.clone(),
- i = this.player.computeIntersectWithFloor(t, e);
- if (i.length > 0) {
- for (var r = 0, o = 0; o < i.length; o++)
- if (i[o].distance > .05) {
- r = o;
- break
- } var a = i[r].point;
- this.activeMeasurement.removeMarker(0), this.addPoint(t, !1), this.addPoint(a, !1), this.addPoint(new n.Vector3, !1), this.endAndReMeasure()
- }
- }
- }, this.addPoint = function(t, r) {
- if (i.activeMeasurement && i.activeMeasurement.points) {
- var o = t || i.pointIntersect,
- a = new n.Vector3(o.x, o.y, o.z);
- if (function(t, e) {
- var n = 0;
- if (2 <= e.length) {
- for (var r = 0, o = e.length; r < o; ++r) {
- var a = t.x.toFixed(2) === e[r].x.toFixed(2),
- s = t.y.toFixed(2) === e[r].y.toFixed(2),
- l = t.z.toFixed(2) === e[r].z.toFixed(2);
- a && s && l && n++
- }
- if (2 === n && !i.singleMeasuring) return !0
- }
- return !1
- }(a, this.activeMeasurement.points)) return;
- i.activeMeasurement.addMarker(a, r), 2 == i.activeMeasurement.points.length ? e(".measure-edit-cancel, .measure-edit-delete")
- .show() : (e(".measure-edit-cancel")
- .hide(), e(".measure-edit-save")
- .show())
- }
- this.allSpheres = [];
- for (var s = [], l = 0; i.measurements && l < i.measurements.length; l++) s.push(i.measurements[l]);
- for (l = 0; l < s.length; l++)
- for (var u = s[l], h = 0; h < u.spheres.length; h++) {
- var c = u.spheres[h];
- l == s.length - 1 && h == u.spheres.length - 1 || i.allSpheres.push(c)
- }
- }, this.hideLastPoint = function() {}, this.getMousePointCloudIntersection = function(t) {
- var e = this.player.getMouseOnWholeIntersect(t);
- return e ? e.clone() : null
- }, this.setAutoFit = function(t) {
- this.autoFit = t
- }, this.setMeasureArea = function(t) {
- this.measureArea = t
- }, this.startInsertion = function(e, r, a) {
- u;
- var s = void 0 === (e = e || {})
- .showDistances || e.showDistances,
- l = void 0 !== e.showArea && e.showArea,
- h = void 0 !== e.showAngles && e.showAngles,
- c = void 0 !== e.closed && e.closed,
- d = e.maxMarkers || Number.MAX_SAFE_INTEGER,
- p = new o(t, a);
- p.showDistances = s, p.showArea = l, p.showAngles = h, p.showEdge = !0, p.closed = c, p.maxMarkers = d, p.category = 1, p.unit = this.unit, p.enableAutoFit = this.autoFit, p.editMode = this.editMode, this.addMeasurement(p, 2), a ? p.addMarker(new n.Vector3(a.vertex_position[0].x, a.vertex_position[0].y, a.vertex_position[0].z)) : i.pointIntersect ? p.addMarker(i.pointIntersect.clone()) : p.addMarker(new n.Vector3(0, 0, 0)), this.activeMeasurement = p
- }, this.finishInsertion = function(t, n) {
- if (t) {
- if (this.activeMeasurement && this.activeMeasurement.points && this.activeMeasurement.points.length) {
- if (1 === this.activeMeasurement.points.length) return !1;
- 2 === this.activeMeasurement.points.length || this.activeMeasurement.removeMarker(this.activeMeasurement.points.length - 1), this.activeMeasurement.points.length > 2 && (i.activeMeasurement.category = 2);
- var o = this.measureData(this.activeMeasurement);
- n ? (i.measurements[i.measurements.length - 1].measureid = n, i.measurements[i.measurements.length - 1].category = i.activeMeasurement.category) : r.valueFromHash("publicity") || r.valueFromHash("publictest") ? i.measurements[i.measurements.length - 1].measureid = 111 : "modelMeasure" === r.valueFromHash("iframe_type_editor") ? window.parent.addMeasure(o, (function(t) {
- i.measurements[i.measurements.length - 2].measureid = t
- })) : i.measurements[i.measurements.length - 1].measureid = this.activeMeasurement.uuid
- }
- e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
- .hide()
- }
- var a = {
- type: "insertion_finished",
- measurement: this.activeMeasurement
- };
- this.dispatchEvent(a), this.activeMeasurement = null, l
- }, this.updateMeasureVisible = function(t) {
- if (!t) return !1;
- for (var e = 0; e < this.measurements.length; e++) this.computeLableVisible(this.measurements[e], t)
- }, this.computeLableVisible = function(t, e) {
- for (var i = e.id, r = e.position, o = new n.Vector3, a = t.edgeLabels.concat(t.areaLabel), s = null, l = [], u = 0; u < a.length; u++) {
- (s = a[u])
- .userData.panoVisibleMap || (s.userData.panoVisibleMap = {}), o.subVectors(s.position, r)
- .normalize();
- var h = this.player.computeIntersectWithFloor(r, o);
- h.length > 0 ? h[0].distance > s.position.distanceTo(r) || h[0].point.distanceTo(s.position) < .05 ? (l.push(!0), s.userData.panoVisibleMap[i] = !0) : (l.push(!1), s.userData.panoVisibleMap[i] = !1) : (l.push(!0), s.userData.panoVisibleMap[i] = !0)
- }
- return l
- }, this.changeSize = function(t) {
- for (var e = null, i = this.measurements.length - 1; i >= 0; i--) {
- var n = this.measurements[i];
- if (t === n.measureid) {
- e = this.measureData(n);
- break
- }
- }
- window.parent && window.parent.changeSize && e && (e.measureid = t, e.measureId = t, window.parent.changeSize(e))
- }, this.measureData = function(t) {
- var e = t,
- i = [];
- return e.points.forEach((function(t) {
- i.push({
- x: t.x,
- y: t.y,
- z: t.z
- })
- })), e.edgeLabels.forEach((function(t, i) {
- e.lineDetail[i] && (e.lineDetail[i].value = t.textNum)
- })), {
- vertex_position: i,
- quaternion: e.q,
- areaDetail: e.areaDetail,
- lineDetail: e.lineDetail,
- enable: e.enable,
- mode: e.mode,
- unit: e.unit,
- category: e.category,
- flooridx: e.flooridx,
- locationid: e.location_id
- }
- }, this.addMeasurement = function(t, e) {
- if (this.sceneMeasurement.add(t), this.measurements.push(t), 1 == e) switch (this.mode) {
- case 1:
- this.backupDollhouseMeasurements.push(t);
- break;
- case 2:
- this.backupPanoramaMeasurements.push(t);
- break;
- case 3:
- this.backupFloorplanMeasurements.push(t)
- }
- this.dispatchEvent({
- type: "measurement_added",
- measurement: t
- }), t.addEventListener("marker_added", (function(t) {
- i.dispatchEvent(t)
- })), t.addEventListener("marker_removed", (function(t) {
- i.dispatchEvent(t)
- })), t.addEventListener("marker_moved", (function(t) {
- i.dispatchEvent(t)
- }))
- }, this.changeMode = function(t, e) {
- switch (e) {
- case "panorama":
- (i.measureState || G.conf.modelMeasure) && i.showAll();
- break;
- case "dollhouse":
- case "floorplan":
- break;
- case "transitioning":
- i.hideAll()
- }
- }, this.removeMeasurement = function(t, e) {
- if (!t) {
- var i = this.measurements.length - 1;
- t = this.measurements[i], e = 1
- }
- if (this.sceneMeasurement.remove(t), (n = this.measurements.indexOf(t)) >= 0 && this.measurements.splice(n, 1), 1 == e) switch (this.mode) {
- case 1:
- (n = this.backupDollhouseMeasurements.indexOf(t)) >= 0 && this.backupDollhouseMeasurements.splice(n, 1);
- break;
- case 2:
- (n = this.backupPanoramaMeasurements.indexOf(t)) >= 0 && this.backupPanoramaMeasurements.splice(n, 1);
- break;
- case 3:
- var n;
- (n = this.backupFloorplanMeasurements.indexOf(t)) >= 0 && this.backupFloorplanMeasurements.splice(n, 1)
- }
- }, this.updateMode = function(t) {
- switch (this.mode = t, this.changeState(), this.mode) {
- case "panorama":
- this.getPointType = 2, this.modeScale = 1;
- break;
- case "dollhouse":
- this.getPointType = 2, this.modeScale = 20;
- break;
- case "floorplan":
- this.getPointType = 1, this.modeScale = 20
- }
- }, this.backup = function() {
- for (var t = this.measurements.length - 1; t >= 0; t--) {
- var e = this.measurements[t];
- this.removeMeasurement(e, 2)
- }
- }, this.restore = function() {
- var t = null;
- switch (this.mode) {
- case 1:
- t = this.backupDollhouseMeasurements;
- break;
- case 2:
- t = this.backupPanoramaMeasurements;
- break;
- case 3:
- t = this.backupFloorplanMeasurements
- }
- for (var e = t.length, i = 0; i < e; i++) {
- var n = t[i];
- this.addMeasurement(n, 2)
- }
- }, this.intoMeasureMode = function(t) {
- this.inMeasureMode = !0, this.player.inMeasureMode = !0, this.isPC = t, "panorama" === this.player.mode && (this.measureState = !0), this.measureTexture.show()
- }, this.exitMeasureMode = function(t) {
- this.inMeasureMode = !1, this.player.inMeasureMode = !1, this.activeMeasurement && this.activeMeasurement.points && this.activeMeasurement.points.length && (this.removeMeasurement(this.activeMeasurement, 1), this.activeMeasurement.removeMarker(this.activeMeasurement.points.length - 1)), i.activeMeasurement = null, this.player.measuringToolControls.updateMeasureInfo(this.measurements), this.measureTexture.hide()
- }, this.deleteAll = function() {
- for (var t = this.measurements.length - 1; t >= 0; t--) {
- var e = this.measurements[t];
- this.removeMeasurement(e, 1)
- }
- }, this.show = function(t) {
- for (var e = this.measurements.length - 1; e >= 0; e--) {
- var i = this.measurements[e];
- i.measureid === t && this.showOrHide(i, !0)
- }
- }, this.hide = function(t) {
- for (var e = this.measurements.length - 1; e >= 0; e--) {
- var i = this.measurements[e];
- i.measureid === t && this.showOrHide(i, !1)
- }
- }, this.showAll = function() {
- this.measureState = !0;
- for (var t = this.measurements.length - 1; t >= 0; t--) {
- var e = this.measurements[t];
- e.editMode || this.showOrHide(e, !0)
- }
- }, this.hideAll = function() {
- for (var t = this.measurements.length - 1; t >= 0; t--) {
- var e = this.measurements[t];
- this.showOrHide(e, !1)
- }
- "panorama" === this.player.mode && (this.measureState = !1)
- }, this.delete = function(t) {
- for (var e = this.measurements.length - 1; e >= 0; e--) {
- var i = this.measurements[e];
- i.measureid !== t && i.uuid !== t || this.removeMeasurement(i, 1)
- }
- this.player.measuringToolControls.updateMeasureInfo(this.measurements)
- }, this.changeName = function(t, e) {
- for (var i = this.measurements.length - 1; i >= 0; i--) {
- var n = this.measurements[i];
- n.measureid === t && n.changeName(e)
- }
- this.player.measuringToolControls.updateMeasureInfo(this.measurements)
- }, this.selected = function(t) {
- this.clickMeasureId = t
- }, this.disSelected = function(t) {
- for (var e = this.measurements.length - 1; e >= 0; e--) {
- var i = this.measurements[e];
- i.measureid === t && i.disSelected(t)
- }
- }, this.changeUnit = function(t) {}, this.changeState = function() {
- for (var t = 0; t < this.measurements.length; t++) {
- var e = this.measurements[t];
- if (!e.enable) break;
- e.modeType = this.mode, e.update()
- }
- }, this.showOrHide = function(t, e) {
- t.enable = e, t.showDistances = e, t.showArea = e, t.showEdge = e, t.update(), this.player.measuringToolControls.updateMeasureInfo(this.measurements)
- }, this.unbindEventListener = function() {
- this.domElement.removeEventListener("mousemove", onMouseMove, !1), this.domElement.removeEventListener("mousedown", onMouseDown, !1), this.domElement.removeEventListener("mouseup", onMouseUp, !0)
- }, this.onIntoEditMeasure = function() {
- this.editMode = !0;
- for (var t = this.measurements.length - 1; t >= 0; t--) {
- var e = this.measurements[t];
- e.editMode && this.showOrHide(e, !0)
- }
- }, this.onQuitEditMeasure = function() {
- this.editMode = !1;
- for (var t = this.measurements.length - 1; t >= 0; t--) {
- var e = this.measurements[t];
- e.editMode && this.showOrHide(e, !1)
- }
- }, this.update = function() {
- if (0 === this.measurements.length) return !1;
- for (var t = [], e = 0; e < this.measurements.length; e++) t.push(this.measurements[e]);
- this.activeMeasurement && t.push(this.activeMeasurement);
- for (e = 0; e < t.length; e++) {
- for (var r = t[e], o = 0; o < r.spheres.length; o++) {
- var a = r.spheres[o];
- this.allSpheres.push(a);
- var s = i.camera.position.distanceTo(a.getWorldPosition(new n.Vector3)),
- l = m(1, i.camera.fov * Math.PI / 180, i.player.cameras.floorplan.top, c.domElement.clientHeight),
- u = 30 * this.modeScale / l;
- a.scale.set(u, u, u)
- }
- for (o = 0; o < r.edgeLabels.length; o++) {
- var h = r.edgeLabels[o];
- s = i.camera.position.distanceTo(h.getWorldPosition()), l = m(1, i.camera.fov * Math.PI / 180, i.player.cameras.floorplan.top, c.domElement.clientHeight), u = 90 * this.modeScale / l;
- h.scale.set(u, u, u)
- }
- for (o = 0; o < r.edgeLabels.length; o++) {
- h = r.angleLabels[o], s = i.camera.position.distanceTo(h.getWorldPosition()), u = 70 / (l = m(1, i.camera.fov * Math.PI / 180, s, c.domElement.clientHeight));
- h.scale.set(u, u, u)
- }
- s = i.camera.position.distanceTo(r.areaLabel.getWorldPosition()), l = m(1, i.camera.fov * Math.PI / 180, i.player.cameras.floorplan.top, c.domElement.clientHeight), u = 90 * this.modeScale / l;
- r.areaLabel.scale.set(u, u, u)
- }
- }, this.player.on(s.ModeChanged, this.changeMode), e(".measure-edit-save")
- .on("click", (function() {
- i.endAndReMeasure(), e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
- .hide()
- })), e(".measure-edit-cancel")
- .on("click", (function() {
- i.exitMeasureMode(), i.startInsertion({
- showDistances: !0,
- showArea: !0,
- closed: !0,
- autoFit: this.autoFit
- }, !0), i.intoMeasureMode(!0), e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
- .hide()
- })), e(".measure-edit-delete")
- .on("click", (function() {
- i.exitMeasureMode(), i.startInsertion({
- showDistances: !0,
- showArea: !0,
- closed: !0,
- autoFit: i.autoFit
- }, !0), i.intoMeasureMode(!0), e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
- .hide(), i.clickMeasureId && (i.delete(i.clickMeasureId), i.clickMeasureId = null)
- }))
- }
- l.prototype = Object.create(n.EventDispatcher.prototype), t.exports = l
- })
- .call(this, i(6))
- }, function(t, e, i) {
- var n = i(0),
- r = i(116),
- o = i(9);
- function a(t, e) {
- G.Measure = this;
- var i = this;
- this.player = t, this.camera = t.camera, n.Object3D.call(this), this.enable = !e || e.enable, this.mode = e ? e.mode : t.mode, this.location_id = e ? e.locationid : t.currentPano.id, this.flooridx = e ? e.flooridx : t.currentPano.floorIndex, this.enableAutoFit = !1, this.checked = !1, this.unit = 1, this.lineDetail = [], this.areaDetail = {
- name: "",
- value: 0,
- desc_position: {
- x: 0,
- y: 0,
- z: 0
- }
- }, this.q = e ? e.quaternion : {
- x: this.camera.quaternion.x,
- y: this.camera.quaternion.y,
- z: this.camera.quaternion.z,
- w: this.camera.quaternion.w
- }, this.points = [], this._showDistances = !0, this._showArea = !0, this._closed = !0, this.maxMarkers = Number.MAX_SAFE_INTEGER, this.spheres = [], this.edges = [], G.edges = this.edges, this.sphereLabels = [], this.edgeLabels = [], this.angleLabels = [], this.text = "", this.lockedFitAxis = !1, e && (1 === e.category ? this.text = "未命名" === e.lineDetail[0].name ? "" : e.lineDetail[0].name + " " : this.text = "未命名" === e.areaDetail.name ? "" : e.areaDetail.name + " "), this.flooridx || (this.flooridx = 0), this.areaLabel = new r(""), this.areaLabel.material.opacity = 1, this.areaLabel.textNum = 0;
- var a = new n.SphereGeometry(.01, 16, 16);
- this.color = new n.Color(16760622);
- var s = function(t) {
- t.target.material.emissive.setHex(8947848)
- },
- l = function(t) {
- t.target.material.emissive.setHex(0)
- },
- u = function(t) {
- var e = t.tool,
- n = (e.dragstart, e.mouse, e.getMousePointCloudIntersection());
- if (n) {
- var r = i.spheres.indexOf(e.dragstart.object);
- i.setPosition(r, n)
- }
- t.event.stopImmediatePropagation()
- },
- h = function(t) {};
- function c(t) {
- for (var e = (t += "")
- .split("."), i = e[0], n = e.length > 1 ? "." + e[1] : "", r = /(\d+)(\d{3})/; r.test(i);) i = i.replace(r, "$1,$2");
- return i + n
- }
- this.addMarker = function(t, e) {
- var o = !1,
- c = null;
- null == e && (e = !0), e && 0 !== this.points.length && (c = this.points.pop(), o = !0), this.points.push(t), o && this.points.push(c);
- var d = new n.Mesh(a, new n.MeshBasicMaterial({
- flatShading: n.SmoothShading,
- color: i.color,
- depthTest: !0,
- transparent: !0,
- opacity: 1
- }));
- d.name = "sphere", d.userData.index = this.points.length - 1, d.addEventListener("move", s), d.addEventListener("leave", l), d.addEventListener("drag", u), d.addEventListener("drop", h), this.add(d), this.spheres.push(d);
- var p = new n.LineGeometry;
- p.setPositions([0, 0, 0, 0, 0, 0]), G.matLine = new n.LineMaterial({
- color: 16760622,
- linewidth: 2,
- resolution: new n.Vector2(window.renderWidth || (window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)),
- depthTest: !0
- });
- var f = new n.Line2(p, G.matLine);
- f.renderOrder = 99, f.computeLineDistances(), f.scale.set(1, 1, 1), f.visible = !0, this.add(f), this.edges.push(f);
- var m = new r;
- m.visible = !1, m.textNum = 0, this.edgeLabels.push(m);
- var g = new r;
- g.material.opacity = 1, g.visible = !1, this.angleLabels.push(g), this.add(g);
- var v = {
- type: "marker_added",
- measurement: this
- };
- this.dispatchEvent(v), this.setPosition(this.points.length - 1, t)
- }, this.removeMarker = function(t, e) {
- this.points.splice(t, 1), this.remove(this.spheres[t]);
- var i = 0 === t ? 0 : t - 1;
- this.remove(this.edges[i]), this.edges.splice(i, 1), this.remove(this.edgeLabels[i]), this.edgeLabels.splice(i, 1), this.spheres.splice(t, 1), this.update(), this.dispatchEvent({
- type: "marker_removed",
- measurement: this
- })
- }, this.setMarker = function(t, e) {
- this.points[t] = e;
- var i = {
- type: "marker_moved",
- measure: this,
- index: t,
- position: e.position.clone()
- };
- this.dispatchEvent(i), this.update()
- }, this.setPosition = function(t, e) {
- this.points[t].copy(e);
- var i = {
- type: "marker_moved",
- measure: this,
- index: t,
- position: e.clone()
- };
- this.dispatchEvent(i), this.update()
- }, this.changeName = function(t) {
- this.text = t, this.update()
- }, this.getPlaneAera = function() {
- var t = 0,
- e = this.points.length - 1,
- i = [];
- if (!(this.points.length >= 3)) return t;
- var r = new n.Plane;
- r.setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]), r.constant = 0;
- var o = r.normal,
- a = o.angleTo(new n.Vector3(0, 1, 0)),
- s = (new n.Vector3)
- .crossVectors(o, new n.Vector3(0, 1, 0))
- .normalize(),
- l = (new n.Quaternion)
- .setFromAxisAngle(s, a);
- i.push({
- x: 0,
- y: 0
- });
- for (var u = new n.Vector3, h = 1; h < this.points.length; h++) u.subVectors(this.points[h], this.points[0]), r.projectPoint(u.clone(), u), u.applyQuaternion(l), i.push({
- x: u.x,
- y: u.z
- });
- if (i.length > 0)
- for (h = 0; h < i.length; h++) {
- var c = i[h],
- d = i[e];
- t += (d.x + c.x) * (c.y - d.y), e = h
- }
- return Math.abs(t / 2)
- }, this.getAngleBetweenLines = function(t, e, i) {
- var r = (new n.Vector3)
- .subVectors(e, t),
- o = (new n.Vector3)
- .subVectors(i, t);
- return r.angleTo(o)
- }, this.changeUnit = function(t) {
- this.unit = t, this.update()
- }, this.selected = function() {
- this.checked = !0, this.update()
- }, this.disSelected = function() {
- this.checked = !1, this.update()
- }, this.fitAxis = function(t, e) {
- if (!this.lockedFitAxis) {
- var i, r = null,
- o = null,
- a = null;
- i = t[e - 1], o = t[e], r = new n.Vector3(o.x, i.y, o.z), (a = this.computeFitPosition(r, i, o))
- .point && o.copy(a.point), r.set(o.x, o.y, i.z), (a = this.computeFitPosition(r, i, o))
- .point && o.copy(a.point), r.set(i.x, o.y, o.z), (a = this.computeFitPosition(r, i, o))
- .point && o.copy(a.point)
- }
- }, this.computeFitPosition = function(t, e, i) {
- var r = {
- point: null,
- angle: 0
- },
- o = (new n.Vector3)
- .subVectors(e, t)
- .normalize(),
- a = (new n.Vector3)
- .subVectors(i, e),
- s = (new n.Vector3)
- .crossVectors(o, a),
- l = o.angleTo(a),
- u = a.length(),
- h = (new n.Vector3)
- .crossVectors(o, s)
- .normalize();
- if (u <= 1.15) l <= .1 ? (a.projectOnVector(o), r.point = (new n.Vector3)
- .addVectors(e, a), r.angle = 0) : l >= 3.05 ? (r.point = (new n.Vector3)
- .addVectors(e, a), r.angle = 180) : l >= 1.48 && l <= 1.65 && (a.projectOnVector(h), r.point = (new n.Vector3)
- .addVectors(e, a), r.angle = 90);
- else {
- var c = Math.abs(Math.sin(l) * u),
- d = Math.abs(Math.cos(l) * u);
- c < .2 ? (a.projectOnVector(o), r.point = (new n.Vector3)
- .addVectors(e, a), r.angle = l > 3 ? 180 : 0) : d < .2 && (a.projectOnVector(h), r.point = (new n.Vector3)
- .addVectors(e, a), r.angle = 90)
- }
- return r
- }, this.cpmputedOutScreen = function(t) {
- var e = !1;
- return this.points.length >= 3 && (e = !0), e
- }, this.update = function() {
- if (0 !== this.points.length)
- if (1 !== this.points.length) {
- var t = this.points.length - 1,
- e = new n.Vector3;
- this.enableAutoFit && this.points.length >= 2 && this.fitAxis(this.points, t);
- for (var r = 0; r <= t; r++) {
- E = this.points[r];
- e.add(E)
- }
- e.divideScalar(this.points.length);
- var a = this.cpmputedOutScreen(e);
- this.areaLabel.position.copy(e), this.areaLabel.userData.screen_position = o.convertWorldPositionToScreen(e.clone(), this.camera), this.areaLabel.visible = this.showArea && this.points.length >= 3;
- var s = "" !== this.text ? this.text : "未命名",
- l = c(this.getPlaneAera()
- .toFixed(2)),
- u = "";
- u = l + "m²", u = this.text + u, this.areaLabel.setText(u), this.areaLabel.textNum = l, this.checked, this.enable || (this.areaLabel.visible = !1), this.areaLabel.setDepth(a), this.areaDetail.name = s, this.areaDetail.value = this.getPlaneAera()
- .toFixed(2), this.areaDetail.desc_position = {
- x: this.areaLabel.position.x,
- y: this.areaLabel.position.y,
- z: this.areaLabel.position.z
- };
- for (r = 0; r <= t; r++) {
- var h = r,
- d = r + 1 > t ? 0 : r + 1,
- p = 0 === r ? t : r - 1,
- f = (E = this.points[h], this.points[d]),
- m = this.points[p],
- g = this.spheres[h];
- g.position.copy(E), g.material.color = i.color;
- var v = this.edges[h],
- y = [E.x, E.y, E.z, f.x, f.y, f.z];
- v.geometry.setPositions(y), v.computeLineDistances(), v.geometry.verticesNeedUpdate = !0, v.geometry.computeBoundingSphere(), this.showEdge && this.enable ? this.showEdge && (v.visible = h < t || this.closed, g.visible = !0) : (v.visible = !1, g.visible = !1), this.checked;
- var b = this.edgeLabels[r],
- w = (new n.Vector3)
- .add(E);
- w.add(f), w = w.multiplyScalar(.5);
- var x = E.distanceTo(f)
- .toFixed(2);
- b.position.copy(w), b.userData.screen_position = o.convertWorldPositionToScreen(w.clone(), this.camera);
- var M = "" !== this.text ? this.text : "未命名",
- T = x;
- this.lineDetail.length === t - 1 ? this.lineDetail.push({
- name: M,
- value: x,
- desc_position: {}
- }) : this.lineDetail.length === t && (this.lineDetail[t - 1].name = M, this.lineDetail[t - 1].value = x, this.lineDetail[t - 1].desc_position = {
- x: w.x,
- y: w.y,
- z: w.z
- }), b.setText(this.text + T + "m"), b.textNum = T, b.setDepth(a), this.checked, b.visible = this.showDistances && (h < t || this.closed) && this.points.length >= 2 && x > 0, this.enable || (b.visible = !1);
- var S = this.angleLabels[r],
- _ = this.getAngleBetweenLines(E, m, f),
- A = f.clone()
- .sub(m);
- A.multiplyScalar(.5), A = m.clone()
- .add(A)
- .sub(E)
- .normalize();
- var P = Math.min(E.distanceTo(m), E.distanceTo(f));
- P /= 9;
- var C = E.clone()
- .add(A.multiplyScalar(P));
- S.position.copy(C);
- u = c((_ * (180 / Math.PI))
- .toFixed(1)) + "°";
- S.setText(u), S.visible = this.showAngles && (h < t || this.closed) && this.points.length >= 3 && _ > 0, this.enable || (S.visible = !1)
- }
- } else {
- var E = this.points[0];
- this.spheres[0].position.copy(E)
- }
- }
- }
- a.prototype = Object.create(n.Object3D.prototype), Object.defineProperty(a.prototype, "showArea", {
- get: function() {
- return this._showArea
- },
- set: function(t) {
- this._showArea = t, this.update()
- }
- }), Object.defineProperty(a.prototype, "closed", {
- get: function() {
- return this._closed
- },
- set: function(t) {
- this._closed = t, this.update()
- }
- }), Object.defineProperty(a.prototype, "showDistances", {
- get: function() {
- return this._showDistances
- },
- set: function(t) {
- this._showDistances = t, this.update()
- }
- }), t.exports = a
- }, function(t, e, i) {
- var n = i(0),
- r = i(3);
- function o(t) {
- n.Object3D.call(this);
- var e = new n.Texture;
- e.minFilter = n.LinearFilter, e.magFilter = n.LinearFilter;
- var i = new n.SpriteMaterial({
- map: e,
- depthTest: !1,
- depthWrite: !0
- });
- this.material = i, this.sprite = new n.Sprite(i), this.sprite.name = "measure", this.add(this.sprite), this.borderThickness = 1, this.fontface = "PingFangSC-Medium,PingFang SC", this.borderColor = "rgba(0, 0, 0, 0)", this.backgroundColor = "rgba(0, 0, 0, 0.6)", this.textColor = "rgba(255, 255, 255, 1)", this.text = "", this.fontsize = r.isMobile() ? 20 : 16, this.setText(t)
- }
- o.prototype = new n.Object3D, o.prototype.setText = function(t) {
- this.text = t, this.update()
- }, o.prototype.setTextColor = function(t) {
- this.textColor = t, this.update()
- }, o.prototype.setBorderColor = function(t) {
- this.borderColor = t, this.update()
- }, o.prototype.setBackgroundColor = function(t) {
- this.backgroundColor = t, this.update()
- }, o.prototype.setDepth = function(t) {
- this.material.depthTest = !t
- }, o.prototype.update = function() {
- var t = document.createElement("canvas"),
- e = t.getContext("2d");
- e.font = this.fontsize + "px " + this.fontface, this.text = " " + this.text + " ";
- var i = e.measureText(this.text)
- .width + 20,
- r = this.fontsize + 14;
- e.canvas.width = i, e.canvas.height = r, e.font = this.fontsize + "px " + this.fontface, e.fillStyle = this.backgroundColor, e.strokeStyle = this.borderColor, e.lineWidth = this.borderThickness, this.roundRect(e, 0, 0, i, r, 3), e.fillStyle = this.textColor, e.fillText(this.text, 9, this.fontsize + 6);
- var o = new n.Texture(t);
- o.minFilter = n.LinearFilter, o.magFilter = n.LinearFilter, o.needsUpdate = !0, this.sprite.material.map = o, this.sprite.scale.set(.006 * i * .4, .006 * r * .4, 1)
- }, o.prototype.roundRect = function(t, e, i, n, r, o) {
- t.beginPath(), t.moveTo(e + o, i), t.lineTo(e + n - o, i), t.quadraticCurveTo(e + n, i, e + n, i + o), t.lineTo(e + n, i + r - o), t.quadraticCurveTo(e + n, i + r, e + n - o, i + r), t.lineTo(e + o, i + r), t.quadraticCurveTo(e, i + r, e, i + r - o), t.lineTo(e, i + o), t.quadraticCurveTo(e, i, e + o, i), t.closePath(), t.fill(), t.stroke(), t.closePath()
- }, t.exports = o
- }, function(t, e, i) {
- var n = i(0),
- r = i(9),
- o = i(13);
- function a(t) {
- this.player = t, this.sRender = t.sRender
- }
- a.prototype.showWireFrame = function(t) {
- var e;
- 0 === t && (e = this.player.model.chunks), 1 === t && (e = this.player.model.colliders), 2 === t && (e = this.panoMarkers), this.player.model.userData.totalVertices = 0, this.player.model.userData.totalFaces = 0;
- for (var i = {}, n = 0; n < e.length; ++n) {
- var r, o = e[n];
- this.removeWireFrame(o),
- function t() {
- r = Math.random(), i["_" + r] && t(), i["_" + r] = 1
- }(), this.addWireFrame(o, 16777215 * r * 10)
- }
- }, a.prototype.hideWireFrame = function() {
- for (var t = this.player.model.chunks, e = this.player.model.colliders, i = t.concat(e), n = 0; n < i.length; ++n) {
- var r = i[n];
- this.removeWireFrame(r)
- }
- }, a.prototype.addWireFrame = function(t, e) {
- t.userData.line_segments && this.removeWireFrame(t);
- var i = t.geometry,
- r = new n.Geometry;
- r.fromBufferGeometry(i)
- .mergeVertices(), this.player.model.userData.totalVertices += r.vertices.length, this.player.model.userData.totalFaces += r.faces.length;
- var o = new n.WireframeGeometry(t.geometry),
- a = new n.LineSegments(o);
- a.material.color.setHex(e), a.rotation.copy(t.rotation), a.position.copy(t.position), t.userData.line_segments = a, t.add(a)
- }, a.prototype.removeWireFrame = function(t) {
- if (t.userData.line_segments) {
- var e = t.userData.line_segments;
- t.userData.line_segments = null, e.geometry.dispose(), e.material.dispose(), t.remove(e)
- }
- }, a.prototype.showVertexNormals = function(t) {
- for (var e = 0 === t ? this.player.model.chunks : this.player.model.colliders, i = 0, r = e.length; i < r; ++i) {
- var o = new n.VertexNormalsHelper(e[i], .25);
- e[i].add(o)
- }
- }, a.prototype.drawLine = function(t) {
- var e = new n.Vector3(t.x, t.y, t.z),
- i = o.drawLine(this.player.model.position, e);
- this.sRender.scene.add(i)
- }, a.prototype.drawFatLine = function(t) {
- var e = new n.LineGeometry;
- e.setPositions([0, 0, 0, t.x, t.y, t.z]);
- var i = new n.LineMaterial({
- color: 16711680,
- linewidth: 2,
- resolution: new n.Vector2(this.sRender.renderer.domElement.width, this.sRender.renderer.domElement.height)
- }),
- r = new n.Line2(e, i);
- this.sRender.scene.add(r)
- }, a.prototype.udpateShader = function(t, e) {
- t = new n.Vector3(t.x, t.y, t.z), this.player.model.chunks.forEach((function(i) {
- i.material.uniforms.centerT && i.material.uniforms.centerT.value.copy(t.normalize()), i.material.uniforms.virtualCameraAngle && (i.material.uniforms.virtualCameraAngle.value = n.Math.degToRad(e))
- }))
- }, a.prototype.hideChunks = function() {
- for (var t = this.player.model.chunks, e = 0, i = t.length; e < i; ++e) t[e].visible = !1
- }, a.prototype.showChunks = function() {
- for (var t = this.player.model.chunks, e = 0, i = t.length; e < i; ++e) t[e].visible = !0
- }, a.prototype.showColliders = function(t) {
- for (var e = this.player.model.colliders, i = 0, n = e.length; i < n; ++i) e[i].material.color.setHex(t), e[i].material.visible = !0
- }, a.prototype.hideColliders = function() {
- for (var t = this.player.model.colliders, e = 0, i = t.length; e < i; ++e) t[e].material.visible = !1
- }, a.prototype.getFrustum = function() {
- var t = new n.Frustum;
- return t.setFromMatrix((new n.Matrix4)
- .multiplyMatrices(this.sRender.camera.projectionMatrix, this.sRender.camera.matrixWorldInverse)), t
- }, a.prototype.switchDirLight = function(t) {
- if (t) {
- var e = new n.DirectionalLight(16777215);
- e.position.set(0, 5, 0), this.sRender.scene.add(e), this.sRender.scene.userData.dir_light = e
- } else this.sRender.scene.userData.dir_light && this.sRender.scene.remove(this.sRender.scene.userData.dir_light)
- }, a.prototype.hideHumanModelOfOutScreen = function() {
- for (var t = this.player.humanModelControls.putModelsOfHuman, e = new n.Vector3, i = !1, a = 0, s = t.length; a < s; ++a) {
- var l = t[a],
- u = this.sRender.scene.userData["line" + a];
- u && (u.geometry && u.geometry.dispose(), u.material && u.material.dispose(), this.sRender.scene.remove(u)), u = o.drawLine(e, l.position, 255), this.sRender.scene.add(u), i = r.computeWorldPositionOutCamera(l.position, this.sRender.camera), l.visible = !i
- }
- }, t.exports = a
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(5),
- o = i(3),
- a = (i(9), i(119)),
- s = i(121),
- l = (i(123), i(125)),
- u = i(127),
- h = i(129),
- c = i(69);
- function d(t, e, i, r, o, a) {
- const s = new n.Group,
- l = new n.MeshBasicMaterial({
- color: e
- }),
- u = new n.CylinderGeometry(r, r, i, 32),
- h = new n.Mesh(u, l);
- h.position.y = i / 2;
- const c = new n.MeshBasicMaterial({
- color: e
- }),
- d = new n.ConeGeometry(2 * r, 3 * r, 32),
- p = new n.Mesh(d, c);
- p.position.y = i;
- const f = document.createElement("canvas");
- f.width = 32, f.height = 32;
- const m = f.getContext("2d");
- m.font = o + "px Arial", m.fillStyle = e.getStyle(), m.fillText(t, f.width / 2, f.height / 2);
- const g = new n.CanvasTexture(f),
- v = new n.SpriteMaterial({
- map: g
- }),
- y = new n.Sprite(v);
- return y.position.y = i + 4 * r, y.scale.set(.2, .2, .2), s.add(h), s.add(p), s.add(y), s
- }
- function p() {
- var t = new n.ConeGeometry(.2, .5, 4),
- e = new n.Group,
- i = new n.EdgesGeometry(t),
- r = new n.MeshBasicMaterial({
- color: 16777215,
- transparent: !0,
- opacity: .3
- }),
- o = new n.Mesh(t, r),
- a = new n.LineSegments(i, new n.LineBasicMaterial({
- color: 65280,
- linewidth: 2
- }));
- o.rotation.x = Math.PI, a.rotation.x = Math.PI;
- var s = d("X", new n.Color(16711680), .2, .02, 12);
- s.rotation.z = -Math.PI / 2;
- var l = d("Y", new n.Color(65280), .2, .02, 12),
- u = d("Z", new n.Color(255), .2, .02, 12);
- u.rotation.x = Math.PI / 2;
- var h = new n.Group;
- return h.add(s), h.add(l), h.add(u), e.add(o), e.add(a), e.add(h), e.name = "probemodel", e
- }
- function f(t) {
- this.player = t, this.sRender = t.sRender, this.virtualCameraFovControls = t.virtualCameraFovControls, this.humanModelAnimationControls = t.humanModelAnimationControls, this.humanModelControls = t.humanModelControls, this.weaponModelControls = t.weaponModelControls, this.measuringToolControls = t.measuringToolControls, this.postilControls = t.postilControls, this.isEscPutModel = !1, this._isPuttingModel = !1, this.KEYS = {
- k_27: "ESC",
- k_46: "DEL"
- }, this.MOUSE = {
- button: {
- _0: "LEFT_BUTTON",
- _2: "RIGHT_BUTTON"
- }
- }, this.execState = {
- intoDollhouse: {
- times: 0
- },
- intoPanorama: {
- times: 0
- },
- intoTransitioning: {
- times: 0
- }
- }, this.recordCameraPositionChangeList = [], this.recordCameraRotationChangeList = [], this.defineProperty(), this.initStateEngine(), this.initEmitMessage(), G.conf.modelplaced && o.getQueryString("isLocal") || (this.humanModelControls.canbeSelect = !1, this.weaponModelControls.canbeSelect = !1, this.virtualCameraFovControls.canbeSelect = !1), G.conf.annotation && o.getQueryString("isLocal") || (this.postilControls.canbeSelect = !1)
- }
- f.prototype.defineProperty = function() {
- Object.defineProperty(this, "isPuttingModel", {
- get: function() {
- return this._isPuttingModel
- },
- set: function(t) {
- this._isPuttingModel = t
- }
- })
- }, f.prototype.checkPlayerMode = function(t) {
- switch (t) {
- case "panorama":
- this.intoPanorama();
- break;
- case "dollhouse":
- this.intoDollhouse();
- break;
- case "floorplan":
- break;
- case "transitioning":
- this.intoTransitioning()
- }
- }, f.prototype.checkCameraChangeList = function() {
- var t = {},
- e = {};
- if (5 === this.recordCameraPositionChangeList.length && 5 === this.recordCameraRotationChangeList.length) {
- var i = 0,
- n = 0,
- r = this.recordCameraPositionChangeList[0];
- t["k_" + r.x.toFixed(3) + "_" + r.y.toFixed(3) + "_" + r.z.toFixed(3)] = 1;
- for (var o = 1; o < 5; ++o) {
- var a = this.recordCameraPositionChangeList[o];
- 1 !== t["k_" + a.x.toFixed(3) + "_" + a.y.toFixed(3) + "_" + a.z.toFixed(3)] && (i = 1)
- }
- var s = this.recordCameraRotationChangeList[0];
- e["k_" + s.x.toFixed(3) + "_" + s.y.toFixed(3) + "_" + s.z.toFixed(3)] = 1;
- for (o = 1; o < 5; ++o) {
- var l = this.recordCameraRotationChangeList[o];
- 1 !== e["k_" + l.x.toFixed(3) + "_" + l.y.toFixed(3) + "_" + l.z.toFixed(3)] && (n = 1)
- }
- this.recordCameraPositionChangeList = [], this.recordCameraRotationChangeList = [], 1 === i && this.onCameraPositionMove(), 0 === i && this.onCameraPositionMoveStop(), 1 === n && this.onCameraRotationMove(), 0 === n && this.onCameraRotationMoveStop()
- }
- }, f.prototype.checkPuttingState = function() {}, f.prototype.initStateEngine = function() {
- this.MouseStateMachine = {
- LEFT_BUTTON: {
- state: !1,
- status: {
- mousedown: {
- state: !1,
- callback: this.handleMouseLeftButtonDown.bind(this)
- },
- mouseup: {
- state: !1,
- callback: this.handleMouseLeftButtonUp.bind(this)
- }
- }
- },
- RIGHT_BUTTON: {
- state: !1,
- status: {
- mousedown: {
- state: !1,
- callback: this.handleMouseRightButtonDown.bind(this)
- },
- mouseup: {
- state: !1,
- callback: this.handleMouseRightButtonUp.bind(this)
- }
- }
- },
- MOVE: {
- state: !1,
- callback: this.handleMouseMove.bind(this)
- }
- }, this.KeysStateMachine = {
- ESC: {
- state: !1,
- status: {
- keyup: {
- state: !1,
- callback: this.handleKeyOfESC.bind(this)
- },
- keydown: {
- state: !1,
- callback: function() {}
- }
- }
- }
- }
- }, f.prototype.initEmitMessage = function() {
- this.humanModelControls.emitter.on("human-follow-mouse", this._emitHumanFollowMouse.bind(this)), this.humanModelControls.emitter.on("human-put-over", this._emitHumanPutOver.bind(this)), this.humanModelControls.emitter.on("human-put-cancel", this._emitHumanPutCancel.bind(this)), this.humanModelControls.emitter.on("human-handle-choosed", this._emitHumanHandleChoosed.bind(this)), this.humanModelControls.emitter.on("human-unchoosed", this._emitHumanUnChoosed.bind(this)), this.humanModelControls.emitter.on("human-mouse-in", this._emitHumanMouseIn.bind(this)), this.humanModelControls.emitter.on("human-mouse-out", this._emitHumanMouseOut.bind(this)), this.weaponModelControls.emitter.on("weapon-follow-mouse", this._emitWeaponFollowMouse.bind(this)), this.weaponModelControls.emitter.on("weapon-put-over", this._emitWeaponPutOver.bind(this)), this.weaponModelControls.emitter.on("weapon-put-cancel", this._emitWeaponPutCancel.bind(this)), this.weaponModelControls.emitter.on("weapon-handle-choosed", this._emitWeaponHandleChoosed.bind(this)), this.weaponModelControls.emitter.on("weapon-unchoosed", this._emitWeaponUnChoosed.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-follow-mouse", this._emitVirtualCameraFollowMouse.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-follow-mouse-over", this._emitVirtualCameraFollowMouseOver.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-put-cancel", this._emitVirtualCameraPutCancel.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-handle-choosed", this._emitVirtualCameraHandleChoosed.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-unchoosed", this._emitVirtualCameraUnChoosed.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-mouse-in", this._emitVirtualCameraMouseIn.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-mouse-out", this._emitVirtualCameraMouseOut.bind(this)), this.postilControls.emitter.on("postil-follow-mouse", this._emitPostilFollowMouse.bind(this)), this.postilControls.emitter.on("postil-put-over", this._emitPostilPutOver.bind(this)), this.postilControls.emitter.on("postil-put-cancel", this._emitPostilPutCancel.bind(this))
- }, f.prototype.intoPanorama = function() {
- 1 !== this.execState.intoPanorama.times && (this.execState.intoTransitioning.times = 0, this.execState.intoPanorama.times += 1, this.player.emit("viewModePanorama"), this.humanModelControls.canbeUsed && ((G.conf.modelplaced || o.getQueryString("isLocal")) && (this.humanModelControls.canbeSelect = !0), this.humanModelControls.onIntoPanorama()), this.weaponModelControls.canbeUsed && ((G.conf.modelplaced || o.getQueryString("isLocal")) && (this.weaponModelControls._canbeSelect = !0), this.weaponModelControls.onIntoPanorama()), this.postilControls.canbeUsed && ((G.conf.annotation || o.getQueryString("isLocal")) && (this.postilControls.canbeSelect = !0), this.postilControls.onIntoPanorama()), this.virtualCameraFovControls.canbeUsed && ((G.conf.modelplaced || o.getQueryString("isLocal")) && (this.virtualCameraFovControls._canbeSelect = !0), this.virtualCameraFovControls.onIntoPanorama()), this.postilControls.canbeUsed && this.postilControls.onIntoPanorama())
- }, f.prototype.intoTransitioning = function() {
- this.execState.intoPanorama.times = 0, this.execState.intoDollhouse.times = 0, this.execState.intoTransitioning.times += 1, this.player.emit("viewModeTransitioning"), this.humanModelControls.onIntoTransitioning(), this.virtualCameraFovControls.onIntoTransitioning(), this.weaponModelControls.onIntoTransitioning()
- }, f.prototype.intoDollhouse = function() {
- 1 !== this.execState.intoDollhouse.times && (this.execState.intoTransitioning.times = 0, this.execState.intoDollhouse.times += 1, this.player.emit("view-mode-dollhouse"), this.humanModelControls.onIntoDollhouse(), this.virtualCameraFovControls.onIntoDollhouse())
- }, f.prototype.handleKeyOfESC = function() {
- this.isEscPutModel = !1, this.humanModelControls.canbeUsed && this.humanModelControls.handleKeyOfEsc(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleKeyOfEsc(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleKeyOfEsc(), this.postilControls.canbeUsed && this.postilControls.handleKeyOfEsc();
- var t = this.getChoosedModel();
- !t || t.userData.follow_mouse ? t || this.isEscPutModel || this.player.emit("quit-put-mode") : this.destroyChoosedModelControlState(t)
- }, f.prototype.handleMouseMove = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseMove(event), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseMove(event), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseMove(event), this.postilControls.canbeUsed && this.postilControls.handleMouseMove(event), this.humanModelControls.HUMANMODEL && (this.humanModelControls.HUMANMODEL.userData.follow_mouse ? (this.weaponModelControls._canbeSelect = !1, this.virtualCameraFovControls._canbeSelect = !1) : (this.weaponModelControls._canbeSelect = !0, this.virtualCameraFovControls._canbeSelect = !0)), this.weaponModelControls.CONTROLMODEL && (this.weaponModelControls.CONTROLMODEL.userData.follow_mouse ? (this.humanModelControls.canbeSelect = !1, this.virtualCameraFovControls._canbeSelect = !1) : (this.humanModelControls.canbeSelect = !0, this.virtualCameraFovControls._canbeSelect = !0)), this.virtualCameraFovControls.VIRTUAL_CAMERA && (this.virtualCameraFovControls.VIRTUAL_CAMERA.userData.follow_mouse ? (this.humanModelControls.canbeSelect = !1, this.weaponModelControls._canbeSelect = !1) : (this.humanModelControls.canbeSelect = !0, this.weaponModelControls._canbeSelect = !0))
- }, f.prototype.handleMouseLeftButtonDown = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseLeftButtonDown(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseLeftButtonDown(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseLeftButtonDown(), this.postilControls.canbeUsed && this.postilControls.handleMouseLeftButtonDown()
- }, f.prototype.handleMouseLeftButtonUp = function() {
- m && (m = !1, this.onHandleControlPanoramaMoveStopNoPan()), this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseLeftButtonUp(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseLeftButtonUp(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseLeftButtonUp(), this.postilControls.canbeUsed && this.postilControls.handleMouseLeftButtonUp()
- }, f.prototype.handleMouseRightButtonDown = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseRightButtonDown(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseRightButtonDown(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseRightButtonDown(), this.postilControls.canbeUsed && this.postilControls.handleMouseRightButtonDown()
- }, f.prototype.handleMouseRightButtonUp = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseRightButtonUp(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseRightButtonUp(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseRightButtonUp(), this.postilControls.canbeUsed && this.postilControls.handleMouseRightButtonUp()
- }, f.prototype.loadHumanModel = function(t) {
- if (!this._isPuttingModel && !this.player.inMeasureMode) {
- var e = this;
- if (10 !== t) {
- var i = "model/human/model_" + t + ".fbx";
- this.player.emit("showLoaddingOfLoadPutModel"), a.load(i)
- .then((function(i) {
- var n = new l(i, t);
- n.init(), n.initMatcap()
- .then((function(i) {
- var n = i.userData.setting_item;
- 3 === t && (n.modelName = "成年男性"), 4 === t && (n.modelName = "成年女性"), 5 === t && (n.modelName = "男性警察"), 6 === t && (n.modelName = "男性警察"), 7 === t && (n.modelName = "青年女性"), 8 === t && (n.modelName = "青年男性"), e.addHumanModel(i)
- }))
- }))
- } else {
- i = "model/human/model_" + t + ".glb";
- this.player.emit("showLoaddingOfLoadPutModel"), s.load(i)
- .then((function(t) {
- var i = new n.Group;
- i.add(t.scene.children[0]), i.animations = t.animations;
- var r = new n.AxesHelper(.4);
- i.add(r), i.scale.set(.8, .8, .8), i.userData.follow_mouse = !0, e.sRender.scene.add(i), e.humanModelAnimationControls.init(i), e.player.emit("hideLoaddingOfLoadPutModel")
- }))
- }
- }
- }, f.prototype.loadWeaponModel = function(t) {
- if (!this._isPuttingModel && !this.player.inMeasureMode) {
- this.player.emit("showLoaddingOfLoadPutModel");
- var e = p();
- new u(e, t)
- .init(), e.userData.setting_item.modelName = "探针", this.addWeaponModel(e)
- }
- }, f.prototype.loadPostilModel = function(t) {
- if (!this._isPuttingModel && !this.player.inMeasureMode) {
- var e = this,
- i = new c(t)
- .init();
- if (i) {
- i.userData.follow_mouse = !0, this.postilControls.POSTIL && this.postilControls.destroyPostilChoosedState(), this.postilControls.POSTIL = i;
- var n = setTimeout((function() {
- e.sRender.scene.add(i), clearTimeout(n)
- }), 300)
- }
- }
- }, f.prototype.loadVirtualCamera = function(t) {
- if (!this._isPuttingModel && !this.player.inMeasureMode) {
- var e = (new h)
- .init();
- this.addVirtualCamera(e)
- }
- }, f.prototype.loadModelList = function(t) {
- this.player.isLoadedSaveModel = !0;
- var e = this,
- i = [],
- n = [],
- r = [],
- o = [],
- s = {};
- for (var c in t) {
- "human" !== (f = t[c])
- .type && "weapon" !== f.type || (o.push(f.timestamp), s["k_" + f.timestamp] = f), "camera" === f.type && r.push(f)
- }
- o.sort((function(t, e) {
- return t - e
- }));
- for (var d = 0; d < o.length; ++d) {
- var f = s["k_" + o[d]];
- n.push(f)
- }
- function m() {
- for (var t = [], i = 0, n = r.length; i < n; ++i) t.push(i + 1);
- var o = [],
- a = null;
- ! function i(n) {
- if (!n) return o[o.length - 1], void e.player.emit("hideLoaddingOfLoadPutModel");
- var s, l, u;
- s = n, l = function(e) {
- return o.push(e), i(t.shift())
- }, (u = (new h)
- .init(r[s - 1]))
- .userData.is_save = !0, e.addVirtualCameraOfSave(u), null === a && (a = setTimeout((function() {
- e.virtualCameraFovControls.addAxleWire(u), e.virtualCameraFovControls.computeCrash(u, l), clearTimeout(a), a = null
- }), 0))
- }(t.shift())
- }
- 0 < n.length ? (e.player.emit("showLoaddingOfLoadPutModel"), function t() {
- var o = n[i.length];
- "human" === o.type && function(t, o, s) {
- o = "model/human/model_" + t.mid + ".fbx", a.load(o)
- .then((function(o) {
- t.uuid = o.uuid, o.userData.setting_item = t, o.userData.is_save = !0;
- var a = new l(o, t.mid);
- a.init(), a.initMatcap()
- .then((function(t) {
- i.push(t.uuid), e.addHumanModelOfSave(t), i.length !== n.length ? s() : (e.player.emit("hideLoaddingOfLoadPutModel"), e.player.emit("putModelListLoadingIsOver"), 0 < r.length && (e.player.emit("showLoaddingOfLoadPutModel"), setTimeout((function() {
- m()
- }), 200)))
- }))
- }))
- }(o, "", t), "weapon" == o.type && function(t, o, a) {
- "model/weapon/model_" + t.mid + ".obj", t.uuid = s.uuid, s.userData.setting_item = t;
- var s = p();
- new u(s, t.mid)
- .init(), s.userData.is_save = !0, i.push(s.uuid), e.addWeaponModelOfSave(s), i.length !== n.length ? a() : (e.player.emit("hideLoaddingOfLoadPutModel"), e.player.emit("putModelListLoadingIsOver"), 0 < r.length && (e.player.emit("showLoaddingOfLoadPutModel"), setTimeout((function() {
- m()
- }), 200)))
- }(o, 0, t)
- }()) : (e.player.emit("showLoaddingOfLoadPutModel"), setTimeout((function() {
- m()
- }), 200))
- }, f.prototype.getChoosedModel = function() {
- return this.humanModelControls.HUMANMODEL || this.weaponModelControls.CONTROLMODEL || this.virtualCameraFovControls.VIRTUAL_CAMERA
- }, f.prototype.addHumanModel = function(t) {
- var e = this.getChoosedModel();
- e && this.destroyChoosedModelControlState(e);
- var i = this;
- t.userData.follow_mouse = !0, this.humanModelControls.HUMANMODEL = t, this.humanModelControls.initSkeletonBox(t);
- var n = setTimeout((function() {
- i.sRender.scene.add(t), i.player.emit("hideLoaddingOfLoadPutModel"), clearTimeout(n)
- }), 300)
- }, f.prototype.addWeaponModel = function(t) {
- var e = this.getChoosedModel();
- e && this.destroyChoosedModelControlState(e);
- var i = this;
- t.userData.follow_mouse = !0, this.weaponModelControls.initBoundingBox(t), this.weaponModelControls.CONTROLMODEL = t;
- var n = setTimeout((function() {
- i.sRender.scene.add(t), i.player.emit("hideLoaddingOfLoadPutModel"), clearTimeout(n)
- }), 300)
- }, f.prototype.addVirtualCamera = function(t) {
- var e = this.getChoosedModel();
- e && this.destroyChoosedModelControlState(e), t.userData.follow_mouse = !0;
- var i = this.virtualCameraFovControls.VIRTUAL_CAMERA;
- i && (this.virtualCameraFovControls.destroyBoxHelper(i), this.virtualCameraFovControls.destroyControl(i)), this.virtualCameraFovControls.VIRTUAL_CAMERA = t, this.virtualCameraFovControls.initBoxHelper(t), this.sRender.scene.add(t)
- }, f.prototype.addHumanModelOfSave = function(t) {
- var e = t.userData.setting_item;
- this.sRender.scene.add(t), this.player.emit("addModelListItem", e), this.humanModelControls.putModelsOfHuman.push(t), this.humanModelControls.putModelsOfHumanKV[t.uuid] = t
- }, f.prototype.addWeaponModelOfSave = function(t) {
- this.sRender.scene.add(t), this.weaponModelControls.WEAPONS_SCENE.push(t), this.weaponModelControls.WEAPONS_KV[t.uuid] = t, this.player.emit("addModelListItem", t.userData.setting_item)
- }, f.prototype.addVirtualCameraOfSave = function(t) {
- this.sRender.scene.add(t), this.virtualCameraFovControls.putModels.push(t), this.virtualCameraFovControls.putModelsOfKV[t.uuid] = t, this.player.emit("addModelListItem", t.userData.setting_item)
- }, f.prototype.savePutModels = function() {
- for (var t = {}, e = this.humanModelControls.putModelsOfHuman, i = this.weaponModelControls.WEAPONS_SCENE, n = this.virtualCameraFovControls.putModels, r = e.concat(i)
- .concat(n), a = 0, s = r.length; a < s; ++a) {
- var l = r[a].userData.setting_item;
- t[l.uuid] = l
- }
- if (o.getQueryString("isLocal")) {
- var u = JSON.stringify(t);
- localStorage.setItem("SETTINGS_DATA_PUTMODEL", u)
- }
- return JSON.stringify(t)
- }, f.prototype.showModelsList = function(t) {
- this.player.isShowModelList = !0, this.player.isLoadedSaveModel ? (this.humanModelControls.canbeUsed && this.humanModelControls.handleSwitchSaveModelVisible(!0), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleSwitchSaveModelVisible(!0), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleSwitchSaveCameraVisible(!0), this.player.emit("showModelListPanel")) : this.loadModelList(t)
- }, f.prototype.hideModelsList = function() {
- this.player.isShowModelList = !1, this.humanModelControls.canbeUsed && this.humanModelControls.handleSwitchSaveModelVisible(!1), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleSwitchSaveModelVisible(!1), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleSwitchSaveCameraVisible(!1), this.player.emit("hideModelListPanel")
- }, f.prototype.switchPutModelCanbeSelect = function(t) {
- this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = t), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = t), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = t)
- }, f.prototype.switchMouseWheelLocked = function(t) {
- this.player.controls && this.player.controls[r.PANORAMA] && (this.player.controls[r.PANORAMA].lockedMouseWheel = t, this.player.controls[r.DOLLHOUSE].lockedMouseWheel = t), this.switchKeyMoveDisabled(t), this.switchKeyRotateDisabled(t)
- }, f.prototype.switchKeyMoveDisabled = function(t) {
- this.player.controls && this.player.controls[r.PANORAMA] && (this.player.controls[r.PANORAMA].disableKeyMove = t)
- }, f.prototype.switchKeyRotateDisabled = function(t) {
- this.player.controls && this.player.controls[r.PANORAMA] && (this.player.controls[r.PANORAMA].disableKeyRotate = t)
- }, f.prototype.destroyChoosedModelControlState = function(t) {
- switch (t.userData.setting_item.type) {
- case "human":
- this.humanModelControls.destroyInvalidModelControl(t);
- break;
- case "weapon":
- this.weaponModelControls.destroyModelChoosedState(t);
- break;
- case "camera":
- this.virtualCameraFovControls.destroyModelControlState(t)
- }
- }, f.prototype.onHandleControlPanoramaMove = function() {
- "panorama" === this.player.mode && (this.player.emit("handle-control-panorama-move"), this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlPanoramaMove(), this.weaponModelControls.canbeUsed && this.weaponModelControls.onHandleControlPanoramaMove(), this.measuringToolControls.canbeUsed && this.measuringToolControls.onHandleControlPanoramaMove(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMove())
- }, f.prototype.onHandleDollhouseMove = function() {
- this.player.emit("handle-control-dollhouse-move"), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlDollhouseMove(), this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlDollhouseMove()
- }, f.prototype.onHandleControlTtagsMove = function() {
- "panorama" === this.player.mode && (this.humanModelControls.onHandleControlTtagsMove(), this.weaponModelControls.onHandleControlTtagsMove(), this.virtualCameraFovControls.onHandleControlTtagsMove())
- }, f.prototype.onHandleControlPanoramaMoveStop = function() {
- "panorama" === this.player.mode && (this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlPanoramaMoveStop(), this.weaponModelControls.canbeUsed && this.weaponModelControls.onHandleControlPanoramaMoveStop(), this.measuringToolControls.canbeUsed && this.measuringToolControls.onHandleControlPanoramaMoveStop(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMoveStop())
- }, f.prototype.onHandleControlPanoramaMoveStopNoPan = function() {
- this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMoveStopNoPan()
- }, f.prototype.onHandleDollhouseMoveStop = function() {
- this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlDollhouseMoveStop(), this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlDollhouseMoveStop()
- };
- var m = !1;
- f.prototype.onPlayerHandleControlPanoramaMove = function() {
- m = !0, this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlPanoramaMove(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMove()
- }, f.prototype.onFlyEnd = function() {
- "panorama" === this.player.mode && (this.humanModelControls.onFlyEnd(), this.measuringToolControls.onFlyEnd(), this.virtualCameraFovControls.onFlyEnd())
- }, f.prototype.onPlayerMouseMove = function(t) {
- this.MouseStateMachine.MOVE.state = !0, this.MouseStateMachine.MOVE.callback()
- }, f.prototype.onPlayerMouseDown = function(t) {
- var e = t.button,
- i = this.MOUSE.button["_" + e];
- i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !0, this.MouseStateMachine[i].status.mouseup.state = !1, this.MouseStateMachine[i].status.mousedown.callback()), this.MouseStateMachine.MOVE.state = !1
- }, f.prototype.onPlayerMouseUp = function(t) {
- var e = t.button,
- i = this.MOUSE.button["_" + e];
- i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !1, this.MouseStateMachine[i].status.mouseup.state = !0, this.MouseStateMachine[i].status.mouseup.callback()), this.MouseStateMachine.MOVE.state = !1
- }, f.prototype.onPlayerKeyUp = function(t) {
- var e = t.keyCode ? t.keyCode : t.which;
- this.KEYS["k_" + e] && (this.KeysStateMachine[this.KEYS["k_" + e]].state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.callback())
- }, f.prototype.onPlayerKeyUpPlayerContainer = function(t) {
- var e = t.keyCode ? t.keyCode : t.which;
- this.KEYS["k_" + e] && (this.KeysStateMachine[this.KEYS["k_" + e]].state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.callback())
- };
- var g = !1;
- f.prototype.onCameraPositionMove = function() {
- g = !1, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraPositionMove()
- }, f.prototype.onCameraPositionMoveStop = function() {
- g || (g = !0, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraPositionMoveStop())
- };
- var v = !1;
- f.prototype.onCameraRotationMove = function() {
- v = !1, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraRotationMove()
- }, f.prototype.onCameraRotationMoveStop = function() {
- v || (v = !0, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraRotationMoveStop())
- }, f.prototype._emitHumanFollowMouse = function() {
- this.isEscPutModel = !1, this._isPuttingModel = !0, this.switchPutModelCanbeSelect(!1), this.player.emit("hide-right-tools"), this.player.emit("put-model-follow-mouse"), this.switchMouseWheelLocked(!0)
- }, f.prototype._emitHumanPutOver = function() {
- this.isEscPutModel = !1, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-over"), this.switchMouseWheelLocked(!1)
- }, f.prototype._emitHumanPutCancel = function() {
- this.isEscPutModel = !0, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-cancel"), this.switchMouseWheelLocked(!1)
- }, f.prototype._emitHumanHandleChoosed = function() {
- this.switchMouseWheelLocked(!0)
- }, f.prototype._emitHumanUnChoosed = function() {
- this.switchMouseWheelLocked(!1)
- }, f.prototype._emitWeaponFollowMouse = function() {
- this.isEscPutModel = !1, this._isPuttingModel = !0, this.switchPutModelCanbeSelect(!1), this.player.emit("hide-right-tools"), this.player.emit("put-model-follow-mouse"), this.switchMouseWheelLocked(!0)
- }, f.prototype._emitWeaponPutOver = function() {
- this.isEscPutModel = !1, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-over"), this.switchMouseWheelLocked(!1)
- }, f.prototype._emitWeaponPutCancel = function() {
- this.isEscPutModel = !0, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-cancel"), this.switchMouseWheelLocked(!1)
- }, f.prototype._emitWeaponHandleChoosed = function() {
- this.switchMouseWheelLocked(!0)
- }, f.prototype._emitWeaponUnChoosed = function() {
- this.switchMouseWheelLocked(!1)
- }, f.prototype._emitVirtualCameraFollowMouse = function() {
- this.isEscPutModel = !1, this._isPuttingModel = !0, this.switchPutModelCanbeSelect(!1), this.player.emit("hide-right-tools"), this.player.emit("put-model-follow-mouse"), this.switchMouseWheelLocked(!0)
- }, f.prototype._emitVirtualCameraFollowMouseOver = function() {
- this.isEscPutModel = !1, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-over"), this.switchMouseWheelLocked(!1)
- }, f.prototype._emitVirtualCameraPutCancel = function() {
- this.isEscPutModel = !0, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-cancel"), this.switchMouseWheelLocked(!1)
- }, f.prototype._emitVirtualCameraHandleChoosed = function() {
- this.switchMouseWheelLocked(!0)
- }, f.prototype._emitVirtualCameraUnChoosed = function() {
- this.switchMouseWheelLocked(!1)
- }, f.prototype._emitPostilFollowMouse = function() {
- this._isPuttingModel = !0, this.player.emit("put-model-follow-mouse")
- }, f.prototype._emitPostilPutOver = function() {
- this._isPuttingModel = !1, this.player.emit("put-model-follow-mouse-over")
- }, f.prototype._emitPostilPutCancel = function() {
- this._isPuttingModel = !1, this.player.emit("put-model-follow-mouse-cancel")
- }, f.prototype._emitVirtualCameraMouseIn = function() {
- this.switchMouseWheelLocked(!0)
- }, f.prototype._emitVirtualCameraMouseOut = function() {
- this.switchMouseWheelLocked(!1)
- }, f.prototype._emitHumanMouseIn = function() {
- this.switchMouseWheelLocked(!0)
- }, f.prototype._emitHumanMouseOut = function() {
- this.switchMouseWheelLocked(!1)
- }, f.prototype.updateCameraChangeList = function() {
- var t = this.sRender.camera.position.clone(),
- e = this.sRender.camera.rotation.clone();
- this.recordCameraPositionChangeList.push(t), this.recordCameraRotationChangeList.push(e), this.checkCameraChangeList()
- };
- f.prototype.update = function(t) {
- this.updateCameraChangeList(), this.virtualCameraFovControls.update(t), this.humanModelAnimationControls.update(t), this.humanModelControls.update(t), this.weaponModelControls.update(t), this.measuringToolControls.update(t), this.postilControls.update(t), this.checkPlayerMode(this.player.mode)
- }, t.exports = f
- }, function(t, e, i) {
- "use strict";
- i(120);
- var n = i(0);
- function r() {}
- r.prototype.load = function(t) {
- var e = new n.FBXLoaderOfMeshMatcapMaterial;
- return new Promise((function(i, n) {
- e.load(t, (function(t) {
- t ? i(t) : n("FBXLoader Failed")
- }))
- }))
- }, t.exports = new r
- }, function(t, e, i) {
- var n = i(0);
- n.FBXLoaderOfMeshMatcapMaterial = function() {
- var t, e, i;
- function r(t) {
- this.manager = void 0 !== t ? t : n.DefaultLoadingManager
- }
- function o(t) {
- this.textureLoader = t
- }
- function a() {}
- function s() {}
- function l() {}
- function u() {}
- function h(t, e) {
- this.dv = new DataView(t), this.offset = 0, this.littleEndian = void 0 === e || e
- }
- function c() {}
- function d(t) {
- var e = t.match(/FBXVersion: (\d+)/);
- if (e) return parseInt(e[1]);
- throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")
- }
- function p(t) {
- return t / 46186158e3
- }
- r.prototype = {
- constructor: r,
- crossOrigin: "anonymous",
- load: function(t, e, i, r) {
- var o = this,
- a = void 0 === o.path ? n.LoaderUtils.extractUrlBase(t) : o.path,
- s = new n.FileLoader(this.manager);
- s.setPath(o.path), s.setResponseType("arraybuffer"), s.load(t, (function(i) {
- try {
- e(o.parse(i, a))
- } catch (e) {
- setTimeout((function() {
- r && r(e), o.manager.itemError(t)
- }), 0)
- }
- }), i, r)
- },
- setPath: function(t) {
- return this.path = t, this
- },
- setResourcePath: function(t) {
- return this.resourcePath = t, this
- },
- setCrossOrigin: function(t) {
- return this.crossOrigin = t, this
- },
- parse: function(e, i) {
- if (s = "Kaydara FBX Binary \0", (a = e)
- .byteLength >= s.length && s === x(a, 0, s.length)) t = (new u)
- .parse(e);
- else {
- var r = x(e);
- if (! function(t) {
- var e = ["K", "a", "y", "d", "a", "r", "a", "\\", "F", "B", "X", "\\", "B", "i", "n", "a", "r", "y", "\\", "\\"],
- i = 0;
- for (var n = 0; n < e.length; ++n) {
- if ((o = void 0, o = t[(r = 1) - 1], t = t.slice(i + r), i++, o) === e[n]) return !1
- }
- var r, o;
- return !0
- }(r)) throw new Error("THREE.FBXLoader: Unknown format.");
- if (d(r) < 7e3) throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + d(r));
- t = (new l)
- .parse(r)
- }
- var a, s;
- return new o(new n.TextureLoader(this.manager)
- .setPath(this.resourcePath || i)
- .setCrossOrigin(this.crossOrigin))
- .parse(t)
- }
- }, o.prototype = {
- constructor: o,
- parse: function() {
- e = this.parseConnections();
- var t = this.parseImages(),
- n = this.parseTextures(t),
- r = this.parseMaterials(n),
- o = this.parseDeformers(),
- s = (new a)
- .parse(o);
- return this.parseScene(o, s, r), i
- },
- parseConnections: function() {
- var e = new Map;
- "Connections" in t && t.Connections.connections.forEach((function(t) {
- var i = t[0],
- n = t[1],
- r = t[2];
- e.has(i) || e.set(i, {
- parents: [],
- children: []
- });
- var o = {
- ID: n,
- relationship: r
- };
- e.get(i)
- .parents.push(o), e.has(n) || e.set(n, {
- parents: [],
- children: []
- });
- var a = {
- ID: i,
- relationship: r
- };
- e.get(n)
- .children.push(a)
- }));
- return e
- },
- parseImages: function() {
- var e = {},
- i = {};
- if ("Video" in t.Objects) {
- var n = t.Objects.Video;
- for (var r in n) {
- var o = n[r];
- if (e[u = parseInt(r)] = o.RelativeFilename || o.Filename, "Content" in o) {
- var a = o.Content instanceof ArrayBuffer && o.Content.byteLength > 0,
- s = "string" == typeof o.Content && "" !== o.Content;
- if (a || s) {
- var l = this.parseImage(n[r]);
- i[o.RelativeFilename || o.Filename] = l
- }
- }
- }
- }
- for (var u in e) {
- var h = e[u];
- void 0 !== i[h] ? e[u] = i[h] : e[u] = e[u].split("\\")
- .pop()
- }
- return e
- },
- parseImage: function(t) {
- var e, i = t.Content,
- r = t.RelativeFilename || t.Filename;
- switch (r.slice(r.lastIndexOf(".") + 1)
- .toLowerCase()) {
- case "bmp":
- e = "image/bmp";
- break;
- case "jpg":
- case "jpeg":
- e = "image/jpeg";
- break;
- case "png":
- e = "image/png";
- break;
- case "tif":
- e = "image/tiff";
- break;
- case "tga":
- if ("function" != typeof n.TGALoader) return;
- if (null === n.Loader.Handlers.get(".tga")) {
- var o = new n.TGALoader;
- o.setPath(this.textureLoader.path), n.Loader.Handlers.add(/\.tga$/i, o)
- }
- e = "image/tga";
- break;
- default:
- return
- }
- if ("string" == typeof i) return "data:" + e + ";base64," + i;
- var a = new Uint8Array(i);
- return window.URL.createObjectURL(new Blob([a], {
- type: e
- }))
- },
- parseTextures: function(e) {
- var i = new Map;
- if ("Texture" in t.Objects) {
- var n = t.Objects.Texture;
- for (var r in n) {
- var o = this.parseTexture(n[r], e);
- i.set(parseInt(r), o)
- }
- }
- return i
- },
- parseTexture: function(t, e) {
- var i = this.loadTexture(t, e);
- i.ID = t.id, i.name = t.attrName;
- var r = t.WrapModeU,
- o = t.WrapModeV,
- a = void 0 !== r ? r.value : 0,
- s = void 0 !== o ? o.value : 0;
- if (i.wrapS = 0 === a ? n.RepeatWrapping : n.ClampToEdgeWrapping, i.wrapT = 0 === s ? n.RepeatWrapping : n.ClampToEdgeWrapping, "Scaling" in t) {
- var l = t.Scaling.value;
- i.repeat.x = l[0], i.repeat.y = l[1]
- }
- return i
- },
- loadTexture: function(t, i) {
- var r, o, a = this.textureLoader.path,
- s = e.get(t.id)
- .children;
- void 0 !== s && s.length > 0 && void 0 !== i[s[0].ID] && (0 !== (r = i[s[0].ID])
- .indexOf("blob:") && 0 !== r.indexOf("data:") || this.textureLoader.setPath(void 0));
- var l = t.FileName.slice(-3)
- .toLowerCase();
- if ("tga" === l) {
- var u = n.Loader.Handlers.get(".tga");
- o = null === u ? new n.Texture : u.load(r)
- } else o = "psd" === l ? new n.Texture : this.textureLoader.load(r);
- return this.textureLoader.setPath(a), o
- },
- parseMaterials: function(e) {
- var i = new Map;
- if ("Material" in t.Objects) {
- var n = t.Objects.Material;
- for (var r in n) {
- var o = this.parseMaterial(n[r], e);
- null !== o && i.set(parseInt(r), o)
- }
- }
- return i
- },
- parseMaterial: function(t, i) {
- var r = t.id,
- o = t.attrName,
- a = t.ShadingModel;
- if ("object" == typeof a && (a = a.value), !e.has(r)) return null;
- var s, l = this.parseParameters(t, i, r);
- switch (a.toLowerCase()) {
- case "phong":
- s = new n.MeshMatcapMaterial;
- break;
- case "lambert":
- s = new n.MeshLambertMaterial;
- break;
- default:
- s = new n.MeshMatcapMaterial
- }
- return s.setValues(l), s.name = o, s
- },
- parseParameters: function(t, i, r) {
- var o = {};
- t.BumpFactor && (o.bumpScale = t.BumpFactor.value), t.Diffuse ? o.color = (new n.Color)
- .fromArray(t.Diffuse.value) : t.DiffuseColor && "Color" === t.DiffuseColor.type && (o.color = (new n.Color)
- .fromArray(t.DiffuseColor.value)), t.DisplacementFactor && (o.displacementScale = t.DisplacementFactor.value), t.Opacity && (o.opacity = parseFloat(t.Opacity.value)), o.opacity < 1 && (o.transparent = !0), t.ReflectionFactor && (o.reflectivity = t.ReflectionFactor.value);
- var a = this;
- return e.get(r)
- .children.forEach((function(t) {
- switch (t.relationship) {
- case "Bump":
- o.bumpMap = a.getTexture(i, t.ID);
- break;
- case "Maya|TEX_ao_map":
- o.aoMap = a.getTexture(i, t.ID);
- break;
- case "DiffuseColor":
- case "Maya|TEX_color_map":
- o.map = a.getTexture(i, t.ID);
- break;
- case "DisplacementColor":
- o.displacementMap = a.getTexture(i, t.ID);
- break;
- case "EmissiveColor":
- o.emissiveMap = a.getTexture(i, t.ID);
- break;
- case "NormalMap":
- case "Maya|TEX_normal_map":
- o.normalMap = a.getTexture(i, t.ID);
- break;
- case "ReflectionColor":
- o.envMap = a.getTexture(i, t.ID), o.envMap.mapping = n.EquirectangularReflectionMapping;
- break;
- case "SpecularColor":
- o.specularMap = a.getTexture(i, t.ID);
- break;
- case "TransparentColor":
- o.alphaMap = a.getTexture(i, t.ID), o.transparent = !0
- }
- })), o
- },
- getTexture: function(i, n) {
- return "LayeredTexture" in t.Objects && n in t.Objects.LayeredTexture && (n = e.get(n)
- .children[0].ID), i.get(n)
- },
- parseDeformers: function() {
- var i = {},
- n = {};
- if ("Deformer" in t.Objects) {
- var r = t.Objects.Deformer;
- for (var o in r) {
- var a = r[o],
- s = e.get(parseInt(o));
- if ("Skin" === a.attrType) {
- var l = this.parseSkeleton(s, r);
- l.ID = o, s.parents.length, l.geometryID = s.parents[0].ID, i[o] = l
- } else if ("BlendShape" === a.attrType) {
- var u = {
- id: o
- };
- u.rawTargets = this.parseMorphTargets(s, r), u.id = o, s.parents.length, n[o] = u
- }
- }
- }
- return {
- skeletons: i,
- morphTargets: n
- }
- },
- parseSkeleton: function(t, e) {
- var i = [];
- return t.children.forEach((function(t) {
- var r = e[t.ID];
- if ("Cluster" === r.attrType) {
- var o = {
- ID: t.ID,
- indices: [],
- weights: [],
- transformLink: (new n.Matrix4)
- .fromArray(r.TransformLink.a)
- };
- "Indexes" in r && (o.indices = r.Indexes.a, o.weights = r.Weights.a), i.push(o)
- }
- })), {
- rawBones: i,
- bones: []
- }
- },
- parseMorphTargets: function(t, i) {
- for (var n = [], r = 0; r < t.children.length; r++) {
- var o = t.children[r],
- a = i[o.ID],
- s = {
- name: a.attrName,
- initialWeight: a.DeformPercent,
- id: a.id,
- fullWeights: a.FullWeights.a
- };
- if ("BlendShapeChannel" !== a.attrType) return;
- s.geoID = e.get(parseInt(o.ID))
- .children.filter((function(t) {
- return void 0 === t.relationship
- }))[0].ID, n.push(s)
- }
- return n
- },
- parseScene: function(r, o, a) {
- i = new n.Group;
- var l = this.parseModels(r.skeletons, o, a),
- u = t.Objects.Model,
- h = this;
- l.forEach((function(t) {
- var n = u[t.ID];
- h.setLookAtProperties(t, n), e.get(t.ID)
- .parents.forEach((function(e) {
- var i = l.get(e.ID);
- void 0 !== i && i.add(t)
- })), null === t.parent && i.add(t)
- })), this.bindSkeleton(r.skeletons, o, l), this.createAmbientLight(), this.setupMorphMaterials(), i.traverse((function(t) {
- if (t.userData.transformData) {
- t.parent && (t.userData.transformData.parentMatrixWorld = t.parent.matrix);
- var e = y(t.userData.transformData);
- t.applyMatrix(e)
- }
- }));
- var c = (new s)
- .parse();
- 1 === i.children.length && i.children[0].isGroup && (i.children[0].animations = c, i = i.children[0]), i.animations = c
- },
- parseModels: function(i, r, o) {
- var a = new Map,
- s = t.Objects.Model;
- for (var l in s) {
- var u = parseInt(l),
- h = s[l],
- c = e.get(u),
- d = this.buildSkeleton(c, i, u, h.attrName);
- if (!d) {
- switch (h.attrType) {
- case "Camera":
- d = this.createCamera(c);
- break;
- case "Light":
- d = this.createLight(c);
- break;
- case "Mesh":
- d = this.createMesh(c, r, o);
- break;
- case "NurbsCurve":
- d = this.createCurve(c, r);
- break;
- case "LimbNode":
- case "Root":
- d = new n.Bone;
- break;
- case "Null":
- default:
- d = new n.Group
- }
- d.name = n.PropertyBinding.sanitizeNodeName(h.attrName), d.ID = u
- }
- this.getTransformData(d, h), a.set(u, d)
- }
- return a
- },
- buildSkeleton: function(t, e, i, r) {
- var o = null;
- return t.parents.forEach((function(t) {
- for (var a in e) {
- var s = e[a];
- s.rawBones.forEach((function(e, a) {
- if (e.ID === t.ID) {
- var l = o;
- (o = new n.Bone)
- .matrixWorld.copy(e.transformLink), o.name = n.PropertyBinding.sanitizeNodeName(r), o.ID = i, s.bones[a] = o, null !== l && o.add(l)
- }
- }))
- }
- })), o
- },
- createCamera: function(e) {
- var i, r;
- if (e.children.forEach((function(e) {
- var i = t.Objects.NodeAttribute[e.ID];
- void 0 !== i && (r = i)
- })), void 0 === r) i = new n.Object3D;
- else {
- var o = 0;
- void 0 !== r.CameraProjectionType && 1 === r.CameraProjectionType.value && (o = 1);
- var a = 1;
- void 0 !== r.NearPlane && (a = r.NearPlane.value / 1e3);
- var s = 1e3;
- void 0 !== r.FarPlane && (s = r.FarPlane.value / 1e3);
- var l = (window.renderWidth || window.innerWidth),
- u = (window.renderHeight || window.innerHeight);
- void 0 !== r.AspectWidth && void 0 !== r.AspectHeight && (l = r.AspectWidth.value, u = r.AspectHeight.value);
- var h = l / u,
- c = 45;
- void 0 !== r.FieldOfView && (c = r.FieldOfView.value);
- var d = r.FocalLength ? r.FocalLength.value : null;
- switch (o) {
- case 0:
- i = new n.PerspectiveCamera(c, h, a, s), null !== d && i.setFocalLength(d);
- break;
- case 1:
- i = new n.OrthographicCamera(-l / 2, l / 2, u / 2, -u / 2, a, s);
- break;
- default:
- i = new n.Object3D
- }
- }
- return i
- },
- createLight: function(e) {
- var i, r;
- if (e.children.forEach((function(e) {
- var i = t.Objects.NodeAttribute[e.ID];
- void 0 !== i && (r = i)
- })), void 0 === r) i = new n.Object3D;
- else {
- var o;
- o = void 0 === r.LightType ? 0 : r.LightType.value;
- var a = 16777215;
- void 0 !== r.Color && (a = (new n.Color)
- .fromArray(r.Color.value));
- var s = void 0 === r.Intensity ? 1 : r.Intensity.value / 100;
- void 0 !== r.CastLightOnObject && 0 === r.CastLightOnObject.value && (s = 0);
- var l = 0;
- void 0 !== r.FarAttenuationEnd && (l = void 0 !== r.EnableFarAttenuation && 0 === r.EnableFarAttenuation.value ? 0 : r.FarAttenuationEnd.value);
- switch (o) {
- case 0:
- i = new n.PointLight(a, s, l, 1);
- break;
- case 1:
- i = new n.DirectionalLight(a, s);
- break;
- case 2:
- var u = Math.PI / 3;
- void 0 !== r.InnerAngle && (u = n.Math.degToRad(r.InnerAngle.value));
- var h = 0;
- void 0 !== r.OuterAngle && (h = n.Math.degToRad(r.OuterAngle.value), h = Math.max(h, 1)), i = new n.SpotLight(a, s, l, u, h, 1);
- break;
- default:
- i = new n.PointLight(a, s)
- }
- void 0 !== r.CastShadows && 1 === r.CastShadows.value && (i.castShadow = !0)
- }
- return i
- },
- createMesh: function(t, e, i) {
- var r, o = null,
- a = null,
- s = [];
- return t.children.forEach((function(t) {
- e.has(t.ID) && (o = e.get(t.ID)), i.has(t.ID) && s.push(i.get(t.ID))
- })), s.length > 1 ? a = s : s.length > 0 ? a = s[0] : (a = new n.MeshMatcapMaterial({
- color: 13421772
- }), s.push(a)), "color" in o.attributes && s.forEach((function(t) {
- t.vertexColors = n.VertexColors
- })), o.FBX_Deformer ? (s.forEach((function(t) {
- t.skinning = !0
- })), (r = new n.SkinnedMesh(o, a))
- .normalizeSkinWeights()) : r = new n.Mesh(o, a), r
- },
- createCurve: function(t, e) {
- var i = t.children.reduce((function(t, i) {
- return e.has(i.ID) && (t = e.get(i.ID)), t
- }), null),
- r = new n.LineBasicMaterial({
- color: 3342591,
- linewidth: 1
- });
- return new n.Line(i, r)
- },
- getTransformData: function(t, e) {
- var i = {};
- "InheritType" in e && (i.inheritType = parseInt(e.InheritType.value)), i.eulerOrder = "RotationOrder" in e ? b(e.RotationOrder.value) : "ZYX", "Lcl_Translation" in e && (i.translation = e.Lcl_Translation.value), "PreRotation" in e && (i.preRotation = e.PreRotation.value), "Lcl_Rotation" in e && (i.rotation = e.Lcl_Rotation.value), "PostRotation" in e && (i.postRotation = e.PostRotation.value), "Lcl_Scaling" in e && (i.scale = e.Lcl_Scaling.value), "ScalingOffset" in e && (i.scalingOffset = e.ScalingOffset.value), "ScalingPivot" in e && (i.scalingPivot = e.ScalingPivot.value), "RotationOffset" in e && (i.rotationOffset = e.RotationOffset.value), "RotationPivot" in e && (i.rotationPivot = e.RotationPivot.value), t.userData.transformData = i
- },
- setLookAtProperties: function(r, o) {
- "LookAtProperty" in o && e.get(r.ID)
- .children.forEach((function(e) {
- if ("LookAtProperty" === e.relationship) {
- var o = t.Objects.Model[e.ID];
- if ("Lcl_Translation" in o) {
- var a = o.Lcl_Translation.value;
- void 0 !== r.target ? (r.target.position.fromArray(a), i.add(r.target)) : r.lookAt((new n.Vector3)
- .fromArray(a))
- }
- }
- }))
- },
- bindSkeleton: function(t, i, r) {
- var o = this.parsePoseNodes();
- for (var a in t) {
- var s = t[a];
- e.get(parseInt(s.ID))
- .parents.forEach((function(t) {
- if (i.has(t.ID)) {
- var a = t.ID;
- e.get(a)
- .parents.forEach((function(t) {
- r.has(t.ID) && r.get(t.ID)
- .bind(new n.Skeleton(s.bones), o[t.ID])
- }))
- }
- }))
- }
- },
- parsePoseNodes: function() {
- var e = {};
- if ("Pose" in t.Objects) {
- var i = t.Objects.Pose;
- for (var r in i)
- if ("BindPose" === i[r].attrType) {
- var o = i[r].PoseNode;
- Array.isArray(o) ? o.forEach((function(t) {
- e[t.Node] = (new n.Matrix4)
- .fromArray(t.Matrix.a)
- })) : e[o.Node] = (new n.Matrix4)
- .fromArray(o.Matrix.a)
- }
- }
- return e
- },
- createAmbientLight: function() {
- if ("GlobalSettings" in t && "AmbientColor" in t.GlobalSettings) {
- var e = t.GlobalSettings.AmbientColor.value,
- r = e[0],
- o = e[1],
- a = e[2];
- if (0 !== r || 0 !== o || 0 !== a) {
- var s = new n.Color(r, o, a);
- i.add(new n.AmbientLight(s, 1))
- }
- }
- },
- setupMorphMaterials: function() {
- var t = this;
- i.traverse((function(e) {
- e.isMesh && e.geometry.morphAttributes.position && e.geometry.morphAttributes.position.length && (Array.isArray(e.material) ? e.material.forEach((function(i, n) {
- t.setupMorphMaterial(e, i, n)
- })) : t.setupMorphMaterial(e, e.material))
- }))
- },
- setupMorphMaterial: function(t, e, n) {
- var r = t.uuid,
- o = e.uuid,
- a = !1;
- if (i.traverse((function(t) {
- t.isMesh && (Array.isArray(t.material) ? t.material.forEach((function(e) {
- e.uuid === o && t.uuid !== r && (a = !0)
- })) : t.material.uuid === o && t.uuid !== r && (a = !0))
- })), !0 === a) {
- var s = e.clone();
- s.morphTargets = !0, void 0 === n ? t.material = s : t.material[n] = s
- } else e.morphTargets = !0
- }
- }, a.prototype = {
- constructor: a,
- parse: function(i) {
- var n = new Map;
- if ("Geometry" in t.Objects) {
- var r = t.Objects.Geometry;
- for (var o in r) {
- var a = e.get(parseInt(o)),
- s = this.parseGeometry(a, r[o], i);
- n.set(parseInt(o), s)
- }
- }
- return n
- },
- parseGeometry: function(t, e, i) {
- switch (e.attrType) {
- case "Mesh":
- return this.parseMeshGeometry(t, e, i);
- case "NurbsCurve":
- return this.parseNurbsGeometry(e)
- }
- },
- parseMeshGeometry: function(e, i, n) {
- var r = n.skeletons,
- o = n.morphTargets,
- a = e.parents.map((function(e) {
- return t.Objects.Model[e.ID]
- }));
- if (0 !== a.length) {
- var s = e.children.reduce((function(t, e) {
- return void 0 !== r[e.ID] && (t = r[e.ID]), t
- }), null),
- l = e.children.reduce((function(t, e) {
- return void 0 !== o[e.ID] && (t = o[e.ID]), t
- }), null),
- u = a[0],
- h = {};
- "RotationOrder" in u && (h.eulerOrder = b(u.RotationOrder.value)), "InheritType" in u && (h.inheritType = parseInt(u.InheritType.value)), "GeometricTranslation" in u && (h.translation = u.GeometricTranslation.value), "GeometricRotation" in u && (h.rotation = u.GeometricRotation.value), "GeometricScaling" in u && (h.scale = u.GeometricScaling.value);
- var c = y(h);
- return this.genGeometry(i, s, l, c)
- }
- },
- genGeometry: function(t, e, i, r) {
- var o = new n.BufferGeometry;
- t.attrName && (o.name = t.attrName);
- var a = this.parseGeoNode(t, e),
- s = this.genBuffers(a),
- l = new n.Float32BufferAttribute(s.vertex, 3);
- if (r.applyToBufferAttribute(l), o.addAttribute("position", l), s.colors.length > 0 && o.addAttribute("color", new n.Float32BufferAttribute(s.colors, 3)), e && (o.addAttribute("skinIndex", new n.Uint16BufferAttribute(s.weightsIndices, 4)), o.addAttribute("skinWeight", new n.Float32BufferAttribute(s.vertexWeights, 4)), o.FBX_Deformer = e), s.normal.length > 0) {
- var u = new n.Float32BufferAttribute(s.normal, 3);
- (new n.Matrix3)
- .getNormalMatrix(r)
- .applyToBufferAttribute(u), o.addAttribute("normal", u)
- }
- if (s.uvs.forEach((function(t, e) {
- var i = "uv" + (e + 1)
- .toString();
- 0 === e && (i = "uv"), o.addAttribute(i, new n.Float32BufferAttribute(s.uvs[e], 2))
- })), a.material && "AllSame" !== a.material.mappingType) {
- var h = s.materialIndex[0],
- c = 0;
- if (s.materialIndex.forEach((function(t, e) {
- t !== h && (o.addGroup(c, e - c, h), h = t, c = e)
- })), o.groups.length > 0) {
- var d = o.groups[o.groups.length - 1],
- p = d.start + d.count;
- p !== s.materialIndex.length && o.addGroup(p, s.materialIndex.length - p, h)
- }
- 0 === o.groups.length && o.addGroup(0, s.materialIndex.length, s.materialIndex[0])
- }
- return this.addMorphTargets(o, t, i, r), o
- },
- parseGeoNode: function(t, e) {
- var i = {};
- if (i.vertexPositions = void 0 !== t.Vertices ? t.Vertices.a : [], i.vertexIndices = void 0 !== t.PolygonVertexIndex ? t.PolygonVertexIndex.a : [], t.LayerElementColor && (i.color = this.parseVertexColors(t.LayerElementColor[0])), t.LayerElementMaterial && (i.material = this.parseMaterialIndices(t.LayerElementMaterial[0])), t.LayerElementNormal && (i.normal = this.parseNormals(t.LayerElementNormal[0])), t.LayerElementUV) {
- i.uv = [];
- for (var n = 0; t.LayerElementUV[n];) i.uv.push(this.parseUVs(t.LayerElementUV[n])), n++
- }
- return i.weightTable = {}, null !== e && (i.skeleton = e, e.rawBones.forEach((function(t, e) {
- t.indices.forEach((function(n, r) {
- void 0 === i.weightTable[n] && (i.weightTable[n] = []), i.weightTable[n].push({
- id: e,
- weight: t.weights[r]
- })
- }))
- }))), i
- },
- genBuffers: function(t) {
- var e = {
- vertex: [],
- normal: [],
- colors: [],
- uvs: [],
- materialIndex: [],
- vertexWeights: [],
- weightsIndices: []
- },
- i = 0,
- n = 0,
- r = !0,
- o = [],
- a = [],
- s = [],
- l = [],
- u = [],
- h = [],
- c = this;
- return t.vertexIndices.forEach((function(d, p) {
- var f = !1;
- d < 0 && (d ^= -1, f = !0);
- var g = [],
- v = [];
- if (o.push(3 * d, 3 * d + 1, 3 * d + 2), t.color) {
- var y = m(p, i, d, t.color);
- s.push(y[0], y[1], y[2])
- }
- if (t.skeleton) {
- if (void 0 !== t.weightTable[d] && t.weightTable[d].forEach((function(t) {
- v.push(t.weight), g.push(t.id)
- })), v.length > 4) {
- r || (r = !0);
- var b = [0, 0, 0, 0],
- w = [0, 0, 0, 0];
- v.forEach((function(t, e) {
- var i = t,
- n = g[e];
- w.forEach((function(t, e, r) {
- if (i > t) {
- r[e] = i, i = t;
- var o = b[e];
- b[e] = n, n = o
- }
- }))
- })), g = b, v = w
- }
- for (; v.length < 4;) v.push(0), g.push(0);
- for (var x = 0; x < 4; ++x) u.push(v[x]), h.push(g[x])
- }
- if (t.normal) {
- y = m(p, i, d, t.normal);
- a.push(y[0], y[1], y[2])
- }
- if (t.material && "AllSame" !== t.material.mappingType) var M = m(p, i, d, t.material)[0];
- t.uv && t.uv.forEach((function(t, e) {
- var n = m(p, i, d, t);
- void 0 === l[e] && (l[e] = []), l[e].push(n[0]), l[e].push(n[1])
- })), n++, f && (c.genFace(e, t, o, M, a, s, l, u, h, n), i++, n = 0, o = [], a = [], s = [], l = [], u = [], h = [])
- })), e
- },
- genFace: function(t, e, i, n, r, o, a, s, l, u) {
- for (var h = 2; h < u; h++) t.vertex.push(e.vertexPositions[i[0]]), t.vertex.push(e.vertexPositions[i[1]]), t.vertex.push(e.vertexPositions[i[2]]), t.vertex.push(e.vertexPositions[i[3 * (h - 1)]]), t.vertex.push(e.vertexPositions[i[3 * (h - 1) + 1]]), t.vertex.push(e.vertexPositions[i[3 * (h - 1) + 2]]), t.vertex.push(e.vertexPositions[i[3 * h]]), t.vertex.push(e.vertexPositions[i[3 * h + 1]]), t.vertex.push(e.vertexPositions[i[3 * h + 2]]), e.skeleton && (t.vertexWeights.push(s[0]), t.vertexWeights.push(s[1]), t.vertexWeights.push(s[2]), t.vertexWeights.push(s[3]), t.vertexWeights.push(s[4 * (h - 1)]), t.vertexWeights.push(s[4 * (h - 1) + 1]), t.vertexWeights.push(s[4 * (h - 1) + 2]), t.vertexWeights.push(s[4 * (h - 1) + 3]), t.vertexWeights.push(s[4 * h]), t.vertexWeights.push(s[4 * h + 1]), t.vertexWeights.push(s[4 * h + 2]), t.vertexWeights.push(s[4 * h + 3]), t.weightsIndices.push(l[0]), t.weightsIndices.push(l[1]), t.weightsIndices.push(l[2]), t.weightsIndices.push(l[3]), t.weightsIndices.push(l[4 * (h - 1)]), t.weightsIndices.push(l[4 * (h - 1) + 1]), t.weightsIndices.push(l[4 * (h - 1) + 2]), t.weightsIndices.push(l[4 * (h - 1) + 3]), t.weightsIndices.push(l[4 * h]), t.weightsIndices.push(l[4 * h + 1]), t.weightsIndices.push(l[4 * h + 2]), t.weightsIndices.push(l[4 * h + 3])), e.color && (t.colors.push(o[0]), t.colors.push(o[1]), t.colors.push(o[2]), t.colors.push(o[3 * (h - 1)]), t.colors.push(o[3 * (h - 1) + 1]), t.colors.push(o[3 * (h - 1) + 2]), t.colors.push(o[3 * h]), t.colors.push(o[3 * h + 1]), t.colors.push(o[3 * h + 2])), e.material && "AllSame" !== e.material.mappingType && (t.materialIndex.push(n), t.materialIndex.push(n), t.materialIndex.push(n)), e.normal && (t.normal.push(r[0]), t.normal.push(r[1]), t.normal.push(r[2]), t.normal.push(r[3 * (h - 1)]), t.normal.push(r[3 * (h - 1) + 1]), t.normal.push(r[3 * (h - 1) + 2]), t.normal.push(r[3 * h]), t.normal.push(r[3 * h + 1]), t.normal.push(r[3 * h + 2])), e.uv && e.uv.forEach((function(e, i) {
- void 0 === t.uvs[i] && (t.uvs[i] = []), t.uvs[i].push(a[i][0]), t.uvs[i].push(a[i][1]), t.uvs[i].push(a[i][2 * (h - 1)]), t.uvs[i].push(a[i][2 * (h - 1) + 1]), t.uvs[i].push(a[i][2 * h]), t.uvs[i].push(a[i][2 * h + 1])
- }))
- },
- addMorphTargets: function(e, i, n, r) {
- if (null !== n) {
- e.morphAttributes.position = [];
- var o = this;
- n.rawTargets.forEach((function(n) {
- var a = t.Objects.Geometry[n.geoID];
- void 0 !== a && o.genMorphGeometry(e, i, a, r, n.name)
- }))
- }
- },
- genMorphGeometry: function(t, e, i, r, o) {
- var a = new n.BufferGeometry;
- i.attrName && (a.name = i.attrName);
- for (var s = void 0 !== e.PolygonVertexIndex ? e.PolygonVertexIndex.a : [], l = void 0 !== e.Vertices ? e.Vertices.a.slice() : [], u = void 0 !== i.Vertices ? i.Vertices.a : [], h = void 0 !== i.Indexes ? i.Indexes.a : [], c = 0; c < h.length; c++) {
- var d = 3 * h[c];
- l[d] += u[3 * c], l[d + 1] += u[3 * c + 1], l[d + 2] += u[3 * c + 2]
- }
- var p = {
- vertexIndices: s,
- vertexPositions: l
- },
- f = this.genBuffers(p),
- m = new n.Float32BufferAttribute(f.vertex, 3);
- m.name = o || i.attrName, r.applyToBufferAttribute(m), t.morphAttributes.position.push(m)
- },
- parseNormals: function(t) {
- var e = t.MappingInformationType,
- i = t.ReferenceInformationType,
- n = t.Normals.a,
- r = [];
- return "IndexToDirect" === i && ("NormalIndex" in t ? r = t.NormalIndex.a : "NormalsIndex" in t && (r = t.NormalsIndex.a)), {
- dataSize: 3,
- buffer: n,
- indices: r,
- mappingType: e,
- referenceType: i
- }
- },
- parseUVs: function(t) {
- var e = t.MappingInformationType,
- i = t.ReferenceInformationType,
- n = t.UV.a,
- r = [];
- return "IndexToDirect" === i && (r = t.UVIndex.a), {
- dataSize: 2,
- buffer: n,
- indices: r,
- mappingType: e,
- referenceType: i
- }
- },
- parseVertexColors: function(t) {
- var e = t.MappingInformationType,
- i = t.ReferenceInformationType,
- n = t.Colors.a,
- r = [];
- return "IndexToDirect" === i && (r = t.ColorIndex.a), {
- dataSize: 4,
- buffer: n,
- indices: r,
- mappingType: e,
- referenceType: i
- }
- },
- parseMaterialIndices: function(t) {
- var e = t.MappingInformationType,
- i = t.ReferenceInformationType;
- if ("NoMappingInformation" === e) return {
- dataSize: 1,
- buffer: [0],
- indices: [0],
- mappingType: "AllSame",
- referenceType: i
- };
- for (var n = t.Materials.a, r = [], o = 0; o < n.length; ++o) r.push(o);
- return {
- dataSize: 1,
- buffer: n,
- indices: r,
- mappingType: e,
- referenceType: i
- }
- },
- parseNurbsGeometry: function(t) {
- if (void 0 === n.NURBSCurve) return new n.BufferGeometry;
- var e = parseInt(t.Order);
- if (isNaN(e)) return new n.BufferGeometry;
- for (var i, r, o = e - 1, a = t.KnotVector.a, s = [], l = t.Points.a, u = 0, h = l.length; u < h; u += 4) s.push((new n.Vector4)
- .fromArray(l, u));
- if ("Closed" === t.Form) s.push(s[0]);
- else if ("Periodic" === t.Form) {
- i = o, r = a.length - 1 - i;
- for (u = 0; u < o; ++u) s.push(s[u])
- }
- var c = new n.NURBSCurve(o, a, s, i, r)
- .getPoints(7 * s.length),
- d = new Float32Array(3 * c.length);
- c.forEach((function(t, e) {
- t.toArray(d, 3 * e)
- }));
- var p = new n.BufferGeometry;
- return p.addAttribute("position", new n.BufferAttribute(d, 3)), p
- }
- }, s.prototype = {
- constructor: s,
- parse: function() {
- var t = [],
- e = this.parseClips();
- if (void 0 !== e)
- for (var i in e) {
- var n = e[i],
- r = this.addClip(n);
- t.push(r)
- }
- return t
- },
- parseClips: function() {
- if (void 0 !== t.Objects.AnimationCurve) {
- var e = this.parseAnimationCurveNodes();
- this.parseAnimationCurves(e);
- var i = this.parseAnimationLayers(e);
- return this.parseAnimStacks(i)
- }
- },
- parseAnimationCurveNodes: function() {
- var e = t.Objects.AnimationCurveNode,
- i = new Map;
- for (var n in e) {
- var r = e[n];
- if (null !== r.attrName.match(/S|R|T|DeformPercent/)) {
- var o = {
- id: r.id,
- attr: r.attrName,
- curves: {}
- };
- i.set(o.id, o)
- }
- }
- return i
- },
- parseAnimationCurves: function(i) {
- var n = t.Objects.AnimationCurve;
- for (var r in n) {
- var o = {
- id: n[r].id,
- times: n[r].KeyTime.a.map(p),
- values: n[r].KeyValueFloat.a
- },
- a = e.get(o.id);
- if (void 0 !== a) {
- var s = a.parents[0].ID,
- l = a.parents[0].relationship;
- l.match(/X/) ? i.get(s)
- .curves.x = o : l.match(/Y/) ? i.get(s)
- .curves.y = o : l.match(/Z/) ? i.get(s)
- .curves.z = o : l.match(/d|DeformPercent/) && i.has(s) && (i.get(s)
- .curves.morph = o)
- }
- }
- },
- parseAnimationLayers: function(r) {
- var o = t.Objects.AnimationLayer,
- a = new Map;
- for (var s in o) {
- var l = [],
- u = e.get(parseInt(s));
- if (void 0 !== u) u.children.forEach((function(o, a) {
- if (r.has(o.ID)) {
- var s = r.get(o.ID);
- if (void 0 !== s.curves.x || void 0 !== s.curves.y || void 0 !== s.curves.z) {
- if (void 0 === l[a])
- if (void 0 !== (f = e.get(o.ID)
- .parents.filter((function(t) {
- return void 0 !== t.relationship
- }))[0].ID)) {
- var u = t.Objects.Model[f.toString()],
- h = {
- modelName: n.PropertyBinding.sanitizeNodeName(u.attrName),
- ID: u.id,
- initialPosition: [0, 0, 0],
- initialRotation: [0, 0, 0],
- initialScale: [1, 1, 1]
- };
- i.traverse((function(t) {
- t.ID === u.id && (h.transform = t.matrix, t.userData.transformData && (h.eulerOrder = t.userData.transformData.eulerOrder))
- })), h.transform || (h.transform = new n.Matrix4), "PreRotation" in u && (h.preRotation = u.PreRotation.value), "PostRotation" in u && (h.postRotation = u.PostRotation.value), l[a] = h
- } l[a] && (l[a][s.attr] = s)
- } else if (void 0 !== s.curves.morph) {
- if (void 0 === l[a]) {
- var c = e.get(o.ID)
- .parents.filter((function(t) {
- return void 0 !== t.relationship
- }))[0].ID,
- d = e.get(c)
- .parents[0].ID,
- p = e.get(d)
- .parents[0].ID,
- f = e.get(p)
- .parents[0].ID;
- u = t.Objects.Model[f], h = {
- modelName: n.PropertyBinding.sanitizeNodeName(u.attrName),
- morphName: t.Objects.Deformer[c].attrName
- };
- l[a] = h
- }
- l[a][s.attr] = s
- }
- }
- })), a.set(parseInt(s), l)
- }
- return a
- },
- parseAnimStacks: function(i) {
- var n = t.Objects.AnimationStack,
- r = {};
- for (var o in n) {
- var a = e.get(parseInt(o))
- .children;
- a.length;
- var s = i.get(a[0].ID);
- r[o] = {
- name: n[o].attrName,
- layer: s
- }
- }
- return r
- },
- addClip: function(t) {
- var e = [],
- i = this;
- return t.layer.forEach((function(t) {
- e = e.concat(i.generateTracks(t))
- })), new n.AnimationClip(t.name, -1, e)
- },
- generateTracks: function(t) {
- var e = [],
- i = new n.Vector3,
- r = new n.Quaternion,
- o = new n.Vector3;
- if (t.transform && t.transform.decompose(i, r, o), i = i.toArray(), r = (new n.Euler)
- .setFromQuaternion(r, t.eulerOrder)
- .toArray(), o = o.toArray(), void 0 !== t.T && Object.keys(t.T.curves)
- .length > 0) {
- var a = this.generateVectorTrack(t.modelName, t.T.curves, i, "position");
- void 0 !== a && e.push(a)
- }
- if (void 0 !== t.R && Object.keys(t.R.curves)
- .length > 0) {
- var s = this.generateRotationTrack(t.modelName, t.R.curves, r, t.preRotation, t.postRotation, t.eulerOrder);
- void 0 !== s && e.push(s)
- }
- if (void 0 !== t.S && Object.keys(t.S.curves)
- .length > 0) {
- var l = this.generateVectorTrack(t.modelName, t.S.curves, o, "scale");
- void 0 !== l && e.push(l)
- }
- if (void 0 !== t.DeformPercent) {
- var u = this.generateMorphTrack(t);
- void 0 !== u && e.push(u)
- }
- return e
- },
- generateVectorTrack: function(t, e, i, r) {
- var o = this.getTimesForAllAxes(e),
- a = this.getKeyframeTrackValues(o, e, i);
- return new n.VectorKeyframeTrack(t + "." + r, o, a)
- },
- generateRotationTrack: function(t, e, i, r, o, a) {
- void 0 !== e.x && (this.interpolateRotations(e.x), e.x.values = e.x.values.map(n.Math.degToRad)), void 0 !== e.y && (this.interpolateRotations(e.y), e.y.values = e.y.values.map(n.Math.degToRad)), void 0 !== e.z && (this.interpolateRotations(e.z), e.z.values = e.z.values.map(n.Math.degToRad));
- var s = this.getTimesForAllAxes(e),
- l = this.getKeyframeTrackValues(s, e, i);
- void 0 !== r && ((r = r.map(n.Math.degToRad))
- .push(a), r = (new n.Euler)
- .fromArray(r), r = (new n.Quaternion)
- .setFromEuler(r)), void 0 !== o && ((o = o.map(n.Math.degToRad))
- .push(a), o = (new n.Euler)
- .fromArray(o), o = (new n.Quaternion)
- .setFromEuler(o)
- .inverse());
- for (var u = new n.Quaternion, h = new n.Euler, c = [], d = 0; d < l.length; d += 3) h.set(l[d], l[d + 1], l[d + 2], a), u.setFromEuler(h), void 0 !== r && u.premultiply(r), void 0 !== o && u.multiply(o), u.toArray(c, d / 3 * 4);
- return new n.QuaternionKeyframeTrack(t + ".quaternion", s, c)
- },
- generateMorphTrack: function(t) {
- var e = t.DeformPercent.curves.morph,
- r = e.values.map((function(t) {
- return t / 100
- })),
- o = i.getObjectByName(t.modelName)
- .morphTargetDictionary[t.morphName];
- return new n.NumberKeyframeTrack(t.modelName + ".morphTargetInfluences[" + o + "]", e.times, r)
- },
- getTimesForAllAxes: function(t) {
- var e = [];
- return void 0 !== t.x && (e = e.concat(t.x.times)), void 0 !== t.y && (e = e.concat(t.y.times)), void 0 !== t.z && (e = e.concat(t.z.times)), e = e.sort((function(t, e) {
- return t - e
- }))
- .filter((function(t, e, i) {
- return i.indexOf(t) == e
- }))
- },
- getKeyframeTrackValues: function(t, e, i) {
- var n = i,
- r = [],
- o = -1,
- a = -1,
- s = -1;
- return t.forEach((function(t) {
- if (e.x && (o = e.x.times.indexOf(t)), e.y && (a = e.y.times.indexOf(t)), e.z && (s = e.z.times.indexOf(t)), -1 !== o) {
- var i = e.x.values[o];
- r.push(i), n[0] = i
- } else r.push(n[0]);
- if (-1 !== a) {
- var l = e.y.values[a];
- r.push(l), n[1] = l
- } else r.push(n[1]);
- if (-1 !== s) {
- var u = e.z.values[s];
- r.push(u), n[2] = u
- } else r.push(n[2])
- })), r
- },
- interpolateRotations: function(t) {
- for (var e = 1; e < t.values.length; e++) {
- var i = t.values[e - 1],
- n = t.values[e] - i,
- r = Math.abs(n);
- if (r >= 180) {
- for (var o = r / 180, a = n / o, s = i + a, l = t.times[e - 1], u = (t.times[e] - l) / o, h = l + u, c = [], d = []; h < t.times[e];) c.push(h), h += u, d.push(s), s += a;
- t.times = M(t.times, e, c), t.values = M(t.values, e, d)
- }
- }
- }
- }, l.prototype = {
- constructor: l,
- getPrevNode: function() {
- return this.nodeStack[this.currentIndent - 2]
- },
- getCurrentNode: function() {
- return this.nodeStack[this.currentIndent - 1]
- },
- getCurrentProp: function() {
- return this.currentProp
- },
- pushStack: function(t) {
- this.nodeStack.push(t), this.currentIndent += 1
- },
- popStack: function() {
- this.nodeStack.pop(), this.currentIndent -= 1
- },
- setCurrentProp: function(t, e) {
- this.currentProp = t, this.currentPropName = e
- },
- parse: function(t) {
- this.currentIndent = 0, this.allNodes = new c, this.nodeStack = [], this.currentProp = [], this.currentPropName = "";
- var e = this,
- i = t.split(/[\r\n]+/);
- return i.forEach((function(t, n) {
- var r = t.match(/^[\s\t]*;/),
- o = t.match(/^[\s\t]*$/);
- if (!r && !o) {
- var a = t.match("^\\t{" + e.currentIndent + "}(\\w+):(.*){", ""),
- s = t.match("^\\t{" + e.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"),
- l = t.match("^\\t{" + (e.currentIndent - 1) + "}}");
- a ? e.parseNodeBegin(t, a) : s ? e.parseNodeProperty(t, s, i[++n]) : l ? e.popStack() : t.match(/^[^\s\t}]/) && e.parseNodePropertyContinued(t)
- }
- })), this.allNodes
- },
- parseNodeBegin: function(t, e) {
- var i = e[1].trim()
- .replace(/^"/, "")
- .replace(/"$/, ""),
- n = e[2].split(",")
- .map((function(t) {
- return t.trim()
- .replace(/^"/, "")
- .replace(/"$/, "")
- })),
- r = {
- name: i
- },
- o = this.parseNodeAttr(n),
- a = this.getCurrentNode();
- 0 === this.currentIndent ? this.allNodes.add(i, r) : i in a ? ("PoseNode" === i ? a.PoseNode.push(r) : void 0 !== a[i].id && (a[i] = {}, a[i][a[i].id] = a[i]), "" !== o.id && (a[i][o.id] = r)) : "number" == typeof o.id ? (a[i] = {}, a[i][o.id] = r) : "Properties70" !== i && (a[i] = "PoseNode" === i ? [r] : r), "number" == typeof o.id && (r.id = o.id), "" !== o.name && (r.attrName = o.name), "" !== o.type && (r.attrType = o.type), this.pushStack(r)
- },
- parseNodeAttr: function(t) {
- var e = t[0];
- "" !== t[0] && (e = parseInt(t[0]), isNaN(e) && (e = t[0]));
- var i = "",
- n = "";
- return t.length > 1 && (i = t[1].replace(/^(\w+)::/, ""), n = t[2]), {
- id: e,
- name: i,
- type: n
- }
- },
- parseNodeProperty: function(t, e, i) {
- var n = e[1].replace(/^"/, "")
- .replace(/"$/, "")
- .trim(),
- r = e[2].replace(/^"/, "")
- .replace(/"$/, "")
- .trim();
- "Content" === n && "," === r && (r = i.replace(/"/g, "")
- .replace(/,$/, "")
- .trim());
- var o = this.getCurrentNode();
- if ("Properties70" !== o.name) {
- if ("C" === n) {
- var a = r.split(",")
- .slice(1),
- s = parseInt(a[0]),
- l = parseInt(a[1]),
- u = r.split(",")
- .slice(3);
- n = "connections",
- function(t, e) {
- for (var i = 0, n = t.length, r = e.length; i < r; i++, n++) t[n] = e[i]
- }(r = [s, l], u = u.map((function(t) {
- return t.trim()
- .replace(/^"/, "")
- }))), void 0 === o[n] && (o[n] = [])
- }
- "Node" === n && (o.id = r), n in o && Array.isArray(o[n]) ? o[n].push(r) : "a" !== n ? o[n] = r : o.a = r, this.setCurrentProp(o, n), "a" === n && "," !== r.slice(-1) && (o.a = w(r))
- } else this.parseNodeSpecialProperty(t, n, r)
- },
- parseNodePropertyContinued: function(t) {
- var e = this.getCurrentNode();
- e.a += t, "," !== t.slice(-1) && (e.a = w(e.a))
- },
- parseNodeSpecialProperty: function(t, e, i) {
- var n = i.split('",')
- .map((function(t) {
- return t.trim()
- .replace(/^\"/, "")
- .replace(/\s/, "_")
- })),
- r = n[0],
- o = n[1],
- a = n[2],
- s = n[3],
- l = n[4];
- switch (o) {
- case "int":
- case "enum":
- case "bool":
- case "ULongLong":
- case "double":
- case "Number":
- case "FieldOfView":
- l = parseFloat(l);
- break;
- case "Color":
- case "ColorRGB":
- case "Vector3D":
- case "Lcl_Translation":
- case "Lcl_Rotation":
- case "Lcl_Scaling":
- l = w(l)
- }
- this.getPrevNode()[r] = {
- type: o,
- type2: a,
- flag: s,
- value: l
- }, this.setCurrentProp(this.getPrevNode(), r)
- }
- }, u.prototype = {
- constructor: u,
- parse: function(t) {
- var e = new h(t);
- e.skip(23);
- for (var i = e.getUint32(), n = new c; !this.endOfContent(e);) {
- var r = this.parseNode(e, i);
- null !== r && n.add(r.name, r)
- }
- return n
- },
- endOfContent: function(t) {
- return t.size() % 16 == 0 ? (t.getOffset() + 160 + 16 & -16) >= t.size() : t.getOffset() + 160 + 16 >= t.size()
- },
- parseNode: function(t, e) {
- var i = {},
- n = e >= 7500 ? t.getUint64() : t.getUint32(),
- r = e >= 7500 ? t.getUint64() : t.getUint32(),
- o = (e >= 7500 ? t.getUint64() : t.getUint32(), t.getUint8()),
- a = t.getString(o);
- if (0 === n) return null;
- for (var s = [], l = 0; l < r; l++) s.push(this.parseProperty(t));
- var u = s.length > 0 ? s[0] : "",
- h = s.length > 1 ? s[1] : "",
- c = s.length > 2 ? s[2] : "";
- for (i.singleProperty = 1 === r && t.getOffset() === n; n > t.getOffset();) {
- var d = this.parseNode(t, e);
- null !== d && this.parseSubNode(a, i, d)
- }
- return i.propertyList = s, "number" == typeof u && (i.id = u), "" !== h && (i.attrName = h), "" !== c && (i.attrType = c), "" !== a && (i.name = a), i
- },
- parseSubNode: function(t, e, i) {
- if (!0 === i.singleProperty) {
- var n = i.propertyList[0];
- Array.isArray(n) ? (e[i.name] = i, i.a = n) : e[i.name] = n
- } else if ("Connections" === t && "C" === i.name) {
- var r = [];
- i.propertyList.forEach((function(t, e) {
- 0 !== e && r.push(t)
- })), void 0 === e.connections && (e.connections = []), e.connections.push(r)
- } else if ("Properties70" === i.name) {
- Object.keys(i)
- .forEach((function(t) {
- e[t] = i[t]
- }))
- } else if ("Properties70" === t && "P" === i.name) {
- var o, a = i.propertyList[0],
- s = i.propertyList[1],
- l = i.propertyList[2],
- u = i.propertyList[3];
- 0 === a.indexOf("Lcl ") && (a = a.replace("Lcl ", "Lcl_")), 0 === s.indexOf("Lcl ") && (s = s.replace("Lcl ", "Lcl_")), o = "Color" === s || "ColorRGB" === s || "Vector" === s || "Vector3D" === s || 0 === s.indexOf("Lcl_") ? [i.propertyList[4], i.propertyList[5], i.propertyList[6]] : i.propertyList[4], e[a] = {
- type: s,
- type2: l,
- flag: u,
- value: o
- }
- } else void 0 === e[i.name] ? "number" == typeof i.id ? (e[i.name] = {}, e[i.name][i.id] = i) : e[i.name] = i : "PoseNode" === i.name ? (Array.isArray(e[i.name]) || (e[i.name] = [e[i.name]]), e[i.name].push(i)) : void 0 === e[i.name][i.id] && (e[i.name][i.id] = i)
- },
- parseProperty: function(t) {
- var e = t.getString(1);
- switch (e) {
- case "C":
- return t.getBoolean();
- case "D":
- return t.getFloat64();
- case "F":
- return t.getFloat32();
- case "I":
- return t.getInt32();
- case "L":
- return t.getInt64();
- case "R":
- var i = t.getUint32();
- return t.getArrayBuffer(i);
- case "S":
- i = t.getUint32();
- return t.getString(i);
- case "Y":
- return t.getInt16();
- case "b":
- case "c":
- case "d":
- case "f":
- case "i":
- case "l":
- var n = t.getUint32(),
- r = t.getUint32(),
- o = t.getUint32();
- if (0 === r) switch (e) {
- case "b":
- case "c":
- return t.getBooleanArray(n);
- case "d":
- return t.getFloat64Array(n);
- case "f":
- return t.getFloat32Array(n);
- case "i":
- return t.getInt32Array(n);
- case "l":
- return t.getInt64Array(n)
- }
- var a = new h(new Zlib.Inflate(new Uint8Array(t.getArrayBuffer(o)))
- .decompress()
- .buffer);
- switch (e) {
- case "b":
- case "c":
- return a.getBooleanArray(n);
- case "d":
- return a.getFloat64Array(n);
- case "f":
- return a.getFloat32Array(n);
- case "i":
- return a.getInt32Array(n);
- case "l":
- return a.getInt64Array(n)
- }
- default:
- throw new Error("THREE.FBXLoader: Unknown property type " + e)
- }
- }
- }, h.prototype = {
- constructor: h,
- getOffset: function() {
- return this.offset
- },
- size: function() {
- return this.dv.buffer.byteLength
- },
- skip: function(t) {
- this.offset += t
- },
- getBoolean: function() {
- return 1 == (1 & this.getUint8())
- },
- getBooleanArray: function(t) {
- for (var e = [], i = 0; i < t; i++) e.push(this.getBoolean());
- return e
- },
- getUint8: function() {
- var t = this.dv.getUint8(this.offset);
- return this.offset += 1, t
- },
- getInt16: function() {
- var t = this.dv.getInt16(this.offset, this.littleEndian);
- return this.offset += 2, t
- },
- getInt32: function() {
- var t = this.dv.getInt32(this.offset, this.littleEndian);
- return this.offset += 4, t
- },
- getInt32Array: function(t) {
- for (var e = [], i = 0; i < t; i++) e.push(this.getInt32());
- return e
- },
- getUint32: function() {
- var t = this.dv.getUint32(this.offset, this.littleEndian);
- return this.offset += 4, t
- },
- getInt64: function() {
- var t, e;
- return this.littleEndian ? (t = this.getUint32(), e = this.getUint32()) : (e = this.getUint32(), t = this.getUint32()), 2147483648 & e ? (e = 4294967295 & ~e, 4294967295 === (t = 4294967295 & ~t) && (e = e + 1 & 4294967295), -(4294967296 * e + (t = t + 1 & 4294967295))) : 4294967296 * e + t
- },
- getInt64Array: function(t) {
- for (var e = [], i = 0; i < t; i++) e.push(this.getInt64());
- return e
- },
- getUint64: function() {
- var t, e;
- return this.littleEndian ? (t = this.getUint32(), e = this.getUint32()) : (e = this.getUint32(), t = this.getUint32()), 4294967296 * e + t
- },
- getFloat32: function() {
- var t = this.dv.getFloat32(this.offset, this.littleEndian);
- return this.offset += 4, t
- },
- getFloat32Array: function(t) {
- for (var e = [], i = 0; i < t; i++) e.push(this.getFloat32());
- return e
- },
- getFloat64: function() {
- var t = this.dv.getFloat64(this.offset, this.littleEndian);
- return this.offset += 8, t
- },
- getFloat64Array: function(t) {
- for (var e = [], i = 0; i < t; i++) e.push(this.getFloat64());
- return e
- },
- getArrayBuffer: function(t) {
- var e = this.dv.buffer.slice(this.offset, this.offset + t);
- return this.offset += t, e
- },
- getString: function(t) {
- for (var e = [], i = 0; i < t; i++) e[i] = this.getUint8();
- var r = e.indexOf(0);
- return r >= 0 && (e = e.slice(0, r)), n.LoaderUtils.decodeText(new Uint8Array(e))
- }
- }, c.prototype = {
- constructor: c,
- add: function(t, e) {
- this[t] = e
- }
- };
- var f = [];
- function m(t, e, i, n) {
- var r;
- switch (n.mappingType) {
- case "ByPolygonVertex":
- r = t;
- break;
- case "ByPolygon":
- r = e;
- break;
- case "ByVertice":
- r = i;
- break;
- case "AllSame":
- r = n.indices[0]
- }
- "IndexToDirect" === n.referenceType && (r = n.indices[r]);
- var o = r * n.dataSize,
- a = o + n.dataSize;
- return function(t, e, i, n) {
- for (var r = i, o = 0; r < n; r++, o++) t[o] = e[r];
- return t
- }(f, n.buffer, o, a)
- }
- var g = new n.Euler,
- v = new n.Vector3;
- function y(t) {
- var e, i = new n.Matrix4,
- r = new n.Matrix4,
- o = new n.Matrix4,
- a = new n.Matrix4,
- s = new n.Matrix4,
- l = new n.Matrix4,
- u = new n.Matrix4,
- h = new n.Matrix4,
- c = new n.Matrix4,
- d = new n.Matrix4,
- p = new n.Matrix4,
- f = t.inheritType ? t.inheritType : 0;
- (t.translation && i.setPosition(v.fromArray(t.translation)), t.preRotation) && ((e = t.preRotation.map(n.Math.degToRad))
- .push(t.eulerOrder), r.makeRotationFromEuler(g.fromArray(e)));
- t.rotation && ((e = t.rotation.map(n.Math.degToRad))
- .push(t.eulerOrder), o.makeRotationFromEuler(g.fromArray(e)));
- t.postRotation && ((e = t.postRotation.map(n.Math.degToRad))
- .push(t.eulerOrder), a.makeRotationFromEuler(g.fromArray(e)));
- t.scale && s.scale(v.fromArray(t.scale)), t.scalingOffset && u.setPosition(v.fromArray(t.scalingOffset)), t.scalingPivot && l.setPosition(v.fromArray(t.scalingPivot)), t.rotationOffset && h.setPosition(v.fromArray(t.rotationOffset)), t.rotationPivot && c.setPosition(v.fromArray(t.rotationPivot)), t.parentMatrixWorld && (d = t.parentMatrixWorld);
- var m = r.multiply(o)
- .multiply(a),
- y = new n.Matrix4;
- d.extractRotation(y);
- var b, w, x, M, T = new n.Matrix4;
- if (T.copyPosition(d), x = T.getInverse(T)
- .multiply(d), w = y.getInverse(y)
- .multiply(x), b = s, 0 === f) M = y.multiply(m)
- .multiply(w)
- .multiply(b);
- else if (1 === f) M = y.multiply(w)
- .multiply(m)
- .multiply(b);
- else {
- var S = (new n.Matrix4)
- .copy(s),
- _ = w.multiply(S.getInverse(S));
- M = y.multiply(m)
- .multiply(_)
- .multiply(b)
- }
- var A = i.multiply(h)
- .multiply(c)
- .multiply(r)
- .multiply(o)
- .multiply(a)
- .multiply(c.getInverse(c))
- .multiply(u)
- .multiply(l)
- .multiply(s)
- .multiply(l.getInverse(l)),
- P = (new n.Matrix4)
- .copyPosition(A),
- C = d.multiply(P);
- return p.copyPosition(C), A = p.multiply(M)
- }
- function b(t) {
- var e = ["ZYX", "YZX", "XZY", "ZXY", "YXZ", "XYZ"];
- return 6 === (t = t || 0) ? e[0] : e[t]
- }
- function w(t) {
- return t.split(",")
- .map((function(t) {
- return parseFloat(t)
- }))
- }
- function x(t, e, i) {
- return void 0 === e && (e = 0), void 0 === i && (i = t.byteLength), n.LoaderUtils.decodeText(new Uint8Array(t, e, i))
- }
- function M(t, e, i) {
- return t.slice(0, e)
- .concat(i)
- .concat(t.slice(e))
- }
- return r
- }()
- }, function(t, e, i) {
- ! function() {
- "use strict";
- i(122);
- var e = i(0);
- t.exports = {
- load: function(t) {
- var i = new e.GLTFLoader;
- return new Promise((function(e, n) {
- i.load(t, (function(t) {
- t && e(t)
- }))
- }))
- }
- }
- }()
- }, function(t, e, i) {
- var n = i(0);
- n.GLTFLoader = function() {
- function t(t) {
- this.manager = void 0 !== t ? t : n.DefaultLoadingManager, this.dracoLoader = null
- }
- function e() {
- var t = {};
- return {
- get: function(e) {
- return t[e]
- },
- add: function(e, i) {
- t[e] = i
- },
- remove: function(e) {
- delete t[e]
- },
- removeAll: function() {
- t = {}
- }
- }
- }
- t.prototype = {
- constructor: t,
- crossOrigin: "anonymous",
- load: function(t, e, i, r) {
- var o, a = this;
- o = void 0 !== this.resourcePath ? this.resourcePath : void 0 !== this.path ? this.path : n.LoaderUtils.extractUrlBase(t), a.manager.itemStart(t);
- var s = function(e) {
- r && r(e), a.manager.itemError(t), a.manager.itemEnd(t)
- },
- l = new n.FileLoader(a.manager);
- l.setPath(this.path), l.setResponseType("arraybuffer"), l.load(t, (function(i) {
- try {
- a.parse(i, o, (function(i) {
- e(i), a.manager.itemEnd(t)
- }), s)
- } catch (t) {
- s(t)
- }
- }), i, s)
- },
- setCrossOrigin: function(t) {
- return this.crossOrigin = t, this
- },
- setPath: function(t) {
- return this.path = t, this
- },
- setResourcePath: function(t) {
- return this.resourcePath = t, this
- },
- setDRACOLoader: function(t) {
- return this.dracoLoader = t, this
- },
- parse: function(t, e, l, u) {
- var f, m = {};
- if ("string" == typeof t) f = t;
- else if (n.LoaderUtils.decodeText(new Uint8Array(t, 0, 4)) === s) {
- try {
- m[i.KHR_BINARY_GLTF] = new h(t)
- } catch (t) {
- return void(u && u(t))
- }
- f = m[i.KHR_BINARY_GLTF].content
- } else f = n.LoaderUtils.decodeText(new Uint8Array(t));
- var g = JSON.parse(f);
- if (void 0 === g.asset || g.asset.version[0] < 2) u && u(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead."));
- else {
- if (g.extensionsUsed)
- for (var v = 0; v < g.extensionsUsed.length; ++v) {
- var y = g.extensionsUsed[v],
- b = g.extensionsRequired || [];
- switch (y) {
- case i.KHR_LIGHTS_PUNCTUAL:
- m[y] = new o(g);
- break;
- case i.KHR_MATERIALS_UNLIT:
- m[y] = new a(g);
- break;
- case i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:
- m[y] = new p(g);
- break;
- case i.KHR_DRACO_MESH_COMPRESSION:
- m[y] = new c(g, this.dracoLoader);
- break;
- case i.MSFT_TEXTURE_DDS:
- m[i.MSFT_TEXTURE_DDS] = new r;
- break;
- case i.KHR_TEXTURE_TRANSFORM:
- m[i.KHR_TEXTURE_TRANSFORM] = new d(g);
- break;
- default:
- b.indexOf(y)
- }
- }
- new U(g, m, {
- path: e || this.resourcePath || "",
- crossOrigin: this.crossOrigin,
- manager: this.manager
- })
- .parse(l, u)
- }
- }
- };
- var i = {
- KHR_BINARY_GLTF: "KHR_binary_glTF",
- KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
- KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
- KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: "KHR_materials_pbrSpecularGlossiness",
- KHR_MATERIALS_UNLIT: "KHR_materials_unlit",
- KHR_TEXTURE_TRANSFORM: "KHR_texture_transform",
- MSFT_TEXTURE_DDS: "MSFT_texture_dds"
- };
- function r() {
- if (!n.DDSLoader) throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");
- this.name = i.MSFT_TEXTURE_DDS, this.ddsLoader = new n.DDSLoader
- }
- function o(t) {
- this.name = i.KHR_LIGHTS_PUNCTUAL;
- var e = t.extensions && t.extensions[i.KHR_LIGHTS_PUNCTUAL] || {};
- this.lightDefs = e.lights || []
- }
- function a() {
- this.name = i.KHR_MATERIALS_UNLIT
- }
- o.prototype.loadLight = function(t) {
- var e, i = this.lightDefs[t],
- r = new n.Color(16777215);
- void 0 !== i.color && r.fromArray(i.color);
- var o = void 0 !== i.range ? i.range : 0;
- switch (i.type) {
- case "directional":
- (e = new n.DirectionalLight(r))
- .target.position.set(0, 0, -1), e.add(e.target);
- break;
- case "point":
- (e = new n.PointLight(r))
- .distance = o;
- break;
- case "spot":
- (e = new n.SpotLight(r))
- .distance = o, i.spot = i.spot || {}, i.spot.innerConeAngle = void 0 !== i.spot.innerConeAngle ? i.spot.innerConeAngle : 0, i.spot.outerConeAngle = void 0 !== i.spot.outerConeAngle ? i.spot.outerConeAngle : Math.PI / 4, e.angle = i.spot.outerConeAngle, e.penumbra = 1 - i.spot.innerConeAngle / i.spot.outerConeAngle, e.target.position.set(0, 0, -1), e.add(e.target);
- break;
- default:
- throw new Error('THREE.GLTFLoader: Unexpected light type, "' + i.type + '".')
- }
- return e.position.set(0, 0, 0), e.decay = 2, void 0 !== i.intensity && (e.intensity = i.intensity), e.name = i.name || "light_" + t, Promise.resolve(e)
- }, a.prototype.getMaterialType = function() {
- return n.MeshBasicMaterial
- }, a.prototype.extendParams = function(t, e, i) {
- var r = [];
- t.color = new n.Color(1, 1, 1), t.opacity = 1;
- var o = e.pbrMetallicRoughness;
- if (o) {
- if (Array.isArray(o.baseColorFactor)) {
- var a = o.baseColorFactor;
- t.color.fromArray(a), t.opacity = a[3]
- }
- void 0 !== o.baseColorTexture && r.push(i.assignTexture(t, "map", o.baseColorTexture))
- }
- return Promise.all(r)
- };
- var s = "glTF",
- l = 1313821514,
- u = 5130562;
- function h(t) {
- this.name = i.KHR_BINARY_GLTF, this.content = null, this.body = null;
- var e = new DataView(t, 0, 12);
- if (this.header = {
- magic: n.LoaderUtils.decodeText(new Uint8Array(t.slice(0, 4))),
- version: e.getUint32(4, !0),
- length: e.getUint32(8, !0)
- }, this.header.magic !== s) throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
- if (this.header.version < 2) throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");
- for (var r = new DataView(t, 12), o = 0; o < r.byteLength;) {
- var a = r.getUint32(o, !0);
- o += 4;
- var h = r.getUint32(o, !0);
- if (o += 4, h === l) {
- var c = new Uint8Array(t, 12 + o, a);
- this.content = n.LoaderUtils.decodeText(c)
- } else if (h === u) {
- var d = 12 + o;
- this.body = t.slice(d, d + a)
- }
- o += a
- }
- if (null === this.content) throw new Error("THREE.GLTFLoader: JSON content not found.")
- }
- function c(t, e) {
- if (!e) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
- this.name = i.KHR_DRACO_MESH_COMPRESSION, this.json = t, this.dracoLoader = e
- }
- function d() {
- this.name = i.KHR_TEXTURE_TRANSFORM
- }
- function p() {
- return {
- name: i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,
- specularGlossinessParams: ["color", "map", "lightMap", "lightMapIntensity", "aoMap", "aoMapIntensity", "emissive", "emissiveIntensity", "emissiveMap", "bumpMap", "bumpScale", "normalMap", "displacementMap", "displacementScale", "displacementBias", "specularMap", "specular", "glossinessMap", "glossiness", "alphaMap", "envMap", "envMapIntensity", "refractionRatio"],
- getMaterialType: function() {
- return n.ShaderMaterial
- },
- extendParams: function(t, e, i) {
- var r = e.extensions[this.name],
- o = n.ShaderLib.standard,
- a = n.UniformsUtils.clone(o.uniforms),
- s = ["#ifdef USE_SPECULARMAP", "\tuniform sampler2D specularMap;", "#endif"].join("\n"),
- l = ["#ifdef USE_GLOSSINESSMAP", "\tuniform sampler2D glossinessMap;", "#endif"].join("\n"),
- u = ["vec3 specularFactor = specular;", "#ifdef USE_SPECULARMAP", "\tvec4 texelSpecular = texture2D( specularMap, vUv );", "\ttexelSpecular = sRGBToLinear( texelSpecular );", "\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture", "\tspecularFactor *= texelSpecular.rgb;", "#endif"].join("\n"),
- h = ["float glossinessFactor = glossiness;", "#ifdef USE_GLOSSINESSMAP", "\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );", "\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture", "\tglossinessFactor *= texelGlossiness.a;", "#endif"].join("\n"),
- c = ["PhysicalMaterial material;", "material.diffuseColor = diffuseColor.rgb;", "material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );", "material.specularColor = specularFactor.rgb;"].join("\n"),
- d = o.fragmentShader.replace("uniform float roughness;", "uniform vec3 specular;")
- .replace("uniform float metalness;", "uniform float glossiness;")
- .replace("#include <roughnessmap_pars_fragment>", s)
- .replace("#include <metalnessmap_pars_fragment>", l)
- .replace("#include <roughnessmap_fragment>", u)
- .replace("#include <metalnessmap_fragment>", h)
- .replace("#include <lights_physical_fragment>", c);
- delete a.roughness, delete a.metalness, delete a.roughnessMap, delete a.metalnessMap, a.specular = {
- value: (new n.Color)
- .setHex(1118481)
- }, a.glossiness = {
- value: .5
- }, a.specularMap = {
- value: null
- }, a.glossinessMap = {
- value: null
- }, t.vertexShader = o.vertexShader, t.fragmentShader = d, t.uniforms = a, t.defines = {
- STANDARD: ""
- }, t.color = new n.Color(1, 1, 1), t.opacity = 1;
- var p = [];
- if (Array.isArray(r.diffuseFactor)) {
- var f = r.diffuseFactor;
- t.color.fromArray(f), t.opacity = f[3]
- }
- if (void 0 !== r.diffuseTexture && p.push(i.assignTexture(t, "map", r.diffuseTexture)), t.emissive = new n.Color(0, 0, 0), t.glossiness = void 0 !== r.glossinessFactor ? r.glossinessFactor : 1, t.specular = new n.Color(1, 1, 1), Array.isArray(r.specularFactor) && t.specular.fromArray(r.specularFactor), void 0 !== r.specularGlossinessTexture) {
- var m = r.specularGlossinessTexture;
- p.push(i.assignTexture(t, "glossinessMap", m)), p.push(i.assignTexture(t, "specularMap", m))
- }
- return Promise.all(p)
- },
- createMaterial: function(t) {
- var e = new n.ShaderMaterial({
- defines: t.defines,
- vertexShader: t.vertexShader,
- fragmentShader: t.fragmentShader,
- uniforms: t.uniforms,
- fog: !0,
- lights: !0,
- opacity: t.opacity,
- transparent: t.transparent
- });
- return e.isGLTFSpecularGlossinessMaterial = !0, e.color = t.color, e.map = void 0 === t.map ? null : t.map, e.lightMap = null, e.lightMapIntensity = 1, e.aoMap = void 0 === t.aoMap ? null : t.aoMap, e.aoMapIntensity = 1, e.emissive = t.emissive, e.emissiveIntensity = 1, e.emissiveMap = void 0 === t.emissiveMap ? null : t.emissiveMap, e.bumpMap = void 0 === t.bumpMap ? null : t.bumpMap, e.bumpScale = 1, e.normalMap = void 0 === t.normalMap ? null : t.normalMap, t.normalScale && (e.normalScale = t.normalScale), e.displacementMap = null, e.displacementScale = 1, e.displacementBias = 0, e.specularMap = void 0 === t.specularMap ? null : t.specularMap, e.specular = t.specular, e.glossinessMap = void 0 === t.glossinessMap ? null : t.glossinessMap, e.glossiness = t.glossiness, e.alphaMap = null, e.envMap = void 0 === t.envMap ? null : t.envMap, e.envMapIntensity = 1, e.refractionRatio = .98, e.extensions.derivatives = !0, e
- },
- cloneMaterial: function(t) {
- var e = t.clone();
- e.isGLTFSpecularGlossinessMaterial = !0;
- for (var i = this.specularGlossinessParams, n = 0, r = i.length; n < r; n++) e[i[n]] = t[i[n]];
- return e
- },
- refreshUniforms: function(t, e, i, n, r, o) {
- if (!0 === r.isGLTFSpecularGlossinessMaterial) {
- var a, s = r.uniforms,
- l = r.defines;
- s.opacity.value = r.opacity, s.diffuse.value.copy(r.color), s.emissive.value.copy(r.emissive)
- .multiplyScalar(r.emissiveIntensity), s.map.value = r.map, s.specularMap.value = r.specularMap, s.alphaMap.value = r.alphaMap, s.lightMap.value = r.lightMap, s.lightMapIntensity.value = r.lightMapIntensity, s.aoMap.value = r.aoMap, s.aoMapIntensity.value = r.aoMapIntensity, r.map ? a = r.map : r.specularMap ? a = r.specularMap : r.displacementMap ? a = r.displacementMap : r.normalMap ? a = r.normalMap : r.bumpMap ? a = r.bumpMap : r.glossinessMap ? a = r.glossinessMap : r.alphaMap ? a = r.alphaMap : r.emissiveMap && (a = r.emissiveMap), void 0 !== a && (a.isWebGLRenderTarget && (a = a.texture), !0 === a.matrixAutoUpdate && a.updateMatrix(), s.uvTransform.value.copy(a.matrix)), r.envMap && (s.envMap.value = r.envMap, s.envMapIntensity.value = r.envMapIntensity, s.flipEnvMap.value = r.envMap.isCubeTexture ? -1 : 1, s.reflectivity.value = r.reflectivity, s.refractionRatio.value = r.refractionRatio, s.maxMipLevel.value = t.properties.get(r.envMap)
- .__maxMipLevel), s.specular.value.copy(r.specular), s.glossiness.value = r.glossiness, s.glossinessMap.value = r.glossinessMap, s.emissiveMap.value = r.emissiveMap, s.bumpMap.value = r.bumpMap, s.normalMap.value = r.normalMap, s.displacementMap.value = r.displacementMap, s.displacementScale.value = r.displacementScale, s.displacementBias.value = r.displacementBias, null !== s.glossinessMap.value && void 0 === l.USE_GLOSSINESSMAP && (l.USE_GLOSSINESSMAP = "", l.USE_ROUGHNESSMAP = ""), null === s.glossinessMap.value && void 0 !== l.USE_GLOSSINESSMAP && (delete l.USE_GLOSSINESSMAP, delete l.USE_ROUGHNESSMAP)
- }
- }
- }
- }
- function f(t, e, i, r) {
- n.Interpolant.call(this, t, e, i, r)
- }
- c.prototype.decodePrimitive = function(t, e) {
- var i = this.json,
- n = this.dracoLoader,
- r = t.extensions[this.name].bufferView,
- o = t.extensions[this.name].attributes,
- a = {},
- s = {},
- l = {};
- for (var u in o) {
- var h = P[u] || u.toLowerCase();
- a[h] = o[u]
- }
- for (u in t.attributes) {
- h = P[u] || u.toLowerCase();
- if (void 0 !== o[u]) {
- var c = i.accessors[t.attributes[u]],
- d = T[c.componentType];
- l[h] = d, s[h] = !0 === c.normalized
- }
- }
- return e.getDependency("bufferView", r)
- .then((function(t) {
- return new Promise((function(e) {
- n.decodeDracoFile(t, (function(t) {
- for (var i in t.attributes) {
- var n = t.attributes[i],
- r = s[i];
- void 0 !== r && (n.normalized = r)
- }
- e(t)
- }), a, l)
- }))
- }))
- }, d.prototype.extendTexture = function(t, e) {
- return t = t.clone(), void 0 !== e.offset && t.offset.fromArray(e.offset), void 0 !== e.rotation && (t.rotation = e.rotation), void 0 !== e.scale && t.repeat.fromArray(e.scale), e.texCoord, t.needsUpdate = !0, t
- }, f.prototype = Object.create(n.Interpolant.prototype), f.prototype.constructor = f, f.prototype.copySampleValue_ = function(t) {
- for (var e = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = t * n * 3 + n, o = 0; o !== n; o++) e[o] = i[r + o];
- return e
- }, f.prototype.beforeStart_ = f.prototype.copySampleValue_, f.prototype.afterEnd_ = f.prototype.copySampleValue_, f.prototype.interpolate_ = function(t, e, i, n) {
- for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = 2 * a, l = 3 * a, u = n - e, h = (i - e) / u, c = h * h, d = c * h, p = t * l, f = p - l, m = -2 * d + 3 * c, g = d - c, v = 1 - m, y = g - c + h, b = 0; b !== a; b++) {
- var w = o[f + b + a],
- x = o[f + b + s] * u,
- M = o[p + b + a],
- T = o[p + b] * u;
- r[b] = v * w + y * x + m * M + g * T
- }
- return r
- };
- var m, g = 0,
- v = 1,
- y = 2,
- b = 3,
- w = 4,
- x = 5,
- M = 6,
- T = (n.Matrix3, n.Matrix4, n.Vector2, n.Vector3, n.Vector4, n.Texture, {
- 5120: Int8Array,
- 5121: Uint8Array,
- 5122: Int16Array,
- 5123: Uint16Array,
- 5125: Uint32Array,
- 5126: Float32Array
- }),
- S = {
- 9728: n.NearestFilter,
- 9729: n.LinearFilter,
- 9984: n.NearestMipMapNearestFilter,
- 9985: n.LinearMipMapNearestFilter,
- 9986: n.NearestMipMapLinearFilter,
- 9987: n.LinearMipMapLinearFilter
- },
- _ = {
- 33071: n.ClampToEdgeWrapping,
- 33648: n.MirroredRepeatWrapping,
- 10497: n.RepeatWrapping
- },
- A = (n.BackSide, n.FrontSide, n.NeverDepth, n.LessDepth, n.EqualDepth, n.LessEqualDepth, n.GreaterEqualDepth, n.NotEqualDepth, n.GreaterEqualDepth, n.AlwaysDepth, n.AddEquation, n.SubtractEquation, n.ReverseSubtractEquation, n.ZeroFactor, n.OneFactor, n.SrcColorFactor, n.OneMinusSrcColorFactor, n.SrcAlphaFactor, n.OneMinusSrcAlphaFactor, n.DstAlphaFactor, n.OneMinusDstAlphaFactor, n.DstColorFactor, n.OneMinusDstColorFactor, n.SrcAlphaSaturateFactor, {
- SCALAR: 1,
- VEC2: 2,
- VEC3: 3,
- VEC4: 4,
- MAT2: 4,
- MAT3: 9,
- MAT4: 16
- }),
- P = {
- POSITION: "position",
- NORMAL: "normal",
- TANGENT: "tangent",
- TEXCOORD_0: "uv",
- TEXCOORD_1: "uv2",
- COLOR_0: "color",
- WEIGHTS_0: "skinWeight",
- JOINTS_0: "skinIndex"
- },
- C = {
- scale: "scale",
- translation: "position",
- rotation: "quaternion",
- weights: "morphTargetInfluences"
- },
- E = {
- CUBICSPLINE: void 0,
- LINEAR: n.InterpolateLinear,
- STEP: n.InterpolateDiscrete
- },
- D = "OPAQUE",
- L = "MASK",
- O = "BLEND",
- I = {
- "image/png": n.RGBAFormat,
- "image/jpeg": n.RGBFormat
- };
- function R(t, e) {
- return "string" != typeof t || "" === t ? "" : /^(https?:)?\/\//i.test(t) || /^data:.*,.*$/i.test(t) || /^blob:.*$/i.test(t) ? t : e + t
- }
- function N(t, e, i) {
- for (var n in i.extensions) void 0 === t[n] && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[n] = i.extensions[n])
- }
- function k(t, e) {
- void 0 !== e.extras && "object" == typeof e.extras && (t.userData = e.extras)
- }
- function F(t, e) {
- if (t.updateMorphTargets(), void 0 !== e.weights)
- for (var i = 0, n = e.weights.length; i < n; i++) t.morphTargetInfluences[i] = e.weights[i];
- if (e.extras && Array.isArray(e.extras.targetNames)) {
- var r = e.extras.targetNames;
- if (t.morphTargetInfluences.length === r.length) {
- t.morphTargetDictionary = {};
- for (i = 0, n = r.length; i < n; i++) t.morphTargetDictionary[r[i]] = i
- }
- }
- }
- function B(t) {
- for (var e = "", i = Object.keys(t)
- .sort(), n = 0, r = i.length; n < r; n++) e += i[n] + ":" + t[i[n]] + ";";
- return e
- }
- function z(t) {
- if (t.isInterleavedBufferAttribute) {
- for (var e = t.count, i = t.itemSize, r = t.array.slice(0, e * i), o = 0, a = 0; o < e; ++o) r[a++] = t.getX(o), i >= 2 && (r[a++] = t.getY(o)), i >= 3 && (r[a++] = t.getZ(o)), i >= 4 && (r[a++] = t.getW(o));
- return new n.BufferAttribute(r, i, t.normalized)
- }
- return t.clone()
- }
- function U(t, i, r) {
- this.json = t || {}, this.extensions = i || {}, this.options = r || {}, this.cache = new e, this.primitiveCache = {}, this.textureLoader = new n.TextureLoader(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.fileLoader = new n.FileLoader(this.options.manager), this.fileLoader.setResponseType("arraybuffer")
- }
- function V(t, e, i) {
- var n = e.attributes,
- r = [];
- function o(e, n) {
- return i.getDependency("accessor", e)
- .then((function(e) {
- t.addAttribute(n, e)
- }))
- }
- for (var a in n) {
- var s = P[a] || a.toLowerCase();
- s in t.attributes || r.push(o(n[a], s))
- }
- if (void 0 !== e.indices && !t.index) {
- var l = i.getDependency("accessor", e.indices)
- .then((function(e) {
- t.setIndex(e)
- }));
- r.push(l)
- }
- return k(t, e), Promise.all(r)
- .then((function() {
- return void 0 !== e.targets ? function(t, e, i) {
- for (var n = !1, r = !1, o = 0, a = e.length; o < a; o++) {
- if (void 0 !== (u = e[o])
- .POSITION && (n = !0), void 0 !== u.NORMAL && (r = !0), n && r) break
- }
- if (!n && !r) return Promise.resolve(t);
- var s = [],
- l = [];
- for (o = 0, a = e.length; o < a; o++) {
- var u = e[o];
- if (n) {
- var h = void 0 !== u.POSITION ? i.getDependency("accessor", u.POSITION) : t.attributes.position;
- s.push(h)
- }
- if (r) {
- h = void 0 !== u.NORMAL ? i.getDependency("accessor", u.NORMAL) : t.attributes.normal;
- l.push(h)
- }
- }
- return Promise.all([Promise.all(s), Promise.all(l)])
- .then((function(i) {
- for (var o = i[0], a = i[1], s = 0, l = o.length; s < l; s++) t.attributes.position !== o[s] && (o[s] = z(o[s]));
- for (s = 0, l = a.length; s < l; s++) t.attributes.normal !== a[s] && (a[s] = z(a[s]));
- for (s = 0, l = e.length; s < l; s++) {
- var u = e[s],
- h = "morphTarget" + s;
- if (n && void 0 !== u.POSITION) {
- var c = o[s];
- c.name = h;
- for (var d = t.attributes.position, p = 0, f = c.count; p < f; p++) c.setXYZ(p, c.getX(p) + d.getX(p), c.getY(p) + d.getY(p), c.getZ(p) + d.getZ(p))
- }
- if (r && void 0 !== u.NORMAL) {
- var m = a[s];
- m.name = h;
- var g = t.attributes.normal;
- for (p = 0, f = m.count; p < f; p++) m.setXYZ(p, m.getX(p) + g.getX(p), m.getY(p) + g.getY(p), m.getZ(p) + g.getZ(p))
- }
- }
- return n && (t.morphAttributes.position = o), r && (t.morphAttributes.normal = a), t
- }))
- }(t, e.targets, i) : t
- }))
- }
- return U.prototype.parse = function(t, e) {
- var i = this,
- n = this.json,
- r = this.extensions;
- this.cache.removeAll(), this.markDefs(), Promise.all([this.getDependencies("scene"), this.getDependencies("animation"), this.getDependencies("camera")])
- .then((function(e) {
- var o = {
- scene: e[0][n.scene || 0],
- scenes: e[0],
- animations: e[1],
- cameras: e[2],
- asset: n.asset,
- parser: i,
- userData: {}
- };
- N(r, o, n), t(o)
- }))
- .catch(e)
- }, U.prototype.markDefs = function() {
- for (var t = this.json.nodes || [], e = this.json.skins || [], i = this.json.meshes || [], n = {}, r = {}, o = 0, a = e.length; o < a; o++)
- for (var s = e[o].joints, l = 0, u = s.length; l < u; l++) t[s[l]].isBone = !0;
- for (var h = 0, c = t.length; h < c; h++) {
- var d = t[h];
- void 0 !== d.mesh && (void 0 === n[d.mesh] && (n[d.mesh] = r[d.mesh] = 0), n[d.mesh]++, void 0 !== d.skin && (i[d.mesh].isSkinnedMesh = !0))
- }
- this.json.meshReferences = n, this.json.meshUses = r
- }, U.prototype.getDependency = function(t, e) {
- var n = t + ":" + e,
- r = this.cache.get(n);
- if (!r) {
- switch (t) {
- case "scene":
- r = this.loadScene(e);
- break;
- case "node":
- r = this.loadNode(e);
- break;
- case "mesh":
- r = this.loadMesh(e);
- break;
- case "accessor":
- r = this.loadAccessor(e);
- break;
- case "bufferView":
- r = this.loadBufferView(e);
- break;
- case "buffer":
- r = this.loadBuffer(e);
- break;
- case "material":
- r = this.loadMaterial(e);
- break;
- case "texture":
- r = this.loadTexture(e);
- break;
- case "skin":
- r = this.loadSkin(e);
- break;
- case "animation":
- r = this.loadAnimation(e);
- break;
- case "camera":
- r = this.loadCamera(e);
- break;
- case "light":
- r = this.extensions[i.KHR_LIGHTS_PUNCTUAL].loadLight(e);
- break;
- default:
- throw new Error("Unknown type: " + t)
- }
- this.cache.add(n, r)
- }
- return r
- }, U.prototype.getDependencies = function(t) {
- var e = this.cache.get(t);
- if (!e) {
- var i = this,
- n = this.json[t + ("mesh" === t ? "es" : "s")] || [];
- e = Promise.all(n.map((function(e, n) {
- return i.getDependency(t, n)
- }))), this.cache.add(t, e)
- }
- return e
- }, U.prototype.loadBuffer = function(t) {
- var e = this.json.buffers[t],
- n = this.fileLoader;
- if (e.type && "arraybuffer" !== e.type) throw new Error("THREE.GLTFLoader: " + e.type + " buffer type is not supported.");
- if (void 0 === e.uri && 0 === t) return Promise.resolve(this.extensions[i.KHR_BINARY_GLTF].body);
- var r = this.options;
- return new Promise((function(t, i) {
- n.load(R(e.uri, r.path), t, void 0, (function() {
- i(new Error('THREE.GLTFLoader: Failed to load buffer "' + e.uri + '".'))
- }))
- }))
- }, U.prototype.loadBufferView = function(t) {
- var e = this.json.bufferViews[t];
- return this.getDependency("buffer", e.buffer)
- .then((function(t) {
- var i = e.byteLength || 0,
- n = e.byteOffset || 0;
- return t.slice(n, n + i)
- }))
- }, U.prototype.loadAccessor = function(t) {
- var e = this,
- i = this.json,
- r = this.json.accessors[t];
- if (void 0 === r.bufferView && void 0 === r.sparse) return Promise.resolve(null);
- var o = [];
- return void 0 !== r.bufferView ? o.push(this.getDependency("bufferView", r.bufferView)) : o.push(null), void 0 !== r.sparse && (o.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), o.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(o)
- .then((function(t) {
- var o, a, s = t[0],
- l = A[r.type],
- u = T[r.componentType],
- h = u.BYTES_PER_ELEMENT,
- c = h * l,
- d = r.byteOffset || 0,
- p = void 0 !== r.bufferView ? i.bufferViews[r.bufferView].byteStride : void 0,
- f = !0 === r.normalized;
- if (p && p !== c) {
- var m = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType,
- g = e.cache.get(m);
- g || (o = new u(s), g = new n.InterleavedBuffer(o, p / h), e.cache.add(m, g)), a = new n.InterleavedBufferAttribute(g, l, d / h, f)
- } else o = null === s ? new u(r.count * l) : new u(s, d, r.count * l), a = new n.BufferAttribute(o, l, f);
- if (void 0 !== r.sparse) {
- var v = A.SCALAR,
- y = T[r.sparse.indices.componentType],
- b = r.sparse.indices.byteOffset || 0,
- w = r.sparse.values.byteOffset || 0,
- x = new y(t[1], b, r.sparse.count * v),
- M = new u(t[2], w, r.sparse.count * l);
- null !== s && a.setArray(a.array.slice());
- for (var S = 0, _ = x.length; S < _; S++) {
- var P = x[S];
- if (a.setX(P, M[S * l]), l >= 2 && a.setY(P, M[S * l + 1]), l >= 3 && a.setZ(P, M[S * l + 2]), l >= 4 && a.setW(P, M[S * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")
- }
- }
- return a
- }))
- }, U.prototype.loadTexture = function(t) {
- var e, r = this,
- o = this.json,
- a = this.options,
- s = this.textureLoader,
- l = window.URL || window.webkitURL,
- u = o.textures[t],
- h = u.extensions || {},
- c = (e = h[i.MSFT_TEXTURE_DDS] ? o.images[h[i.MSFT_TEXTURE_DDS].source] : o.images[u.source])
- .uri,
- d = !1;
- return void 0 !== e.bufferView && (c = r.getDependency("bufferView", e.bufferView)
- .then((function(t) {
- d = !0;
- var i = new Blob([t], {
- type: e.mimeType
- });
- return c = l.createObjectURL(i)
- }))), Promise.resolve(c)
- .then((function(t) {
- var e = n.Loader.Handlers.get(t);
- return e || (e = h[i.MSFT_TEXTURE_DDS] ? r.extensions[i.MSFT_TEXTURE_DDS].ddsLoader : s), new Promise((function(i, n) {
- e.load(R(t, a.path), i, void 0, n)
- }))
- }))
- .then((function(t) {
- !0 === d && l.revokeObjectURL(c), t.flipY = !1, void 0 !== u.name && (t.name = u.name), e.mimeType in I && (t.format = I[e.mimeType]);
- var i = (o.samplers || {})[u.sampler] || {};
- return t.magFilter = S[i.magFilter] || n.LinearFilter, t.minFilter = S[i.minFilter] || n.LinearMipMapLinearFilter, t.wrapS = _[i.wrapS] || n.RepeatWrapping, t.wrapT = _[i.wrapT] || n.RepeatWrapping, t
- }))
- }, U.prototype.assignTexture = function(t, e, r) {
- var o = this;
- return this.getDependency("texture", r.index)
- .then((function(a) {
- if (!a.isCompressedTexture) switch (e) {
- case "aoMap":
- case "emissiveMap":
- case "metalnessMap":
- case "normalMap":
- case "roughnessMap":
- a.format = n.RGBFormat
- }
- if (o.extensions[i.KHR_TEXTURE_TRANSFORM]) {
- var s = void 0 !== r.extensions ? r.extensions[i.KHR_TEXTURE_TRANSFORM] : void 0;
- s && (a = o.extensions[i.KHR_TEXTURE_TRANSFORM].extendTexture(a, s))
- }
- t[e] = a
- }))
- }, U.prototype.assignFinalMaterial = function(t) {
- var e = t.geometry,
- r = t.material,
- o = this.extensions,
- a = void 0 !== e.attributes.tangent,
- s = void 0 !== e.attributes.color,
- l = void 0 === e.attributes.normal,
- u = !0 === t.isSkinnedMesh,
- h = Object.keys(e.morphAttributes)
- .length > 0,
- c = h && void 0 !== e.morphAttributes.normal;
- if (t.isPoints) {
- var d = "PointsMaterial:" + r.uuid,
- p = this.cache.get(d);
- p || (p = new n.PointsMaterial, n.Material.prototype.copy.call(p, r), p.color.copy(r.color), p.map = r.map, p.lights = !1, this.cache.add(d, p)), r = p
- } else if (t.isLine) {
- d = "LineBasicMaterial:" + r.uuid;
- var f = this.cache.get(d);
- f || (f = new n.LineBasicMaterial, n.Material.prototype.copy.call(f, r), f.color.copy(r.color), f.lights = !1, this.cache.add(d, f)), r = f
- }
- if (a || s || l || u || h) {
- d = "ClonedMaterial:" + r.uuid + ":";
- r.isGLTFSpecularGlossinessMaterial && (d += "specular-glossiness:"), u && (d += "skinning:"), a && (d += "vertex-tangents:"), s && (d += "vertex-colors:"), l && (d += "flat-shading:"), h && (d += "morph-targets:"), c && (d += "morph-normals:");
- var m = this.cache.get(d);
- m || (m = r.isGLTFSpecularGlossinessMaterial ? o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(r) : r.clone(), u && (m.skinning = !0), a && (m.vertexTangents = !0), s && (m.vertexColors = n.VertexColors), l && (m.flatShading = !0), h && (m.morphTargets = !0), c && (m.morphNormals = !0), this.cache.add(d, m)), r = m
- }
- r.aoMap && void 0 === e.attributes.uv2 && void 0 !== e.attributes.uv && e.addAttribute("uv2", new n.BufferAttribute(e.attributes.uv.array, 2)), r.isGLTFSpecularGlossinessMaterial && (t.onBeforeRender = o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms), t.material = r
- }, U.prototype.loadMaterial = function(t) {
- var e, r = this.json,
- o = this.extensions,
- a = r.materials[t],
- s = {},
- l = a.extensions || {},
- u = [];
- if (l[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) {
- var h = o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];
- e = h.getMaterialType(), u.push(h.extendParams(s, a, this))
- } else if (l[i.KHR_MATERIALS_UNLIT]) {
- var c = o[i.KHR_MATERIALS_UNLIT];
- e = c.getMaterialType(), u.push(c.extendParams(s, a, this))
- } else {
- e = n.MeshStandardMaterial;
- var d = a.pbrMetallicRoughness || {};
- if (s.color = new n.Color(1, 1, 1), s.opacity = 1, Array.isArray(d.baseColorFactor)) {
- var p = d.baseColorFactor;
- s.color.fromArray(p), s.opacity = p[3]
- }
- void 0 !== d.baseColorTexture && u.push(this.assignTexture(s, "map", d.baseColorTexture)), s.metalness = void 0 !== d.metallicFactor ? d.metallicFactor : 1, s.roughness = void 0 !== d.roughnessFactor ? d.roughnessFactor : 1, void 0 !== d.metallicRoughnessTexture && (u.push(this.assignTexture(s, "metalnessMap", d.metallicRoughnessTexture)), u.push(this.assignTexture(s, "roughnessMap", d.metallicRoughnessTexture)))
- }!0 === a.doubleSided && (s.side = n.DoubleSide);
- var f = a.alphaMode || D;
- return f === O ? s.transparent = !0 : (s.transparent = !1, f === L && (s.alphaTest = void 0 !== a.alphaCutoff ? a.alphaCutoff : .5)), void 0 !== a.normalTexture && e !== n.MeshBasicMaterial && (u.push(this.assignTexture(s, "normalMap", a.normalTexture)), s.normalScale = new n.Vector2(1, 1), void 0 !== a.normalTexture.scale && s.normalScale.set(a.normalTexture.scale, a.normalTexture.scale)), void 0 !== a.occlusionTexture && e !== n.MeshBasicMaterial && (u.push(this.assignTexture(s, "aoMap", a.occlusionTexture)), void 0 !== a.occlusionTexture.strength && (s.aoMapIntensity = a.occlusionTexture.strength)), void 0 !== a.emissiveFactor && e !== n.MeshBasicMaterial && (s.emissive = (new n.Color)
- .fromArray(a.emissiveFactor)), void 0 !== a.emissiveTexture && e !== n.MeshBasicMaterial && u.push(this.assignTexture(s, "emissiveMap", a.emissiveTexture)), Promise.all(u)
- .then((function() {
- var t;
- return t = e === n.ShaderMaterial ? o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s) : new e(s), void 0 !== a.name && (t.name = a.name), t.map && (t.map.encoding = n.sRGBEncoding), t.emissiveMap && (t.emissiveMap.encoding = n.sRGBEncoding), t.specularMap && (t.specularMap.encoding = n.sRGBEncoding), k(t, a), a.extensions && N(o, t, a), t
- }))
- }, U.prototype.loadGeometries = function(t) {
- var e = this,
- r = this.extensions,
- o = this.primitiveCache;
- function a(t) {
- return r[i.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t, e)
- .then((function(i) {
- return V(i, t, e)
- }))
- }
- for (var s, l, u = [], h = 0, c = t.length; h < c; h++) {
- var d, p = t[h],
- f = (l = void 0, (l = (s = p)
- .extensions && s.extensions[i.KHR_DRACO_MESH_COMPRESSION]) ? "draco:" + l.bufferView + ":" + l.indices + ":" + B(l.attributes) : s.indices + ":" + B(s.attributes) + ":" + s.mode),
- m = o[f];
- if (m) u.push(m.promise);
- else d = p.extensions && p.extensions[i.KHR_DRACO_MESH_COMPRESSION] ? a(p) : V(new n.BufferGeometry, p, e), o[f] = {
- primitive: p,
- promise: d
- }, u.push(d)
- }
- return Promise.all(u)
- }, U.prototype.loadMesh = function(t) {
- for (var e = this, i = this.json, r = (this.extensions, i.meshes[t]), o = r.primitives, a = [], s = 0, l = o.length; s < l; s++) {
- var u = void 0 === o[s].material ? m = m || new n.MeshStandardMaterial({
- color: 16777215,
- emissive: 0,
- metalness: 1,
- roughness: 1,
- transparent: !1,
- depthTest: !0,
- side: n.FrontSide
- }) : this.getDependency("material", o[s].material);
- a.push(u)
- }
- return Promise.all(a)
- .then((function(i) {
- return e.loadGeometries(o)
- .then((function(a) {
- for (var s = [], l = 0, u = a.length; l < u; l++) {
- var h, c = a[l],
- d = o[l],
- p = i[l];
- if (d.mode === w || d.mode === x || d.mode === M || void 0 === d.mode) !0 === (h = !0 === r.isSkinnedMesh ? new n.SkinnedMesh(c, p) : new n.Mesh(c, p))
- .isSkinnedMesh && h.normalizeSkinWeights(), d.mode === x ? h.drawMode = n.TriangleStripDrawMode : d.mode === M && (h.drawMode = n.TriangleFanDrawMode);
- else if (d.mode === v) h = new n.LineSegments(c, p);
- else if (d.mode === b) h = new n.Line(c, p);
- else if (d.mode === y) h = new n.LineLoop(c, p);
- else {
- if (d.mode !== g) throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + d.mode);
- h = new n.Points(c, p)
- }
- Object.keys(h.geometry.morphAttributes)
- .length > 0 && F(h, r), h.name = r.name || "mesh_" + t, a.length > 1 && (h.name += "_" + l), k(h, r), e.assignFinalMaterial(h), s.push(h)
- }
- if (1 === s.length) return s[0];
- var f = new n.Group;
- for (l = 0, u = s.length; l < u; l++) f.add(s[l]);
- return f
- }))
- }))
- }, U.prototype.loadCamera = function(t) {
- var e, i = this.json.cameras[t],
- r = i[i.type];
- if (r) return "perspective" === i.type ? e = new n.PerspectiveCamera(n.Math.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : "orthographic" === i.type && (e = new n.OrthographicCamera(r.xmag / -2, r.xmag / 2, r.ymag / 2, r.ymag / -2, r.znear, r.zfar)), void 0 !== i.name && (e.name = i.name), k(e, i), Promise.resolve(e)
- }, U.prototype.loadSkin = function(t) {
- var e = this.json.skins[t],
- i = {
- joints: e.joints
- };
- return void 0 === e.inverseBindMatrices ? Promise.resolve(i) : this.getDependency("accessor", e.inverseBindMatrices)
- .then((function(t) {
- return i.inverseBindMatrices = t, i
- }))
- }, U.prototype.loadAnimation = function(t) {
- for (var e = this.json.animations[t], i = [], r = [], o = [], a = [], s = [], l = 0, u = e.channels.length; l < u; l++) {
- var h = e.channels[l],
- c = e.samplers[h.sampler],
- d = h.target,
- p = void 0 !== d.node ? d.node : d.id,
- m = void 0 !== e.parameters ? e.parameters[c.input] : c.input,
- g = void 0 !== e.parameters ? e.parameters[c.output] : c.output;
- i.push(this.getDependency("node", p)), r.push(this.getDependency("accessor", m)), o.push(this.getDependency("accessor", g)), a.push(c), s.push(d)
- }
- return Promise.all([Promise.all(i), Promise.all(r), Promise.all(o), Promise.all(a), Promise.all(s)])
- .then((function(i) {
- for (var r = i[0], o = i[1], a = i[2], s = i[3], l = i[4], u = [], h = 0, c = r.length; h < c; h++) {
- var d = r[h],
- p = o[h],
- m = a[h],
- g = s[h],
- v = l[h];
- if (void 0 !== d) {
- var y;
- switch (d.updateMatrix(), d.matrixAutoUpdate = !0, C[v.path]) {
- case C.weights:
- y = n.NumberKeyframeTrack;
- break;
- case C.rotation:
- y = n.QuaternionKeyframeTrack;
- break;
- case C.position:
- case C.scale:
- default:
- y = n.VectorKeyframeTrack
- }
- var b = d.name ? d.name : d.uuid,
- w = void 0 !== g.interpolation ? E[g.interpolation] : n.InterpolateLinear,
- x = [];
- C[v.path] === C.weights ? d.traverse((function(t) {
- !0 === t.isMesh && t.morphTargetInfluences && x.push(t.name ? t.name : t.uuid)
- })) : x.push(b);
- for (var M = 0, T = x.length; M < T; M++) {
- var S = new y(x[M] + "." + C[v.path], p.array, m.array, w);
- "CUBICSPLINE" === g.interpolation && (S.createInterpolant = function(t) {
- return new f(this.times, this.values, this.getValueSize() / 3, t)
- }, S.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0), u.push(S)
- }
- }
- }
- var _ = void 0 !== e.name ? e.name : "animation_" + t;
- return new n.AnimationClip(_, void 0, u)
- }))
- }, U.prototype.loadNode = function(t) {
- var e = this.json,
- r = this.extensions,
- o = this,
- a = e.meshReferences,
- s = e.meshUses,
- l = e.nodes[t];
- return (!0 === l.isBone ? Promise.resolve(new n.Bone) : void 0 !== l.mesh ? o.getDependency("mesh", l.mesh)
- .then((function(t) {
- var e;
- if (a[l.mesh] > 1) {
- var i = s[l.mesh]++;
- (e = t.clone())
- .name += "_instance_" + i, e.onBeforeRender = t.onBeforeRender;
- for (var n = 0, r = e.children.length; n < r; n++) e.children[n].name += "_instance_" + i, e.children[n].onBeforeRender = t.children[n].onBeforeRender
- } else e = t;
- return void 0 !== l.weights && e.traverse((function(t) {
- if (t.isMesh)
- for (var e = 0, i = l.weights.length; e < i; e++) t.morphTargetInfluences[e] = l.weights[e]
- })), e
- })) : void 0 !== l.camera ? o.getDependency("camera", l.camera) : l.extensions && l.extensions[i.KHR_LIGHTS_PUNCTUAL] && void 0 !== l.extensions[i.KHR_LIGHTS_PUNCTUAL].light ? o.getDependency("light", l.extensions[i.KHR_LIGHTS_PUNCTUAL].light) : Promise.resolve(new n.Object3D))
- .then((function(t) {
- if (void 0 !== l.name && (t.name = n.PropertyBinding.sanitizeNodeName(l.name)), k(t, l), l.extensions && N(r, t, l), void 0 !== l.matrix) {
- var e = new n.Matrix4;
- e.fromArray(l.matrix), t.applyMatrix(e)
- } else void 0 !== l.translation && t.position.fromArray(l.translation), void 0 !== l.rotation && t.quaternion.fromArray(l.rotation), void 0 !== l.scale && t.scale.fromArray(l.scale);
- return t
- }))
- }, U.prototype.loadScene = function() {
- function t(e, i, r, o) {
- var a = r.nodes[e];
- return o.getDependency("node", e)
- .then((function(t) {
- return void 0 === a.skin ? t : o.getDependency("skin", a.skin)
- .then((function(t) {
- for (var i = [], n = 0, r = (e = t)
- .joints.length; n < r; n++) i.push(o.getDependency("node", e.joints[n]));
- return Promise.all(i)
- }))
- .then((function(i) {
- for (var r = !0 === t.isGroup ? t.children : [t], o = 0, a = r.length; o < a; o++) {
- for (var s = r[o], l = [], u = [], h = 0, c = i.length; h < c; h++) {
- var d = i[h];
- if (d) {
- l.push(d);
- var p = new n.Matrix4;
- void 0 !== e.inverseBindMatrices && p.fromArray(e.inverseBindMatrices.array, 16 * h), u.push(p)
- }
- }
- s.bind(new n.Skeleton(l, u), s.matrixWorld)
- }
- return t
- }));
- var e
- }))
- .then((function(e) {
- i.add(e);
- var n = [];
- if (a.children)
- for (var s = a.children, l = 0, u = s.length; l < u; l++) {
- var h = s[l];
- n.push(t(h, e, r, o))
- }
- return Promise.all(n)
- }))
- }
- return function(e) {
- var i = this.json,
- r = this.extensions,
- o = this.json.scenes[e],
- a = new n.Scene;
- void 0 !== o.name && (a.name = o.name), k(a, o), o.extensions && N(r, a, o);
- for (var s = o.nodes || [], l = [], u = 0, h = s.length; u < h; u++) l.push(t(s[u], a, i, this));
- return Promise.all(l)
- .then((function() {
- return a
- }))
- }
- }(), t
- }()
- }, function(t, e, i) {
- "use strict";
- i(124);
- var n = i(0);
- i(68);
- function r() {
- this.loader = new n.OBJLoaderOfMeshMatcapMaterial
- }
- r.prototype.load = function(t) {
- var e = this;
- return new Promise((function(i, n) {
- e.loader.load(t, (function(t) {
- t ? i(t) : n("load obj model error!")
- }))
- }))
- }, t.exports = new r
- }, function(t, e, i) {
- var n = i(0);
- n.OBJLoaderOfMeshMatcapMaterial = function() {
- var t = /^[og]\s*(.+)?/,
- e = /^mtllib /,
- i = /^usemtl /;
- function r() {
- var t = {
- objects: [],
- object: {},
- vertices: [],
- normals: [],
- colors: [],
- uvs: [],
- materialLibraries: [],
- startObject: function(t, e) {
- if (this.object && !1 === this.object.fromDeclaration) return this.object.name = t, void(this.object.fromDeclaration = !1 !== e);
- var i = this.object && "function" == typeof this.object.currentMaterial ? this.object.currentMaterial() : void 0;
- if (this.object && "function" == typeof this.object._finalize && this.object._finalize(!0), this.object = {
- name: t || "",
- fromDeclaration: !1 !== e,
- geometry: {
- vertices: [],
- normals: [],
- colors: [],
- uvs: []
- },
- materials: [],
- smooth: !0,
- startMaterial: function(t, e) {
- var i = this._finalize(!1);
- i && (i.inherited || i.groupCount <= 0) && this.materials.splice(i.index, 1);
- var n = {
- index: this.materials.length,
- name: t || "",
- mtllib: Array.isArray(e) && e.length > 0 ? e[e.length - 1] : "",
- smooth: void 0 !== i ? i.smooth : this.smooth,
- groupStart: void 0 !== i ? i.groupEnd : 0,
- groupEnd: -1,
- groupCount: -1,
- inherited: !1,
- clone: function(t) {
- var e = {
- index: "number" == typeof t ? t : this.index,
- name: this.name,
- mtllib: this.mtllib,
- smooth: this.smooth,
- groupStart: 0,
- groupEnd: -1,
- groupCount: -1,
- inherited: !1
- };
- return e.clone = this.clone.bind(e), e
- }
- };
- return this.materials.push(n), n
- },
- currentMaterial: function() {
- if (this.materials.length > 0) return this.materials[this.materials.length - 1]
- },
- _finalize: function(t) {
- var e = this.currentMaterial();
- if (e && -1 === e.groupEnd && (e.groupEnd = this.geometry.vertices.length / 3, e.groupCount = e.groupEnd - e.groupStart, e.inherited = !1), t && this.materials.length > 1)
- for (var i = this.materials.length - 1; i >= 0; i--) this.materials[i].groupCount <= 0 && this.materials.splice(i, 1);
- return t && 0 === this.materials.length && this.materials.push({
- name: "",
- smooth: this.smooth
- }), e
- }
- }, i && i.name && "function" == typeof i.clone) {
- var n = i.clone(0);
- n.inherited = !0, this.object.materials.push(n)
- }
- this.objects.push(this.object)
- },
- finalize: function() {
- this.object && "function" == typeof this.object._finalize && this.object._finalize(!0)
- },
- parseVertexIndex: function(t, e) {
- var i = parseInt(t, 10);
- return 3 * (i >= 0 ? i - 1 : i + e / 3)
- },
- parseNormalIndex: function(t, e) {
- var i = parseInt(t, 10);
- return 3 * (i >= 0 ? i - 1 : i + e / 3)
- },
- parseUVIndex: function(t, e) {
- var i = parseInt(t, 10);
- return 2 * (i >= 0 ? i - 1 : i + e / 2)
- },
- addVertex: function(t, e, i) {
- var n = this.vertices,
- r = this.object.geometry.vertices;
- r.push(n[t + 0], n[t + 1], n[t + 2]), r.push(n[e + 0], n[e + 1], n[e + 2]), r.push(n[i + 0], n[i + 1], n[i + 2])
- },
- addVertexPoint: function(t) {
- var e = this.vertices;
- this.object.geometry.vertices.push(e[t + 0], e[t + 1], e[t + 2])
- },
- addVertexLine: function(t) {
- var e = this.vertices;
- this.object.geometry.vertices.push(e[t + 0], e[t + 1], e[t + 2])
- },
- addNormal: function(t, e, i) {
- var n = this.normals,
- r = this.object.geometry.normals;
- r.push(n[t + 0], n[t + 1], n[t + 2]), r.push(n[e + 0], n[e + 1], n[e + 2]), r.push(n[i + 0], n[i + 1], n[i + 2])
- },
- addColor: function(t, e, i) {
- var n = this.colors,
- r = this.object.geometry.colors;
- r.push(n[t + 0], n[t + 1], n[t + 2]), r.push(n[e + 0], n[e + 1], n[e + 2]), r.push(n[i + 0], n[i + 1], n[i + 2])
- },
- addUV: function(t, e, i) {
- var n = this.uvs,
- r = this.object.geometry.uvs;
- r.push(n[t + 0], n[t + 1]), r.push(n[e + 0], n[e + 1]), r.push(n[i + 0], n[i + 1])
- },
- addUVLine: function(t) {
- var e = this.uvs;
- this.object.geometry.uvs.push(e[t + 0], e[t + 1])
- },
- addFace: function(t, e, i, n, r, o, a, s, l) {
- var u = this.vertices.length,
- h = this.parseVertexIndex(t, u),
- c = this.parseVertexIndex(e, u),
- d = this.parseVertexIndex(i, u);
- if (this.addVertex(h, c, d), void 0 !== n && "" !== n) {
- var p = this.uvs.length;
- h = this.parseUVIndex(n, p), c = this.parseUVIndex(r, p), d = this.parseUVIndex(o, p), this.addUV(h, c, d)
- }
- if (void 0 !== a && "" !== a) {
- var f = this.normals.length;
- h = this.parseNormalIndex(a, f), c = a === s ? h : this.parseNormalIndex(s, f), d = a === l ? h : this.parseNormalIndex(l, f), this.addNormal(h, c, d)
- }
- this.colors.length > 0 && this.addColor(h, c, d)
- },
- addPointGeometry: function(t) {
- this.object.geometry.type = "Points";
- for (var e = this.vertices.length, i = 0, n = t.length; i < n; i++) this.addVertexPoint(this.parseVertexIndex(t[i], e))
- },
- addLineGeometry: function(t, e) {
- this.object.geometry.type = "Line";
- for (var i = this.vertices.length, n = this.uvs.length, r = 0, o = t.length; r < o; r++) this.addVertexLine(this.parseVertexIndex(t[r], i));
- var a = 0;
- for (o = e.length; a < o; a++) this.addUVLine(this.parseUVIndex(e[a], n))
- }
- };
- return t.startObject("", !1), t
- }
- function o(t) {
- this.manager = void 0 !== t ? t : n.DefaultLoadingManager, this.materials = null
- }
- return o.prototype = {
- constructor: o,
- load: function(t, e, i, r) {
- var o = this,
- a = new n.FileLoader(o.manager);
- a.setPath(this.path), a.load(t, (function(t) {
- e(o.parse(t))
- }), i, r)
- },
- setPath: function(t) {
- return this.path = t, this
- },
- setMaterials: function(t) {
- return this.materials = t, this
- },
- parse: function(o) {
- var a = new r; - 1 !== o.indexOf("\r\n") && (o = o.replace(/\r\n/g, "\n")), -1 !== o.indexOf("\\\n") && (o = o.replace(/\\\n/g, ""));
- for (var s = o.split("\n"), l = "", u = "", h = [], c = "function" == typeof "".trimLeft, d = 0, p = s.length; d < p; d++)
- if (l = s[d], 0 !== (l = c ? l.trimLeft() : l.trim())
- .length && "#" !== (u = l.charAt(0)))
- if ("v" === u) {
- var f = l.split(/\s+/);
- switch (f[0]) {
- case "v":
- a.vertices.push(parseFloat(f[1]), parseFloat(f[2]), parseFloat(f[3])), 8 === f.length && a.colors.push(parseFloat(f[4]), parseFloat(f[5]), parseFloat(f[6]));
- break;
- case "vn":
- a.normals.push(parseFloat(f[1]), parseFloat(f[2]), parseFloat(f[3]));
- break;
- case "vt":
- a.uvs.push(parseFloat(f[1]), parseFloat(f[2]))
- }
- } else if ("f" === u) {
- for (var m = l.substr(1)
- .trim()
- .split(/\s+/), g = [], v = 0, y = m.length; v < y; v++) {
- var b = m[v];
- if (b.length > 0) {
- var w = b.split("/");
- g.push(w)
- }
- }
- var x = g[0];
- for (v = 1, y = g.length - 1; v < y; v++) {
- var M = g[v],
- T = g[v + 1];
- a.addFace(x[0], M[0], T[0], x[1], M[1], T[1], x[2], M[2], T[2])
- }
- } else if ("l" === u) {
- var S = l.substring(1)
- .trim()
- .split(" "),
- _ = [],
- A = [];
- if (-1 === l.indexOf("/")) _ = S;
- else
- for (var P = 0, C = S.length; P < C; P++) {
- var E = S[P].split("/");
- "" !== E[0] && _.push(E[0]), "" !== E[1] && A.push(E[1])
- }
- a.addLineGeometry(_, A)
- } else if ("p" === u) {
- var D = l.substr(1)
- .trim()
- .split(" ");
- a.addPointGeometry(D)
- } else if (null !== (h = t.exec(l))) {
- var L = (" " + h[0].substr(1)
- .trim())
- .substr(1);
- a.startObject(L)
- } else if (i.test(l)) a.object.startMaterial(l.substring(7)
- .trim(), a.materialLibraries);
- else if (e.test(l)) a.materialLibraries.push(l.substring(7)
- .trim());
- else {
- if ("s" !== u) {
- if ("\0" === l) continue;
- throw new Error('THREE.OBJLoader: Unexpected line: "' + l + '"')
- }
- if ((h = l.split(" "))
- .length > 1) {
- var O = h[1].trim()
- .toLowerCase();
- a.object.smooth = "0" !== O && "off" !== O
- } else a.object.smooth = !0;
- (q = a.object.currentMaterial()) && (q.smooth = a.object.smooth)
- }
- a.finalize();
- var I = new n.Group;
- I.materialLibraries = [].concat(a.materialLibraries);
- for (d = 0, p = a.objects.length; d < p; d++) {
- var R = a.objects[d],
- N = R.geometry,
- k = R.materials,
- F = "Line" === N.type,
- B = "Points" === N.type,
- z = !1;
- if (0 !== N.vertices.length) {
- var U = new n.BufferGeometry;
- U.addAttribute("position", new n.Float32BufferAttribute(N.vertices, 3)), N.normals.length > 0 ? U.addAttribute("normal", new n.Float32BufferAttribute(N.normals, 3)) : U.computeVertexNormals(), N.colors.length > 0 && (z = !0, U.addAttribute("color", new n.Float32BufferAttribute(N.colors, 3))), N.uvs.length > 0 && U.addAttribute("uv", new n.Float32BufferAttribute(N.uvs, 2));
- for (var V, j = [], H = 0, G = k.length; H < G; H++) {
- var W = k[H],
- q = void 0;
- if (null !== this.materials)
- if (q = this.materials.create(W.name), !F || !q || q instanceof n.LineBasicMaterial) {
- if (B && q && !(q instanceof n.PointsMaterial)) {
- var Y = new n.PointsMaterial({
- size: 10,
- sizeAttenuation: !1
- });
- n.Material.prototype.copy.call(Y, q), Y.color.copy(q.color), Y.map = q.map, Y.lights = !1, q = Y
- }
- } else {
- var X = new n.LineBasicMaterial;
- n.Material.prototype.copy.call(X, q), X.color.copy(q.color), X.lights = !1, q = X
- } q || ((q = F ? new n.LineBasicMaterial : B ? new n.PointsMaterial({
- size: 1,
- sizeAttenuation: !1
- }) : new n.MeshMatcapMaterial)
- .name = W.name), q.flatShading = !W.smooth, q.vertexColors = z ? n.VertexColors : n.NoColors, j.push(q)
- }
- if (j.length > 1) {
- for (H = 0, G = k.length; H < G; H++) {
- W = k[H];
- U.addGroup(W.groupStart, W.groupCount, H)
- }
- V = F ? new n.LineSegments(U, j) : B ? new n.Points(U, j) : new n.Mesh(U, j)
- } else V = F ? new n.LineSegments(U, j[0]) : B ? new n.Points(U, j[0]) : new n.Mesh(U, j[0]);
- V.name = R.name, I.add(V)
- }
- }
- return I
- }
- }, o
- }()
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(126),
- o = {
- Bip001_Neck: "Neck",
- Bip001_Spine: "Spine",
- Bip001_Spine1: "Spine1",
- Bip001_L_Clavicle: "LeftShoulder",
- Bip001_L_UpperArm: "LeftArm",
- Bip001_L_Forearm: "LeftForeArm",
- Bip001_L_Hand: "LeftHand",
- Bip001_L_Thigh: "LeftUpLeg",
- Bip001_L_Calf: "LeftLeg",
- Bip001_L_Foot: "LeftFoot",
- Bip001_R_Clavicle: "RightShoulder",
- Bip001_R_UpperArm: "RightArm",
- Bip001_R_Forearm: "RightForeArm",
- Bip001_R_Hand: "RightHand",
- Bip001_R_Thigh: "RightUpLeg",
- Bip001_R_Calf: "RightLeg",
- Bip001_R_Foot: "RightFoot",
- Neck: "Neck",
- Spine: "Spine",
- Spine1: "Spine1",
- LeftShoulder: "LeftShoulder",
- LeftArm: "LeftArm",
- LeftForeArm: "LeftForeArm",
- LeftHand: "LeftHand",
- LeftUpLeg: "LeftUpLeg",
- LeftLeg: "LeftLeg",
- LeftFoot: "LeftFoot",
- RightShoulder: "RightShoulder",
- RightArm: "RightArm",
- RightForeArm: "RightForeArm",
- RightHand: "RightHand",
- RightUpLeg: "RightUpLeg",
- RightLeg: "RightLeg",
- RightFoot: "RightFoot"
- };
- function a(t, e) {
- this.model = t, this.mid = e, this.settingItem = {}
- }
- a.prototype.init = function() {
- this.model.userData.is_save ? (this.settingItem = this.model.userData.setting_item, this.restoreOfSettingItem(this.settingItem)) : (this.settingItem = new r(this.mid, this.model.uuid), this.settingItem.position = this.model.position, this.settingItem.rotation = this.model.rotation, this.settingItem.scale = this.model.scale, this.model.userData.setting_item = this.settingItem), this.initUserData(this.model), this.initSkeletonHelper(this.model)
- }, a.prototype.restoreOfSettingItem = function(t) {
- this.model.position.copy(t.position), this.model.rotation.copy(t.rotation), this.model.scale.copy(t.scale), this.model.visible = t.isShow, t.position = this.model.position, t.rotation = this.model.rotation, t.scale = this.model.scale, t.headTop_center_position = (new n.Vector3)
- .copy(t.headTop_center_position)
- }, a.prototype.initUserData = function(t) {
- t.userData.handle_choosed = !1, t.userData.follow_mouse = !1, t.userData.skeleton_helper = null, t.userData.skeleton_box = null, t.userData.transform_control = null, t.userData.setting_item = this.settingItem
- }, a.prototype.initSkeletonHelper = function(t) {
- if (!t.userData.skeleton_helper) {
- var e = new n.SkeletonHelper(t);
- e.visible = !1, t.userData.skeleton_helper = e, G.render.scene.add(e), this.initBones2(e.bones)
- }
- }, a.prototype.initBons = function(t) {
- var e = this,
- i = {};
- for (var r in this.settingItem.bones_rotation) i[r] = null;
- var a = t.children.filter((function(t) {
- return "Hips" === t.name || "Bip001" === t.name
- }))[0],
- s = new n.Vector3(1, 1, 1);
- (.1 >= 100 * a.scale.x || .1 >= 100 * a.scale.y || .1 >= 100 * a.scale.z) && (s.x = 10, s.y = 10, s.z = 10), a.traverse((function(n) {
- var r = o[n.name];
- if (null === i[r]) {
- if (i[r] = n, n.userData.current_scale = s, n.userData.rotation_default = {
- x: n.rotation.x,
- y: n.rotation.y,
- z: n.rotation.z
- }, t.userData.is_save) {
- var a = t.userData.setting_item;
- n.rotation.copy(a.bones_rotation[r])
- }
- e.settingItem.bones_rotation[r] = n.rotation
- }
- })), t.userData.bones = i
- }, a.prototype.initBones2 = function(t) {
- var e = {};
- for (var i in this.settingItem.bones_rotation) e[i] = null;
- for (var n = 0, r = t.length; n < r; ++n) {
- var a = t[n],
- s = o[a.name];
- if (void 0 !== s && null === e[s]) {
- if (e[s] = a, a.userData.rotation_default = {
- x: a.rotation.x,
- y: a.rotation.y,
- z: a.rotation.z
- }, this.model.userData.is_save) {
- var l = this.model.userData.setting_item;
- a.rotation.copy(l.bones_rotation[s])
- }
- this.settingItem.bones_rotation[s] = a.rotation
- }
- }
- this.model.userData.bones = e
- }, a.prototype.initMatcap = function() {
- var t = this,
- e = new n.TextureLoader;
- return new Promise((function(i, n) {
- e.load("model/texture/matcaps/matcap-porcelain-white.jpg", (function(e) {
- e ? (t.model.traverse((function(i) {
- "SkinnedMesh" === i.type && (i.userData.type = "HumanSkin", i.material.matcap = e, i.material.color.setHex(t.settingItem.skin_color), i.skeleton.update()), "AmbientLight" === i.type && t.model.remove(i)
- })), i(t.model)) : n("add matcap error!")
- }))
- }))
- }, t.exports = a
- }, function(t, e, i) {
- "use strict";
- var n = i(0);
- t.exports = function(t, e) {
- this.mid = t, this.uuid = e, this.type = "human", this.modelName = "人体模型", this.raycaster = !1, this.isShow = !0, this.ground_clearance = 0, this.geometric_scaling = !0, this.origin_skin_color = "0x484DC2", this.origin_size = {
- width: 0,
- height: 0,
- depth: 0
- }, this.origin_scale = new n.Vector3(1, 1, 1), this.origin_position = new n.Vector3, this.origin_rotation = new n.Euler, this.skin_color = "0x484DC2", this.size = {
- width: 0,
- height: 0,
- depth: 0
- }, this.scale = new n.Vector3, this.position = new n.Vector3, this.rotation = new n.Euler, this.collision = !1, this.bones_rotation = {
- Neck: new n.Euler,
- Spine1: new n.Euler,
- LeftHand: new n.Euler,
- LeftArm: new n.Euler,
- LeftForeArm: new n.Euler,
- LeftFoot: new n.Euler,
- LeftUpLeg: new n.Euler,
- LeftLeg: new n.Euler,
- RightHand: new n.Euler,
- RightArm: new n.Euler,
- RightForeArm: new n.Euler,
- RightFoot: new n.Euler,
- RightUpLeg: new n.Euler,
- RightLeg: new n.Euler
- }, this.timestamp = 0, this.current_location_id = "", this.headTop_center_position = new n.Vector3, this.headTop_center_screen_position = {
- x: 0,
- y: 0
- }, this.labelIsShow = !0, this.labelBlockView = !1
- }
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = (i(68), i(128));
- function o(t, e) {
- this.id = e, this.model = t, this.settingItem = null
- }
- o.prototype.init = function() {
- this.model.userData.setting_item && (this.settingItem = this.model.userData.setting_item, this.restoreOfSettingItem(this.settingItem)), void 0 === this.model.userData.setting_item && (this.settingItem = new r(this.id, this.model.uuid), this.settingItem.position = this.model.position, this.settingItem.rotation = this.model.rotation, this.settingItem.scale = this.model.scale), this.initUserData(this.model)
- }, o.prototype.initUserData = function(t) {
- t.userData.handle_choosed = !1, t.userData.follow_mouse = !1, t.userData.box_helper = null, t.userData.transform_control = null, t.userData.setting_item = this.settingItem
- }, o.prototype.initMatcap = function() {
- var t = this;
- new n.TextureLoader;
- return new Promise((function(e, i) {
- e(t.model)
- }))
- }, o.prototype.restoreOfSettingItem = function(t) {
- this.model.position.copy(t.position), this.model.rotation.copy(t.rotation), this.model.scale.copy(t.scale), this.model.visible = t.isShow, t.position = this.model.position, t.rotation = this.model.rotation, t.scale = this.model.scale
- }, t.exports = o
- }, function(t, e, i) {
- "use strict";
- var n = i(0);
- t.exports = function(t, e) {
- this.mid = t, this.uuid = e, this.type = "weapon", this.modelName = "凶器", this.raycaster = !1, this.isShow = !0, this.ground_clearance = 0, this.geometric_scaling = !0, this.origin_skin_color = "0xc3c3c3", this.origin_size = {
- width: 0,
- height: 0,
- depth: 0
- }, this.origin_scale = new n.Vector3(1, 1, 1), this.origin_position = new n.Vector3, this.origin_rotation = new n.Euler, this.skin_color = "0x999999", this.size = {
- width: 0,
- height: 0,
- depth: 0
- }, this.scale = new n.Vector3, this.position = new n.Vector3, this.rotation = new n.Euler, this.collision = !1, this.timestamp = 0, this.current_location_id = ""
- }
- }, function(t, e, i) {
- "use strict";
- i(0);
- var n = i(130),
- r = i(131);
- function o() {
- this.model = new r, this._settingItem = null, this.defineProperty()
- }
- o.prototype.defineProperty = function() {
- Object.defineProperty(this, "settingItem", {
- get: function() {
- return this._settingItem
- },
- set: function(t) {
- this._settingItem = t, this._settingItem.uuid = this.model.uuid, this.restoreOfSettingItem(this._settingItem)
- }
- })
- }, o.prototype.init = function(t) {
- return t ? this.settingItem = t : (this._settingItem = new n(this.model.uuid), this._settingItem.position = this.model.position, this._settingItem.rotation = this.model.rotation), this.initUserData(this.model), this.model
- }, o.prototype.initUserData = function(t) {
- t.userData.handle_choosed = !1, t.userData.follow_mouse = !1, t.userData.box_helper = null, t.userData.transform_control = null, t.userData.face_group = null, t.userData.setting_item = this._settingItem
- }, o.prototype.restoreOfSettingItem = function(t) {
- this.model.position.copy(t.position), this.model.rotation.copy(t.rotation), this.model.visible = t.isShow, t.position = this.model.position, t.rotation = this.model.rotation, t.origin_position = this.model.position, t.origin_rotation = this.model.rotation, this.model.FOV = t.FOV, this.model.DISTANCE = t.DISTANCE
- }, t.exports = o
- }, function(t, e, i) {
- "use strict";
- var n = i(0);
- t.exports = function() {
- this.type = "camera", this.mid = 1, this.uuid = null, this.modelName = "摄像头", this.position = new n.Vector3, this.rotation = new n.Euler, this.FOV = 0, this.DISTANCE = 0, this.FOV_MIN = 10, this.FOV_MAX = 180, this.DISTANCE_MIN = 300, this.DISTANCE_MAX = 1e3, this.isShow = !0, this.origin_position = new n.Vector3, this.origin_rotation = new n.Euler, this.isBarrier = !1, this.isLabelShow = !0, this.labelPosition = {
- x: 0,
- y: 0
- }, this.labelPosition2 = {
- x: 0,
- y: 0
- }, this.hasSpaceData = !1, this.directionDistanceType = {
- axis_1_0_0: 0,
- "axis_0_-1_0": 0,
- "axis_0_0_-1": 0
- }, this.axleWireWidthDirectionRotate = {
- axis_1_0_0: 0,
- "axis_0_-1_0": 0,
- "axis_0_0_-1": 0
- }, this.current_location_id = ""
- }
- }, function(t, e, i) {
- "use strict";
- var n = i(0);
- function r() {
- n.Group.call(this), this._R = .025, this._H = .15, this._FOV = 30, this._DISTANCE = 300, this.segmentOfCone = 320, this.userData.virtual_camera = null, this.userData.cone = null, this._visible = !0, this.init(), this.defineProperty()
- }
- r.prototype = Object.create(n.Group.prototype), r.prototype.defineProperty = function() {
- Object.defineProperty(this, "FOV", {
- get: function() {
- return this._FOV
- },
- set: function(t) {
- this._FOV = t, this.update()
- }
- }), Object.defineProperty(this, "DISTANCE", {
- get: function() {
- return this._DISTANCE
- },
- set: function(t) {
- this._DISTANCE = t, this.update()
- }
- })
- }, r.prototype.init = function() {
- var t = new n.CylinderBufferGeometry(this._R, this._R, this._H, 32),
- e = new n.MeshLambertMaterial({
- color: 3355443,
- opacity: 1,
- transparent: !0
- }),
- i = new n.Mesh(t, e);
- i.geometry.rotateX(Math.PI / 2), i.name = "VirtualCamera", this.userData.virtual_camera = i, this.add(i);
- var r = Math.tan(.5 * this._FOV * Math.PI / 180) * this._DISTANCE * .01,
- o = (t = new n.ConeGeometry(r, .01 * this._DISTANCE, this.segmentOfCone), e = new n.MeshPhongMaterial({
- color: 16776960,
- transparent: !0,
- opacity: 0,
- depthWrite: !1,
- side: n.DoubleSide
- }), new n.Mesh(t, e));
- o.name = "cone", o.rotateX(-Math.PI / 2), o.geometry.translate(0, .01 * -this._DISTANCE * .5 - .5 * this._H, 0), this.userData.cone = o, this.add(o)
- }, r.prototype.update = function() {
- var t = this.userData.cone;
- if (t) {
- var e = Math.tan(.5 * this._FOV * Math.PI / 180) * this._DISTANCE * .01;
- t.geometry = new n.ConeGeometry(e, .01 * this._DISTANCE, this.segmentOfCone), t.geometry.translate(0, .01 * -this._DISTANCE * .5 - .5 * this._H, 0)
- }
- }, t.exports = r
- }, function(t, e, i) {
- "use strict";
- var n = i(0);
- t.exports = function(t) {
- this.uuid = null, this.type = t, this.color = "#ff0000", this.title = "未命名", this.desc = "", this.imgs = [], this.position = new n.Vector3(0, 0, 0), this.scale = new n.Vector3(1, 1, 1), this.fat = 0, this.size = {
- width: 0,
- height: 0
- }, this.default_scale = new n.Vector3(1, 1, 1), this.default_color = "#ff0000", this.default_fat = 0, this.default_size = {
- width: 0,
- height: 0
- }, this.visible = !0, this.screenPosition = {
- x: 0,
- y: 0
- }, this.current_location_id = "", this.size_slide_stop = null, this.distanceToScreenCenter = 0
- }
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- this.player = t, this.sRender = t.sRender, this.humanModelControls = t.humanModelControls, this.weaponModelControls = t.weaponModelControls, this.postilControls = t.postilControls, this.virtualCameraFovControls = t.virtualCameraFovControls
- }
- n.prototype.resetPutModel = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.restoreOriginSetting(), this.weaponModelControls.canbeUsed && this.weaponModelControls.restoreOriginSetting(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.restoreOriginSetting()
- }, n.prototype.showPutModel = function(t) {
- this.humanModelControls.handleShowModel(t), this.weaponModelControls.handleShowModel(t), this.virtualCameraFovControls.handleShowModel(t)
- }, n.prototype.showHumanModelBonesNode = function() {
- if (this.humanModelControls.canbeUsed && this.humanModelControls.HUMANMODEL) {
- var t = this.humanModelControls.HUMANMODEL;
- this.humanModelControls.initBonesNode(t), this.humanModelControls.destroyControl(t)
- }
- }, n.prototype.showVirtualCameraMeasurement = function(t) {
- var e = this.virtualCameraFovControls.putModelsOfKV[t];
- e && this.virtualCameraFovControls.computeSpaceData(e, !0)
- }, n.prototype.hideVirtualCameraMeasurement = function(t) {
- var e = this.virtualCameraFovControls.putModelsOfKV[t];
- e && this.virtualCameraFovControls.destroySpaceData(e)
- }, n.prototype.bundleTranslateControlOfPutModel = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.bundleControlOfTranslate(), this.weaponModelControls.canbeUsed && this.weaponModelControls.bundleControlOfTranslate(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.bundleControlOfTranslate()
- }, n.prototype.bundleRotateControlOfPutModel = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.bundleControlOfRotate(), this.weaponModelControls.canbeUsed && this.weaponModelControls.bundleControlOfRotate(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.bundleControlOfRotate()
- }, n.prototype.handleClickModelItem = function(t) {
- var e = this.humanModelControls.putModelsOfHumanKV[t],
- i = this.weaponModelControls.WEAPONS_KV[t],
- n = this.virtualCameraFovControls.putModelsOfKV[t],
- r = e || i || n;
- if (r) var o = r.userData.setting_item.current_location_id;
- this.player.flyToPano({
- pano: this.player.model.panos.index[o],
- lookAtPoint: r.position,
- duration: 360
- }, (function(t) {}))
- }, n.prototype.handleClickCompleteBtn = function() {
- this.humanModelControls.canbeUsed && this.humanModelControls.handleComplete(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleComplete(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleComplete()
- }, n.prototype.onIntoEditMode = function() {
- this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !1, this.humanModelControls.handleShowCurrentModel()), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !1, this.weaponModelControls.handleShowCurrentModel()), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !1, this.virtualCameraFovControls.handleShowCurrentCamera())
- }, n.prototype.onQuitEditMode = function() {
- this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !1, this.humanModelControls.handleHideCurrentModel()), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !1, this.weaponModelControls.handleHideCurrentModel()), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !1, this.virtualCameraFovControls.handleHideCurrentCamera())
- }, n.prototype.onIntoPutMode = function() {
- this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !0), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !0), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !0)
- }, n.prototype.onQuitPutMode = function() {
- this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !1, this.humanModelControls.destroyInvalidModelControl()), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !1, this.weaponModelControls.destroyModelChoosedState()), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !1, this.virtualCameraFovControls.destroyModelControlState())
- }, n.prototype.onVirtualSetSlideStop = function(t) {
- switch (t) {
- case "camera-fov":
- this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onCameraFovSlideStop();
- break;
- case "camera-distance":
- this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onCameraDistanceSlideStop();
- break;
- default:
- this.humanModelControls.canbeUsed && (this.humanModelControls.needUpdateSkeletonBox = !0, this.humanModelControls.updateSetToolsAndControlPosition()), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateSetToolsAndControlPosition()
- }
- }, n.prototype.updatePutModelName = function(t) {
- this.humanModelControls.canbeUsed && this.humanModelControls.updateModelName(t), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateModelName(t), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.updateModelName(t)
- }, n.prototype.updateSizeOfPutModel = function(t) {
- this.humanModelControls.canbeUsed && this.humanModelControls.updateSize(t), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateSize(t)
- }, n.prototype.updateModelGroundClearance = function(t) {
- this.humanModelControls.canbeUsed && this.humanModelControls.updateModelGroundClearance(t), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateModelGroundClearance(t)
- }, n.prototype.updateCollision = function(t) {
- this.humanModelControls.canbeUsed && this.humanModelControls.HUMANMODEL && (this.humanModelControls.collision = t), this.weaponModelControls.canbeUsed && this.weaponModelControls.CONTROLMODEL && (this.weaponModelControls.collision = t)
- }, n.prototype.updatePostilInfo = function(t) {
- this.postilControls.canbeUsed && this.postilControls.updatePostilInfo(t)
- }, t.exports = n
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(9),
- o = i(13),
- a = i(40)(n),
- s = i(4)
- .EventEmitter,
- l = (new n.TextureLoader)
- .load("images/bone_node_default_2x.png"),
- u = (new n.TextureLoader)
- .load("images/bone_node_choosed_2x.png"),
- h = (i(135), i(41));
- function c(t) {
- this._canbeUsed = !1, this._canbeChoosed = !0, this._canbeSelect = !0, this._needUpdateSkeletonBox = !1, this._collision = !1, this.player = t, this.sRender = t.sRender, this.mouse = new n.Vector3, this.raycaster = new n.Raycaster, this.raycaster2 = new n.Raycaster, this.putModelsOfHuman = [], this.putModelsOfHumanKV = {}, this.HUMANMODEL = null, this.INTERSECTS_SKIN = null, this.BONENODE = null, this.boneNodes = [], this.controls = [], this.viewMode = {
- transitioning: !1,
- panorama: !1
- }, this.currentColliders = [], this._box_top_center = new n.Vector3, this.collision_d = .05, this.modelControlChange = !1, this.boneControlChange = !1, this.locationId = null, this.eye = new n.Vector3, this.unitY = new n.Vector3(0, 1, 0), this.emitter = new s, this.defineProperty(), this.initStateEngine()
- }
- c.prototype.defineProperty = function() {
- Object.defineProperty(this, "canbeUsed", {
- get: function() {
- return this._canbeUsed
- },
- set: function(t) {
- this._canbeUsed = t
- }
- }), Object.defineProperty(this, "canbeSelect", {
- get: function() {
- return this._canbeSelect
- },
- set: function(t) {
- this._canbeSelect = t
- }
- }), Object.defineProperty(this, "collision", {
- get: function() {
- return this._collision
- },
- set: function(t) {
- this._collision = t, this.HUMANMODEL.userData.setting_item.collision = t;
- var e = this.HUMANMODEL.userData.transform_control;
- if (e)
- for (var i in e.MOVELOCK) e.MOVELOCK[i].state = !1
- }
- }), Object.defineProperty(this, "box_top_center", {
- get: function() {
- return this._box_top_center
- },
- set: function(t) {
- this._box_top_center = t
- }
- }), Object.defineProperty(this, "needUpdateSkeletonBox", {
- get: function() {
- return this._needUpdateSkeletonBox
- },
- set: function(t) {
- t && this.HUMANMODEL && this.updateSkeletonBox(this.HUMANMODEL)
- }
- })
- }, c.prototype.initStateEngine = function() {
- this.MouseStateEngine = {
- mouseMoveIn: {
- state: !1,
- callback: this.handleMouseMoveInVirtualHuman.bind(this)
- },
- mouseMoveOut: {
- state: !1,
- callback: this.handleMouseMoveOutVirtualHuman.bind(this)
- }
- }, this.MouseStateEngineTranstion = {
- mouseMoveIn: {
- mouseMoveOut: function() {
- this.MouseStateEngine.mouseMoveIn.state && (this.MouseStateEngine.mouseMoveIn.state = !1, this.MouseStateEngine.mouseMoveOut.state = !0, this.MouseStateEngine.mouseMoveOut.callback())
- }.bind(this)
- }
- }
- }, c.prototype.init = function(t) {
- if (this.HUMANMODEL) {
- if (this.HUMANMODEL.uuid === t.uuid) return;
- this.destroyInvalidModelControl()
- }
- this.HUMANMODEL = t, this.initSkeletonBox(this.HUMANMODEL), this.bundleControlOfTranslate();
- var e = t.userData.setting_item,
- i = t.userData.skeleton_box;
- this.updateSetToolsPosition(i), this.player.emit("choosedHumanModel", e), this.player.emit("showPutModelSetTools", "human")
- }, c.prototype.initBonesNode = function(t) {
- if (0 < this.boneNodes.length) this.handleSwitchBonesNodeVisible(!0);
- else {
- var e = t.userData.bones;
- for (var i in e) {
- var r = e[i],
- o = new n.SpriteMaterial({
- map: l,
- side: n.DoubleSide,
- transparent: !0,
- depthTest: !1
- }),
- a = new n.Sprite(o),
- s = r.localToWorld(r.position.clone()
- .applyMatrix4(r.matrixWorld));
- a.scale.divideScalar(22), a.position.copy(s), a.userData.type = "BoneNode", a.userData.mouse_hover = !1, a.userData.handle_choosed = !1, a.userData.bundle_bone = r, this.sRender.scene.add(a), this.boneNodes[this.boneNodes.length] = a
- }
- }
- }, c.prototype.initSkeletonHelper = function(t) {
- if (!t.userData.skeleton_helper) {
- var e = new n.SkeletonHelper(t);
- e.visible = !1, t.userData.skeleton_helper = e, this.sRender.scene.add(e)
- }
- }, c.prototype.initSkeletonBox = function(t) {
- if (!t.userData.skeleton_box) {
- var e = t.userData.skeleton_helper,
- i = new n.BoxHelper(e, 5756395);
- i.visible = !1, i.geometry.computeBoundingBox(), i.userData.out_screen = !1, t.userData.skeleton_box = i, this.sRender.scene.add(i), this.initBoundingCube(i)
- }
- }, c.prototype.initBoundingCube = function(t) {
- t.geometry.computeBoundingBox();
- var e = this.HUMANMODEL.userData.box_helper_fatline;
- e && (this.sRender.scene.remove(e), e.traverse((function(t) {
- t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
- })));
- var i = o.drawBoxHelperOfLine2(t, 5756395, this.sRender.renderer.domElement);
- this.sRender.scene.add(i), this.HUMANMODEL.userData.box_helper_fatline = i;
- var r = t.geometry.boundingBox,
- a = r.getSize(new n.Vector3),
- s = r.getCenter(new n.Vector3),
- l = this.HUMANMODEL.userData.box_cube;
- if (l) return l.geometry = new n.BoxGeometry(a.x, a.y, a.z, 2, 2, 2), void l.position.copy(s);
- var u = new n.BoxGeometry(a.x, a.y, a.z, 2, 2, 2),
- h = new n.MeshBasicMaterial({
- color: 65280,
- transparent: !0,
- opacity: 0,
- depthTest: !0,
- depthWrite: !1
- }),
- c = new n.Mesh(u, h);
- c.position.copy(s), this.HUMANMODEL.userData.box_cube = c, this.sRender.scene.add(c)
- }, c.prototype.initFilterSphere = function(t) {
- var e = this.HUMANMODEL.userData.filter_sphere;
- t.geometry.computeBoundingSphere();
- var i = t.geometry.boundingSphere,
- r = i.center;
- if (e) return e.geometry.copy(new n.SphereBufferGeometry(i.radius, 32, 32)), void e.position.copy(r);
- var o = new n.SphereBufferGeometry(i.radius, 32, 32),
- a = new n.MeshBasicMaterial({
- color: 13421772,
- transparent: !0,
- opacity: .2,
- depthWrite: !1
- }),
- s = new n.Mesh(o, a);
- s.position.copy(r), s.userData.radius = i.radius, this.HUMANMODEL.userData.filter_sphere = s, this.sRender.scene.add(s)
- }, c.prototype.bundleControlOfModel = function(t, e) {
- if (t.userData.transform_control) return (i = t.userData.transform_control)
- .setMode(e), void this.destroyBoneNodes();
- var i, n = this,
- r = t.userData.skeleton_box;
- (i = new a(this.sRender.camera, this.sRender.renderer.domElement))
- .attach(t), i.setMode(e), i.setSize(.5), this.updateControlPosition(i, r), i.addEventListener("objectChange", (function(t) {
- n.modelControlChange = !0, n.needUpdateSkeletonBox = !0, n.player.emit("hidePutModelSetTools"), n.updateGroudClearance(), "translate" === this.getMode() && n.updateControlPosition(i, r)
- })), i.addEventListener("mouseDown", (function(t) {
- i.MOVELOCK[i.axis].state = !1
- })), i.addEventListener("mouseUp", (function(e) {
- if (n.modelControlChange = !1, n.updateSetToolsPosition(r), n.player.emit("showPutModelSetTools", "human"), "rotate" === this.getMode() && n.updateControlPosition(i, r), n._collision) {
- var o = n.computeContainsPoint(t, n.currentColliders);
- 0 < o.length && n.computeCrash_2(o)
- }
- })), t.userData.transform_control = i, this.sRender.scene.add(i), this.controls.push(i), this.destroyBoneNodes()
- }, c.prototype.bundleControlOfBone = function(t) {
- var e = this,
- i = new a(this.sRender.camera, this.sRender.renderer.domElement);
- i.attach(t), i.setMode("rotate"), i.setSize(.5), i.addEventListener("objectChange", (function(t) {
- e.boneControlChange = !0, e.needUpdateSkeletonBox = !0, e.handleSwitchBonesNodeVisible(!0)
- })), i.addEventListener("mouseDown", (function(t) {
- i.MOVELOCK[i.axis].state = !1
- })), i.addEventListener("mouseUp", (function(t) {
- e.boneControlChange = !1
- })), t.userData.transform_control = i, this.sRender.scene.add(i), this.controls.push(i)
- }, c.prototype.bundleControlOfTranslate = function() {
- this.HUMANMODEL && this.bundleControlOfModel(this.HUMANMODEL, "translate")
- }, c.prototype.bundleControlOfRotate = function() {
- this.HUMANMODEL && this.bundleControlOfModel(this.HUMANMODEL, "rotate")
- }, c.prototype.onHandleControlPanoramaMove = function() {
- this._canbeChoosed = !1, this.INTERSECTS_SKIN && (this.INTERSECTS_SKIN = null), this.HUMANMODEL && !this.HUMANMODEL.userData.follow_mouse && this.player.emit("hidePutModelSetTools"), this.pickedObject && !this.pickedObject.parent.userData.handle_choosed && this.MouseStateEngine.mouseMoveIn.state && this.updateLabelPosition(this.pickedObject.parent)
- }, c.prototype.onHandleControlTtagsMove = function() {
- this.player.emit("hide-virtual-human-info"), this.HUMANMODEL && !this.HUMANMODEL.userData.follow_mouse && this.player.emit("hidePutModelSetTools")
- }, c.prototype.onHandleControlPanoramaMoveStop = function() {
- if (this.HUMANMODEL && !this.HUMANMODEL.userData.follow_mouse) {
- var t = this.HUMANMODEL.userData.skeleton_box,
- e = !this.modelControlChange,
- i = !this.boneControlChange,
- n = !t.userData.out_screen;
- e && i && n && (this.updateSetToolsPosition(t), this.player.emit("showPutModelSetTools", "human"))
- }
- }, c.prototype.onHandleControlDollhouseMove = function() {}, c.prototype.onHandleControlDollhouseMoveStop = function() {}, c.prototype.onFlyEnd = function() {}, c.prototype.onIntoPanorama = function() {
- 0 < this.putModelsOfHuman.length && this.player.emit("showModelListPanel")
- }, c.prototype.onIntoDollhouse = function() {}, c.prototype.onIntoTransitioning = function() {
- this.destroyInvalidModelControl()
- }, c.prototype.getOriginModelInfo = function(t) {
- var e = t.userData.setting_item,
- i = t.userData.skeleton_box;
- i.geometry.computeBoundingBox(), e.timestamp = (new Date)
- .getTime();
- var r = i.geometry.boundingBox.getSize(new n.Vector3),
- o = 1e3 * r.x.toFixed(3),
- a = 1e3 * r.y.toFixed(3),
- s = 1e3 * r.z.toFixed(3);
- 0 === e.origin_size.width && 0 === e.origin_size.height && 0 === e.origin_size.depth && (e.origin_size = {
- width: o,
- height: a,
- depth: s
- }), e.size = {
- width: o,
- height: a,
- depth: s
- }, e.origin_position.copy(t.position.clone()), e.origin_rotation.copy(t.rotation.clone()), e.origin_scale.copy(t.scale.clone())
- }, c.prototype.getHeadTopPosition = function(t) {
- for (var e = t.userData.skeleton_helper.bones, i = ["Bip001_HeadNub", "head_end"], r = null, o = 0; o < e.length; ++o) {
- var a = e[o],
- s = a.name;
- if (-1 !== i.indexOf(s)) {
- r = a;
- break
- }
- }
- return r ? r.localToWorld(r.position.clone()
- .applyMatrix4(r.matrixWorld))
- .clone() : new n.Vector3
- }, c.prototype.destroySkeletonBox = function(t) {
- if (t.userData.skeleton_box) {
- var e = t.userData.skeleton_box;
- this.sRender.scene.remove(e), e.geometry.dispose(), e.material.dispose(), t.userData.skeleton_box = null
- }
- if (t.userData.box_helper_fatline) {
- var i = t.userData.box_helper_fatline;
- this.sRender.scene.remove(i), i.traverse((function(t) {
- t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
- })), t.userData.box_helper_fatline = null
- }
- }, c.prototype.destroySkeletonHelper = function(t) {
- if (t.userData.skeleton_helper) {
- var e = t.userData.skeleton_helper;
- this.sRender.scene.remove(e), e.geometry.dispose(), e.material.dispose(), t.userData.skeleton_helper = null
- }
- }, c.prototype.destroyBoneNodes = function() {
- if (this.BONENODE) {
- var t = this.BONENODE.userData.bundle_bone;
- this.destroyControl(t), this.BONENODE = null
- }
- for (var e = 0, i = this.boneNodes.length; e < i; ++e) {
- var n = this.boneNodes[e];
- this.sRender.scene.remove(n), n.geometry.dispose(), n.material.dispose()
- }
- this.boneNodes = []
- }, c.prototype.destroyControl = function(t) {
- if (t.userData.transform_control) {
- var e = t.userData.transform_control;
- t.userData.transform_control = null, e.dispose(), e.detach(), this.sRender.scene.remove(e), this.BONENODE = null
- }
- }, c.prototype.destroyInvalidModelControl = function(t) {
- (t = t || this.HUMANMODEL) && (this.destroySkeletonBox(t), this.destroyControl(t), t.userData.handle_choosed = !1, this.HUMANMODEL = null, this.emitter.emit("human-unchoosed"), this.INTERSECTS_SKIN && (this.INTERSECTS_SKIN = null), this.destroyBoneNodes(), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel"))
- }, c.prototype.destroyModelFromScene = function(t) {
- this.sRender.scene.remove(t), t.traverse((function(t) {
- t.material && t.material.dispose(), t.geometry && t.geometry.dispose()
- }))
- }, c.prototype.destroyLabel = function(t) {
- t.geometry.dispose(), t.material.dispose(), this.sRender.scene.remove(t)
- }, c.prototype.handlePutModel = function(t) {
- t.userData.follow_mouse = !1;
- var e = t.userData.setting_item;
- "" === e.current_location_id && (e.current_location_id = this.locationId), this.putModelsOfHuman.push(t), this.putModelsOfHumanKV[t.uuid] = t, this.HUMANMODEL = null, this.getOriginModelInfo(t), this.destroySkeletonBox(t), this.player.emit("addModelListItem", t.userData.setting_item), this.emitter.emit("human-put-over")
- }, c.prototype.handleKeyOfEsc = function() {
- if (this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse) {
- var t = this.HUMANMODEL;
- this.destroyInvalidModelControl(t), this.destroyModelFromScene(t), this.player.emit("deletePutModelSuccess", t.uuid), this.emitter.emit("human-put-cancel")
- }
- }, c.prototype.handleMouseLeftButtonDown = function() {
- if (!1 !== h.canbeChoosedOfMode3D || "panorama" === this.player.mode) {
- if (this._canbeChoosed = !0, 0 < this.putModelsOfHuman.length) {
- if (this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse) return;
- this._canbeSelect && this.handleSelectModel()
- }
- if (0 < this.boneNodes.length) {
- if (this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse) return;
- this.handleSelectBoneNode()
- }
- }
- }, c.prototype.handleMouseLeftButtonUp = function() {
- this._canbeChoosed && (this.BONENODE && this.handleChoosedBoneNode(this.BONENODE), this.INTERSECTS_SKIN && (this.player.weaponModelControls.destroyModelChoosedState(), this.player.virtualCameraFovControls.destroyModelControlState(), this.handleChoosedModel(this.INTERSECTS_SKIN.parent)))
- }, c.prototype.handleMouseRightButtonDown = function() {}, c.prototype.handleMouseRightButtonUp = function() {
- this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse && this.handlePutModel(this.HUMANMODEL)
- }, c.prototype.handleSelectModel = function() {
- this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
- var t = this.raycaster.intersectObjects(this.putModelsOfHuman, !0);
- if (0 < t.length) {
- var e = t[0],
- i = e.object;
- "SkinnedMesh" === e.object.type && (this.INTERSECTS_SKIN = i, this.player.disableNavigator = !0)
- }
- }, c.prototype.handleSelectBoneNode = function() {
- this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
- var t = this.raycaster.intersectObjects(this.boneNodes);
- if (0 < t.length) {
- this.player.disableNavigator = !0;
- var e = t[0];
- if (this.BONENODE && this.BONENODE.uuid !== e.object.uuid) {
- this.BONENODE.userData.handle_choosed = !1, this.BONENODE.material.map = l, this.BONENODE.scale.divideScalar(1.5);
- var i = this.BONENODE.userData.bundle_bone;
- this.destroyControl(i)
- }
- this.BONENODE = e.object
- }
- }, c.prototype.handleChoosedBoneNode = function() {
- var t = this.BONENODE.userData.bundle_bone;
- t.userData.transform_control || (this.BONENODE.userData.handle_choosed = !0, this.BONENODE.material.map = u, this.BONENODE.scale.multiplyScalar(1.5), this.bundleControlOfBone(t))
- }, c.prototype.handleHumanModelFollowMouse = function(t, e) {
- t.position.copy(e), this.emitter.emit("human-follow-mouse")
- }, c.prototype.handleChoosedModel = function(t) {
- if (t.visible) {
- t.userData.handle_choosed = !0;
- var e = t.userData.setting_item;
- this._collision = e.collision, this.init(t), this.emitter.emit("human-handle-choosed")
- }
- }, c.prototype.handleDeleteHumanModel = function(t) {
- if (this.putModelsOfHumanKV[t]) {
- var e = this.putModelsOfHumanKV[t];
- e.userData.handle_choosed && (this.destroyInvalidModelControl(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), this.destroyModelFromScene(e), this.putModelsOfHuman.splice(this.putModelsOfHuman.indexOf(e), 1), delete this.putModelsOfHumanKV[t], this.player.emit("deletePutModelSuccess", t), 0 === this.putModelsOfHuman.length && 0 === this.player.weaponModelControls.WEAPONS_SCENE.length && 0 === this.player.virtualCameraFovControls.putModels.length && this.player.emit("hideModelListPanel")
- }
- }, c.prototype.handleHideHumanModel = function(t) {
- if (this.putModelsOfHumanKV[t]) {
- var e = this.putModelsOfHumanKV[t],
- i = e.userData.setting_item;
- i.isShow = !1, e.visible = i.isShow, e.userData.handle_choosed && (this.destroyInvalidModelControl(e), this.player.emit("hidePutModelSetTools"))
- }
- }, c.prototype.handleShowModel = function(t) {
- if (this.putModelsOfHumanKV[t]) {
- var e = this.putModelsOfHumanKV[t],
- i = e.userData.setting_item;
- i.isShow = !0, e.visible = i.isShow
- }
- }, c.prototype.handleShowCurrentModel = function() {
- for (var t = 0, e = this.putModelsOfHuman.length; t < e; ++t) {
- var i = this.putModelsOfHuman[t];
- !0 !== i.userData.is_save && (i.visible = !0)
- }
- }, c.prototype.handleHideCurrentModel = function() {
- for (var t = 0, e = this.putModelsOfHuman.length; t < e; ++t) {
- var i = this.putModelsOfHuman[t];
- !0 !== i.userData.is_save && (i.visible = !1), i.userData.handle_choosed && (this.destroyInvalidModelControl(i), this.player.emit("hidePutModelSetTools"))
- }
- }, c.prototype.handleSwitchHumanLabelVisible = function(t, e) {
- t.userData.setting_item.labelIsShow = e
- }, c.prototype.handleSwitchSaveModelVisible = function(t) {
- for (var e = 0, i = this.putModelsOfHuman.length; e < i; ++e) {
- var n = this.putModelsOfHuman[e];
- n.userData.is_save && (n.visible = t, !1 === t && n.userData.handle_choosed && (this.destroyInvalidModelControl(n), this.player.emit("hidePutModelSetTools")))
- }
- }, c.prototype.handleSwitchBonesNodeVisible = function(t) {
- for (var e = 0, i = this.boneNodes.length; e < i; ++e) {
- var n = this.boneNodes[e],
- r = n.userData.bundle_bone,
- o = r.localToWorld(r.position.clone()
- .applyMatrix4(r.matrixWorld));
- n.position.copy(o), n.visible = t
- }
- }, c.prototype.handleMouseMoveInVirtualHuman = function(t) {
- document.body.style.cursor = "pointer", this.emitter.emit("human-mouse-in");
- var e = t.parent,
- i = e.userData.setting_item,
- n = this.getHeadTopPosition(e);
- i.headTop_center_position = n, i.headTop_center_screen_position = r.convertWorldPositionToScreen(n, this.sRender.camera), this.player.emit("show-virtual-human-info", i)
- }, c.prototype.handleMouseMoveOutVirtualHuman = function() {
- document.body.style.cursor = "", this.emitter.emit("human-mouse-out"), this.player.emit("hide-virtual-human-info")
- }, c.prototype.handleMouseMove = function() {
- if (this.mouse.copy(this.player.mouse), this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse && (this.handleHumanModelFollowMouse(this.HUMANMODEL, this.player.intersect.point), this.needUpdateSkeletonBox = !0), 0 < this.putModelsOfHuman.length) {
- var t = this.putModelsOfHuman.filter((function(t) {
- return !1 === t.userData.handle_choosed
- }));
- 0 < t.length && this.handlePickupVirtualHuman(t)
- }
- }, c.prototype.handlePickupVirtualHuman = function(t) {
- this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
- var e = this.raycaster.intersectObjects(t, !0);
- if (0 < e.length) {
- var i = e[0].object;
- "SkinnedMesh" === i.type ? (this.pickedObject = i, this.MouseStateEngine.mouseMoveIn.state = !0, this.MouseStateEngine.mouseMoveIn.callback(i)) : this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
- } else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
- }, c.prototype.handleComplete = function() {
- this.destroyInvalidModelControl()
- }, c.prototype.restoreOriginPose = function(t) {
- var e = t.userData.bones,
- i = t.userData.setting_item;
- for (var r in e) {
- var o = e[r],
- a = o.userData.rotation_default,
- s = new n.Euler(a.x, a.y, a.z, "XYZ"),
- l = new n.Quaternion;
- l.setFromEuler(s), o.quaternion.copy(l.clone())
- }
- var u = i.origin_rotation,
- h = new n.Euler(u.x, u.y, u.z, "XYZ"),
- c = new n.Quaternion;
- c.setFromEuler(h), t.quaternion.copy(c.clone())
- }, c.prototype.restoreOriginSetting = function() {
- if (this.HUMANMODEL) {
- var t = this,
- e = this.HUMANMODEL,
- i = e.userData.setting_item,
- n = e.userData.skeleton_box,
- r = e.userData.transform_control;
- if (e.position.y = i.origin_position.y, i.ground_clearance = 0, e.scale.copy(i.origin_scale), i.size.width = i.origin_size.width, i.size.height = i.origin_size.height, i.size.depth = i.origin_size.depth, this.updateSkinColor({
- hex: i.origin_skin_color
- }), this.restoreOriginPose(e), r) var o = setTimeout((function() {
- t.needUpdateSkeletonBox = !0, t.updateControlPosition(r, n), t.updateSetToolsPosition(n), clearTimeout(o)
- }), 100);
- this.player.emit("resetPutModelInfo", i)
- }
- }, c.prototype.computeContainsPoint = function(t, e) {
- for (var i = t.userData.skeleton_box, n = (t.userData.box_cube.geometry.vertices, i.geometry.boundingSphere.center), r = [], o = 0, a = e.length; o < a; ++o) {
- var s = e[o];
- s.geometry.boundingBox.containsPoint(n) && r.push(s)
- }
- return r
- };
- var d = null,
- p = null,
- f = null;
- c.prototype.computeCrash_2 = function(t) {
- var e = this,
- i = this.HUMANMODEL,
- o = i.userData.transform_control;
- i.userData.box_cube;
- i.userData.skeleton_box && function a(s) {
- var l = i.userData.skeleton_box,
- u = r.getVerticesOfItemSize(l.geometry);
- l.geometry.computeBoundingBox();
- for (var h = l.geometry.boundingBox.getCenter(new n.Vector3), c = new n.Vector3, m = 0, g = 0; g < u.length; ++g) {
- var v = u[g].applyMatrix4(l.matrix);
- c.subVectors(v, h)
- .normalize();
- var y = new n.Raycaster(h, c)
- .intersectObjects(t);
- if (0 < y.length) {
- var b = y[0],
- w = b.object,
- x = (b.point, b.distance),
- M = b.face.normal;
- x < c.length() && (m = 1, o.axis && (p = o.axis, o.MOVELOCK[p].state = !0), null === d && (d = (new n.Vector3)
- .subVectors(M.applyMatrix4(w.matrixWorld), w.position)
- .normalize()))
- }
- }
- 1 === m && (null === f && (f = (new Date)
- .getTime()), i.position.add(d.clone()
- .divideScalar(100)), e.needUpdateSkeletonBox = !0, 2e3 > (new Date)
- .getTime() - f ? requestAnimationFrame(a) : (d = null, f = null, o.MOVELOCK[p].state = !1, e.updateControlPosition(o, l)));
- 0 === m && p && (d = null, o.MOVELOCK[p].state = !1, e.updateControlPosition(o, l))
- }()
- }, c.prototype.computeHumanLabelVisible = function(t, e) {
- if (0 < this.putModelsOfHuman.length)
- for (var i = 0, r = this.putModelsOfHuman.length; i < r; ++i) {
- var o = this.putModelsOfHuman[i].userData.setting_item,
- a = o.headTop_center_position.clone(),
- s = new n.Vector3;
- s.subVectors(t.position, a)
- .normalize(), this.raycaster2.set(a, s, 1);
- var l = this.raycaster2.intersectObjects(e);
- if (0 < l.length) l[0].distance < a.distanceTo(t.position) ? o.labelBlockView = !0 : o.labelBlockView = !1;
- else o.labelBlockView = !1
- }
- }, c.prototype.updateControlOfMode = function(t) {
- if (this.HUMANMODEL) {
- var e = this.HUMANMODEL.userData.transform_control;
- e ? e.setMode(t) : this.bundleControlOfModel(this.HUMANMODEL, t)
- }
- }, c.prototype.updateSkeletonBox = function(t) {
- var e = t.userData.skeleton_box,
- i = t.userData.setting_item;
- e.update(), e.geometry.computeBoundingBox();
- var n = this.getHeadTopPosition(t);
- i.headTop_center_position = n, i.headTop_center_screen_position = r.convertWorldPositionToScreen(n, this.sRender.camera), this.initBoundingCube(e)
- }, c.prototype.updateControls = function() {
- for (var t = 0; t < this.controls.length; ++t) this.controls[t].update()
- }, c.prototype.updateBoneNodesDirection = function() {
- for (var t = 0; t < this.boneNodes.length; ++t) this.boneNodes[t].lookAt(this.sRender.camera.position)
- }, c.prototype.updateControlPosition = function(t, e) {
- e.geometry.computeBoundingBox();
- var i = e.geometry.boundingBox,
- r = i.getCenter(new n.Vector3),
- o = i.getSize(new n.Vector3),
- a = new n.Vector3(r.x, r.y - .5 * o.y, r.z);
- t.currentWorldPosition.copy(a)
- }, c.prototype.updateSkinColor = function(t) {
- var e = this.HUMANMODEL;
- e.traverse((function(e) {
- "SkinnedMesh" === e.type && e.material.color.setHex(t.hex)
- })), e.userData.setting_item.skin_color = t.hex
- }, c.prototype.updateModelName = function(t) {
- this.HUMANMODEL && (this.HUMANMODEL.userData.setting_item.modelName = t)
- }, c.prototype.updateSetToolsPosition = function(t) {
- t.geometry.computeBoundingBox();
- for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = {}, o = [], a = [], s = 0; s < e.length; ++s) {
- var l = e[s].clone();
- if (!r.computeWorldPositionOutCamera(l, this.sRender.camera)) {
- var u = r.convertWorldPositionToScreen(l, this.sRender.camera);
- o.push(u.x), a.push(u.y), i["k_" + u.x] = u, n["k_" + u.y] = u
- }
- }
- var h = i["k_" + Math.max.apply(null, o)];
- this.player.emit("setPutModelToolsPosition", h)
- }, c.prototype.updateGroudClearance = function() {
- if (this.HUMANMODEL) {
- var t = this.HUMANMODEL,
- e = t.userData.setting_item,
- i = e.origin_position,
- n = 100 * (t.position.clone()
- .y - i.y);
- e.ground_clearance = n, this.player.emit("resetPutModelInfo", e)
- }
- }, c.prototype.updateModelGroundClearance = function(t) {
- if (this.HUMANMODEL) {
- var e = this.HUMANMODEL,
- i = e.userData.setting_item;
- e.position.y = i.origin_position.y + .01 * t, i.ground_clearance = t;
- var n = e.userData.transform_control,
- r = e.userData.skeleton_box;
- this.needUpdateSkeletonBox = !0, this.updateSetToolsPosition(r), n && this.updateControlPosition(n, r)
- }
- }, c.prototype.updateSize = function(t) {
- if (this.HUMANMODEL) {
- var e = this.HUMANMODEL,
- i = e.userData.setting_item,
- n = e.userData.transform_control,
- r = i.origin_size,
- o = i.origin_scale,
- a = o.x / r.width,
- s = o.y / r.height,
- l = o.z / r.depth,
- u = t.width * a,
- h = t.height * s,
- c = t.depth * l;
- e.scale.set(u, h, c), i.scale = e.scale, i.size = {
- width: u * r.width,
- height: h * r.height,
- depth: c * r.depth
- }, this.needUpdateSkeletonBox = !0;
- var d = e.userData.skeleton_box;
- this.updateSetToolsPosition(d), n && this.updateControlPosition(n, d)
- }
- }, c.prototype.updateSetToolsAndControlPosition = function() {
- if (this.HUMANMODEL) {
- var t = this.HUMANMODEL,
- e = t.userData.skeleton_box,
- i = t.userData.transform_control;
- this.updateSetToolsPosition(e), this.player.emit("showPutModelSetTools", "human"), i && e && this.updateControlPosition(i, e)
- }
- }, c.prototype.updateBoxHelperIsOutScrren = function(t) {
- if ("panorama" === this.player.mode) {
- for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = 0, o = e.length; n < o; ++n) {
- var a = e[n],
- s = a.applyMatrix4(this.sRender.camera.matrixWorldInverse)
- .applyMatrix4(this.sRender.camera.projectionMatrix),
- l = Math.abs(s.x) > 1,
- u = Math.abs(s.y) > 1,
- h = Math.abs(s.z) > 1;
- (l || u || h) && (1, i["k_" + n] = a)
- }
- e.length === Object.keys(i)
- .length ? (this.player.emit("hidePutModelSetTools"), t.userData.out_screen = !0) : t.userData.out_screen = !1
- }
- }, c.prototype.updateLabelPosition = function(t) {
- if (t) {
- var e = t.userData.setting_item,
- i = this.getHeadTopPosition(t);
- e.headTop_center_position = i, e.headTop_center_screen_position = r.convertWorldPositionToScreen(i, this.sRender.camera), this.player.emit("show-virtual-human-info", e)
- }
- }, c.prototype.updateHumanLabel = function(t) {
- for (var e = 0, i = t.length; e < i; ++e) {
- var n = t[e],
- o = n.userData.setting_item;
- o.headTop_center_screen_position = r.convertWorldPositionToScreen(o.headTop_center_position, this.sRender.camera), r.computeWorldPositionOutCamera(o.headTop_center_position, this.sRender.camera) ? o.labelIsShow = !1 : o.labelIsShow = !0, n.visible || (o.labelIsShow = !1)
- }
- }, c.prototype.update = function() {
- if (0 < this.controls.length && this.updateControls(), this.player && (this.player.currentPano && this.player.currentPano.id && (this.locationId = this.player.currentPano.id), 0 === this.currentColliders.length && (this.currentColliders = this.player.model.floors.reduce((function(t, e) {
- return e.hidden ? t : t.concat(e.collider.children)
- }), []))), this.HUMANMODEL) {
- var t = this.HUMANMODEL.userData;
- t.handle_choosed && this.updateBoxHelperIsOutScrren(t.skeleton_box)
- }
- }, t.exports = c
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(13);
- function o(t) {
- n.Sprite.call(this), this.geometry = new n.PlaneBufferGeometry, this.init(t)
- }
- o.prototype = Object.create(n.Sprite.prototype), o.prototype.init = function(t) {
- var e = r.initCanvasLabel(t),
- i = e.texture,
- o = e.canvas;
- this.width = o.width, this.height = o.height, this.material = new n.ShaderMaterial({
- uniforms: {
- tDiffuse: {
- value: i
- },
- width: {
- value: o.width
- },
- height: {
- value: o.height
- },
- domWidth: {
- value: t.renderDom.width
- },
- domHeight: {
- value: t.renderDom.height
- }
- },
- vertexShader: ["precision highp float;", "uniform float width;", "uniform float height;", "uniform float domWidth;", "uniform float domHeight;", "varying vec2 vUv;", "void main() {", "vUv = uv;", "vec4 proj = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);", "gl_Position = vec4(", "proj.x / proj.w + position.x * width / domWidth * 2.0,", "proj.y / proj.w + position.y * height / domHeight * 2.0,", "proj.z / proj.w,", "1.0", ");", "}"].join("\n"),
- fragmentShader: ["precision highp float;", "uniform sampler2D tDiffuse;", "uniform float width;", "uniform float height;", "varying vec2 vUv;", "void main() {", "vec2 _uv = vec2(", "(floor(vUv.s * width) + 0.5) / width,", "(floor(vUv.t * height) + 0.5) / height", ");", "gl_FragColor = texture2D( tDiffuse, _uv );", "}"].join("\n"),
- transparent: !0
- })
- }, t.exports = o
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(9),
- o = i(4)
- .EventEmitter,
- a = i(40)(n),
- s = i(13),
- l = i(41);
- function u(t) {
- this._canbeUsed = !1, this._canbeSelect = !0, this._canbeChoosed = !0, this.player = t, this.sRender = t.sRender, this.raycaster = new n.Raycaster, this.mouse = new n.Vector3, this.CONTROLMODEL = null, this.CURRENTMODEL = null, this.INTERSECT = null, this.WEAPONS_SCENE = [], this.ACTIVEMODEL = null, this.WEAPONS_KV = {}, this.controls = [], this._collision = !1, this.collision_d = .05, this.modelControlChange = !1, this.emitter = new o, this.defineProperty(), this.initStateEngine()
- }
- window.THREE = n, u.prototype.defineProperty = function() {
- Object.defineProperty(this, "canbeUsed", {
- get: function() {
- return this._canbeUsed
- },
- set: function(t) {
- this._canbeUsed = t
- }
- }), Object.defineProperty(this, "canbeSelect", {
- get: function() {
- return this._canbeSelect
- },
- set: function(t) {
- this._canbeSelect = t
- }
- }), Object.defineProperty(this, "collision", {
- get: function(t) {
- return this._collision
- },
- set: function(t) {
- this._collision = t;
- var e = this.CONTROLMODEL.userData.setting_item,
- i = this.CONTROLMODEL.userData.transform_control;
- if (e.collision = t, i)
- for (var n in i.MOVELOCK) i.MOVELOCK[n].state = !1
- }
- })
- }, u.prototype.initStateEngine = function() {
- this.MouseStateEngine = {
- mouseMoveIn: {
- state: !1,
- callback: this.handleMouseMoveInWeapon.bind(this)
- },
- mouseMoveOut: {
- state: !1,
- callback: this.handleMouseMoveOutWeapon.bind(this)
- }
- }, this.MouseStateEngineTranstion = {
- mouseMoveIn: {
- mouseMoveOut: function() {
- this.MouseStateEngine.mouseMoveIn.state && (this.MouseStateEngine.mouseMoveIn.state = !1, this.MouseStateEngine.mouseMoveOut.state = !0, this.MouseStateEngine.mouseMoveOut.callback())
- }.bind(this)
- }
- }
- }, u.prototype.initBoundingBox = function(t) {
- if (!t.userData.box_helper) {
- var e = new n.BoxHelper(t, 5756395);
- e.visible = !1, e.geometry.computeBoundingBox();
- var i = e.geometry.boundingBox.getSize(new n.Vector3);
- e.userData.out_screen = !1, t.userData.box_helper = e, t.userData.box_size = i, this.sRender.scene.add(e);
- var r = s.drawBoxHelperOfLine2(e, 5756395, this.sRender.renderer.domElement);
- t.userData.box_helper_fatline = r, this.sRender.scene.add(r)
- }
- }, u.prototype.initOriginInfo = function(t) {
- var e = t.userData.setting_item,
- i = t.userData.box_helper;
- i.geometry.computeBoundingBox(), e.timestamp = (new Date)
- .getTime();
- var r = i.geometry.boundingBox.getSize(new n.Vector3),
- o = r.x.toFixed(3),
- a = r.y.toFixed(3),
- s = r.z.toFixed(3);
- 0 === e.origin_size.width && 0 === e.origin_size.height && 0 === e.origin_size.depth && (e.origin_size = {
- width: o,
- height: a,
- depth: s
- }), e.size = {
- width: o,
- height: a,
- depth: s
- }, e.origin_position.copy(t.position.clone()), e.origin_rotation.copy(t.rotation.clone()), e.origin_scale.copy(t.scale.clone()), e.current_location_id = this.player.currentPano.id
- };
- var h = !1;
- u.prototype.onHandleControlPanoramaMove = function() {
- h = !1, this._canbeChoosed = !1, this.CONTROLMODEL && this.player.emit("hidePutModelSetTools"), this.INTERSECT && (this.INTERSECT = null)
- }, u.prototype.onHandleControlTtagsMove = function() {
- this.CONTROLMODEL && this.player.emit("hidePutModelSetTools")
- }, u.prototype.onHandleControlPanoramaMoveStop = function() {
- if (!h && (h = !0, this.CONTROLMODEL && !this.CONTROLMODEL.userData.follow_mouse)) {
- var t = this.CONTROLMODEL.userData.box_helper;
- this.modelControlChange || t.userData.out_screen || (this.updateSetToolsPosition(t), this.player.emit("showPutModelSetTools", "weapon"))
- }
- }, u.prototype.onIntoPanorama = function() {
- 0 < this.WEAPONS_SCENE.length && this.player.emit("showModelListPanel")
- }, u.prototype.onIntoTransitioning = function() {
- this.destroyModelChoosedState()
- }, u.prototype.handleMouseMove = function() {
- if (this.mouse.copy(this.player.mouse), this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse && this.player.intersect && this.player.intersect.point && (this.handleModelFollowingMouse(this.CONTROLMODEL, this.player.intersect.point), this.updateBoundingBox()), 0 < this.WEAPONS_SCENE.length) {
- var t = this.WEAPONS_SCENE.filter((function(t) {
- return !1 === t.userData.handle_choosed
- }));
- 0 < t.length && this.handlePickupWeapon(t)
- }
- }, u.prototype.handleMouseLeftButtonDown = function() {
- if ((!1 !== l.canbeChoosedOfMode3D || "panorama" === this.player.mode) && (this._canbeChoosed = !0, 0 < this.WEAPONS_SCENE.length)) {
- if (this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse) return;
- this._canbeSelect && this.handleSelectModel()
- }
- }, u.prototype.handleMouseLeftButtonUp = function() {
- this._canbeChoosed && this.INTERSECT && (this.player.humanModelControls.destroyInvalidModelControl(), this.player.virtualCameraFovControls.destroyModelControlState(), (this.INTERSECT.name = "probeModel") ? this.handleChooseModel(this.INTERSECT.parent) : this.handleChooseModel(this.INTERSECT.parent.parent.parent), this.INTERSECT = null)
- }, u.prototype.handleMouseRightButtonDown = function() {}, u.prototype.handleMouseRightButtonUp = function() {
- this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse && this.handlePutModel(this.CONTROLMODEL)
- }, u.prototype.handleModelFollowingMouse = function(t, e) {
- var i = t.userData.box_size,
- r = (new n.Vector3)
- .copy(e.clone());
- r.y += i.y, t.position.copy(r), this.emitter.emit("weapon-follow-mouse")
- }, u.prototype.handlePutModel = function(t) {
- t.userData.follow_mouse = !1, this.WEAPONS_SCENE.push(t), this.WEAPONS_KV[t.uuid] = t, this.initOriginInfo(t), this.destroyBoundingBox(t), this.player.emit("addModelListItem", t.userData.setting_item), this.CONTROLMODEL = null, this.emitter.emit("weapon-put-over")
- }, u.prototype.handleSelectModel = function() {
- this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
- var t = this.raycaster.intersectObjects(this.WEAPONS_SCENE, !0);
- if (0 < t.length) {
- var e = t[0].object;
- this.INTERSECT = e, this.player.disableNavigator = !0
- }
- }, u.prototype.handleChooseModel = function(t) {
- if (t.visible && (this.CONTROLMODEL && t.uuid !== this.CONTROLMODEL.uuid && this.destroyModelChoosedState(), !this.CONTROLMODEL || t.uuid !== this.CONTROLMODEL.uuid)) {
- this.CURRENTMODEL = t, document.body.style.cursor = "", t.userData.handle_choosed = !0, this.CONTROLMODEL = t, this.initBoundingBox(t), this.bundleControlOfTranslate();
- var e = t.userData.box_helper;
- this.updateSetToolsPosition(e), this.player.emit("showPutModelSetTools", "weapon"), this.player.emit("choosed-weapon", t.userData.setting_item), this.emitter.emit("weapon-handle-choosed")
- }
- }, u.prototype.handleKeyOfEsc = function() {
- if (this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse) {
- var t = this.CONTROLMODEL;
- this.destroyModelChoosedState(t), this.destroyModelFromScene(t), this.emitter.emit("weapon-put-cancel")
- }
- }, u.prototype.handleDeleteModel = function(t) {
- if (this.WEAPONS_KV[t]) {
- var e = this.WEAPONS_KV[t];
- e.userData.handle_choosed && (this.destroyModelChoosedState(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), this.destroyModelFromScene(e), this.WEAPONS_SCENE.splice(this.WEAPONS_SCENE.indexOf(e), 1), delete this.WEAPONS_KV[t], this.player.emit("deletePutModelSuccess", t), 0 === this.WEAPONS_SCENE.length && 0 === this.player.humanModelControls.putModelsOfHuman.length && 0 === this.player.virtualCameraFovControls.putModels.length && this.player.emit("hideModelListPanel")
- }
- }, u.prototype.handleShowModel = function(t) {
- if (this.WEAPONS_KV[t]) {
- var e = this.WEAPONS_KV[t],
- i = e.userData.setting_item;
- i.isShow = !0, e.visible = i.isShow
- }
- }, u.prototype.handleHideModel = function(t) {
- if (this.WEAPONS_KV[t]) {
- var e = this.WEAPONS_KV[t],
- i = e.userData.setting_item;
- i.isShow = !1, e.visible = i.isShow, e.userData.handle_choosed && (this.destroyModelChoosedState(e), this.player.emit("hidePutModelSetTools"))
- }
- }, u.prototype.handleShowCurrentModel = function() {
- for (var t = 0, e = this.WEAPONS_SCENE.length; t < e; ++t) {
- var i = this.WEAPONS_SCENE[t];
- !0 !== i.userData.is_save && (i.visible = !0)
- }
- }, u.prototype.handleHideCurrentModel = function() {
- for (var t = 0, e = this.WEAPONS_SCENE.length; t < e; ++t) {
- var i = this.WEAPONS_SCENE[t];
- !0 !== i.userData.is_save && (i.visible = !1), i.userData.handle_choosed && (this.destroyModelChoosedState(i), this.player.emit("hidePutModelSetTools"))
- }
- }, u.prototype.handleSwitchSaveModelVisible = function(t) {
- for (var e = 0, i = this.WEAPONS_SCENE.length; e < i; ++e) {
- var n = this.WEAPONS_SCENE[e];
- n.userData.is_save && (n.visible = t, !1 === t && n.userData.handle_choosed && (this.destroyModelChoosedState(n), this.player.emit("hidePutModelSetTools")))
- }
- }, u.prototype.handleHideAllModel = function() {
- for (var t = 0, e = this.WEAPONS_SCENE.length; t < e; ++t) {
- var i = this.WEAPONS_SCENE[t];
- i.visible = !1, i.userData.handle_choosed && (this.destroyModelChoosedState(i), this.player.emit("hidePutModelSetTools"))
- }
- }, u.prototype.handleComplete = function() {
- if (this.destroyModelChoosedState(), this.CURRENTMODEL) {
- var t = this.CURRENTMODEL.getWorldPosition(),
- e = this.CURRENTMODEL.getWorldQuaternion();
- this.player.emit("putProbeModelComplete", {
- worldPosition: t,
- worldQuaternion: e
- })
- }
- }, u.prototype.handlePickupWeapon = function(t) {
- this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
- var e = this.raycaster.intersectObjects(t, !0);
- if (0 < e.length) {
- var i = e[0].object;
- this.MouseStateEngine.mouseMoveIn.state = !0, this.MouseStateEngine.mouseMoveIn.callback(i)
- } else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
- }, u.prototype.handleMouseMoveInWeapon = function(t) {
- document.body.style.cursor = "pointer", this.sRender.outlinePass.selectedObjects = [t.parent]
- }, u.prototype.handleMouseMoveOutWeapon = function() {
- document.body.style.cursor = "", this.sRender.outlinePass.selectedObjects = []
- }, u.prototype.bundleControlOfTranslate = function() {
- this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "translate")
- }, u.prototype.bundleControlOfRotate = function() {
- this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "rotate")
- }, u.prototype.bundleControlOfModel = function(t, e) {
- if (t.userData.transform_control) {
- (n = t.userData.transform_control)
- .setMode(e)
- } else {
- var i = this,
- n = new a(this.sRender.camera, this.sRender.renderer.domElement),
- r = t.userData.box_helper;
- this.updateControlPosition(n, r), n.attach(t), n.setMode(e), n.setSize(.5), n.addEventListener("objectChange", (function(e) {
- i.modelControlChange = !0, i.player.emit("hidePutModelSetTools"), i.updateGroudClearance(), i.updateBoundingBox(), "translate" === n.getMode() && i.updateControlPosition(n, r), i._collision && i.computeCrash_2(t)
- })), n.addEventListener("mouseUp", (function(t) {
- i.modelControlChange = !1, "rotate" === n.getMode() && i.updateControlPosition(n, r), i.updateSetToolsPosition(r), i.player.emit("showPutModelSetTools", "weapon")
- })), n.addEventListener("mouseDown", (function(t) {
- n.MOVELOCK[n.axis].state = !1
- })), t.userData.transform_control = n, this.controls.push(n), this.sRender.scene.add(n)
- }
- }, u.prototype.bundleControlOfTranslate = function() {
- this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "translate")
- }, u.prototype.bundleControlOfRotate = function() {
- this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "rotate")
- }, u.prototype.destroyBoundingBox = function(t) {
- if (t.userData.box_helper) {
- var e = t.userData.box_helper;
- t.userData.box_helper = null, e.geometry.dispose(), e.material.dispose(), this.sRender.scene.remove(e)
- }
- if (t.userData.box_helper_fatline) {
- var i = t.userData.box_helper_fatline;
- this.sRender.scene.remove(i), i.traverse((function(t) {
- t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
- })), t.userData.box_helper_fatline = null
- }
- }, u.prototype.destroyModelChoosedState = function(t) {
- (t = t || this.CONTROLMODEL) && (this.destroyControl(this.CONTROLMODEL), this.destroyBoundingBox(this.CONTROLMODEL), this.CONTROLMODEL = null, this.emitter.emit("weapon-unchoosed"), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel"))
- }, u.prototype.destroyControl = function(t) {
- if (t.userData.transform_control) {
- var e = t.userData.transform_control;
- e.dispose(), e.detach(), this.sRender.scene.remove(e), t.userData.handle_choosed = !1, t.userData.transform_control = null
- }
- }, u.prototype.destroyModelFromScene = function(t) {
- this.sRender.scene.remove(t), t.traverse((function(t) {
- t.material && t.material.dispose(), t.geometry && t.geometry.dispose()
- }))
- }, u.prototype.restoreOriginSetting = function() {
- if (this.CONTROLMODEL) {
- var t = this,
- e = this.CONTROLMODEL,
- i = e.userData.setting_item,
- n = e.userData.box_helper,
- r = e.userData.transform_control;
- e.position.y = i.origin_position.y, i.ground_clearance = 0;
- var o = i.origin_rotation;
- if (e.rotation.copy(o), e.scale.copy(i.origin_scale), i.size.width = i.origin_size.width, i.size.height = i.origin_size.height, i.size.depth = i.origin_size.depth, this.updateModelColor({
- hex: i.origin_skin_color
- }), r) var a = setTimeout((function() {
- t.updateBoundingBox(), t.updateControlPosition(r, n), t.updateSetToolsPosition(n), clearTimeout(a)
- }), 100);
- this.player.emit("resetPutModelInfo", i)
- }
- }, u.prototype.computeCrash_2 = function(t) {
- if (t.userData.box_helper) {
- var e = t.userData.transform_control,
- i = t.userData.box_helper,
- o = i.geometry;
- o.computeBoundingBox();
- for (var a = o.boundingBox, s = r.getVerticesOfItemSize(o), l = a.getCenter(new n.Vector3), u = 0; u < s.length; ++u) {
- s[u].userData = {}, s[u].userData.name = "v_" + u;
- var h = s[u].clone()
- .applyMatrix4(i.matrix)
- .sub(l),
- c = new n.Raycaster(l, h)
- .intersectObjects(this.player.model.colliders);
- if (0 < c.length) {
- var d = c[0],
- p = d.object,
- f = d.face,
- m = (d.point, d.distance);
- f.normal.applyMatrix4(p.matrixWorld)
- .sub(p.position)
- .normalize();
- h.length() + this.collision_d >= m && (e.MOVELOCK[e.axis].state = !0)
- }
- }
- }
- }, u.prototype.updateBoundingBox = function(t) {
- if ((t = t || this.CONTROLMODEL)
- .userData.box_helper) {
- var e = t.userData.box_helper;
- e.update();
- var i = t.userData.box_helper_fatline;
- i && (this.sRender.scene.remove(i), i.traverse((function(t) {
- t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
- })));
- var n = s.drawBoxHelperOfLine2(e, 5756395, this.sRender.renderer.domElement);
- t.userData.box_helper_fatline = n, this.sRender.scene.add(n)
- }
- }, u.prototype.updateControlPosition = function(t, e) {
- e.geometry.computeBoundingBox();
- var i = e.geometry.boundingBox,
- r = i.getCenter(new n.Vector3),
- o = i.getSize(new n.Vector3),
- a = new n.Vector3(r.x, r.y - .5 * o.y, r.z);
- t.currentWorldPosition.copy(a)
- }, u.prototype.updateSetToolsPosition = function(t) {
- t.geometry.computeBoundingBox();
- for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = {}, o = [], a = [], s = 0; s < e.length; ++s) {
- var l = e[s].clone();
- if (!r.computeWorldPositionOutCamera(l, this.sRender.camera)) {
- var u = r.convertWorldPositionToScreen(l, this.sRender.camera);
- o.push(u.x), a.push(u.y), i["k_" + u.x] = u, n["k_" + u.y] = u
- }
- }
- var h = i["k_" + Math.max.apply(null, o)];
- this.player.emit("setPutModelToolsPosition", h)
- }, u.prototype.updateModelColor = function(t) {
- this.CONTROLMODEL.traverse((function(e) {
- "Mesh" === e.type && e.material.color.setHex(t.hex)
- })), this.CONTROLMODEL.userData.setting_item.skin_color = t.hex
- }, u.prototype.updateSize = function(t) {
- if (this.CONTROLMODEL) {
- var e = this.CONTROLMODEL,
- i = e.userData.setting_item,
- n = i.origin_size,
- r = i.origin_scale,
- o = r.x / n.width,
- a = r.y / n.height,
- s = r.z / n.depth,
- l = t.width * o,
- u = t.height * a,
- h = t.depth * s;
- e.scale.set(l, u, h), i.scale = e.scale, i.size = {
- width: l * n.width,
- height: u * n.height,
- depth: h * n.depth
- }, this.updateBoundingBox()
- }
- }, u.prototype.updateGroudClearance = function() {
- if (this.CONTROLMODEL) {
- var t = this.CONTROLMODEL,
- e = t.userData.setting_item,
- i = e.origin_position,
- n = t.position.clone()
- .y - i.y;
- e.ground_clearance = n, this.player.emit("resetPutModelInfo", e)
- }
- }, u.prototype.updateModelGroundClearance = function(t) {
- if (this.CONTROLMODEL) {
- var e = this.CONTROLMODEL,
- i = e.userData.setting_item;
- e.position.y = i.origin_position.y + .01 * t, i.ground_clearance = t;
- var n = e.userData.transform_control,
- r = e.userData.box_helper;
- this.updateBoundingBox(), this.updateSetToolsPosition(r), n && this.updateControlPosition(n, r)
- }
- }, u.prototype.updateSetToolsAndControlPosition = function() {
- if (this.CONTROLMODEL) {
- var t = this.CONTROLMODEL,
- e = t.userData.box_helper,
- i = t.userData.transform_control;
- this.updateSetToolsPosition(e), i && e && this.updateControlPosition(i, e), this.player.emit("showPutModelSetTools", "weapon")
- }
- }, u.prototype.updateBoxHelperIsOutScrren = function(t) {
- if ("panorama" === this.player.mode) {
- for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = 0, o = e.length; n < o; ++n) {
- var a = e[n],
- s = a.applyMatrix4(this.sRender.camera.matrixWorldInverse)
- .applyMatrix4(this.sRender.camera.projectionMatrix),
- l = Math.abs(s.x) > 1,
- u = Math.abs(s.y) > 1,
- h = Math.abs(s.z) > 1;
- (l || u || h) && (1, i["k_" + n] = a)
- }
- e.length === Object.keys(i)
- .length ? (this.player.emit("hidePutModelSetTools"), t.userData.out_screen = !0) : t.userData.out_screen = !1
- }
- }, u.prototype.updateModelName = function(t) {
- this.CONTROLMODEL && (this.CONTROLMODEL.userData.setting_item.modelName = t)
- }, u.prototype.updateControls = function() {
- if (0 < this.controls.length)
- for (var t = 0; t < this.controls.length; ++t) this.controls[t].update()
- }, u.prototype.update = function() {
- if (this.updateControls(), this.CONTROLMODEL) {
- var t = this.CONTROLMODEL.userData;
- t.handle_choosed && this.updateBoxHelperIsOutScrren(t.box_helper)
- }
- }, t.exports = u
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(9),
- o = (i(13), i(3), i(4)
- .EventEmitter),
- a = i(138)(n),
- s = (new n.TextureLoader)
- .load("./images/texture/location/location_red_512x512.png");
- function l(t) {
- this._canbeUsed = !1, this._canbeSelect = !1, this.player = t, this.sRender = t.sRender, this.locationId = null, this.raycaster = new n.Raycaster, this.mouse = new n.Vector3, this.POSTIL = null, this.controls = [], this.PostilOfScene = [], this.PostilOfKV = {}, this.hideAll = !1, this.defineProperty(), this.emitter = new o
- }
- l.prototype.defineProperty = function() {
- Object.defineProperty(this, "canbeUsed", {
- get: function() {
- return this._canbeUsed
- },
- set: function(t) {
- this._canbeUsed = t
- }
- }), Object.defineProperty(this, "canbeSelect", {
- get: function() {
- return this._canbeSelect
- },
- set: function(t) {
- this._canbeSelect = t
- }
- })
- }, l.prototype.initBox = function() {
- if (!this.POSTIL.userData.box_line) {
- this.POSTIL.geometry.computeBoundingBox();
- var t = this.POSTIL.geometry.boundingBox.getSize(new n.Vector3),
- e = new n.PlaneBufferGeometry(t.x, t.y),
- i = new n.EdgesGeometry(e),
- r = new n.LineSegments(i, new n.LineBasicMaterial({
- color: 65280
- }));
- this.POSTIL.userData.box_line = r, this.POSTIL.add(r)
- }
- }, l.prototype.onIntoPanorama = function() {
- this.destroyPostilChoosedState()
- }, l.prototype.handleMouseLeftButtonDown = function() {
- if ("panorama" === this.player.mode && 0 < this.PostilOfScene.length) {
- if (this.POSTIL && this.POSTIL.userData.follow_mouse) return;
- this._canbeSelect && this.handleSelectPostil()
- }
- }, l.prototype.handleMouseLeftButtonUp = function() {
- "panorama" === this.player.mode && this.POSTIL && !this.POSTIL.userData.follow_mouse && this.handleChoosedPostil(this.POSTIL)
- }, l.prototype.handleMouseRightButtonDown = function() {}, l.prototype.handleMouseRightButtonUp = function() {
- "panorama" === this.player.mode && this.POSTIL && this.POSTIL.userData.follow_mouse && (this.handlePutPostil(this.POSTIL), this.POSTIL = null)
- }, l.prototype.handleMouseMove = function() {
- !this.player || this.player && "panorama" !== this.player.mode || (this.mouse.copy(this.player.mouse), "panorama" === this.player.mode && this.POSTIL && this.POSTIL.userData.follow_mouse && 0 < this.player.model.colliders.length && this.handlePostilFollowingMouse2(this.POSTIL, this.player.intersect))
- }, l.prototype.handlePutPostil = function(t) {
- var e = this;
- t.userData.follow_mouse = !1;
- var i = this.player.panoMarkers.filter((function(t) {
- return e.locationId === t.pano.id
- }))[0];
- t.userData.marker = i, this.PostilOfScene.push(t), this.PostilOfKV[t.uuid] = t, this.destroyPositionLine(t), this.updateSettingItem(t), this.updateMarkerTexture(t), t.userData.marker = i;
- var r = new n.BoxHelper(t);
- this.sRender.scene.add(r), r.visible = !1, t.userData.box_helper = r, this.player.emit("add-postil-item", t.userData.setting_item), this.emitter.emit("postil-put-over")
- }, l.prototype.handleKeyOfEsc = function() {
- this.POSTIL && this.POSTIL.userData.follow_mouse && (this.destroyPositionLine(), this.sRender.scene.remove(this.POSTIL), this.POSTIL.geometry.dispose(), this.POSTIL.material.dispose(), this.POSTIL = null, this.emitter.emit("postil-put-cancel"))
- }, l.prototype.handleModelFollowingMouse = function(t, e) {
- this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
- var i = this.raycaster.intersectObjects(e);
- if (0 < i.length) {
- var n = i[0];
- if (n.face) {
- var r = n.face.normal.applyMatrix4(n.object.matrixWorld)
- .sub(n.object.position)
- .normalize();
- t.position.set(0, 0, 0), t.lookAt(r), t.position.copy(n.point)
- }
- }
- }, l.prototype.handlePostilFollowingMouse2 = function(t, e) {
- if (e.face) {
- var i = e.point,
- n = e.face.normal.applyMatrix4(e.object.matrixWorld)
- .sub(e.object.position)
- .normalize(),
- r = i.clone();
- t.position.copy(r.add(n.divideScalar(6))
- .clone()), this.destroyPositionLine(), this.addPositionLine(i, t.position), t.lookAt(this.sRender.camera.position), this.emitter.emit("postil-follow-mouse")
- }
- }, l.prototype.handleSelectPostil = function() {
- this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
- var t = this.raycaster.intersectObjects(this.PostilOfScene);
- if (0 < t.length) {
- this.player.disableNavigator = !0;
- var e = t[0];
- this.POSTIL && this.POSTIL.uuid !== e.object.uuid && (this.destroyControl(this.POSTIL), this.destroyBox(this.POSTIL)), this.POSTIL = e.object
- }
- }, l.prototype.handleChoosedPostil = function(t) {
- t.userData.handle_choosed = !0, this.bundleControl(t), this.updateSettingItem(t), this.player.emit("choosed-postil", t.userData.setting_item)
- }, l.prototype.handleDeletePostil = function(t) {
- if (this.PostilOfKV[t]) {
- var e = this.PostilOfKV[t],
- i = e.userData.marker,
- n = i.userData.postils,
- r = i.userData.default_texture;
- e.userData.transform_control && (this.destroyControl(e), this.destroyBox(e), this.POSTIL.userData.transform_control = null, this.POSTIL = null, this.player.emit("hide-postil-set-tool")), this.sRender.scene.remove(e), e.geometry.dispose(), e.material.dispose(), this.PostilOfScene.splice(this.PostilOfScene.indexOf(e), 1), delete this.PostilOfKV[t], delete n[t], 0 === Object.keys(n)
- .length && (i.material.map = r, i.material.map.needsUpdate = !0), this.player.emit("delete-postil-success", t)
- }
- }, l.prototype.handleEditPostil = function(t) {
- if (this.PostilOfKV[t]) return this.PostilOfKV[t].userData.setting_item
- }, l.prototype.bundleControl = function(t) {
- var e = this,
- i = t.userData.setting_item;
- if (!t.userData.transform_control) {
- var n = new a(this.sRender.camera, this.sRender.renderer.domElement);
- n.attach(t), n.setMode("translate"), n.setSize(.5), n.addEventListener("objectChange", (function(i) {
- e.player.emit("hide-postil-set-tool"), e.updateSettingItem(t)
- })), n.addEventListener("mouseUp", (function(t) {
- e.player.emit("update-postil-ui", i)
- })), n.addEventListener("mouseDown", (function(t) {})), t.userData.transform_control = n, this.controls.push(n), this.sRender.scene.add(n)
- }
- }, l.prototype.addPositionLine = function(t, e) {
- if (this.POSTIL) {
- var i = new n.LineBasicMaterial({
- color: 16777215
- }),
- r = new n.Geometry;
- r.vertices.push(t, e);
- var o = new n.Line(r, i);
- o.name = "position_line", this.sRender.scene.userData.position_line = o, this.sRender.scene.add(o)
- }
- }, l.prototype.destroyPositionLine = function() {
- if (this.sRender.scene.userData.position_line) {
- var t = this.sRender.scene.userData.position_line;
- this.sRender.scene.userData.position_line = null, this.sRender.scene.remove(t), t.geometry.dispose(), t.material.dispose()
- }
- }, l.prototype.destroyPostilChoosedState = function() {
- this.POSTIL && (this.POSTIL.userData.setting_item.visible = !0, this.destroyControl(this.POSTIL), this.destroyBox(this.POSTIL), this.POSTIL = null, this.player.emit("hide-postil-set-tool"))
- }, l.prototype.destroyControl = function(t) {
- if (t.userData.transform_control) {
- var e = t.userData.transform_control;
- t.userData.transform_control = null, t.userData.handle_choosed = !1, e.dispose(), e.detach(), this.sRender.scene.remove(e)
- }
- }, l.prototype.destroyBox = function(t) {
- if (t.userData.box_line) {
- var e = t.userData.box_line;
- t.userData.box_line = null, t.remove(e), e.geometry.dispose(), e.material.dispose()
- }
- }, l.prototype.updateSettingItem = function(t) {
- var e = t.userData.setting_item;
- if (e.scale = t.scale, e.position = t.position, e.default_scale = t.userData.default_scale, e.default_size = t.userData.default_size, e.default_fat = t.userData.default_fat, 0 === e.size.width && (e.size = t.userData.default_size), 0 === e.fat && (e.fat = t.userData.default_fat), t.userData.box_helper) {
- var i = r.getVerticesOfItemSize(t.geometry)[1].clone()
- .applyMatrix4(t.matrixWorld);
- e.screenPosition = r.convertWorldPositionToScreen(i, this.sRender.camera)
- }
- "" === e.current_location_id && (e.current_location_id = this.locationId)
- }, l.prototype.updatePostilInfo = function(t) {
- var e = t.info,
- i = t.change_type;
- if ("size" === i && e.size_slide_stop && (this.updateSettingItem(this.POSTIL), this.player.emit("update-postil-ui", e)), "fat" === i || "color" === i) {
- var n, r = e.fat,
- o = e.color,
- a = e.size.width;
- 1 === e.type && (n = this.POSTIL.userData.PostilModel.createTorusTexture(r, a, o)), 2 === e.type && (n = this.POSTIL.userData.PostilModel.createRectTexture(r, a, o)), this.POSTIL.material.map = n
- }
- }, l.prototype.updateDirectionOfPostil = function() {
- for (var t = 0, e = this.PostilOfScene.length; t < e; ++t) {
- this.PostilOfScene[t].lookAt(this.sRender.camera.position)
- }
- }, l.prototype.updateControlsOfPostil = function() {
- if (0 < this.controls.length)
- for (var t = 0; t < this.controls.length; ++t) this.controls[t].update()
- }, l.prototype.updateShowOfPostil = function(t) {
- if (!this.hideAll) {
- for (var e = [], i = 0, o = this.PostilOfScene.length; i < o; ++i) {
- var a = this.PostilOfScene[i],
- s = a.userData.setting_item;
- if (t === s.current_location_id) {
- a.visible = !0;
- var l = r.convertWorldPositionToScreen(new n.Vector3(0, 0, 0), this.sRender.camera);
- l = new n.Vector2(l.x, l.y);
- var u = r.convertWorldPositionToScreen(a.position.clone(), this.sRender.camera);
- u = new n.Vector2(u.x, u.y), s.distanceToScreenCenter = u.distanceTo(l);
- var h = r.getVerticesOfItemSize(a.geometry)[1].applyMatrix4(a.matrixWorld);
- s.screenPosition = r.convertWorldPositionToScreen(h.clone(), this.sRender.camera), this.computedOutScrren(a), a.userData.handle_choosed && (s.visible = !1), e[e.length] = s
- } else a.visible = !1
- }
- this.player.emit("update-postil-show", e)
- }
- }, l.prototype.updateMarkerTexture = function(t) {
- var e = t.userData.marker;
- e.userData.postils[t.uuid] = 1, e.material.map = s, e.material.map.needsUpdate = !0
- }, l.prototype.computedOutScrren = function(t) {
- var e = t.position.clone(),
- i = t.userData.setting_item;
- if ("panorama" === this.player.mode) {
- var n = e.applyMatrix4(this.sRender.camera.matrixWorldInverse)
- .applyMatrix4(this.sRender.camera.projectionMatrix);
- i.visible = !0;
- var r = Math.abs(n.x) > 1,
- o = Math.abs(n.y) > 1,
- a = Math.abs(n.z) > 1;
- r || o || a ? (i.visible = !1, t.visible = !1) : (i.visible = !0, t.visible = !0)
- } else i.visible = !1
- }, l.prototype.update = function() {
- this.updateDirectionOfPostil(), this.updateControlsOfPostil(), this.player.currentPano && this.player.currentPano.id && (this.locationId = this.player.currentPano.id, this.updateShowOfPostil(this.locationId))
- }, t.exports = l
- }, function(t, e) {
- t.exports = function(t) {
- var e = function(e) {
- t.MeshBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.opacity = .8, this.color.setHex(e.color), this.highlight = function(t) {
- this.opacity = t ? 1 : .8
- }
- };
- (e.prototype = Object.create(t.MeshBasicMaterial.prototype))
- .constructor = e;
- var i = function(e) {
- t.LineBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.linewidth = 1, this.color.setHex(e.color)
- };
- function n(e, i) {
- t.Object3D.call(this), i = void 0 !== i ? i : document, this.object = void 0, this.visible = !1, this.translationSnap = null, this.rotationSnap = null, this.space = "world", this.size = 1, this.axis = null;
- var n = this,
- r = "translate",
- o = !1,
- a = {
- translate: new t.TransformGizmoDIY2Translate
- };
- for (var s in this._gizmo = a, a) {
- var l = a[s];
- l.visible = s === r, this.add(l)
- }
- var u = {
- type: "change"
- },
- h = {
- type: "mouseDown"
- },
- c = {
- type: "mouseUp",
- mode: r
- },
- d = {
- type: "objectChange"
- },
- p = new t.Raycaster,
- f = new t.Vector2,
- m = new t.Vector3,
- g = new t.Vector3,
- v = new t.Vector3,
- y = new t.Vector3,
- b = 1,
- w = new t.Vector3,
- x = new t.Matrix4,
- M = new t.Vector3,
- T = new t.Quaternion,
- S = new t.Vector3(1, 0, 0),
- _ = new t.Vector3(0, 1, 0),
- A = new t.Vector3(0, 0, 1),
- P = new t.Quaternion,
- C = new t.Quaternion,
- E = new t.Quaternion,
- D = new t.Quaternion,
- L = new t.Vector3,
- O = new t.Vector3,
- I = new t.Matrix4,
- R = new t.Matrix4,
- N = new t.Vector3,
- k = new t.Vector3,
- F = new t.Euler,
- B = new t.Matrix4,
- z = new t.Vector3,
- U = new t.Euler;
- function V(t) {
- if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
- var e = W(t.changedTouches ? t.changedTouches[0] : t, a[r].pickers.children),
- i = null;
- e && (i = e.object.name, t.preventDefault()), n.axis !== i && (n.axis = i, n.update(), n.dispatchEvent(u))
- }
- }
- function j(t) {
- if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
- var e = t.changedTouches ? t.changedTouches[0] : t;
- if (0 === e.button || void 0 === e.button) {
- var i = W(e, a[r].pickers.children);
- if (i) {
- t.preventDefault(), t.stopPropagation(), n.dispatchEvent(h), n.axis = i.object.name, n.update(), w.copy(z)
- .sub(k)
- .normalize(), a[r].setActivePlane(n.axis, w);
- var s = W(e, [a[r].activePlane]);
- s && (L.copy(n.object.position), O.copy(n.object.scale), I.extractRotation(n.object.matrix), B.extractRotation(n.object.matrixWorld), R.extractRotation(n.object.parent.matrixWorld), N.setFromMatrixScale(x.getInverse(n.object.parent.matrixWorld)), g.copy(s.point));
- var l = i.object,
- u = n.getMode(),
- c = n._gizmo[u].pickerGizmos;
- if ("rotate" === u && l.userData.isPicker) {
- for (var d in c) {
- (p = c[d][0][0].children[0])
- .visible = !1
- }
- l.parent.getObjectByName("Torus")
- .visible = !0, l.parent.getObjectByName("ArcSurface")
- .visible = !0
- }
- if ("translate" === u && l.userData.isPicker)
- for (var d in c) {
- var p = c[d][0][0];
- n.axis !== d && (p.visible = !1)
- }
- }
- }
- o = !0
- }
- }
- function H(e) {
- if (void 0 !== n.object && null !== n.axis && !1 !== o && (void 0 === e.button || 0 === e.button)) {
- var i = W(e.changedTouches ? e.changedTouches[0] : e, [a[r].activePlane]);
- if (!1 !== i) {
- if (e.preventDefault(), e.stopPropagation(), m.copy(i.point), "translate" === r && (m.sub(g), m.multiply(N), "local" === n.space && (m.applyMatrix4(x.getInverse(B)), -1 === n.axis.search("X") && (m.x = 0), -1 === n.axis.search("Y") && (m.y = 0), -1 === n.axis.search("Z") && (m.z = 0), m.applyMatrix4(I), n.object.position.copy(L), n.object.position.add(m)), "world" !== n.space && -1 === n.axis.search("XYZ") || (-1 === n.axis.search("X") && (m.x = 0), -1 === n.axis.search("Y") && (m.y = 0), -1 === n.axis.search("Z") && (m.z = 0), m.applyMatrix4(x.getInverse(R)), n.object.position.copy(L), n.object.position.add(m)), null !== n.translationSnap && ("local" === n.space && n.object.position.applyMatrix4(x.getInverse(B)), -1 !== n.axis.search("X") && (n.object.position.x = Math.round(n.object.position.x / n.translationSnap) * n.translationSnap), -1 !== n.axis.search("Y") && (n.object.position.y = Math.round(n.object.position.y / n.translationSnap) * n.translationSnap), -1 !== n.axis.search("Z") && (n.object.position.z = Math.round(n.object.position.z / n.translationSnap) * n.translationSnap), "local" === n.space && n.object.position.applyMatrix4(B))), "rotate" === r && (m.sub(k), m.multiply(N), M.copy(g)
- .sub(k), M.multiply(N), "world" === n.space)) {
- if (v.set(Math.atan2(m.z, m.y), Math.atan2(m.x, m.z), Math.atan2(m.y, m.x)), y.set(Math.atan2(M.z, M.y), Math.atan2(M.x, M.z), Math.atan2(M.y, M.x)), T.setFromRotationMatrix(x.getInverse(R)), null !== n.rotationSnap ? (C.setFromAxisAngle(S, Math.round((v.x - y.x) / n.rotationSnap) * n.rotationSnap), E.setFromAxisAngle(_, Math.round((v.y - y.y) / n.rotationSnap) * n.rotationSnap), D.setFromAxisAngle(A, Math.round((v.z - y.z) / n.rotationSnap) * n.rotationSnap)) : (C.setFromAxisAngle(S, v.x - y.x), E.setFromAxisAngle(_, v.y - y.y), D.setFromAxisAngle(A, v.z - y.z)), P.setFromRotationMatrix(B), "X" === n.axis) {
- T.multiplyQuaternions(T, C);
- var s = n._gizmo[r].pickerGizmos.X[0][0].getObjectByName("ArcSurface");
- (l = new t.Quaternion)
- .setFromAxisAngle(A, v.x), s.quaternion.copy(l)
- }
- if ("Y" === n.axis) {
- T.multiplyQuaternions(T, E);
- s = n._gizmo[r].pickerGizmos.Y[0][0].getObjectByName("ArcSurface");
- (l = new t.Quaternion)
- .setFromAxisAngle(A, v.y), s.quaternion.copy(l)
- }
- if ("Z" === n.axis) {
- T.multiplyQuaternions(T, D);
- var l;
- s = n._gizmo[r].pickerGizmos.Z[0][0].getObjectByName("ArcSurface");
- (l = new t.Quaternion)
- .setFromAxisAngle(A, v.z), s.quaternion.copy(l)
- }
- T.multiplyQuaternions(T, P), n.object.quaternion.copy(T)
- }
- n.update(), n.dispatchEvent(u), n.dispatchEvent(d)
- }
- }
- }
- function G(t) {
- if (t.preventDefault(), void 0 === t.button || 0 === t.button) {
- if (o && null !== n.axis) {
- c.mode = r, n.dispatchEvent(c);
- var e = n.getMode(),
- i = n.axis,
- a = n._gizmo[e].pickerGizmos;
- if ("rotate" === e) {
- for (var s in a) {
- (l = a[s][0][0].children[0])
- .visible = !0
- }
- a[i][0][0].getObjectByName("Torus")
- .visible = !1, a[i][0][0].getObjectByName("ArcSurface")
- .visible = !1
- }
- if ("translate" === e)
- for (var s in a) {
- var l = a[s][0][0];
- n.axis !== s && (l.visible = !0)
- }
- }
- o = !1, "TouchEvent" in window && t instanceof TouchEvent ? (n.axis = null, n.update(), n.dispatchEvent(u)) : V(t)
- }
- }
- function W(t, n) {
- var r = i.getBoundingClientRect(),
- o = (t.clientX - r.left) / r.width,
- a = (t.clientY - r.top) / r.height;
- f.set(2 * o - 1, -2 * a + 1), p.setFromCamera(f, e);
- var s = p.intersectObjects(n, !0);
- return !!s[0] && s[0]
- }
- i.addEventListener("mousedown", j, !1), i.addEventListener("touchstart", j, !1), i.addEventListener("mousemove", V, !1), i.addEventListener("touchmove", V, !1), i.addEventListener("mousemove", H, !1), i.addEventListener("touchmove", H, !1), i.addEventListener("mouseup", G, !1), i.addEventListener("mouseout", G, !1), i.addEventListener("touchend", G, !1), i.addEventListener("touchcancel", G, !1), i.addEventListener("touchleave", G, !1), this.dispose = function() {
- i.removeEventListener("mousedown", j), i.removeEventListener("touchstart", j), i.removeEventListener("mousemove", V), i.removeEventListener("touchmove", V), i.removeEventListener("mousemove", H), i.removeEventListener("touchmove", H), i.removeEventListener("mouseup", G), i.removeEventListener("mouseout", G), i.removeEventListener("touchend", G), i.removeEventListener("touchcancel", G), i.removeEventListener("touchleave", G)
- }, this.attach = function(t) {
- this.object = t, this.visible = !0, this.update()
- }, this.detach = function() {
- this.object = void 0, this.visible = !1, this.axis = null
- }, this.getMode = function() {
- return r
- }, this.setMode = function(t) {
- for (var e in "scale" === (r = t || r) && (n.space = "local"), a) a[e].visible = e === r;
- this.update(), n.dispatchEvent(u)
- }, this.setTranslationSnap = function(t) {
- n.translationSnap = t
- }, this.setRotationSnap = function(t) {
- n.rotationSnap = t
- }, this.setSize = function(t) {
- n.size = t, this.update(), n.dispatchEvent(u)
- }, this.setSpace = function(t) {
- n.space = t, this.update(), n.dispatchEvent(u)
- }, this.update = function() {
- void 0 !== n.object && (n.object.updateMatrixWorld(), k.setFromMatrixPosition(n.object.matrixWorld), F.setFromRotationMatrix(x.extractRotation(n.object.matrixWorld)), e.updateMatrixWorld(), z.setFromMatrixPosition(e.matrixWorld), U.setFromRotationMatrix(x.extractRotation(e.matrixWorld)), b = k.distanceTo(z) / 6 * n.size, this.position.copy(k), this.scale.set(b, b, b), e instanceof t.PerspectiveCamera ? w.copy(z)
- .sub(k)
- .normalize() : e instanceof t.OrthographicCamera && w.copy(z)
- .normalize(), "local" === n.space ? a[r].update(F, w) : "world" === n.space && a[r].update(new t.Euler, w), a[r].highlight(n.axis))
- }
- }
- return (i.prototype = Object.create(t.LineBasicMaterial.prototype))
- .constructor = i, t.TransformGizmoDIY2 = function() {
- this.init = function() {
- t.Object3D.call(this), this.handles = new t.Object3D, this.pickers = new t.Object3D, this.planes = new t.Object3D, this.add(this.handles), this.add(this.pickers), this.add(this.planes);
- var e = new t.PlaneBufferGeometry(50, 50, 2, 2),
- i = new t.MeshBasicMaterial({
- visible: !1,
- side: t.DoubleSide
- }),
- n = {
- XY: new t.Mesh(e, i),
- YZ: new t.Mesh(e, i),
- XZ: new t.Mesh(e, i)
- };
- for (var r in n.YZ.rotation.set(0, Math.PI / 2, 0), n.XZ.rotation.set(-Math.PI / 2, 0, 0), n) n[r].name = r, this.planes.add(n[r]), this.planes[r] = n[r];
- var o = function(t, e) {
- for (var i in t)
- for (r = t[i].length; r--;) {
- var n = t[i][r][0],
- o = t[i][r][1],
- a = t[i][r][2];
- n.name = i, o && n.position.set(o[0], o[1], o[2]), a && n.rotation.set(a[0], a[1], a[2]), e.add(n)
- }
- };
- o(this.handleGizmos, this.handles), o(this.pickerGizmos, this.pickers), this.traverse((function(e) {
- if (e instanceof t.Mesh) {
- e.updateMatrix();
- var i = e.geometry.clone();
- i.applyMatrix(e.matrix), e.geometry = i, e.position.set(0, 0, 0), e.rotation.set(0, 0, 0), e.scale.set(1, 1, 1)
- }
- }))
- }, this.highlight = function(t) {
- this.traverse((function(e) {
- e.material && e.material.highlight && (e.name === t ? e.material.highlight(!0) : e.material.highlight(!1))
- }))
- }
- }, t.TransformGizmoDIY2.prototype = Object.create(t.Object3D.prototype), t.TransformGizmoDIY2.prototype.constructor = t.TransformGizmoDIY2, t.TransformGizmoDIY2.prototype.update = function(t, e) {}, t.TransformGizmoDIY2Translate = function() {
- t.TransformGizmoDIY2.call(this);
- var n = new t.BufferGeometry;
- n.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3));
- var r = new t.Line(n, new i({
- color: 65280
- }));
- r.userData.isLine = !0;
- var o = new t.BufferGeometry;
- o.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3));
- var a = new t.Line(o, new i({
- color: 16711680
- }));
- a.userData.isLine = !0;
- var s = new t.BufferGeometry;
- s.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3));
- var l = new t.Line(s, new i({
- color: 16776960
- }));
- r.userData.isLine = !0, this.handleGizmos = {
- X: [
- [r]
- ],
- Y: [
- [a]
- ],
- Z: [
- [l]
- ]
- };
- var u = function() {
- for (var e = [{
- x: 0,
- y: 18
- }, {
- x: 0,
- y: 10
- }, {
- x: -36,
- y: 10
- }, {
- x: -36,
- y: -8
- }, {
- x: 0,
- y: -8
- }, {
- x: 0,
- y: -18
- }, {
- x: 36,
- y: 0
- }], i = new t.Shape, n = 0; n < e.length; ++n) 0 === n ? i.moveTo(e[n].x, e[n].y) : i.lineTo(e[n].x, e[n].y);
- return new t.ExtrudeBufferGeometry(i, {
- depth: 8,
- bevelEnabled: !1,
- bevelSegments: 1,
- steps: 1,
- bevelSize: 1,
- bevelThickness: 1
- })
- },
- h = new t.Mesh(new u, new e({
- visible: !0,
- transparent: !0,
- color: 65280
- }));
- h.scale.set(.01, .01, .01), h.userData.isPicker = !0;
- var c = new t.Mesh(new u, new e({
- visible: !0,
- transparent: !0,
- color: 16711680
- }));
- c.scale.set(.01, .01, .01), c.userData.isPicker = !0;
- var d = new t.Mesh(new u, new e({
- visible: !0,
- transparent: !0,
- color: 16776960
- }));
- d.scale.set(.01, .01, .01), d.userData.isPicker = !0, this.pickerGizmos = {
- X: [
- [h, [.8, 0, 0],
- [Math.PI / 2, 0, 0]
- ]
- ],
- Y: [
- [c, [0, .8, 0],
- [0, 0, Math.PI / 2]
- ]
- ],
- Z: [
- [d, [0, 0, .8],
- [Math.PI / 2, 0, Math.PI / 2]
- ]
- ]
- }, this.setActivePlane = function(e, i) {
- var n = new t.Matrix4;
- i.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))), "X" === e && (this.activePlane = this.planes.XY, Math.abs(i.y) > Math.abs(i.z) && (this.activePlane = this.planes.XZ)), "Y" === e && (this.activePlane = this.planes.XY, Math.abs(i.x) > Math.abs(i.z) && (this.activePlane = this.planes.YZ)), "Z" === e && (this.activePlane = this.planes.XZ, Math.abs(i.x) > Math.abs(i.y) && (this.activePlane = this.planes.YZ)), "XY" === e && (this.activePlane = this.planes.XY), "YZ" === e && (this.activePlane = this.planes.YZ), "XZ" === e && (this.activePlane = this.planes.XZ)
- };
- var p = new t.Vector3(1, 0, 0),
- f = new t.Vector3(0, 1, 0),
- m = new t.Vector3(0, 0, 1),
- g = new t.Quaternion,
- v = new t.Quaternion,
- y = new t.Vector3(0, 1, 0);
- this.update = function(e, i) {
- t.TransformGizmoDIY2.prototype.update.apply(this, arguments), this.traverse((function(e) {
- var n;
- "X" === e.name && ((n = y.copy(p)
- .applyQuaternion(g)
- .dot(i)) < 0 && (e.scale.x = -1), n > 0 && (e.scale.x = 1));
- if ("Y" === e.name) {
- var r = new t.Quaternion,
- o = new t.Quaternion;
- r.setFromAxisAngle(f, Math.atan2(i.x, i.z)), o.multiplyQuaternions(o, r), e.quaternion.copy(o)
- }
- "Z" === e.name && ((n = y.copy(m)
- .applyQuaternion(v)
- .dot(i)) < 0 && (e.scale.z = -1), n > 0 && (e.scale.z = 1))
- }))
- }, this.init()
- }, t.TransformGizmoDIY2Translate.prototype = Object.create(t.TransformGizmoDIY2.prototype), t.TransformGizmoDIY2Translate.prototype.constructor = t.TransformGizmoDIY2Translate, n.prototype = Object.create(t.Object3D.prototype), n.prototype.constructor = n, n
- }
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(40)(n),
- o = i(9),
- a = i(13),
- s = i(4)
- .EventEmitter,
- l = i(140),
- u = i(41);
- function h(t) {
- this._canbeUsed = !1, this._canbeChoosed = !1, this._canbeSelect = !0, this.player = t, this.sRender = t.sRender, this.raycaster = new n.Raycaster, this.VIRTUAL_CAMERA = null, this.VIRTUAL_CAMERA_INTERSECT = null, this.putModels = [], this.putModelsOfKV = {}, this.controls = [], this.crossFadeControls = [], this.colliders = [], this.newColliders = [], this.newCollidersBoxCube = [], this.emitter = new s, this.defineProperty(), this.initStateEngine()
- }
- h.prototype.defineProperty = function() {
- Object.defineProperty(this, "canbeUsed", {
- get: function() {
- return this._canbeUsed
- },
- set: function(t) {
- this._canbeUsed = t
- }
- }), Object.defineProperty(this, "canbeSelect", {
- get: function() {
- return this._canbeSelect
- },
- set: function(t) {
- this._canbeSelect = t
- }
- })
- }, h.prototype.initStateEngine = function() {
- this.MouseStateEngine = {
- mouseMoveIn: {
- state: !1,
- callback: this.handleMouseMoveInVirtualCamera.bind(this)
- },
- mouseMoveOut: {
- state: !1,
- callback: this.handleMouseMoveOutVirtualCamera.bind(this)
- }
- }, this.MouseStateEngineTranstion = {
- mouseMoveIn: {
- mouseMoveOut: function() {
- this.MouseStateEngine.mouseMoveIn.state && (this.MouseStateEngine.mouseMoveIn.state = !1, this.MouseStateEngine.mouseMoveOut.state = !0, this.MouseStateEngine.mouseMoveOut.callback())
- }.bind(this)
- }
- }
- }, h.prototype.initBoxHelper = function(t) {
- if (!t.userData.box_helper) {
- var e = new n.BoxHelper(t);
- e.visible = !1, e.geometry.computeBoundingBox();
- var i = e.geometry.boundingBox.getSize(new n.Vector3);
- e.userData.box_size = i, t.userData.box_helper = e, this.sRender.scene.add(e)
- }
- }, h.prototype.initPositionLine = function(t, e) {
- if (this.VIRTUAL_CAMERA) {
- var i = new n.LineBasicMaterial({
- color: 16777215
- }),
- r = new n.Geometry;
- r.vertices.push(t, e);
- var o = new n.Line(r, i);
- o.name = "position_line", this.sRender.scene.userData.position_line = o, this.sRender.scene.add(o)
- }
- }, h.prototype.initOriginSettingItem = function(t) {
- var e = t.userData.setting_item;
- e.uuid = t.uuid, e.FOV = t.FOV, e.DISTANCE = t.DISTANCE, e.origin_position.copy(t.position.clone()), e.origin_rotation.copy(t.rotation.clone()), e.current_location_id = this.player.currentPano.id
- }, h.prototype.initNewCollider = function(t) {
- this.newColliders = [];
- for (var e = new n.MeshBasicMaterial({
- side: n.FrontSide,
- transparent: !0,
- opacity: 0
- }), i = 0, r = t.length; i < r; ++i) {
- var o = t[i],
- a = (new n.Geometry)
- .fromBufferGeometry(o.geometry),
- s = new n.Mesh(a, e);
- this.sRender.scene.add(s), this.newColliders.push(s);
- var l = new n.BoxHelper(s, 255);
- l.visible = !1, this.sRender.scene.add(l), s.userData.box_helper = l;
- var u = this.initBoundingCube(l, 2, 0);
- this.sRender.scene.add(u), this.newCollidersBoxCube.push(u)
- }
- for (i = 0, r = this.newCollidersBoxCube.length; i < r; ++i) {
- u = this.newCollidersBoxCube[i], o = t[i];
- u.userData.collider = o
- }
- }, h.prototype.initLabel = function(t) {
- this.player.emit("add-virtual-camera-label", t)
- }, h.prototype.initBoundingCube = function(t, e, i) {
- t.geometry.computeBoundingBox();
- var r = t.geometry.boundingBox,
- o = r.getSize(new n.Vector3),
- a = r.getCenter(new n.Vector3),
- s = new n.BoxGeometry(o.x, o.y, o.z, e, e, e),
- l = new n.MeshBasicMaterial({
- color: i,
- transparent: !0,
- opacity: 0,
- depthTest: !1,
- depthWrite: !1
- }),
- u = new n.Mesh(s, l);
- return u.position.copy(a), u
- };
- var c = !1;
- h.prototype.onHandleControlPanoramaMove = function() {
- c = !1, this._canbeChoosed = !1, this.player.emit("hide-all-virtual-camera-label"), this.VIRTUAL_CAMERA && !this.VIRTUAL_CAMERA.userData.follow_mouse && this.player.emit("hidePutModelSetTools"), this.VIRTUAL_CAMERA_INTERSECT && (this.VIRTUAL_CAMERA_INTERSECT = null)
- }, h.prototype.onHandleControlPanoramaMoveStop = function() {
- if (!c && (c = !0, this.VIRTUAL_CAMERA && !this.VIRTUAL_CAMERA.userData.follow_mouse)) {
- var t = this.VIRTUAL_CAMERA.userData.virtual_camera;
- this.VIRTUAL_CAMERA.userData.setting_item;
- this.updateSetToolsPosition(t), t.userData.out_screen || this.player.emit("showPutModelSetTools", "camera")
- }
- }, h.prototype.onHandleControlPanoramaMoveStopNoPan = function() {}, h.prototype.onHandleControlDollhouseMove = function() {
- this.VIRTUAL_CAMERA && this.player.emit("hidePutModelSetTools")
- }, h.prototype.onHandleControlDollhouseMoveStop = function() {
- if (this.VIRTUAL_CAMERA) {
- var t = this.VIRTUAL_CAMERA.userData.virtual_camera;
- this.VIRTUAL_CAMERA.userData.setting_item;
- this.updateSetToolsPosition(t), this.player.emit("showPutModelSetTools", "camera")
- }
- }, h.prototype.onCameraFovSlideStop = function() {
- this.VIRTUAL_CAMERA
- }, h.prototype.onCameraDistanceSlideStop = function() {
- this.VIRTUAL_CAMERA
- }, h.prototype.onIntoPanorama = function() {
- 0 < this.putModels.length && (this.player.emit("showModelListPanel"), this.updateAllLabelPosition(this.putModels, !0), this.handleShowAllPlaceMonitor())
- }, h.prototype.onIntoTransitioning = function() {
- this.destroyModelControlState(), this.handleHideAllPlaceMonitor(), this.player.emit("hide-all-virtual-camera-label")
- }, h.prototype.onIntoDollhouse = function() {
- G.conf.modelplaced, this.handleShowAllPlaceMonitor(), this.player.emit("hide-all-virtual-camera-label")
- }, h.prototype.onHandleControlTtagsMove = function() {
- this.player.emit("hide-all-virtual-camera-label")
- }, h.prototype.onFlyEnd = function() {
- this.computeLabelBarrier(this.player.currentPano, this.colliders), this.updateAllLabelPosition(this.putModels)
- }, h.prototype.onCameraPositionMove = function() {}, h.prototype.onCameraPositionMoveStop = function() {
- this.updateAllLabelPosition(this.putModels)
- }, h.prototype.onCameraRotationMove = function() {}, h.prototype.onCameraRotationMoveStop = function() {
- this.updateAllLabelPosition(this.putModels)
- }, h.prototype.handleMouseMove = function() {
- if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse && this.handleModelFollowingMouse(this.VIRTUAL_CAMERA), 0 < this.putModels.length) {
- var t = this.putModels.filter((function(t) {
- return !1 === t.userData.handle_choosed
- }));
- 0 < t.length && this.handlePickupVirtualCamera(t)
- }
- }, h.prototype.handlePickupVirtualCamera = function(t) {
- this.raycaster.setFromCamera(this.player.mouse, this.sRender.camera);
- var e = this.raycaster.intersectObjects(t, !0);
- if (0 < e.length) {
- var i = e[0].object;
- "VirtualCamera" === i.name ? (this.pickedObject = i, this.MouseStateEngine.mouseMoveIn.state = !0, this.MouseStateEngine.mouseMoveIn.callback(i)) : this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
- } else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
- }, h.prototype.handleMouseLeftButtonDown = function() {
- if ((!1 !== u.canbeChoosedOfMode3D || "panorama" === this.player.mode) && (this._canbeChoosed = !0, 0 < this.putModels.length)) {
- if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse) return;
- this._canbeSelect && this.handleSelectModel(this.putModels)
- }
- }, h.prototype.handleMouseLeftButtonUp = function() {
- if (this._canbeChoosed && this.VIRTUAL_CAMERA_INTERSECT) {
- this.player.humanModelControls.destroyInvalidModelControl(), this.player.weaponModelControls.destroyModelChoosedState();
- var t = this.VIRTUAL_CAMERA_INTERSECT.parent;
- this.handleChoosedModel(t), this.VIRTUAL_CAMERA_INTERSECT = null
- }
- }, h.prototype.handleMouseRightButtonDown = function() {}, h.prototype.handleMouseRightButtonUp = function() {
- if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse) {
- var t = this.VIRTUAL_CAMERA;
- this.handlePutModel(t), this.destroyBoxHelper(t), this.destroyPositionLine(), this.putModels.push(t), this.putModelsOfKV[t.uuid] = t, this.VIRTUAL_CAMERA = null, this.player.emit("addModelListItem", t.userData.setting_item)
- }
- }, h.prototype.handleModelFollowingMouse = function(t) {
- t.userData.virtual_camera.geometry.computeBoundingBox();
- var e = this.player.intersect,
- i = e.object,
- n = e.face.normal,
- r = e.point,
- o = n.applyMatrix4(i.matrixWorld)
- .sub(i.position)
- .normalize();
- t.position.set(0, 0, 0), t.lookAt(o), t.position.copy(r.clone()
- .add(n.divideScalar(8))), this.emitter.emit("virtualCamera-follow-mouse"), this.destroyPositionLine(), this.initPositionLine(r, t.position)
- }, h.prototype.handlePutModel = function(t) {
- var e = this;
- t.userData.follow_mouse = !1;
- var i = t.userData.setting_item;
- this.emitter.emit("virtualCamera-follow-mouse-over"), this.initOriginSettingItem(t), this.addAxleWire(t), this.computeCrash(t, (function() {
- e.computeSpaceData(t, !1), e.updateLabelPosition(t, i), e.initLabel(i)
- }))
- }, h.prototype.handleMouseMoveInVirtualCamera = function(t) {
- document && (document.body.style.cursor = "pointer");
- t.parent;
- this.sRender.outlinePass.selectedObjects = [t], this.emitter.emit("virtualCamera-mouse-in")
- }, h.prototype.handleMouseMoveOutVirtualCamera = function() {
- document && (document.body.style.cursor = ""), this.sRender.outlinePass.selectedObjects = [], this.emitter.emit("virtualCamera-mouse-out")
- }, h.prototype.handleSelectModel = function(t) {
- this.raycaster.setFromCamera(this.player.mouse, this.sRender.camera);
- var e = this.raycaster.intersectObjects(t, !0);
- if (0 < e.length) {
- var i = e[0].object;
- "VirtualCamera" === i.name && (this.player.disableNavigator = !0, this.player.lockedFlyToPano = !0, this.VIRTUAL_CAMERA_INTERSECT = i)
- }
- }, h.prototype.handleChoosedModel = function(t) {
- if (t.visible && (this.VIRTUAL_CAMERA && t.uuid !== this.VIRTUAL_CAMERA.uuid && this.destroyModelControlState(this.VIRTUAL_CAMERA), !this.VIRTUAL_CAMERA || t.uuid !== this.VIRTUAL_CAMERA.uuid)) {
- t.userData.handle_choosed = !0, this.VIRTUAL_CAMERA = t;
- var e = t.userData.virtual_camera,
- i = t.userData.setting_item;
- e.material.opacity = 1, this.initBoxHelper(t), this.bundleControlOfTranslate(), this.updateSetToolsPosition(t.userData.virtual_camera), this.destroySpaceData(t), this.emitter.emit("virtualCamera-handle-choosed"), this.player.emit("showPutModelSetTools", "camera"), this.player.emit("choosed-virtual-camera", t.userData.setting_item);
- var n = {
- positions: t.userData.axle_wire.geometry.vertices,
- fov: t.FOV,
- distance: t.DISTANCE,
- quaternion: t.quaternion
- };
- this.sRender.emit("virtual-update-position", n), i.isLabelShow = !1, this.initLabel(i)
- }
- }, h.prototype.handleKeyOfEsc = function() {
- if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse) {
- var t = this.VIRTUAL_CAMERA;
- this.destroyPositionLine(), this.destroyModelControlState(t), this.destroyModelFromScene(t), this.emitter.emit("virtualCamera-put-cancel")
- }
- }, h.prototype.handleHideModel = function(t) {
- if (this.putModelsOfKV[t]) {
- var e = this.putModelsOfKV[t],
- i = e.userData.cone,
- n = e.userData.face_group,
- r = i.userData.place_monitor,
- o = e.userData.axle_wire,
- a = e.userData.setting_item;
- this.switchSpaceDataVisible(e, !1), e.userData.handle_choosed && (this.destroyModelControlState(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), n && (n.visible = !1), r && (r.visible = !1), o && (o.visible = !1), e.visible = !1, a.isShow = !1
- }
- }, h.prototype.handleShowModel = function(t) {
- if (this.putModelsOfKV[t]) {
- var e = this.putModelsOfKV[t],
- i = e.userData.cone,
- n = e.userData.face_group,
- r = i.userData.place_monitor,
- o = e.userData.axle_wire,
- a = e.userData.setting_item;
- this.switchSpaceDataVisible(e, !0), n && (n.visible = !0), r && (r.visible = !0), o && (o.visible = !0), e.visible = !0, a.isShow = !0
- }
- }, h.prototype.handleDeleteModel = function(t) {
- if (this.putModelsOfKV[t]) {
- var e = this.putModelsOfKV[t];
- e.userData.handle_choosed && (this.destroyModelControlState(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), this.destroySpaceData(e), this.destroyModelFromScene(e), this.putModels.splice(this.putModels.indexOf(e), 1), delete this.putModelsOfKV[t], this.player.emit("deletePutModelSuccess", t), 0 === this.putModels.length && 0 === this.player.humanModelControls.putModelsOfHuman.length && 0 === this.player.weaponModelControls.WEAPONS_SCENE.length && this.player.emit("hideModelListPanel")
- }
- }, h.prototype.handleHideCurrentCamera = function() {
- for (var t = 0, e = this.putModels.length; t < e; ++t) {
- var i = this.putModels[t];
- !0 !== i.userData.is_save && this.handleHideModel(i.uuid)
- }
- }, h.prototype.handleShowCurrentCamera = function() {
- for (var t = 0, e = this.putModels.length; t < e; ++t) {
- var i = this.putModels[t];
- !0 !== i.userData.is_save && this.handleShowModel(i.uuid)
- }
- }, h.prototype.handleSwitchSaveCameraVisible = function(t) {
- for (var e = 0, i = this.putModels.length; e < i; ++e) {
- var n = this.putModels[e],
- r = n.userData.setting_item;
- n.userData.is_save && (!1 === t && (n.userData.handle_choosed && (this.destroyModelControlState(n), this.player.emit("hidePutModelSetTools")), this.handleHideModel(r.uuid)), !0 === t && this.handleShowModel(r.uuid))
- }
- }, h.prototype.handleHideAllPlaceMonitor = function() {
- for (var t = 0, e = this.putModels.length; t < e; ++t) {
- var i = this.putModels[t],
- n = i.userData.cone,
- r = i.userData.face_group,
- o = n.userData.place_monitor;
- r && i.visible && (r.visible = !1), o && i.visible && (o.visible = !1)
- }
- }, h.prototype.handleShowAllPlaceMonitor = function() {
- for (var t = 0, e = this.putModels.length; t < e; ++t) {
- var i = this.putModels[t],
- n = i.userData.cone,
- r = i.userData.face_group,
- o = n.userData.place_monitor;
- r && i.visible && (r.visible = !0), o && i.visible && (o.visible = !0)
- }
- }, h.prototype.handleSwitchLabelVisible = function(t, e) {}, h.prototype.handleComplete = function() {
- if (this.VIRTUAL_CAMERA) {
- var t = this.VIRTUAL_CAMERA,
- e = t.userData.setting_item;
- this.destroyModelControlState(t), this.computeCrash(t), this.computeSpaceData(t, !1), this.updateLabelPosition(t, e), "panorama" === this.player.mode ? e.isLabelShow = !0 : e.isLabelShow = !1, this.initLabel(e)
- }
- }, h.prototype.bundleControlOfTranslate = function() {
- this.VIRTUAL_CAMERA && this.bundleControlOfModel(this.VIRTUAL_CAMERA, "translate")
- }, h.prototype.bundleControlOfRotate = function() {
- this.VIRTUAL_CAMERA && this.bundleControlOfModel(this.VIRTUAL_CAMERA, "rotate")
- }, h.prototype.bundleControlOfModel = function(t, e) {
- if (t.userData.transform_control) {
- (n = t.userData.transform_control)
- .setMode(e)
- } else {
- var i = this,
- n = new r(this.sRender.camera, this.sRender.renderer.domElement),
- o = t.userData.virtual_camera,
- a = t.userData.cone;
- t.userData.setting_item;
- this.updateControlPosition(n, o.position.clone()
- .applyMatrix4(o.matrixWorld)), n.attach(t), n.setMode(e), n.setSize(.5), n.addEventListener("objectChange", (function(e) {
- "translate" === n.getMode() && i.updateControlPosition(n, o.position.clone()
- .applyMatrix4(o.matrixWorld)), a.visible = !0, i.updateAxleWire(t), i.player.emit("hidePutModelSetTools"), i.destroyPlaceMonitor(t), i.destroyCrossFace(t)
- })), n.addEventListener("mouseDown", (function(t) {})), n.addEventListener("mouseUp", (function(t) {
- "rotate" === n.getMode() && i.updateControlPosition(n, o.position.clone()
- .applyMatrix4(o.matrixWorld)), i.updateSetToolsPosition(o), i.player.emit("showPutModelSetTools", "camera")
- })), t.userData.transform_control = n, this.controls.push(n), this.sRender.scene.add(n)
- }
- };
- var d = {
- name: "totalIntersects"
- };
- h.prototype.computeCrash = function(t, e) {
- var i = this;
- void 0 === e && this.player.emit("showLoaddingOfLoadPutModel");
- var r = setTimeout((function() {
- var o = t.userData.axle_wire,
- a = t.userData.cone,
- s = a.geometry.vertices,
- l = new n.Raycaster,
- u = new n.Vector3,
- h = a.localToWorld(s[0].clone()),
- c = new WeakMap;
- c.set(d, []);
- var p = h.clone(),
- f = s[s.length - 1].clone(),
- m = a.localToWorld(f),
- g = i.newColliders;
- if (o) {
- var v = o.userData.startVec.clone(),
- y = o.userData.endVec.clone(),
- b = o.userData.direct_vector.clone();
- l.set(v, b.normalize());
- var w = l.intersectObjects(g),
- x = v.distanceTo(y);
- if (0 < w.length) {
- var M = (A = w[0])
- .point;
- A.distance <= x && i.updateAxleWire(t, M)
- }
- }
- for (var T = 1, S = s.length - 1; T < S; ++T) {
- f = s[T].clone();
- var _ = a.localToWorld(f);
- u.subVectors(_, h), l.set(h, u.normalize());
- var A;
- w = l.intersectObjects(g), x = h.distanceTo(_);
- if (0 < w.length)(A = w[0])
- .distance <= x ? c.get(d)
- .push(A) : c.get(d)
- .push({
- point: _
- });
- else c.get(d)
- .push({
- point: _
- })
- }
- c.get(d)
- .push(c.get(d)[0]), i.destroyPlaceMonitor(t);
- var P = new n.Group,
- C = new n.MeshBasicMaterial({
- color: 65280,
- side: n.DoubleSide,
- transparent: !0,
- opacity: 0,
- depthTest: !0,
- depthWrite: !1
- });
- for (T = 0, S = c.get(d)
- .length; T < S - 1; ++T) {
- var E = new n.Geometry,
- D = h.clone(),
- L = c.get(d)[T].point,
- O = c.get(d)[T + 1].point;
- E.vertices.push(D, L, O);
- var I = new n.Face3(0, 1, 2);
- E.faces.push(I);
- var R = new n.Mesh(E, C);
- P.add(R)
- }
- c.set(d, null), i.sRender.scene.add(P), a.visible = !1, a.userData.place_monitor = P, i.computeCrossFace(p, m, .5 * t.FOV, g, t), i.player.emit("hideLoaddingOfLoadPutModel"), e && e(), clearTimeout(r)
- }), 100)
- }, h.prototype.computeCrossShape = function(t) {
- for (var e = 0; e < t.length; ++e) {
- if (!t[e + 1]) return;
- var i = t[e].point,
- n = t[e + 1].point,
- r = this.sRender.scene.userData["shape_line_" + e];
- r && (r.geometry && r.geometry.dispose(), r.material && r.material.dispose(), this.sRender.scene.remove(r), this.sRender.scene.userData["shape_line_" + e] = null, r = null), r = a.drawLine(i, n, 255), this.sRender.scene.add(r), this.sRender.scene.userData["shape_line_" + e] = r
- }
- };
- var p = new n.MeshBasicMaterial({
- color: 65280,
- side: n.FrontSide,
- transparent: !0,
- opacity: .2,
- depthTest: !0,
- depthWrite: !1
- }),
- f = {};
- h.prototype.computeCrossFace = function(t, e, i, r, o) {
- var a = this;
- this.destroyCrossFace(o);
- var s = new n.Group;
- this.sRender.scene.add(s), o.userData.face_group = s, r.forEach((function(n) {
- for (var r = n.geometry.vertices, s = n.geometry.faces, l = 0, u = s.length; l < u; ++l) {
- var h = s[l];
- a.computeCurrentFace(h, r, t, e, i, n, o)
- }
- })), f = {}
- }, h.prototype.computeCurrentFace = function(t, e, i, r, o, a, s) {
- var l = s.userData.face_group,
- u = t.normal.clone(),
- h = e[t.a].clone(),
- c = e[t.b].clone(),
- d = e[t.c].clone(),
- m = 0,
- g = new n.Triangle;
- g.set(h, c, d);
- var v = g.getMidpoint(new n.Vector3),
- y = "uuid_" + a.uuid + "face_" + t.a + "_" + t.b + "_" + t.c;
- if (f[y]) m = 1;
- else {
- var b = (new n.Vector3)
- .subVectors(v, i),
- w = (new n.Vector3)
- .subVectors(r, i),
- x = Math.acos(b.clone()
- .normalize()
- .dot(w.clone()
- .normalize())),
- M = n.Math.radToDeg(x);
- if (M <= o || Math.abs(o - M) < 1.125) b.clone()
- .projectOnVector(w.clone())
- .length() <= w.length() && (m = 1, f[y] = 1, this.computeBarrier(i, v) && (m = 0))
- }
- if (1 === m) {
- var T = new n.Geometry;
- T.vertices[0] = e[t.a].clone(), T.vertices[1] = e[t.b].clone(), T.vertices[2] = e[t.c].clone(), T.faces.push(new n.Face3(0, 1, 2));
- var S = new n.Mesh(T, p);
- S.position.add(u.divideScalar(1e3)
- .clone()), l.add(S)
- }
- }, h.prototype.computeFilterColliders = function(t, e, i) {
- var r = [],
- o = {};
- this.player.hideWireFrame();
- for (var a = 0, s = t.length; a < s; ++a) {
- var l = t[a];
- l.geometry.computeBoundingBox();
- var u = l.geometry.boundingBox,
- h = u.getCenter(new n.Vector3),
- c = u.containsPoint(e),
- d = u.containsPoint(i),
- p = h.distanceTo(e) <= e.distanceTo(i),
- f = 0;
- (c || d || p) && (! function t() {
- f = Math.random(), o["_" + f] && t(), o["_" + f] = 1
- }(), this.player.addWireFrame(l, 16777215 * f * 10), r.push(l))
- }
- return r
- }, h.prototype.computeFilterColliders2 = function(t, e) {
- var i = t.userData.box_helper;
- i ? i.update() : (i = new n.BoxHelper(t, 16711680), this.sRender.scene.add(i), t.userData.box_helper = i);
- var r = this.sRender.scene.userData.cone_box_cube;
- r && (r.geometry && r.geometry.dispose(), r.material && r.material.dispose(), this.sRender.scene.remove(r)), (r = this.initBoundingCube(i, 2, 16711680))
- .geometry.computeBoundingBox(), this.sRender.scene.add(r), this.sRender.scene.userData.cone_box_cube = r;
- var o = r.geometry.vertices,
- a = new n.Raycaster,
- s = r.position.clone(),
- l = new n.Vector3;
- this.player.hideWireFrame();
- for (var u = 0, h = o.length; u < h; ++u) {
- var c = o[u].applyMatrix4(r.matrixWorld);
- l.subVectors(c, s), a.set(s, l, 1);
- var d = a.intersectObjects(this.newCollidersBoxCube);
- if (0 < d.length)
- for (var p = 0; p < d.length; ++p) {
- var f = d[p].object.userData.collider;
- this.player.addWireFrame(f, 16777215 * Math.random())
- }
- }
- for (u = 0, h = this.newCollidersBoxCube.length; u < h; ++u) {
- var m = this.newCollidersBoxCube[u];
- m.geometry.computeBoundingBox();
- m.geometry.boundingBox.getCenter(new n.Vector3)
- .applyMatrix4(m.matrixWorld);
- for (var g = m.geometry.vertices, v = (p = 0, g.length); p < v; ++p) {
- c = g[p].applyMatrix4(m.matrixWorld);
- if (r.geometry.boundingBox.containsPoint(c)) {
- f = m.userData.collider;
- this.player.addWireFrame(f, 16777215 * Math.random())
- }
- }
- }
- return []
- }, h.prototype.computeLabelBarrier = function(t, e) {
- for (var i = new n.Raycaster, r = 0, o = this.putModels.length; r < o; ++r) {
- var a = this.putModels[r],
- s = a.userData.virtual_camera,
- l = a.userData.setting_item;
- s.geometry.computeBoundingBox();
- var u = s.geometry.boundingBox.getCenter(new n.Vector3);
- u = u.clone()
- .applyMatrix4(s.matrixWorld);
- var h = new n.Vector3;
- h.subVectors(t.position, u)
- .normalize(), i.set(u, h, 1);
- var c = i.intersectObjects(e);
- if (0 < c.length) c[0].distance < u.distanceTo(t.position) ? l.isBarrier = !0 : l.isBarrier = !1;
- else l.isBarrier = !1
- }
- };
- var m = new n.Raycaster,
- g = new n.Vector3;
- h.prototype.computeBarrier = function(t, e) {
- g.subVectors(e, t), m.set(t, g.normalize());
- var i = m.intersectObjects(this.newColliders),
- n = t.distanceTo(e);
- if (0 < i.length) {
- var r = i[0].distance;
- if (r < n && n - r > .01) return !0
- }
- return !1
- }, h.prototype.computeLabelPosition = function(t) {
- t.geometry.computeBoundingBox();
- var e = t.geometry.boundingBox.getSize(new n.Vector3),
- i = t.position.clone()
- .applyMatrix4(t.matrixWorld);
- return i.y += e.y, i
- }, h.prototype.computeSpaceData = function(t, e) {
- var i = t.userData.setting_item,
- r = t.userData.virtual_camera;
- e && (this.destroySpaceData(t), r.material.opacity = .7);
- for (var s = o.getVerticesOfItemSize(r.geometry), l = r.position.clone()
- .applyMatrix4(r.matrixWorld), u = s[s.length - 2].clone()
- .applyMatrix4(r.matrixWorld), h = s[s.length - 1].clone()
- .applyMatrix4(r.matrixWorld), c = new n.Vector3(1, 0, 0), d = (new n.Vector3(-1, 0, 0), new n.Vector3(0, 1, 0), new n.Vector3(0, -1, 0)), p = (new n.Vector3(0, 0, 1), new n.Vector3(0, 0, -1)), f = ((new n.Vector3)
- .subVectors(h, u)
- .normalize(), [c, d, p]), m = new n.Raycaster, g = t.userData.axle_wire.userData.direct_vector, v = 0, y = f.length; v < y; ++v) {
- var b = f[v];
- m.set(l, b, 1);
- var w = m.intersectObjects(this.colliders);
- if (0 < w.length) {
- var x = w[0],
- M = x.point,
- T = x.distance,
- S = "axis_" + b.x + "_" + b.y + "_" + b.z;
- i.directionDistanceType[S] = T;
- var _ = g.clone()
- .normalize()
- .dot(b.clone()
- .normalize()),
- A = Math.acos(_) / (Math.PI / 180);
- if (i.axleWireWidthDirectionRotate[S] = A, !0 === e) {
- var P = a.drawFatLine(l, M, 16776960, 1.4);
- P.material.depthWrite = !1, t.userData.space_data.push(P);
- var C = l.clone(),
- E = M.clone(),
- D = new n.Line3(C, E)
- .getCenter(new n.Vector3),
- L = this.addMeasureLabel(D, T, P, S);
- P.userData.label = L, this.sRender.scene.add(P), this.sRender.scene.add(L), i.hasSpaceData = !0
- }
- }
- }
- }, h.prototype.computeRotateAngle = function(t) {
- for (var e = t.userData.setting_item, i = t.userData.virtual_camera, r = i.position.clone()
- .applyMatrix4(i.matrixWorld), o = t.userData.axle_wire.userData.direct_vector, a = new n.Raycaster, s = [new n.Vector3(1, 0, 0), new n.Vector3(0, -1, 0), new n.Vector3(0, 0, -1)], l = 0, u = s.length; l < u; ++l) {
- var h = s[l];
- if (a.set(r, h, 1), 0 < a.intersectObjects(this.colliders)
- .length) {
- var c = "axis_" + h.x + "_" + h.y + "_" + h.z,
- d = o.clone()
- .normalize()
- .dot(h.clone()
- .normalize()),
- p = Math.acos(d) / (Math.PI / 180);
- e.axleWireWidthDirectionRotate[c] = p
- }
- }
- this.player.emit("update-ui-rotate", e.axleWireWidthDirectionRotate)
- }, h.prototype.addMeasureLabel = function(t, e, i, n) {
- var r = {
- "axis_0_-1_0": "离地",
- "axis_0_0_-1": "后边",
- axis_1_0_0: "侧边"
- },
- o = {
- text: (r[n] ? r[n] + " " : "") + e.toFixed(2) + "m",
- fontSize: 14,
- fontFace: "Arial",
- renderDom: this.sRender.renderer.domElement
- },
- a = new l(o);
- return a.scale.set(.0015, .0015, .0015), a.position.copy(t), a
- }, h.prototype.addAxleWire = function(t, e) {
- if (!t.userData.axle_wire) {
- var i = t.userData.cone,
- r = t.userData.virtual_camera,
- o = i.geometry.vertices,
- s = r.position.clone()
- .applyMatrix4(r.matrixWorld),
- l = e || i.localToWorld(o[o.length - 1].clone()),
- u = new n.Vector3,
- h = a.drawLine(s, l, 16777215);
- h.userData.startVec = s, h.userData.endVec = l, h.userData.direct_vector = u.subVectors(l, s), t.userData.axle_wire = h;
- var c = {
- positions: h.geometry.vertices,
- fov: t.FOV,
- distance: t.DISTANCE,
- quaternion: t.quaternion
- };
- this.sRender.emit("virtual-update-position", c), this.computeRotateAngle(t)
- }
- }, h.prototype.switchSpaceDataVisible = function(t, e) {
- var i = t.userData.space_data;
- if (i && 0 < i.length)
- for (var n = 0, r = i.length; n < r; ++n) {
- var o = i[n];
- if (o.visible = e, o.userData.label) o.userData.label.visible = e
- }
- }, h.prototype.destroyAxleWire = function(t) {
- var e = t.userData.axle_wire;
- e && (e.material && e.material.dispose(), e.geometry && e.geometry.dispose(), this.sRender.scene.remove(e), t.userData.axle_wire = null)
- }, h.prototype.destroyBoxHelper = function(t) {
- var e = t.userData.box_helper;
- e && (e.geometry && e.geometry.dispose(), e.material && e.material.dispose(), this.sRender.scene.remove(e), t.userData.box_helper = null)
- }, h.prototype.destroyControl = function(t) {
- var e = t.userData.transform_control;
- e && (t.userData.handle_choosed = !1, t.userData.transform_control = null, e.dispose(), e.detach(), this.sRender.scene.remove(e), this.controls.splice(this.controls.indexOf(e), 1))
- }, h.prototype.destroyPositionLine = function() {
- if (this.sRender.scene.userData.position_line) {
- var t = this.sRender.scene.userData.position_line;
- this.sRender.scene.userData.position_line = null, this.sRender.scene.remove(t), t.geometry.dispose(), t.material.dispose()
- }
- }, h.prototype.destroyModelControlState = function(t) {
- (t = t || this.VIRTUAL_CAMERA) && (this.destroyBoxHelper(t), this.destroyControl(t), this.VIRTUAL_CAMERA = null, this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel"), this.emitter.emit("virtualCamera-unchoosed"))
- }, h.prototype.destroyModelFromScene = function(t) {
- (t = t || this.VIRTUAL_CAMERA) && (this.destroyBoxHelper(t), this.destroyControl(t), t.traverse((function(t) {
- t.material && t.material.dispose(), t.geometry && t.geometry.dispose()
- })), this.sRender.scene.remove(t), this.destroyPlaceMonitor(t), this.destroyCrossFace(t), this.destroyAxleWire(t))
- }, h.prototype.destroyPlaceMonitor = function(t) {
- var e = t.userData.cone,
- i = e.userData.place_monitor;
- i && (i.traverse((function(t) {
- t.isMesh && (t.geometry.dispose(), t.material.dispose())
- })), this.sRender.scene.remove(i), e.userData.place_monitor = null)
- }, h.prototype.destroyCrossFace = function(t) {
- var e = t.userData.face_group;
- e && (e.traverse((function(t) {
- t.isMesh && (t.geometry.dispose(), t.material.dispose())
- })), this.sRender.scene.remove(e), t.userData.face_group = null)
- }, h.prototype.destroySpaceData = function(t) {
- t.userData.virtual_camera.material.opacity = 1;
- var e = t.userData.space_data,
- i = t.userData.setting_item;
- if (e && 0 < e.length) {
- for (var n = 0, r = e.length; n < r; ++n) {
- var o = e[n];
- if (o.geometry && o.geometry.dispose(), o.material && o.material.dispose(), this.sRender.scene.remove(o), o.userData.label) {
- var a = o.userData.label;
- a.geometry && a.geometry.dispose(), a.material && a.material.dispose(), this.sRender.scene.remove(a)
- }
- }
- i.hasSpaceData = !1
- }
- e = [], t.userData.space_data = []
- }, h.prototype.restoreOriginSetting = function() {
- if (this.VIRTUAL_CAMERA) {
- var t = this.VIRTUAL_CAMERA,
- e = t.userData.cone,
- i = t.userData.setting_item;
- this.destroyPlaceMonitor(t), this.destroyCrossFace(t), t.FOV = i.FOV_MIN, t.DISTANCE = i.DISTANCE_MIN, e.visible = !0, i.FOV = i.FOV_MIN, i.DISTANCE = i.DISTANCE_MIN, this.player.emit("resetPutModelInfo", i), this.updateAxleWire(t)
- }
- }, h.prototype.updateBoxHelper = function(t) {
- var e = t.userData.box_helper;
- e && e.update()
- }, h.prototype.updateControlPosition = function(t, e) {
- t.currentWorldPosition.copy(e)
- }, h.prototype.updateSetToolsPosition = function(t) {
- var e = t.position.clone()
- .applyMatrix4(t.matrixWorld);
- if (o.computeWorldPositionOutCamera(e.clone(), this.sRender.camera)) t.userData.out_screen = !0, this.player.emit("hidePutModelSetTools");
- else {
- t.userData.out_screen = !1;
- var i = o.convertWorldPositionToScreen(e, this.sRender.camera);
- this.player.emit("setPutModelToolsPosition", i)
- }
- }, h.prototype.updateVirtualCameraFov = function(t) {
- var e = this.VIRTUAL_CAMERA;
- e && (e.userData.cone.visible = !0, e.FOV = t, this.updateAxleWire(e), this.destroyPlaceMonitor(e), this.destroyCrossFace(e))
- }, h.prototype.updateVirtualCameraDistance = function(t) {
- var e = this.VIRTUAL_CAMERA;
- e && (e.userData.cone.visible = !0, e.DISTANCE = t, this.updateAxleWire(e), this.destroyPlaceMonitor(e), this.destroyCrossFace(e))
- }, h.prototype.updateModelName = function(t) {
- if (this.VIRTUAL_CAMERA) {
- this.VIRTUAL_CAMERA.userData.virtual_camera;
- this.VIRTUAL_CAMERA.userData.setting_item.modelName = t
- }
- }, h.prototype.updateLabelPosition = function(t, e) {
- var i = t.userData.virtual_camera,
- n = i.position.clone()
- .applyMatrix4(i.matrixWorld);
- o.computeWorldPositionOutCamera(n, this.sRender.camera) ? e.isLabelShow = !1 : t.userData.handle_choosed || (e.isLabelShow = !0);
- var r = o.convertWorldPositionToScreen(n, this.sRender.camera);
- e.labelPosition2 = r
- }, h.prototype.updateAllLabelPosition = function(t, e) {
- if (0 < t.length)
- for (var i = t, n = 0, r = i.length; n < r; ++n) {
- var o = i[n],
- a = o.userData.setting_item;
- e && (a.isLabelShow = !0), this.updateLabelPosition(o, a), this.initLabel(a)
- }
- }, h.prototype.updateAxleWire = function(t, e) {
- this.destroyAxleWire(t), this.addAxleWire(t, e)
- }, h.prototype.update = function() {
- if (0 < this.controls.length)
- for (var t = 0, e = this.controls.length; t < e; ++t) this.controls[t].update();
- this.VIRTUAL_CAMERA && (this.updateBoxHelper(this.VIRTUAL_CAMERA), this.VIRTUAL_CAMERA.userData.cone.material.clippingPlanes = this.sRender.clipPlanes);
- this.player && 0 === this.colliders.length && (this.colliders = this.player.model.floors.reduce((function(t, e) {
- return e.hidden ? t : t.concat(e.collider.children)
- }), []))
- }, t.exports = h
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = i(13);
- function o(t) {
- n.Sprite.call(this), this.geometry = new n.PlaneBufferGeometry, this.init(t)
- }
- o.prototype = Object.create(n.Sprite.prototype), o.prototype.init = function(t) {
- var e = r.initCanvasLabel(t, "rgba( 255, 255, 255, 1 )", "rgba( 0, 0, 0, 1 )"),
- i = e.texture,
- o = e.canvas;
- this.width = o.width, this.height = o.height, this.material = new n.ShaderMaterial({
- uniforms: {
- tDiffuse: {
- value: i
- },
- width: {
- value: o.width
- },
- height: {
- value: o.height
- },
- domWidth: {
- value: t.renderDom.width
- },
- domHeight: {
- value: t.renderDom.height
- }
- },
- vertexShader: ["precision highp float;", "uniform float width;", "uniform float height;", "uniform float domWidth;", "uniform float domHeight;", "varying vec2 vUv;", "void main() {", "vUv = uv;", "vec4 proj = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);", "gl_Position = vec4(", "proj.x / proj.w + position.x * width / domWidth * 2.0,", "proj.y / proj.w + position.y * height / domHeight * 2.0,", "proj.z / proj.w,", "1.0", ");", "}"].join("\n"),
- fragmentShader: ["precision highp float;", "uniform sampler2D tDiffuse;", "uniform float width;", "uniform float height;", "varying vec2 vUv;", "void main() {", "vec2 _uv = vec2(", "(floor(vUv.s * width) + 0.5) / width,", "(floor(vUv.t * height) + 0.5) / height", ");", "gl_FragColor = texture2D( tDiffuse, _uv );", "}"].join("\n"),
- transparent: !0
- })
- }, t.exports = o
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = (i(142), i(13));
- function o(t) {
- this._canbeUsed = !1, this.player = t, this.HUMAN = null, this.INTERSETCT_SKIN = null, this.ray = new n.Raycaster, this.clock = new n.Clock, this.MOUSE = {
- btn_0: "LEFT_BUTTON",
- btn_2: "RIGHT_BUTTON"
- }, this.startPosition = new n.Vector3, this.mixer = null, this.actions = [], this.idleAction = null, this.walkAction = null, this.actionMode = "", this.walkSpeed = .022, this.defineProperty(), this.initStateEngine(), this.endPosition = null
- }
- o.prototype.defineProperty = function() {
- Object.defineProperty(this, "canbeUsed", {
- get: function() {
- return this._canbeUsed
- },
- set: function(t) {
- this._canbeUsed = t
- }
- })
- }, o.prototype.init = function(t) {
- this.HUMAN = t, this.HUMAN.userData.skeleton_box = null, this.HUMAN.userData.skeleton_helper = null, this.initSkeletonHelper(this.HUMAN), this.initSkeletonBox(this.HUMAN)
- }, o.prototype.initStateEngine = function() {
- this.ActionStateEngine = {
- WALK: {
- state: !1,
- status: {
- start_fade: {
- state: !1,
- callback: this.runFadeOfIdleToWalk
- },
- fading: function() {},
- end_fade: {
- state: !1,
- callback: this.runFadeOfIdleToWalkEnd
- }
- }
- },
- IDLE: {
- state: !1,
- status: {
- start_fade: {
- state: !1,
- callback: this.runFadeOfWalkToIdle
- },
- fading: function() {},
- end_fade: {
- state: !1,
- callback: this.runFadeOfWalkToIdleEnd
- }
- }
- }
- }, this.MouseStateMachine = {
- LEFT_BUTTON: {
- state: !1,
- status: {
- mousedown: {
- state: !1,
- callback: this.handleMouseLeftButtonDown
- },
- mouseup: {
- state: !1,
- callback: this.handleMouseLeftButtonUp
- }
- }
- },
- RIGHT_BUTTON: {
- state: !1,
- status: {
- mousedown: {
- state: !1,
- callback: function() {}
- },
- mouseup: {
- state: !1,
- callback: this.handleMouseRightButtonUp
- }
- }
- },
- MOVE: {
- state: !1,
- callback: this.handleMouseMove
- },
- LEAVE: {
- state: !1,
- callback: function() {}
- }
- }
- }, o.prototype.initSkeletonHelper = function(t) {
- if (!t.userData.skeleton_helper) {
- var e = new n.SkeletonHelper(t);
- t.userData.skeleton_helper = e, this.player.sRender.scene.add(e)
- }
- }, o.prototype.initSkeletonBox = function(t) {
- if (!t.userData.skeleton_box) {
- var e = t.userData.skeleton_helper,
- i = new n.BoxHelper(e, 5756395);
- i.geometry.computeBoundingBox(), i.userData.bottom_center_position = null, t.userData.skeleton_box = i, this.player.sRender.scene.add(i)
- }
- };
- o.prototype.initAction = function(t) {
- this.mixer = new n.AnimationMixer(t), t.userData.mixer = this.mixer, this.idleAction = this.mixer.clipAction(this.HUMAN.animations[0]), this.walkAction = this.mixer.clipAction(this.HUMAN.animations[3]), this.idleAction.name = "idle", this.walkAction.name = "walk", this.actions = [this.idleAction, this.walkAction], this.activateAllActions()
- }, o.prototype.handleWalk = function() {
- this.ActionStateEngine.WALK.state || (this.ActionStateEngine.WALK.state = !0, this.ActionStateEngine.IDLE.state = !1, this.ActionStateEngine.IDLE.status.start_fade.state = !1, this.ActionStateEngine.IDLE.status.end_fade.state = !1, this.ActionStateEngine.WALK.status.start_fade.callback.call(this, 0))
- }, o.prototype.handleWalkAssign = function(t) {
- this.endPosition = t
- }, o.prototype.handleIdle = function() {
- this.ActionStateEngine.IDLE.state || (this.ActionStateEngine.IDLE.state = !0, this.ActionStateEngine.WALK.state = !1, this.ActionStateEngine.WALK.status.start_fade.state = !1, this.ActionStateEngine.WALK.status.end_fade.state = !1, this.ActionStateEngine.IDLE.status.start_fade.callback.call(this, 0))
- }, o.prototype.handleMouseMove = function() {
- this.HUMAN && this.HUMAN.userData.follow_mouse && this.HUMAN.position.copy(this.player.intersect.point)
- }, o.prototype.handleMouseLeftButtonDown = function() {
- if (this.HUMAN && !this.HUMAN.userData.follow_mouse) {
- this.player.disableNavigator = !0;
- var t = r.drawLine(this.HUMAN.position, this.player.intersect.point, 255);
- this.player.sRender.scene.add(t), this.player.sRender.scene.userData.walk_line = t, this.HUMAN.lookAt(this.player.intersect.point), this.HUMAN.rotateY(Math.PI), this.startPosition = this.HUMAN.position.clone(), this.handleWalk()
- }
- }, o.prototype.handleMouseLeftButtonUp = function() {
- var t = this.player.sRender.scene.userData.walk_line;
- t && (t.geometry.dispose(), t.material.dispose(), this.player.sRender.scene.remove(t), this.player.sRender.scene.userData.walk_line = null), this.HUMAN && (this.handleIdle(), this.player.disableNavigator = !0)
- }, o.prototype.handleMouseRightButtonUp = function() {
- this.HUMAN && this.HUMAN.userData.follow_mouse && (this.HUMAN.userData.follow_mouse = !1, this.initAction(this.HUMAN))
- }, o.prototype.runFadeOfIdleToWalk = function(t) {
- var e = this;
- this.setWeight(this.walkAction, 1), this.ActionStateEngine.WALK.status.start_fade.state = !0, this.ActionStateEngine.WALK.status.end_fade.state = !1, this.idleAction.crossFadeTo(this.walkAction, t, !0);
- var i = setTimeout((function() {
- e.ActionStateEngine.WALK.status.start_fade.state = !1, e.ActionStateEngine.WALK.status.end_fade.state = !0, e.ActionStateEngine.WALK.status.end_fade.callback.call(e), clearTimeout(i)
- }), 1e3 * t)
- }, o.prototype.runFadeOfIdleToWalkEnd = function() {}, o.prototype.runFadeOfWalkToIdle = function(t) {
- var e = this;
- this.setWeight(this.idleAction, 1), this.ActionStateEngine.IDLE.status.start_fade.state = !0, this.ActionStateEngine.IDLE.status.end_fade.state = !1, this.walkAction.crossFadeTo(this.idleAction, .5, !0);
- var i = setTimeout((function() {
- e.ActionStateEngine.IDLE.status.start_fade.state = !1, e.ActionStateEngine.IDLE.status.end_fade.state = !0, e.ActionStateEngine.IDLE.status.end_fade.callback.call(e), clearTimeout(i)
- }), 1e3 * t)
- }, o.prototype.runFadeOfWalkToIdleEnd = function() {}, o.prototype.runActionOfWalk = function(t, e) {
- t.distanceTo(e);
- var i = e.clone()
- .sub(t)
- .normalize();
- this.HUMAN.position.add(i.clone()
- .multiplyScalar(1.4 * this.walkSpeed))
- }, o.prototype.activateAllActions = function() {
- this.setWeight(this.idleAction, 1), this.setWeight(this.walkAction, 0), this.actions.forEach((function(t) {
- t.play()
- }))
- }, o.prototype.setWeight = function(t, e) {
- t.enabled = !0, t.setEffectiveTimeScale(1), t.setEffectiveWeight(e), 1 === e && (this.actionMode = t.name)
- }, o.prototype.onPlayerMouseMove = function(t) {
- this.MouseStateMachine.MOVE.state = !0, this.MouseStateMachine.MOVE.callback.call(this)
- }, o.prototype.onPlayerMouseDown = function(t) {
- var e = t.button,
- i = this.MOUSE["btn_" + e];
- this.MouseStateMachine.MOVE.state = !1, i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !0, this.MouseStateMachine[i].status.mouseup.state = !1, this.MouseStateMachine[i].status.mousedown.callback.call(this))
- }, o.prototype.onPlayerMouseUp = function(t) {
- var e = t.button,
- i = this.MOUSE["btn_" + e];
- this.MouseStateMachine.MOVE.state = !1, i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !1, this.MouseStateMachine[i].status.mouseup.state = !0, this.MouseStateMachine[i].status.mouseup.callback.call(this))
- }, o.prototype.updateSkeletonBox = function(t) {
- var e = t.userData.skeleton_box;
- if (e) {
- e.update(), e.geometry.computeBoundingBox();
- var i = e.geometry.boundingBox,
- r = i.getCenter(new n.Vector3),
- o = i.getSize(new n.Vector3),
- a = new n.Vector3(r.x, r.y - .5 * o.y, r.z);
- e.userData.bottom_center_position = a
- }
- };
- o.prototype.updateHumanPosition = function() {
- if (this.HUMAN) {
- var t = this.HUMAN.userData.skeleton_box;
- if (t) t.userData.bottom_center_position.applyMatrix4(this.HUMAN.matrix), this.HUMAN.position.copy(new n.Vector3(this.HUMAN.position.x, this.HUMAN.position.y, this.HUMAN.position.z))
- }
- }, o.prototype.update = function() {
- var t = this.clock.getDelta();
- if (this.HUMAN) {
- this.updateSkeletonBox(this.HUMAN);
- var e = this.HUMAN.userData.mixer;
- e && e.update(t), this.ActionStateEngine.WALK.status.end_fade.state && (this.endPosition ? this.runActionOfWalk(this.startPosition, this.endPosition) : this.player.intersect.point && this.runActionOfWalk(this.startPosition, this.player.intersect.point))
- }
- }, t.exports = o
- }, function(t, e, i) {
- t.exports = function(t) {
- function e(n) {
- if (i[n]) return i[n].exports;
- var r = i[n] = {
- exports: {},
- id: n,
- loaded: !1
- };
- return t[n].call(r.exports, r, r.exports, e), r.loaded = !0, r.exports
- }
- var i = {};
- return e.m = t, e.c = i, e.p = "", e(0)
- }([function(t, e, i) {
- "use strict";
- var n = function(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }(i(1));
- t.exports = n.default
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(2)),
- o = n(i(6)),
- a = n(i(3)),
- s = n(i(7)),
- l = n(i(8)),
- u = n(i(10)),
- h = n(i(11)),
- c = n(i(12)),
- d = n(i(13)),
- p = n(i(14)),
- f = n(i(15)),
- m = n(i(16)),
- g = n(i(9)),
- v = n(i(17));
- e.default = {
- color: {
- Color: r.default,
- math: o.default,
- interpret: a.default
- },
- controllers: {
- Controller: s.default,
- BooleanController: l.default,
- OptionController: u.default,
- StringController: h.default,
- NumberController: c.default,
- NumberControllerBox: d.default,
- NumberControllerSlider: p.default,
- FunctionController: f.default,
- ColorController: m.default
- },
- dom: {
- dom: g.default
- },
- gui: {
- GUI: v.default
- },
- GUI: v.default
- }
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- function r(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }
- function o(t, e, i) {
- Object.defineProperty(t, e, {
- get: function() {
- return "RGB" === this.__state.space || c.recalculateRGB(this, e, i), this.__state[e]
- },
- set: function(t) {
- "RGB" !== this.__state.space && (c.recalculateRGB(this, e, i), this.__state.space = "RGB"), this.__state[e] = t
- }
- })
- }
- function a(t, e) {
- Object.defineProperty(t, e, {
- get: function() {
- return "HSV" === this.__state.space || c.recalculateHSV(this), this.__state[e]
- },
- set: function(t) {
- "HSV" !== this.__state.space && (c.recalculateHSV(this), this.__state.space = "HSV"), this.__state[e] = t
- }
- })
- }
- e.__esModule = !0;
- var s = n(i(3)),
- l = n(i(6)),
- u = n(i(4)),
- h = n(i(5)),
- c = function() {
- function t() {
- if (r(this, t), this.__state = s.default.apply(this, arguments), !1 === this.__state) throw new Error("Failed to interpret color arguments");
- this.__state.a = this.__state.a || 1
- }
- return t.prototype.toString = function() {
- return (0, u.default)(this)
- }, t.prototype.toHexString = function() {
- return (0, u.default)(this, !0)
- }, t.prototype.toOriginal = function() {
- return this.__state.conversion.write(this)
- }, t
- }();
- c.recalculateRGB = function(t, e, i) {
- if ("HEX" === t.__state.space) t.__state[e] = l.default.component_from_hex(t.__state.hex, i);
- else {
- if ("HSV" !== t.__state.space) throw new Error("Corrupted color state");
- h.default.extend(t.__state, l.default.hsv_to_rgb(t.__state.h, t.__state.s, t.__state.v))
- }
- }, c.recalculateHSV = function(t) {
- var e = l.default.rgb_to_hsv(t.r, t.g, t.b);
- h.default.extend(t.__state, {
- s: e.s,
- v: e.v
- }), h.default.isNaN(e.h) ? h.default.isUndefined(t.__state.h) && (t.__state.h = 0) : t.__state.h = e.h
- }, c.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"], o(c.prototype, "r", 2), o(c.prototype, "g", 1), o(c.prototype, "b", 0), a(c.prototype, "h"), a(c.prototype, "s"), a(c.prototype, "v"), Object.defineProperty(c.prototype, "a", {
- get: function() {
- return this.__state.a
- },
- set: function(t) {
- this.__state.a = t
- }
- }), Object.defineProperty(c.prototype, "hex", {
- get: function() {
- return "HEX" !== !this.__state.space && (this.__state.hex = l.default.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
- },
- set: function(t) {
- this.__state.space = "HEX", this.__state.hex = t
- }
- }), e.default = c
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(4)),
- o = n(i(5)),
- a = [{
- litmus: o.default.isString,
- conversions: {
- THREE_CHAR_HEX: {
- read: function(t) {
- var e = t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
- return null !== e && {
- space: "HEX",
- hex: parseInt("0x" + e[1].toString() + e[1].toString() + e[2].toString() + e[2].toString() + e[3].toString() + e[3].toString(), 0)
- }
- },
- write: r.default
- },
- SIX_CHAR_HEX: {
- read: function(t) {
- var e = t.match(/^#([A-F0-9]{6})$/i);
- return null !== e && {
- space: "HEX",
- hex: parseInt("0x" + e[1].toString(), 0)
- }
- },
- write: r.default
- },
- CSS_RGB: {
- read: function(t) {
- var e = t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
- return null !== e && {
- space: "RGB",
- r: parseFloat(e[1]),
- g: parseFloat(e[2]),
- b: parseFloat(e[3])
- }
- },
- write: r.default
- },
- CSS_RGBA: {
- read: function(t) {
- var e = t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
- return null !== e && {
- space: "RGB",
- r: parseFloat(e[1]),
- g: parseFloat(e[2]),
- b: parseFloat(e[3]),
- a: parseFloat(e[4])
- }
- },
- write: r.default
- }
- }
- }, {
- litmus: o.default.isNumber,
- conversions: {
- HEX: {
- read: function(t) {
- return {
- space: "HEX",
- hex: t,
- conversionName: "HEX"
- }
- },
- write: function(t) {
- return t.hex
- }
- }
- }
- }, {
- litmus: o.default.isArray,
- conversions: {
- RGB_ARRAY: {
- read: function(t) {
- return 3 === t.length && {
- space: "RGB",
- r: t[0],
- g: t[1],
- b: t[2]
- }
- },
- write: function(t) {
- return [t.r, t.g, t.b]
- }
- },
- RGBA_ARRAY: {
- read: function(t) {
- return 4 === t.length && {
- space: "RGB",
- r: t[0],
- g: t[1],
- b: t[2],
- a: t[3]
- }
- },
- write: function(t) {
- return [t.r, t.g, t.b, t.a]
- }
- }
- }
- }, {
- litmus: o.default.isObject,
- conversions: {
- RGBA_OBJ: {
- read: function(t) {
- return !!(o.default.isNumber(t.r) && o.default.isNumber(t.g) && o.default.isNumber(t.b) && o.default.isNumber(t.a)) && {
- space: "RGB",
- r: t.r,
- g: t.g,
- b: t.b,
- a: t.a
- }
- },
- write: function(t) {
- return {
- r: t.r,
- g: t.g,
- b: t.b,
- a: t.a
- }
- }
- },
- RGB_OBJ: {
- read: function(t) {
- return !!(o.default.isNumber(t.r) && o.default.isNumber(t.g) && o.default.isNumber(t.b)) && {
- space: "RGB",
- r: t.r,
- g: t.g,
- b: t.b
- }
- },
- write: function(t) {
- return {
- r: t.r,
- g: t.g,
- b: t.b
- }
- }
- },
- HSVA_OBJ: {
- read: function(t) {
- return !!(o.default.isNumber(t.h) && o.default.isNumber(t.s) && o.default.isNumber(t.v) && o.default.isNumber(t.a)) && {
- space: "HSV",
- h: t.h,
- s: t.s,
- v: t.v,
- a: t.a
- }
- },
- write: function(t) {
- return {
- h: t.h,
- s: t.s,
- v: t.v,
- a: t.a
- }
- }
- },
- HSV_OBJ: {
- read: function(t) {
- return !!(o.default.isNumber(t.h) && o.default.isNumber(t.s) && o.default.isNumber(t.v)) && {
- space: "HSV",
- h: t.h,
- s: t.s,
- v: t.v
- }
- },
- write: function(t) {
- return {
- h: t.h,
- s: t.s,
- v: t.v
- }
- }
- }
- }
- }],
- s = void 0,
- l = void 0;
- e.default = function() {
- l = !1;
- var t = arguments.length > 1 ? o.default.toArray(arguments) : arguments[0];
- return o.default.each(a, (function(e) {
- if (e.litmus(t)) return o.default.each(e.conversions, (function(e, i) {
- if (s = e.read(t), !1 === l && !1 !== s) return l = s, s.conversionName = i, s.conversion = e, o.default.BREAK
- })), o.default.BREAK
- })), l
- }
- }, function(t, e) {
- "use strict";
- e.__esModule = !0, e.default = function(t, e) {
- var i = t.__state.conversionName.toString(),
- n = Math.round(t.r),
- r = Math.round(t.g),
- o = Math.round(t.b),
- a = t.a,
- s = Math.round(t.h),
- l = t.s.toFixed(1),
- u = t.v.toFixed(1);
- if (e || "THREE_CHAR_HEX" === i || "SIX_CHAR_HEX" === i) {
- for (var h = t.hex.toString(16); h.length < 6;) h = "0" + h;
- return "#" + h
- }
- return "CSS_RGB" === i ? "rgb(" + n + "," + r + "," + o + ")" : "CSS_RGBA" === i ? "rgba(" + n + "," + r + "," + o + "," + a + ")" : "HEX" === i ? "0x" + t.hex.toString(16) : "RGB_ARRAY" === i ? "[" + n + "," + r + "," + o + "]" : "RGBA_ARRAY" === i ? "[" + n + "," + r + "," + o + "," + a + "]" : "RGB_OBJ" === i ? "{r:" + n + ",g:" + r + ",b:" + o + "}" : "RGBA_OBJ" === i ? "{r:" + n + ",g:" + r + ",b:" + o + ",a:" + a + "}" : "HSV_OBJ" === i ? "{h:" + s + ",s:" + l + ",v:" + u + "}" : "HSVA_OBJ" === i ? "{h:" + s + ",s:" + l + ",v:" + u + ",a:" + a + "}" : "unknown format"
- }
- }, function(t, e) {
- "use strict";
- e.__esModule = !0;
- var i = Array.prototype.forEach,
- n = Array.prototype.slice,
- r = {
- BREAK: {},
- extend: function(t) {
- return this.each(n.call(arguments, 1), (function(e) {
- (this.isObject(e) ? Object.keys(e) : [])
- .forEach(function(i) {
- this.isUndefined(e[i]) || (t[i] = e[i])
- }.bind(this))
- }), this), t
- },
- defaults: function(t) {
- return this.each(n.call(arguments, 1), (function(e) {
- (this.isObject(e) ? Object.keys(e) : [])
- .forEach(function(i) {
- this.isUndefined(t[i]) && (t[i] = e[i])
- }.bind(this))
- }), this), t
- },
- compose: function() {
- var t = n.call(arguments);
- return function() {
- for (var e = n.call(arguments), i = t.length - 1; i >= 0; i--) e = [t[i].apply(this, e)];
- return e[0]
- }
- },
- each: function(t, e, n) {
- if (t)
- if (i && t.forEach && t.forEach === i) t.forEach(e, n);
- else if (t.length === t.length + 0) {
- var r, o = void 0;
- for (o = 0, r = t.length; o < r; o++)
- if (o in t && e.call(n, t[o], o) === this.BREAK) return
- } else
- for (var a in t)
- if (e.call(n, t[a], a) === this.BREAK) return
- },
- defer: function(t) {
- setTimeout(t, 0)
- },
- debounce: function(t, e) {
- var i = void 0;
- return function() {
- function n() {
- i = null
- }
- var r = this,
- o = arguments,
- a = !i;
- clearTimeout(i), i = setTimeout(n, e), a && t.apply(r, o)
- }
- },
- toArray: function(t) {
- return t.toArray ? t.toArray() : n.call(t)
- },
- isUndefined: function(t) {
- return void 0 === t
- },
- isNull: function(t) {
- return null === t
- },
- isNaN: function(t) {
- function e(e) {
- return t.apply(this, arguments)
- }
- return e.toString = function() {
- return t.toString()
- }, e
- }((function(t) {
- return isNaN(t)
- })),
- isArray: Array.isArray || function(t) {
- return t.constructor === Array
- },
- isObject: function(t) {
- return t === Object(t)
- },
- isNumber: function(t) {
- return t === t + 0
- },
- isString: function(t) {
- return t === t + ""
- },
- isBoolean: function(t) {
- return !1 === t || !0 === t
- },
- isFunction: function(t) {
- return "[object Function]" === Object.prototype.toString.call(t)
- }
- };
- e.default = r
- }, function(t, e) {
- "use strict";
- e.__esModule = !0;
- var i = void 0,
- n = {
- hsv_to_rgb: function(t, e, i) {
- var n = Math.floor(t / 60) % 6,
- r = t / 60 - Math.floor(t / 60),
- o = i * (1 - e),
- a = i * (1 - r * e),
- s = i * (1 - (1 - r) * e),
- l = [
- [i, s, o],
- [a, i, o],
- [o, i, s],
- [o, a, i],
- [s, o, i],
- [i, o, a]
- ][n];
- return {
- r: 255 * l[0],
- g: 255 * l[1],
- b: 255 * l[2]
- }
- },
- rgb_to_hsv: function(t, e, i) {
- var n = Math.min(t, e, i),
- r = Math.max(t, e, i),
- o = r - n,
- a = void 0;
- return 0 === r ? {
- h: NaN,
- s: 0,
- v: 0
- } : (a = t === r ? (e - i) / o : e === r ? 2 + (i - t) / o : 4 + (t - e) / o, (a /= 6) < 0 && (a += 1), {
- h: 360 * a,
- s: o / r,
- v: r / 255
- })
- },
- rgb_to_hex: function(t, e, i) {
- var n = this.hex_with_component(0, 2, t);
- return n = this.hex_with_component(n, 1, e), this.hex_with_component(n, 0, i)
- },
- component_from_hex: function(t, e) {
- return t >> 8 * e & 255
- },
- hex_with_component: function(t, e, n) {
- return n << (i = 8 * e) | t & ~(255 << i)
- }
- };
- e.default = n
- }, function(t, e) {
- "use strict";
- e.__esModule = !0;
- var i = function() {
- function t(e, i) {
- (function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- })(this, t), this.initialValue = e[i], this.domElement = document.createElement("div"), this.object = e, this.property = i, this.__onChange = void 0, this.__onFinishChange = void 0
- }
- return t.prototype.onChange = function(t) {
- return this.__onChange = t, this
- }, t.prototype.onFinishChange = function(t) {
- return this.__onFinishChange = t, this
- }, t.prototype.setValue = function(t) {
- return this.object[this.property] = t, this.__onChange && this.__onChange.call(this, t), this.updateDisplay(), this
- }, t.prototype.getValue = function() {
- return this.object[this.property]
- }, t.prototype.updateDisplay = function() {
- return this
- }, t.prototype.isModified = function() {
- return this.initialValue !== this.getValue()
- }, t
- }();
- e.default = i
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(7)),
- o = n(i(9)),
- a = function(t) {
- function e(i, n) {
- ! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var r = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n)),
- a = r;
- return r.__prev = r.getValue(), r.__checkbox = document.createElement("input"), r.__checkbox.setAttribute("type", "checkbox"), o.default.bind(r.__checkbox, "change", (function() {
- a.setValue(!a.__prev)
- }), !1), r.domElement.appendChild(r.__checkbox), r.updateDisplay(), r
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.setValue = function(e) {
- var i = t.prototype.setValue.call(this, e);
- return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), i
- }, e.prototype.updateDisplay = function() {
- return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0) : this.__checkbox.checked = !1, t.prototype.updateDisplay.call(this)
- }, e
- }(r.default);
- e.default = a
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- if ("0" === t || r.default.isUndefined(t)) return 0;
- var e = t.match(a);
- return r.default.isNull(e) ? 0 : parseFloat(e[1])
- }
- e.__esModule = !0;
- var r = function(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }(i(5)),
- o = {};
- r.default.each({
- HTMLEvents: ["change"],
- MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
- KeyboardEvents: ["keydown"]
- }, (function(t, e) {
- r.default.each(t, (function(t) {
- o[t] = e
- }))
- }));
- var a = /(\d+(\.\d+)?)px/,
- s = {
- makeSelectable: function(t, e) {
- void 0 !== t && void 0 !== t.style && (t.onselectstart = e ? function() {
- return !1
- } : function() {}, t.style.MozUserSelect = e ? "auto" : "none", t.style.KhtmlUserSelect = e ? "auto" : "none", t.unselectable = e ? "on" : "off")
- },
- makeFullscreen: function(t, e, i) {
- var n = i,
- o = e;
- r.default.isUndefined(o) && (o = !0), r.default.isUndefined(n) && (n = !0), t.style.position = "absolute", o && (t.style.left = 0, t.style.right = 0), n && (t.style.top = 0, t.style.bottom = 0)
- },
- fakeEvent: function(t, e, i, n) {
- var a = i || {},
- s = o[e];
- if (!s) throw new Error("Event type " + e + " not supported.");
- var l = document.createEvent(s);
- switch (s) {
- case "MouseEvents":
- var u = a.x || a.clientX || 0,
- h = a.y || a.clientY || 0;
- l.initMouseEvent(e, a.bubbles || !1, a.cancelable || !0, window, a.clickCount || 1, 0, 0, u, h, !1, !1, !1, !1, 0, null);
- break;
- case "KeyboardEvents":
- var c = l.initKeyboardEvent || l.initKeyEvent;
- r.default.defaults(a, {
- cancelable: !0,
- ctrlKey: !1,
- altKey: !1,
- shiftKey: !1,
- metaKey: !1,
- keyCode: void 0,
- charCode: void 0
- }), c(e, a.bubbles || !1, a.cancelable, window, a.ctrlKey, a.altKey, a.shiftKey, a.metaKey, a.keyCode, a.charCode);
- break;
- default:
- l.initEvent(e, a.bubbles || !1, a.cancelable || !0)
- }
- r.default.defaults(l, n), t.dispatchEvent(l)
- },
- bind: function(t, e, i, n) {
- var r = n || !1;
- return t.addEventListener ? t.addEventListener(e, i, r) : t.attachEvent && t.attachEvent("on" + e, i), s
- },
- unbind: function(t, e, i, n) {
- var r = n || !1;
- return t.removeEventListener ? t.removeEventListener(e, i, r) : t.detachEvent && t.detachEvent("on" + e, i), s
- },
- addClass: function(t, e) {
- if (void 0 === t.className) t.className = e;
- else if (t.className !== e) {
- var i = t.className.split(/ +/); - 1 === i.indexOf(e) && (i.push(e), t.className = i.join(" ")
- .replace(/^\s+/, "")
- .replace(/\s+$/, ""))
- }
- return s
- },
- removeClass: function(t, e) {
- if (e)
- if (t.className === e) t.removeAttribute("class");
- else {
- var i = t.className.split(/ +/),
- n = i.indexOf(e); - 1 !== n && (i.splice(n, 1), t.className = i.join(" "))
- }
- else t.className = void 0;
- return s
- },
- hasClass: function(t, e) {
- return new RegExp("(?:^|\\s+)" + e + "(?:\\s+|$)")
- .test(t.className) || !1
- },
- getWidth: function(t) {
- var e = getComputedStyle(t);
- return n(e["border-left-width"]) + n(e["border-right-width"]) + n(e["padding-left"]) + n(e["padding-right"]) + n(e.width)
- },
- getHeight: function(t) {
- var e = getComputedStyle(t);
- return n(e["border-top-width"]) + n(e["border-bottom-width"]) + n(e["padding-top"]) + n(e["padding-bottom"]) + n(e.height)
- },
- getOffset: function(t) {
- var e = t,
- i = {
- left: 0,
- top: 0
- };
- if (e.offsetParent)
- do {
- i.left += e.offsetLeft, i.top += e.offsetTop, e = e.offsetParent
- } while (e);
- return i
- },
- isActive: function(t) {
- return t === document.activeElement && (t.type || t.href)
- }
- };
- e.default = s
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(7)),
- o = n(i(9)),
- a = n(i(5)),
- s = function(t) {
- function e(i, n, r) {
- ! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var s = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n)),
- l = r,
- u = s;
- return s.__select = document.createElement("select"), a.default.isArray(l) && function() {
- var t = {};
- a.default.each(l, (function(e) {
- t[e] = e
- })), l = t
- }(), a.default.each(l, (function(t, e) {
- var i = document.createElement("option");
- i.innerHTML = e, i.setAttribute("value", t), u.__select.appendChild(i)
- })), s.updateDisplay(), o.default.bind(s.__select, "change", (function() {
- var t = this.options[this.selectedIndex].value;
- u.setValue(t)
- })), s.domElement.appendChild(s.__select), s
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.setValue = function(e) {
- var i = t.prototype.setValue.call(this, e);
- return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), i
- }, e.prototype.updateDisplay = function() {
- return o.default.isActive(this.__select) ? this : (this.__select.value = this.getValue(), t.prototype.updateDisplay.call(this))
- }, e
- }(r.default);
- e.default = s
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(7)),
- o = n(i(9)),
- a = function(t) {
- function e(i, n) {
- function r() {
- s.setValue(s.__input.value)
- }! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var a = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n)),
- s = a;
- return a.__input = document.createElement("input"), a.__input.setAttribute("type", "text"), o.default.bind(a.__input, "keyup", r), o.default.bind(a.__input, "change", r), o.default.bind(a.__input, "blur", (function() {
- s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
- })), o.default.bind(a.__input, "keydown", (function(t) {
- 13 === t.keyCode && this.blur()
- })), a.updateDisplay(), a.domElement.appendChild(a.__input), a
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.updateDisplay = function() {
- return o.default.isActive(this.__input) || (this.__input.value = this.getValue()), t.prototype.updateDisplay.call(this)
- }, e
- }(r.default);
- e.default = a
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- function r(t) {
- var e = t.toString();
- return e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
- }
- e.__esModule = !0;
- var o = n(i(7)),
- a = n(i(5)),
- s = function(t) {
- function e(i, n, o) {
- ! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var s = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n)),
- l = o || {};
- return s.__min = l.min, s.__max = l.max, s.__step = l.step, a.default.isUndefined(s.__step) ? 0 === s.initialValue ? s.__impliedStep = 1 : s.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(s.initialValue)) / Math.LN10)) / 10 : s.__impliedStep = s.__step, s.__precision = r(s.__impliedStep), s
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.setValue = function(e) {
- var i = e;
- return void 0 !== this.__min && i < this.__min ? i = this.__min : void 0 !== this.__max && i > this.__max && (i = this.__max), void 0 !== this.__step && i % this.__step != 0 && (i = Math.round(i / this.__step) * this.__step), t.prototype.setValue.call(this, i)
- }, e.prototype.min = function(t) {
- return this.__min = t, this
- }, e.prototype.max = function(t) {
- return this.__max = t, this
- }, e.prototype.step = function(t) {
- return this.__step = t, this.__impliedStep = t, this.__precision = r(t), this
- }, e
- }(o.default);
- e.default = s
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(12)),
- o = n(i(9)),
- a = n(i(5)),
- s = function(t) {
- function e(i, n, r) {
- function s() {
- c.__onFinishChange && c.__onFinishChange.call(c, c.getValue())
- }
- function l(t) {
- var e = d - t.clientY;
- c.setValue(c.getValue() + e * c.__impliedStep), d = t.clientY
- }
- function u() {
- o.default.unbind(window, "mousemove", l), o.default.unbind(window, "mouseup", u), s()
- }! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var h = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n, r));
- h.__truncationSuspended = !1;
- var c = h,
- d = void 0;
- return h.__input = document.createElement("input"), h.__input.setAttribute("type", "text"), o.default.bind(h.__input, "change", (function() {
- var t = parseFloat(c.__input.value);
- a.default.isNaN(t) || c.setValue(t)
- })), o.default.bind(h.__input, "blur", (function() {
- s()
- })), o.default.bind(h.__input, "mousedown", (function(t) {
- o.default.bind(window, "mousemove", l), o.default.bind(window, "mouseup", u), d = t.clientY
- })), o.default.bind(h.__input, "keydown", (function(t) {
- 13 === t.keyCode && (c.__truncationSuspended = !0, this.blur(), c.__truncationSuspended = !1, s())
- })), h.updateDisplay(), h.domElement.appendChild(h.__input), h
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.updateDisplay = function() {
- return this.__input.value = this.__truncationSuspended ? this.getValue() : function(t, e) {
- var i = Math.pow(10, e);
- return Math.round(t * i) / i
- }(this.getValue(), this.__precision), t.prototype.updateDisplay.call(this)
- }, e
- }(r.default);
- e.default = s
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(12)),
- o = n(i(9)),
- a = function(t) {
- function e(i, n, r, a, s) {
- function l(t) {
- t.preventDefault();
- var e = c.__background.getBoundingClientRect();
- return c.setValue(function(t, e, i, n, r) {
- return n + (t - e) / (i - e) * (r - n)
- }(t.clientX, e.left, e.right, c.__min, c.__max)), !1
- }
- function u() {
- o.default.unbind(window, "mousemove", l), o.default.unbind(window, "mouseup", u), c.__onFinishChange && c.__onFinishChange.call(c, c.getValue())
- }! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var h = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n, {
- min: r,
- max: a,
- step: s
- })),
- c = h;
- return h.__background = document.createElement("div"), h.__foreground = document.createElement("div"), o.default.bind(h.__background, "mousedown", (function(t) {
- document.activeElement.blur(), o.default.bind(window, "mousemove", l), o.default.bind(window, "mouseup", u), l(t)
- })), o.default.addClass(h.__background, "slider"), o.default.addClass(h.__foreground, "slider-fg"), h.updateDisplay(), h.__background.appendChild(h.__foreground), h.domElement.appendChild(h.__background), h
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.updateDisplay = function() {
- var e = (this.getValue() - this.__min) / (this.__max - this.__min);
- return this.__foreground.style.width = 100 * e + "%", t.prototype.updateDisplay.call(this)
- }, e
- }(r.default);
- e.default = a
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(7)),
- o = n(i(9)),
- a = function(t) {
- function e(i, n, r) {
- ! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var a = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n)),
- s = a;
- return a.__button = document.createElement("div"), a.__button.innerHTML = void 0 === r ? "Fire" : r, o.default.bind(a.__button, "click", (function(t) {
- return t.preventDefault(), s.fire(), !1
- })), o.default.addClass(a.__button, "button"), a.domElement.appendChild(a.__button), a
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.fire = function() {
- this.__onChange && this.__onChange.call(this), this.getValue()
- .call(this.object), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue())
- }, e
- }(r.default);
- e.default = a
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- function r(t, e, i, n) {
- t.style.background = "", u.default.each(c, (function(r) {
- t.style.cssText += "background: " + r + "linear-gradient(" + e + ", " + i + " 0%, " + n + " 100%); "
- }))
- }
- e.__esModule = !0;
- var o = n(i(7)),
- a = n(i(9)),
- s = n(i(2)),
- l = n(i(3)),
- u = n(i(5)),
- h = function(t) {
- function e(i, n) {
- function o(t) {
- f(t), a.default.bind(window, "mousemove", f), a.default.bind(window, "mouseup", h)
- }
- function h() {
- a.default.unbind(window, "mousemove", f), a.default.unbind(window, "mouseup", h), p()
- }
- function c() {
- var t = (0, l.default)(this.value);
- !1 !== t ? (v.__color.__state = t, v.setValue(v.__color.toOriginal())) : this.value = v.__color.toString()
- }
- function d() {
- a.default.unbind(window, "mousemove", m), a.default.unbind(window, "mouseup", d), p()
- }
- function p() {
- v.__onFinishChange && v.__onFinishChange.call(v, v.__color.toOriginal())
- }
- function f(t) {
- t.preventDefault();
- var e = v.__saturation_field.getBoundingClientRect(),
- i = (t.clientX - e.left) / (e.right - e.left),
- n = 1 - (t.clientY - e.top) / (e.bottom - e.top);
- return n > 1 ? n = 1 : n < 0 && (n = 0), i > 1 ? i = 1 : i < 0 && (i = 0), v.__color.v = n, v.__color.s = i, v.setValue(v.__color.toOriginal()), !1
- }
- function m(t) {
- t.preventDefault();
- var e = v.__hue_field.getBoundingClientRect(),
- i = 1 - (t.clientY - e.top) / (e.bottom - e.top);
- return i > 1 ? i = 1 : i < 0 && (i = 0), v.__color.h = 360 * i, v.setValue(v.__color.toOriginal()), !1
- }! function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- }(this, e);
- var g = function(t, e) {
- if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !e || "object" != typeof e && "function" != typeof e ? t : e
- }(this, t.call(this, i, n));
- g.__color = new s.default(g.getValue()), g.__temp = new s.default(0);
- var v = g;
- g.domElement = document.createElement("div"), a.default.makeSelectable(g.domElement, !1), g.__selector = document.createElement("div"), g.__selector.className = "selector", g.__saturation_field = document.createElement("div"), g.__saturation_field.className = "saturation-field", g.__field_knob = document.createElement("div"), g.__field_knob.className = "field-knob", g.__field_knob_border = "2px solid ", g.__hue_knob = document.createElement("div"), g.__hue_knob.className = "hue-knob", g.__hue_field = document.createElement("div"), g.__hue_field.className = "hue-field", g.__input = document.createElement("input"), g.__input.type = "text", g.__input_textShadow = "0 1px 1px ", a.default.bind(g.__input, "keydown", (function(t) {
- 13 === t.keyCode && c.call(this)
- })), a.default.bind(g.__input, "blur", c), a.default.bind(g.__selector, "mousedown", (function() {
- a.default.addClass(this, "drag")
- .bind(window, "mouseup", (function() {
- a.default.removeClass(v.__selector, "drag")
- }))
- }));
- var y = document.createElement("div");
- return u.default.extend(g.__selector.style, {
- width: "122px",
- height: "102px",
- padding: "3px",
- backgroundColor: "#222",
- boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
- }), u.default.extend(g.__field_knob.style, {
- position: "absolute",
- width: "12px",
- height: "12px",
- border: g.__field_knob_border + (g.__color.v < .5 ? "#fff" : "#000"),
- boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
- borderRadius: "12px",
- zIndex: 1
- }), u.default.extend(g.__hue_knob.style, {
- position: "absolute",
- width: "15px",
- height: "2px",
- borderRight: "4px solid #fff",
- zIndex: 1
- }), u.default.extend(g.__saturation_field.style, {
- width: "100px",
- height: "100px",
- border: "1px solid #555",
- marginRight: "3px",
- display: "inline-block",
- cursor: "pointer"
- }), u.default.extend(y.style, {
- width: "100%",
- height: "100%",
- background: "none"
- }), r(y, "top", "rgba(0,0,0,0)", "#000"), u.default.extend(g.__hue_field.style, {
- width: "15px",
- height: "100px",
- border: "1px solid #555",
- cursor: "ns-resize",
- position: "absolute",
- top: "3px",
- right: "3px"
- }),
- function(t) {
- t.style.background = "", t.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", t.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", t.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", t.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", t.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
- }(g.__hue_field), u.default.extend(g.__input.style, {
- outline: "none",
- textAlign: "center",
- color: "#fff",
- border: 0,
- fontWeight: "bold",
- textShadow: g.__input_textShadow + "rgba(0,0,0,0.7)"
- }), a.default.bind(g.__saturation_field, "mousedown", o), a.default.bind(g.__field_knob, "mousedown", o), a.default.bind(g.__hue_field, "mousedown", (function(t) {
- m(t), a.default.bind(window, "mousemove", m), a.default.bind(window, "mouseup", d)
- })), g.__saturation_field.appendChild(y), g.__selector.appendChild(g.__field_knob), g.__selector.appendChild(g.__saturation_field), g.__selector.appendChild(g.__hue_field), g.__hue_field.appendChild(g.__hue_knob), g.domElement.appendChild(g.__input), g.domElement.appendChild(g.__selector), g.updateDisplay(), g
- }
- return function(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
- }(e, t), e.prototype.updateDisplay = function() {
- var t = (0, l.default)(this.getValue());
- if (!1 !== t) {
- var e = !1;
- u.default.each(s.default.COMPONENTS, (function(i) {
- if (!u.default.isUndefined(t[i]) && !u.default.isUndefined(this.__color.__state[i]) && t[i] !== this.__color.__state[i]) return e = !0, {}
- }), this), e && u.default.extend(this.__color.__state, t)
- }
- u.default.extend(this.__temp.__state, this.__color.__state), this.__temp.a = 1;
- var i = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0,
- n = 255 - i;
- u.default.extend(this.__field_knob.style, {
- marginLeft: 100 * this.__color.s - 7 + "px",
- marginTop: 100 * (1 - this.__color.v) - 7 + "px",
- backgroundColor: this.__temp.toHexString(),
- border: this.__field_knob_border + "rgb(" + i + "," + i + "," + i + ")"
- }), this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px", this.__temp.s = 1, this.__temp.v = 1, r(this.__saturation_field, "left", "#fff", this.__temp.toHexString()), this.__input.value = this.__color.toString(), u.default.extend(this.__input.style, {
- backgroundColor: this.__color.toHexString(),
- color: "rgb(" + i + "," + i + "," + i + ")",
- textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
- })
- }, e
- }(o.default),
- c = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
- e.default = h
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- function r(t, e, i) {
- var n = document.createElement("li");
- return e && n.appendChild(e), i ? t.__ul.insertBefore(n, i) : t.__ul.appendChild(n), t.onResize(), n
- }
- function o(t, e) {
- var i = t.__preset_select[t.__preset_select.selectedIndex];
- i.innerHTML = e ? i.value + "*" : i.value
- }
- function a(t, e, i) {
- if (i.__li = e, i.__gui = t, C.default.extend(i, {
- options: function(e) {
- if (arguments.length > 1) {
- var n = i.__li.nextElementSibling;
- return i.remove(), l(t, i.object, i.property, {
- before: n,
- factoryArgs: [C.default.toArray(arguments)]
- })
- }
- if (C.default.isArray(e) || C.default.isObject(e)) {
- var r = i.__li.nextElementSibling;
- return i.remove(), l(t, i.object, i.property, {
- before: r,
- factoryArgs: [e]
- })
- }
- },
- name: function(t) {
- return i.__li.firstElementChild.firstElementChild.innerHTML = t, i
- },
- listen: function() {
- return i.__gui.listen(i), i
- },
- remove: function() {
- return i.__gui.remove(i), i
- }
- }), i instanceof T.default) ! function() {
- var t = new M.default(i.object, i.property, {
- min: i.__min,
- max: i.__max,
- step: i.__step
- });
- C.default.each(["updateDisplay", "onChange", "onFinishChange", "step"], (function(e) {
- var n = i[e],
- r = t[e];
- i[e] = t[e] = function() {
- var e = Array.prototype.slice.call(arguments);
- return r.apply(t, e), n.apply(i, e)
- }
- })), P.default.addClass(e, "has-slider"), i.domElement.insertBefore(t.domElement, i.domElement.firstElementChild)
- }();
- else if (i instanceof M.default) {
- var n = function(e) {
- if (C.default.isNumber(i.__min) && C.default.isNumber(i.__max)) {
- var n = i.__li.firstElementChild.firstElementChild.innerHTML,
- r = i.__gui.__listening.indexOf(i) > -1;
- i.remove();
- var o = l(t, i.object, i.property, {
- before: i.__li.nextElementSibling,
- factoryArgs: [i.__min, i.__max, i.__step]
- });
- return o.name(n), r && o.listen(), o
- }
- return e
- };
- i.min = C.default.compose(n, i.min), i.max = C.default.compose(n, i.max)
- } else i instanceof w.default ? (P.default.bind(e, "click", (function() {
- P.default.fakeEvent(i.__checkbox, "click")
- })), P.default.bind(i.__checkbox, "click", (function(t) {
- t.stopPropagation()
- }))) : i instanceof x.default ? (P.default.bind(e, "click", (function() {
- P.default.fakeEvent(i.__button, "click")
- })), P.default.bind(e, "mouseover", (function() {
- P.default.addClass(i.__button, "hover")
- })), P.default.bind(e, "mouseout", (function() {
- P.default.removeClass(i.__button, "hover")
- }))) : i instanceof S.default && (P.default.addClass(e, "color"), i.updateDisplay = C.default.compose((function(t) {
- return e.style.borderLeftColor = i.__color.toString(), t
- }), i.updateDisplay), i.updateDisplay());
- i.setValue = C.default.compose((function(e) {
- return t.getRoot()
- .__preset_select && i.isModified() && o(t.getRoot(), !0), e
- }), i.setValue)
- }
- function s(t, e) {
- var i = t.getRoot(),
- n = i.__rememberedObjects.indexOf(e.object);
- if (-1 !== n) {
- var r = i.__rememberedObjectIndecesToControllers[n];
- if (void 0 === r && (r = {}, i.__rememberedObjectIndecesToControllers[n] = r), r[e.property] = e, i.load && i.load.remembered) {
- var o = i.load.remembered,
- a = void 0;
- if (o[t.preset]) a = o[t.preset];
- else {
- if (!o[D]) return;
- a = o[D]
- }
- if (a[n] && void 0 !== a[n][e.property]) {
- var s = a[n][e.property];
- e.initialValue = s, e.setValue(s)
- }
- }
- }
- }
- function l(t, e, i, n) {
- if (void 0 === e[i]) throw new Error('Object "' + e + '" has no property "' + i + '"');
- var o = void 0;
- if (n.color) o = new S.default(e, i);
- else {
- var l = [e, i].concat(n.factoryArgs);
- o = y.default.apply(t, l)
- }
- n.before instanceof b.default && (n.before = n.before.__li), s(t, o), P.default.addClass(o.domElement, "c");
- var u = document.createElement("span");
- P.default.addClass(u, "property-name"), u.innerHTML = o.property;
- var h = document.createElement("div");
- h.appendChild(u), h.appendChild(o.domElement);
- var c = r(t, h, n.before);
- return P.default.addClass(c, F.CLASS_CONTROLLER_ROW), o instanceof S.default ? P.default.addClass(c, "color") : P.default.addClass(c, m(o.getValue())), a(t, c, o), t.__controllers.push(o), o
- }
- function u(t, e) {
- return document.location.href + "." + e
- }
- function h(t, e, i) {
- var n = document.createElement("option");
- n.innerHTML = e, n.value = e, t.__preset_select.appendChild(n), i && (t.__preset_select.selectedIndex = t.__preset_select.length - 1)
- }
- function c(t, e) {
- e.style.display = t.useLocalStorage ? "block" : "none"
- }
- function d(t) {
- var e = t.__save_row = document.createElement("li");
- P.default.addClass(t.domElement, "has-save"), t.__ul.insertBefore(e, t.__ul.firstChild), P.default.addClass(e, "save-row");
- var i = document.createElement("span");
- i.innerHTML = " ", P.default.addClass(i, "button gears");
- var n = document.createElement("span");
- n.innerHTML = "Save", P.default.addClass(n, "button"), P.default.addClass(n, "save");
- var r = document.createElement("span");
- r.innerHTML = "New", P.default.addClass(r, "button"), P.default.addClass(r, "save-as");
- var o = document.createElement("span");
- o.innerHTML = "Revert", P.default.addClass(o, "button"), P.default.addClass(o, "revert");
- var a = t.__preset_select = document.createElement("select");
- t.load && t.load.remembered ? C.default.each(t.load.remembered, (function(e, i) {
- h(t, i, i === t.preset)
- })) : h(t, D, !1), P.default.bind(a, "change", (function() {
- for (var e = 0; e < t.__preset_select.length; e++) t.__preset_select[e].innerHTML = t.__preset_select[e].value;
- t.preset = this.value
- })), e.appendChild(a), e.appendChild(i), e.appendChild(n), e.appendChild(r), e.appendChild(o), L && function() {
- var e = document.getElementById("dg-local-explain"),
- i = document.getElementById("dg-local-storage");
- document.getElementById("dg-save-locally")
- .style.display = "block", "true" === localStorage.getItem(u(0, "isLocal")) && i.setAttribute("checked", "checked"), c(t, e), P.default.bind(i, "change", (function() {
- t.useLocalStorage = !t.useLocalStorage, c(t, e)
- }))
- }();
- var s = document.getElementById("dg-new-constructor");
- P.default.bind(s, "keydown", (function(t) {
- !t.metaKey || 67 !== t.which && 67 !== t.keyCode || O.hide()
- })), P.default.bind(i, "click", (function() {
- s.innerHTML = JSON.stringify(t.getSaveObject(), void 0, 2), O.show(), s.focus(), s.select()
- })), P.default.bind(n, "click", (function() {
- t.save()
- })), P.default.bind(r, "click", (function() {
- var e = prompt("Enter a new preset name.");
- e && t.saveAs(e)
- })), P.default.bind(o, "click", (function() {
- t.revert()
- }))
- }
- function p(t, e) {
- t.domElement.style.width = e + "px", t.__save_row && t.autoPlace && (t.__save_row.style.width = e + "px"), t.__closeButton && (t.__closeButton.style.width = e + "px")
- }
- function f(t, e) {
- var i = {};
- return C.default.each(t.__rememberedObjects, (function(n, r) {
- var o = {},
- a = t.__rememberedObjectIndecesToControllers[r];
- C.default.each(a, (function(t, i) {
- o[i] = e ? t.initialValue : t.getValue()
- })), i[r] = o
- })), i
- }
- var m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
- return typeof t
- } : function(t) {
- return t && "function" == typeof Symbol && t.constructor === Symbol ? "symbol" : typeof t
- },
- g = n(i(18)),
- v = n(i(19)),
- y = n(i(20)),
- b = n(i(7)),
- w = n(i(8)),
- x = n(i(15)),
- M = n(i(13)),
- T = n(i(14)),
- S = n(i(16)),
- _ = n(i(21)),
- A = n(i(22)),
- P = n(i(9)),
- C = n(i(5)),
- E = n(i(23));
- g.default.inject(E.default);
- var D = "Default",
- L = function() {
- try {
- return "localStorage" in window && null !== window.localStorage
- } catch (t) {
- return !1
- }
- }(),
- O = void 0,
- I = !0,
- R = void 0,
- N = !1,
- k = [],
- F = function t(e) {
- var i = this,
- n = e || {};
- this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), P.default.addClass(this.domElement, "dg"), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], n = C.default.defaults(n, {
- autoPlace: !0,
- width: t.DEFAULT_WIDTH
- }), n = C.default.defaults(n, {
- resizable: n.autoPlace,
- hideable: n.autoPlace
- }), C.default.isUndefined(n.load) ? n.load = {
- preset: D
- } : n.preset && (n.load.preset = n.preset), C.default.isUndefined(n.parent) && n.hideable && k.push(this), n.resizable = C.default.isUndefined(n.parent) && n.resizable, n.autoPlace && C.default.isUndefined(n.scrollable) && (n.scrollable = !0);
- var o = L && "true" === localStorage.getItem(u(0, "isLocal")),
- a = void 0;
- if (Object.defineProperties(this, {
- parent: {
- get: function() {
- return n.parent
- }
- },
- scrollable: {
- get: function() {
- return n.scrollable
- }
- },
- autoPlace: {
- get: function() {
- return n.autoPlace
- }
- },
- preset: {
- get: function() {
- return i.parent ? i.getRoot()
- .preset : n.load.preset
- },
- set: function(t) {
- i.parent ? i.getRoot()
- .preset = t : n.load.preset = t,
- function(t) {
- for (var e = 0; e < t.__preset_select.length; e++) t.__preset_select[e].value === t.preset && (t.__preset_select.selectedIndex = e)
- }(this), i.revert()
- }
- },
- width: {
- get: function() {
- return n.width
- },
- set: function(t) {
- n.width = t, p(i, t)
- }
- },
- name: {
- get: function() {
- return n.name
- },
- set: function(t) {
- n.name = t, titleRowName && (titleRowName.innerHTML = n.name)
- }
- },
- closed: {
- get: function() {
- return n.closed
- },
- set: function(e) {
- n.closed = e, n.closed ? P.default.addClass(i.__ul, t.CLASS_CLOSED) : P.default.removeClass(i.__ul, t.CLASS_CLOSED), this.onResize(), i.__closeButton && (i.__closeButton.innerHTML = e ? t.TEXT_OPEN : t.TEXT_CLOSED)
- }
- },
- load: {
- get: function() {
- return n.load
- }
- },
- useLocalStorage: {
- get: function() {
- return o
- },
- set: function(t) {
- L && (o = t, t ? P.default.bind(window, "unload", a) : P.default.unbind(window, "unload", a), localStorage.setItem(u(0, "isLocal"), t))
- }
- }
- }), C.default.isUndefined(n.parent)) {
- if (n.closed = !1, P.default.addClass(this.domElement, t.CLASS_MAIN), P.default.makeSelectable(this.domElement, !1), L && o) {
- i.useLocalStorage = !0;
- var s = localStorage.getItem(u(0, "gui"));
- s && (n.load = JSON.parse(s))
- }
- this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = t.TEXT_CLOSED, P.default.addClass(this.__closeButton, t.CLASS_CLOSE_BUTTON), this.domElement.appendChild(this.__closeButton), P.default.bind(this.__closeButton, "click", (function() {
- i.closed = !i.closed
- }))
- } else {
- void 0 === n.closed && (n.closed = !0);
- var l = document.createTextNode(n.name);
- P.default.addClass(l, "controller-name");
- var h = r(i, l);
- P.default.addClass(this.__ul, t.CLASS_CLOSED), P.default.addClass(h, "title"), P.default.bind(h, "click", (function(t) {
- return t.preventDefault(), i.closed = !i.closed, !1
- })), n.closed || (this.closed = !1)
- }
- n.autoPlace && (C.default.isUndefined(n.parent) && (I && (R = document.createElement("div"), P.default.addClass(R, "dg"), P.default.addClass(R, t.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(R), I = !1), R.appendChild(this.domElement), P.default.addClass(this.domElement, t.CLASS_AUTO_PLACE)), this.parent || p(i, n.width)), this.__resizeHandler = function() {
- i.onResizeDebounced()
- }, P.default.bind(window, "resize", this.__resizeHandler), P.default.bind(this.__ul, "webkitTransitionEnd", this.__resizeHandler), P.default.bind(this.__ul, "transitionend", this.__resizeHandler), P.default.bind(this.__ul, "oTransitionEnd", this.__resizeHandler), this.onResize(), n.resizable && function(t) {
- function e(e) {
- return e.preventDefault(), t.width += r - e.clientX, t.onResize(), r = e.clientX, !1
- }
- function i() {
- P.default.removeClass(t.__closeButton, F.CLASS_DRAG), P.default.unbind(window, "mousemove", e), P.default.unbind(window, "mouseup", i)
- }
- function n(n) {
- return n.preventDefault(), r = n.clientX, P.default.addClass(t.__closeButton, F.CLASS_DRAG), P.default.bind(window, "mousemove", e), P.default.bind(window, "mouseup", i), !1
- }
- var r = void 0;
- t.__resize_handle = document.createElement("div"), C.default.extend(t.__resize_handle.style, {
- width: "6px",
- marginLeft: "-3px",
- height: "200px",
- cursor: "ew-resize",
- position: "absolute"
- }), P.default.bind(t.__resize_handle, "mousedown", n), P.default.bind(t.__closeButton, "mousedown", n), t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
- }(this), a = function() {
- L && "true" === localStorage.getItem(u(0, "isLocal")) && localStorage.setItem(u(0, "gui"), JSON.stringify(i.getSaveObject()))
- }, this.saveToLocalStorageIfPossible = a, n.parent || function() {
- var t = i.getRoot();
- t.width += 1, C.default.defer((function() {
- t.width -= 1
- }))
- }()
- };
- F.toggleHide = function() {
- N = !N, C.default.each(k, (function(t) {
- t.domElement.style.display = N ? "none" : ""
- }))
- }, F.CLASS_AUTO_PLACE = "a", F.CLASS_AUTO_PLACE_CONTAINER = "ac", F.CLASS_MAIN = "main", F.CLASS_CONTROLLER_ROW = "cr", F.CLASS_TOO_TALL = "taller-than-window", F.CLASS_CLOSED = "closed", F.CLASS_CLOSE_BUTTON = "close-button", F.CLASS_DRAG = "drag", F.DEFAULT_WIDTH = 245, F.TEXT_CLOSED = "Close Controls", F.TEXT_OPEN = "Open Controls", F._keydownHandler = function(t) {
- "text" === document.activeElement.type || 72 !== t.which && 72 !== t.keyCode || F.toggleHide()
- }, P.default.bind(window, "keydown", F._keydownHandler, !1), C.default.extend(F.prototype, {
- add: function(t, e) {
- return l(this, t, e, {
- factoryArgs: Array.prototype.slice.call(arguments, 2)
- })
- },
- addColor: function(t, e) {
- return l(this, t, e, {
- color: !0
- })
- },
- remove: function(t) {
- this.__ul.removeChild(t.__li), this.__controllers.splice(this.__controllers.indexOf(t), 1);
- var e = this;
- C.default.defer((function() {
- e.onResize()
- }))
- },
- destroy: function() {
- this.autoPlace && R.removeChild(this.domElement), P.default.unbind(window, "keydown", F._keydownHandler, !1), P.default.unbind(window, "resize", this.__resizeHandler), this.saveToLocalStorageIfPossible && P.default.unbind(window, "unload", this.saveToLocalStorageIfPossible)
- },
- addFolder: function(t) {
- if (void 0 !== this.__folders[t]) throw new Error('You already have a folder in this GUI by the name "' + t + '"');
- var e = {
- name: t,
- parent: this
- };
- e.autoPlace = this.autoPlace, this.load && this.load.folders && this.load.folders[t] && (e.closed = this.load.folders[t].closed, e.load = this.load.folders[t]);
- var i = new F(e);
- this.__folders[t] = i;
- var n = r(this, i.domElement);
- return P.default.addClass(n, "folder"), i
- },
- open: function() {
- this.closed = !1
- },
- close: function() {
- this.closed = !0
- },
- onResize: function() {
- var t = this.getRoot();
- if (t.scrollable) {
- var e = P.default.getOffset(t.__ul)
- .top,
- i = 0;
- C.default.each(t.__ul.childNodes, (function(e) {
- t.autoPlace && e === t.__save_row || (i += P.default.getHeight(e))
- })), (window.renderHeight || window.innerHeight) - e - 20 < i ? (P.default.addClass(t.domElement, F.CLASS_TOO_TALL), t.__ul.style.height = (window.renderHeight || window.innerHeight) - e - 20 + "px") : (P.default.removeClass(t.domElement, F.CLASS_TOO_TALL), t.__ul.style.height = "auto")
- }
- t.__resize_handle && C.default.defer((function() {
- t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
- })), t.__closeButton && (t.__closeButton.style.width = t.width + "px")
- },
- onResizeDebounced: C.default.debounce((function() {
- this.onResize()
- }), 200),
- remember: function() {
- if (C.default.isUndefined(O) && ((O = new A.default)
- .domElement.innerHTML = v.default), this.parent) throw new Error("You can only call remember on a top level GUI.");
- var t = this;
- C.default.each(Array.prototype.slice.call(arguments), (function(e) {
- 0 === t.__rememberedObjects.length && d(t), -1 === t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
- })), this.autoPlace && p(this, this.width)
- },
- getRoot: function() {
- for (var t = this; t.parent;) t = t.parent;
- return t
- },
- getSaveObject: function() {
- var t = this.load;
- return t.closed = this.closed, this.__rememberedObjects.length > 0 && (t.preset = this.preset, t.remembered || (t.remembered = {}), t.remembered[this.preset] = f(this)), t.folders = {}, C.default.each(this.__folders, (function(e, i) {
- t.folders[i] = e.getSaveObject()
- })), t
- },
- save: function() {
- this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = f(this), o(this, !1), this.saveToLocalStorageIfPossible()
- },
- saveAs: function(t) {
- this.load.remembered || (this.load.remembered = {}, this.load.remembered[D] = f(this, !0)), this.load.remembered[t] = f(this), this.preset = t, h(this, t, !0), this.saveToLocalStorageIfPossible()
- },
- revert: function(t) {
- C.default.each(this.__controllers, (function(e) {
- this.getRoot()
- .load.remembered ? s(t || this.getRoot(), e) : e.setValue(e.initialValue), e.__onFinishChange && e.__onFinishChange.call(e, e.getValue())
- }), this), C.default.each(this.__folders, (function(t) {
- t.revert(t)
- })), t || o(this.getRoot(), !1)
- },
- listen: function(t) {
- var e = 0 === this.__listening.length;
- this.__listening.push(t), e && function t(e) {
- 0 !== e.length && _.default.call(window, (function() {
- t(e)
- })), C.default.each(e, (function(t) {
- t.updateDisplay()
- }))
- }(this.__listening)
- },
- updateDisplay: function() {
- C.default.each(this.__controllers, (function(t) {
- t.updateDisplay()
- })), C.default.each(this.__folders, (function(t) {
- t.updateDisplay()
- }))
- }
- }), t.exports = F
- }, function(t, e) {
- "use strict";
- t.exports = {
- load: function(t, e) {
- var i = e || document,
- n = i.createElement("link");
- n.type = "text/css", n.rel = "stylesheet", n.href = t, i.getElementsByTagName("head")[0].appendChild(n)
- },
- inject: function(t, e) {
- var i = e || document,
- n = document.createElement("style");
- n.type = "text/css", n.innerHTML = t;
- var r = i.getElementsByTagName("head")[0];
- try {
- r.appendChild(n)
- } catch (t) {}
- }
- }
- }, function(t, e) {
- t.exports = "<div id=dg-save class=\"dg dialogue\"> Here's the new load parameter for your <code>GUI</code>'s constructor: <textarea id=dg-new-constructor></textarea> <div id=dg-save-locally> <input id=dg-local-storage type=checkbox /> Automatically save values to <code>localStorage</code> on exit. <div id=dg-local-explain>The values saved to <code>localStorage</code> will override those passed to <code>dat.GUI</code>'s constructor. This makes it easier to work incrementally, but <code>localStorage</code> is fragile, and your friends may not see the same values you do. </div> </div> </div>"
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(10)),
- o = n(i(13)),
- a = n(i(14)),
- s = n(i(11)),
- l = n(i(15)),
- u = n(i(8)),
- h = n(i(5));
- e.default = function(t, e) {
- var i = t[e];
- return h.default.isArray(arguments[2]) || h.default.isObject(arguments[2]) ? new r.default(t, e, arguments[2]) : h.default.isNumber(i) ? h.default.isNumber(arguments[2]) && h.default.isNumber(arguments[3]) ? h.default.isNumber(arguments[4]) ? new a.default(t, e, arguments[2], arguments[3], arguments[4]) : new a.default(t, e, arguments[2], arguments[3]) : h.default.isNumber(arguments[4]) ? new o.default(t, e, {
- min: arguments[2],
- max: arguments[3],
- step: arguments[4]
- }) : new o.default(t, e, {
- min: arguments[2],
- max: arguments[3]
- }) : h.default.isString(i) ? new s.default(t, e) : h.default.isFunction(i) ? new l.default(t, e, "") : h.default.isBoolean(i) ? new u.default(t, e) : null
- }
- }, function(t, e) {
- "use strict";
- e.__esModule = !0, e.default = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(t) {
- setTimeout(t, 1e3 / 60)
- }
- }, function(t, e, i) {
- "use strict";
- function n(t) {
- return t && t.__esModule ? t : {
- default: t
- }
- }
- e.__esModule = !0;
- var r = n(i(9)),
- o = n(i(5)),
- a = function() {
- function t() {
- (function(t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
- })(this, t), this.backgroundElement = document.createElement("div"), o.default.extend(this.backgroundElement.style, {
- backgroundColor: "rgba(0,0,0,0.8)",
- top: 0,
- left: 0,
- display: "none",
- zIndex: "1000",
- opacity: 0,
- WebkitTransition: "opacity 0.2s linear",
- transition: "opacity 0.2s linear"
- }), r.default.makeFullscreen(this.backgroundElement), this.backgroundElement.style.position = "fixed", this.domElement = document.createElement("div"), o.default.extend(this.domElement.style, {
- position: "fixed",
- display: "none",
- zIndex: "1001",
- opacity: 0,
- WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear",
- transition: "transform 0.2s ease-out, opacity 0.2s linear"
- }), document.body.appendChild(this.backgroundElement), document.body.appendChild(this.domElement);
- var e = this;
- r.default.bind(this.backgroundElement, "click", (function() {
- e.hide()
- }))
- }
- return t.prototype.show = function() {
- var t = this;
- this.backgroundElement.style.display = "block", this.domElement.style.display = "block", this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)", this.layout(), o.default.defer((function() {
- t.backgroundElement.style.opacity = 1, t.domElement.style.opacity = 1, t.domElement.style.webkitTransform = "scale(1)"
- }))
- }, t.prototype.hide = function() {
- var t = this,
- e = function e() {
- t.domElement.style.display = "none", t.backgroundElement.style.display = "none", r.default.unbind(t.domElement, "webkitTransitionEnd", e), r.default.unbind(t.domElement, "transitionend", e), r.default.unbind(t.domElement, "oTransitionEnd", e)
- };
- r.default.bind(this.domElement, "webkitTransitionEnd", e), r.default.bind(this.domElement, "transitionend", e), r.default.bind(this.domElement, "oTransitionEnd", e), this.backgroundElement.style.opacity = 0, this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)"
- }, t.prototype.layout = function() {
- this.domElement.style.left = (window.renderWidth || window.innerWidth) / 2 - r.default.getWidth(this.domElement) / 2 + "px", this.domElement.style.top = (window.renderHeight || window.innerHeight) / 2 - r.default.getHeight(this.domElement) / 2 + "px"
- }, t
- }();
- e.default = a
- }, function(t, e, i) {
- (t.exports = i(24)())
- .push([t.id, ".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;transition:opacity .1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save>ul{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height .1s ease-out;transition:height .1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{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;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}", ""])
- }, function(t, e) {
- t.exports = function() {
- var t = [];
- return t.toString = function() {
- for (var t = [], e = 0; e < this.length; e++) {
- var i = this[e];
- i[2] ? t.push("@media " + i[2] + "{" + i[1] + "}") : t.push(i[1])
- }
- return t.join("")
- }, t.i = function(e, i) {
- "string" == typeof e && (e = [
- [null, e, ""]
- ]);
- for (var n = {}, r = 0; r < this.length; r++) {
- var o = this[r][0];
- "number" == typeof o && (n[o] = !0)
- }
- for (r = 0; r < e.length; r++) {
- var a = e[r];
- "number" == typeof a[0] && n[a[0]] || (i && !a[2] ? a[2] = i : i && (a[2] = "(" + a[2] + ") and (" + i + ")"), t.push(a))
- }
- }, t
- }
- }])
- }, function(t, e, i) {
- "use strict";
- var n = i(0),
- r = (i(13), i(9));
- function o(t) {
- this._canbeUsed = !1, this.player = t, this.sRender = t.sRender, this.ray = new n.Raycaster, this.mouse = new n.Vector3, this.INTERSECT = null, this.measurementTool = null, this.vertexMesh = null, this.activeMeasurement = null, this.labelsInCamera = {}, this.currentInfo = [], this.dragging = !1, this.defineProperty(), this.initStateEngine()
- }
- o.prototype.defineProperty = function() {
- Object.defineProperty(this, "canbeUsed", {
- get: function() {
- return this._canbeUsed
- },
- set: function(t) {
- this._canbeUsed = t
- }
- })
- }, o.prototype.initStateEngine = function() {}, o.prototype.init = function(t) {
- this.measurementTool = t
- }, o.prototype.selectMeasurementVertexMesh = function(t) {
- this.ray.setFromCamera(this.mouse, this.sRender.camera);
- var e = this.ray.intersectObjects(t);
- 0 < e.length ? (this.INTERSECT = e[0], document.body.style.cursor = "pointer") : (this.INTERSECT = null, document.body.style.cursor = "default")
- }, o.prototype.handleChoosedMeasurementVertexMesh = function(t) {
- this.vertexMesh = t.object, this.activeMeasurement = this.vertexMesh.parent, this.measurementTool.lockedAddPoint = !0
- }, o.prototype.onPlayerMouseDown = function() {
- this.INTERSECT && (this.player.disableNavigator = !0, this.player.controls.panorama.lockedRotationFrom = !0, this.handleChoosedMeasurementVertexMesh(this.INTERSECT))
- }, o.prototype.onPlayerMouseMove = function() {
- if (this.mouse.copy(this.player.mouse), !this.vertexMesh) {
- var t = !!this.measurementTool,
- e = this.measurementTool.singleMeasuring && !!this.measurementTool.inMeasureMode,
- i = 1 < this.measurementTool.measurements.length;
- t && e && i && this.selectMeasurementVertexMesh(this.measurementTool.allSpheres)
- }
- this.vertexMesh && this.dragMeasurementVertexMesh(), this.player.inMeasureMode && this.measurementTool && !this.measurementTool.singleMeasuring && this.updateMeasureInfo(this.measurementTool.measurements)
- }, o.prototype.onPlayerMouseUp = function() {
- this.vertexMesh && (this.player.controls.panorama.lockedRotationFrom = !1, this.vertexMesh = null), this.dragging && (this.measurementTool.updateMeasureVisible(this.player.currentPano), this.updateMeasureInfo(this.measurementTool.measurements), this.measurementTool.changeSize(this.activeMeasurement.measureid))
- }, o.prototype.onHandleControlPanoramaMove = function() {
- var t = G.conf.modelMeasure || G.conf.publicity || !G.conf.modelMeasure && !G.conf.publicity,
- e = !!this.measurementTool && 0 < this.measurementTool.measurements.length;
- t && e && (this.measurementTool.lockedAddPoint = !0, this.updateMeasureInfo(this.measurementTool.measurements))
- }, o.prototype.onHandleControlPanoramaMoveStop = function() {
- G.conf.modelMeasure || G.conf.publicity || !G.conf.modelMeasure && G.conf.publicity, !!this.measurementTool && this.measurementTool.measurements.length
- }, o.prototype.onFlyEnd = function() {
- var t = G.conf.modelMeasure || G.conf.publicity,
- e = !!this.measurementTool && 0 < this.measurementTool.measurements.length;
- t && e && this.updateMeasureInfo(this.measurementTool.measurements)
- }, o.prototype.dragMeasurementVertexMesh = function() {
- this.dragging = !0, this.vertexMesh.position.copy(this.player.intersect.point), this.activeMeasurement.points[this.vertexMesh.userData.index].copy(this.vertexMesh.position), this.activeMeasurement.lockedFitAxis = !0, this.activeMeasurement.update(), this.updateMeasureInfo(this.measurementTool.measurements)
- }, o.prototype.computeOutScreen = function(t) {
- var e = t.position.clone()
- .applyMatrix4(this.sRender.camera.matrixWorldInverse)
- .applyMatrix4(this.sRender.camera.projectionMatrix),
- i = Math.abs(e.x) > 1,
- n = Math.abs(e.y) > 1,
- r = Math.abs(e.z) > 1;
- t.userData.out_camera = !!(i || n || r)
- }, o.prototype.computeCrossCollider = function(t) {}, o.prototype.updateMeasureInfo = function(t) {
- var e = [];
- if (this.measurementTool && !this.measurementTool.measureState) return !1;
- for (var i = 0, n = t.length; i < n; ++i) {
- for (var o = t[i].edges, a = t[i].edgeLabels, s = t[i].areaLabel, l = t[i].category, u = t[i].uuid, h = 0, c = a.length; h < c; ++h) a[h].userData.screen_position = r.convertWorldPositionToScreen(a[h].position.clone(), this.sRender.camera), this.computeOutScreen(a[h]);
- this.computeOutScreen(s), s.userData.screen_position = r.convertWorldPositionToScreen(s.position.clone(), this.sRender.camera), e.push({
- edges: o,
- edgeLabels: a,
- areaLabel: s,
- category: l,
- uuid: u
- })
- }
- this.player.emit("get-measurement-info", e)
- };
- o.prototype.update = function() {
- var t = !!this.measurementTool && 0 < this.measurementTool.measurements.length;
- this.player.flying && t && this.updateMeasureInfo(this.measurementTool.measurements)
- }, t.exports = o
- }, function(t, e, i) {
- function n() {
- G.d = this, this.endlessLoop = a.warp.loop, this.clock = new r.Clock(!0), this.model = null, this.player = null, this.currentItem = null, this.destinationItem = null, this.tourIsPlaying = !1, this.transitionStage = w.None, this.nextFunc = null, this.onTheBus = !1, this.reachSource = null, this.interrupted = !1, this.nItems = 0, this.currentScript = 1, this.walkingSectionPaused = !1, this.sLen = 0, this.connect = b(), this.handleOperation = this.handleOperation.bind(this), this.connect.on("operation", this.handleOperation)
- }
- var r = i(0),
- o = i(2),
- a = i(1),
- s = i(8),
- l = i(4)
- .EventEmitter,
- u = i(5),
- h = i(24),
- c = (i(8), i(21)),
- d = i(70),
- p = i(20),
- f = i(27),
- m = i(31),
- g = i(63),
- v = i(64),
- y = (i(3), new o("/js/director.js")),
- b = i(28),
- w = Object.freeze({
- None: 0,
- Moving: 1,
- Aiming: 2,
- Interlude: 3
- }),
- x = Object.freeze({
- Forward: 1,
- NoChange: 0,
- Backwards: -1
- });
- i(71);
- n.prototype = Object.create(l.prototype), n.prototype.init = function(t, e) {
- this.player = t, this.modelManager = e, this.updateModel(), this.resetAll(), this.bindEvents()
- }, n.prototype.resetAll = function() {
- if (this.currentItem = null, this.destinationItem = null, this.tourIsPlaying = !1, this.transitionStage = w.None, this.nextFunc = null, this.onTheBus = !1, this.reachSource = null, this.interrupted = !1, this.model) switch (this.model.switch_scene_type) {
- case 1:
- this.defaultWarpStyle = h.BLACK;
- break;
- case 2:
- this.defaultWarpStyle = h.WALK;
- break;
- case 3:
- this.defaultWarpStyle = h.STD;
- break;
- default:
- this.defaultWarpStyle = h.BLACK
- } else this.defaultWarpStyle = h.BLACK, y.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
- this.resetSpecialTransition()
- }, n.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel(), this.nItems = this.model.heroLocations.length - 1
- }, n.prototype.bindEvents = function() {
- this.modelManager.on(c.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(p.WarpInterruptedWithFlyTo, this.handleFlyToWarpInterruption.bind(this)), this.player.on(p.Move, this.handlePlayerMove.bind(this)), this.player.on(p.PanoChosen, this.handlePlayerPanoChosen.bind(this)), this.player.on(p.ModeChanged, this.handlePlayerModeChanged.bind(this)), this.player.on(p.InputStart, this.handlePlayerInputStart.bind(this)), this.player.on(p.FlyingStarted, this.handlePlayerFlyingStarted.bind(this))
- }, n.prototype.handleFlyToWarpInterruption = function(t, e) {
- t === h.WALK ? (this.interrupt(m.FADEIN), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight()) : this.transitionStage === w.Interlude && (this.interrupt(m.NONE), e && e())
- }, n.prototype.handlePlayerMove = function(t) {
- this.transitionStage === w.Interlude && this.interrupt(m.NONE)
- }, n.prototype.handlePlayerPanoChosen = function(t, e) {
- this.intermediateState() || t.id === e.id || (this.onTheBus = !1, this.emit("update.controls"))
- }, n.prototype.handlePlayerModeChanged = function(t, e) {
- this.intermediateState() || t === e || (this.onTheBus = !1, this.emit("update.controls"))
- }, n.prototype.handlePlayerInputStart = function(t) {
- this.transitionStage === w.Interlude && this.interrupt(m.NONE)
- }, n.prototype.handlePlayerFlyingStarted = function() {
- this.clearWalkingSectionPaused(), G.player.mattertagManager.ttflying = !0
- }, n.prototype.describe = function() {
- return {
- nItems: this.nItems,
- currentItem: this.currentItem,
- destinationItem: this.destinationItem,
- tourIsPlaying: this.tourIsPlaying,
- onTheBus: this.onTheBus,
- endlessLoop: this.endlessLoop,
- viewMode: this.player.mode,
- inTransition: this._inTransition(),
- transitionStage: this.transitionStage
- }
- }, n.prototype._inTransition = function() {
- return this.player.flying || this.player.isWarping() || this.player.mode === u.TRANSITIONING || this.tourIsPlaying
- }, n.prototype.bounceable = function() {
- var t = this.clock.getDelta();
- return this.isInterrupted() || t < .9 && t > .01 || this.player.flying && !this.player.isWarping()
- }, n.prototype.currentMoveDirection = function() {
- return null === this.currentItem || void 0 === this.currentItem ? x.Forward : this.destinationItem === this.currentItem ? x.NoChange : this.destinationItem > this.currentItem ? x.Forward : x.Backwards
- }, n.prototype.clearPath = function() {
- this._inTransition() || this.player.path.discardPathObject()
- }, n.prototype.allFloors = function() {
- G.R.recording && G.R.save({
- tap: "floor",
- action: "all"
- }), this.connect.getSyncState() && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
- type: "floorchange",
- floorIndex: "all"
- }), this.showAllFloors())
- }, n.prototype.showAllFloors = function() {
- var t = this.player.controls[this.player.mode];
- t && t.emit("move", "gui"), this.player.controls[u.PANORAMA].emit(f.InteractionGui, "floor-control"), this.model.toggleAllFloors()
- }, n.prototype.gotoFloor = function(t) {
- G.R.recording && G.R.save({
- tap: "floor",
- action: "" + parseInt(t)
- }), this.connect.getSyncState() && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
- type: "floorchange",
- floorIndex: t
- }), this.player.gotoFloor(t, "gui"))
- }, n.prototype.openTag = function() {
- this.player.mattertagManager.closeTag(), null !== this.currentItem && void 0 !== this.currentItem || (this.currentItem = 0);
- this.currentItem - this.sLen < 0 || G.R.recording
- }, n.prototype.actionComplete = function(t) {
- var e = this.transitionStage;
- if (this.interrupted = !1, this.transitionStage = w.None, this.resetSpecialTransition(), null !== this.destinationItem && this.setCurrentItem(this.destinationItem), this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === u.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()), this.emit("update.controls"), this.currentScript && (this.model.enableTagMovie && e === w.Interlude || this.model.enableTagMovie && e === w.Aiming && null === this.nextFunc)) this.emit("gotoheighlight_done"), G.R.pafter();
- else if (this.nextFunc) {
- var i = this.nextFunc;
- this.nextFunc = null, i()
- } else this.emit("gotoheighlight_done"), G.R.pafter()
- }, n.prototype.awaitCompletion = function(t, e) {
- this.nextFunc = e, t()
- }, n.prototype.updateSuccessFunction = function(t) {
- this.nextFunc = t
- }, n.prototype.interrupt = function(t, e) {
- return !(!this.wouldInterrupt() || !this.canInterrupt()) && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled), this.tourIsPlaying = !1, this.interrupted = !0, this.nextFunc = null, this.emit(d.ActionInterruped), null != t || (t = m.BEGINNING), this.player.interruptAndFastForward(t, e), !0)
- }, n.prototype.wouldInterrupt = function() {
- return this.transitionStage !== w.None
- }, n.prototype.intermediateState = function() {
- return this.transitionStage !== w.None
- }, n.prototype.isInterrupted = function() {
- return this.interrupted
- }, n.prototype.canInterrupt = function() {
- return this.transitionStage !== w.Aiming && this.transitionStage !== w.Moving || this.transitionStage === w.Moving && this.player.mode === u.PANORAMA && this.nextWarpStyle !== h.BLACK
- }, n.prototype.pauseWalkingSection = function() {
- this.walkingSectionPaused = !0
- }, n.prototype.clearWalkingSectionPaused = function() {
- this.walkingSectionPaused = !1
- }, n.prototype.autoTour = function() {
- G.settings.nestscenes && G.settings.nestscenes.scenes && G.settings.nestscenes.scenes.length && !G.settings.nestscenes.scenes[0].script && a.warp.auto >= 0 && s.trigger({
- duration: 1e3 * Math.min(300, a.warp.auto),
- done: function() {
- this.playTour()
- }.bind(this),
- name: "_atr"
- })
- }, n.prototype.atDestinationPano = function() {
- if (!this.player.currentPano || null === this.destinationItem) return !1;
- var t = this.player.currentPano.id;
- if (void 0 === t) return !1;
- var e = this.model.heroLocations;
- return null !== this.destinationItem && void 0 !== e[this.destinationItem] && t == e[this.destinationItem].panoId
- }, n.prototype.redirectToItem = function(t, e) {
- if (null != t)
- if (this.wouldInterrupt())
- if (this.player.mode !== u.TRANSITIONING) {
- y.debug("Director.redirectToItem() -> Redirecting to " + t + " via " + e);
- var i = function() {
- s.setTimeout(function() {
- this.setDestinationItem(t), this.goToDestination(!0, m.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
- }.bind(this), 0)
- }.bind(this);
- this.interrupt(m.END, 0), this.updateSuccessFunction(i)
- } else y.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
- else y.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
- else y.warn("Director.redirectToItem() -> Redirecting to null item.")
- }, n.prototype.useSpecialTransition = function(t) {
- void 0 !== t && this.defaultWarpStyle !== h.BLACK && y.debug("useSpecialTransition(): " + t), this.nextWarpStyle = this.defaultWarpStyle
- }, n.prototype.resetSpecialTransition = function() {
- this.nextWarpStyle = this.defaultWarpStyle
- }, n.prototype.arrivedAtDestination = function(t) {
- if (this.player.flying || this.player.isWarping()) y.warn("Cannot advance to interlude or aiming while player is flying or warping.");
- else {
- this.transitionStage = w.Aiming;
- var e = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
- this.player.model.fadePanoMarkers(0), this.tour360view(), this.awaitCompletion(function() {
- this.resetSpecialTransition(), t ? this.player.aimTourCamera(this.destinationItem, v.Hide, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
- }.bind(this), e)
- }
- }, n.prototype.toast = function(t) {
- setTimeout((function() {
- document.getElementsByClassName("toast-wrap")[0].getElementsByClassName("toast-msg")[0].innerHTML = t;
- var e = document.getElementsByClassName("toast-wrap")[0];
- e.className = e.className.replace("toastAnimate", ""), setTimeout((function() {
- e.className = e.className + " toastAnimate"
- }), 10)
- }), 10)
- }, n.prototype.tour360view = function() {
- this.model
- }, n.prototype.goToDestination = function(t, e, i, n) {
- if (this.onTheBus = !0, this.emit("update.controls"), this.player.updateLastView(), n || !this.atDestinationPano())
- if (this.player.flying || this.player.isWarping()) y.warn("Cannot go to new destination while player is flying or warping.");
- else {
- var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
- o = null,
- a = null;
- if (this.player.mattertagManager.update360Tags(r.panoId), r.isPano()) {
- var s = 0 === this.destinationItem || t ? h.BLACK : this.nextWarpStyle;
- a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, g.Slow, s, e, i, this.actionComplete.bind(this)), o = this.arrivedAtDestination.bind(this, !0)
- } else a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)), o = this.arrivedAtDestination.bind(this, !1);
- this.transitionStage = w.Moving, this.model.fadePanoMarkers(0), this.awaitCompletion(function() {
- a()
- }.bind(this), o), this.emit("update.controls")
- }
- else this.arrivedAtDestination(!0)
- }, n.prototype.tourInterlude = function() {
- if (this.model.fadePanoMarkers(0), this.emit("update.controls"), this.tourIsPlaying) return this.atEndOfTour() && !this.endlessLoop ? (this.stopTour(), void(this.player.mode === u.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
- this.transitionStage = w.Interlude, this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
- }.bind(this), this.goNext.bind(this))
- }, n.prototype.playTour = function(t) {
- this.bounceable() || (this.tourIsPlaying ? y.info("tour is already playing") : this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle), this.reachSource = "play", this.tourIsPlaying = !0, this.wasZoomEnabled = this.player.zoomEnabled, this.player.zoomEnabled = !1, this.resetSpecialTransition(), this.emit("update.controls"), this.player.enablePreRendering(), this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : this.goNext()))
- }, n.prototype.hideTourBar = function() {}, n.prototype.stopTour = function() {
- this.emit("tourStop"), this.isInterrupted() || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled), this.tourIsPlaying = !1, this.interrupt(), this.clearWalkingSectionPaused(), this.resetSpecialTransition(), this.emit("update.controls")), this.hideTourBar()
- }, n.prototype.goToHighlight = function(t) {
- if (this.canInterrupt() || !this.wouldInterrupt()) {
- if (this.wouldInterrupt() && (t === this.destinationItem ? this.interrupt() : this.redirectToItem(t, "goToHighlight")), this.isInterrupted()) return void(G.R.fgotoh = !1);
- this.clearWalkingSectionPaused(), this.setDestinationItem(t), this.useSpecialTransition("Hilight"), this.goToDestination()
- }
- }, n.prototype.goToHighlightByLocation = function(t) {
- var e = this.model.heroLocations.findIndex((function(e) {
- return !(!e.panoId || e.panoId != t)
- }));
- if (this.canInterrupt() || !this.wouldInterrupt()) {
- if (y.debug("<tour.goto " + e + ">"), this.wouldInterrupt() && (e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight")), this.isInterrupted()) return;
- this.clearWalkingSectionPaused(), this.setDestinationItem(e), this.useSpecialTransition("Hilight"), this.goToDestination()
- }
- }, n.prototype.prevHighlight = function() {
- this.bounceable() || (this.player.emit("tour_manual", "prev"), this.interrupt(m.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), this.reachSource = "prev", this.goPrev()))
- }, n.prototype.nextHighlight = function() {
- this.bounceable() || (this.player.emit("tour_manual", "next"), this.interrupt(m.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), this.reachSource = "next", this.goNext()))
- }, n.prototype.handleOperation = function(t) {
- if ("changemode" === t.type) {
- var e = t.mode;
- this.remoteChangeMode(e)
- } else if ("floorchange" === t.type) {
- var i = t.floorIndex;
- "all" === i ? this.showAllFloors() : this.player.gotoFloor(i, "remote")
- }
- }, n.prototype.changeMode = function(t, e) {
- this.connect.getSyncState() && !G.measureMode && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
- type: "changemode",
- mode: t
- }), this.evalChangeMode(t, e))
- }, n.prototype.remoteChangeMode = function(t) {
- this.evalChangeMode(t)
- }, n.prototype.evalChangeMode = function(t, e) {
- var i = e || "gui";
- switch (this.wouldInterrupt() && this.interrupt(), this.player.controls[t].emit("interaction." + i), this.clearWalkingSectionPaused(), t) {
- case u.PANORAMA:
- this.player.insideMode();
- break;
- case u.DOLLHOUSE:
- case u.FLOORPLAN:
- this.player.flyToNewMode({
- mode: t
- })
- }
- }, n.prototype.atEndOfTour = function() {
- return this.currentItem >= this.nItems - 1
- }, n.prototype.firstDestination = function() {
- if (this.nItems <= 0) return null;
- for (var t = 0; t < this.nItems; t++)
- if (this.model.images.list[t].script === this.currentScript) return t;
- return 0
- }, n.prototype.finalDestination = function() {
- if (this.nItems <= 0) return null;
- for (var t = this.nItems - 1; t >= 0; t--)
- if (this.model.images.list[t].script === this.currentScript) return t;
- return 0
- }, n.prototype.goPrev = function() {
- this.tourAdvance(-1)
- }, n.prototype.goNext = function() {
- null === this.currentItem && (this.currentItem = this.finalDestination());
- for (var t, e = !1, i = this.currentItem + 1; i < this.nItems; i++)
- if (this.model.images.list[i].script === this.currentScript) {
- t = i - this.currentItem, e = !0;
- break
- } e || (t = this.nItems - this.currentItem), 0 === t && (t = 1), this.tourAdvance(t)
- }, n.prototype.setDestinationItem = function(t) {
- t > this.nItems && (t = this.firstDestination()), this.destinationItem = t, this.emit("update.controls")
- }, n.prototype.setCurrentItem = function(t) {
- this.currentItem = t, this.emit("update.controls")
- }, n.prototype.nextItem = function(t) {
- return t ? t > this.nItems && this.endlessLoop ? this.firstDestination() : t < this.nItems ? t + 1 : void 0 : this.firstDestination()
- }, n.prototype.prevItem = function(t) {
- return null === t ? this.firstDestination() : t < 0 ? this.endlessLoop ? this.lastDestination() : null : t - 1
- }, n.prototype.tourAdvance = function(t) {
- y.debug("tourAdvance(" + t + ")"), null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + t), 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")), this.goToDestination()
- }, n.prototype.compassAdd = function(t) {
- this.model.adjustCompass += t
- }, n.prototype.compassReset = function(t) {
- this.model.adjustCompass = t
- }, t.exports = n
- }, function(t, e, i) {
- (function(e) {
- (function(n) {
- function r(t) {
- this.player = null, this.director = null, this.modelManager = null, this.container = null, this.mattertagManager = null, this.fadeInSpeed = t, null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
- }
- var o = i(0),
- a = i(2),
- s = (i(7), i(20)),
- l = i(70),
- u = i(1),
- h = i(5),
- c = (i(24), i(31), i(21)),
- d = i(42),
- p = i(8),
- f = i(10),
- m = new a(n);
- r.prototype.init = function(t, e, i, n, r) {
- this.player = e, this.director = t, this.modelManager = i, this.mattertagManager = n, this.container = r, this.updateModel(), this.bindEvents()
- }, r.prototype.bindEvents = function() {
- this.modelManager.on(c.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(s.ModeChanging, this.handlePlayerModeChanging.bind(this)), this.player.on(s.ModeChanged, this.handlePlayerModeChanged.bind(this)), this.player.on(s.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)), this.player.on(s.StartInside, this.handleStartInside.bind(this)), this.player.on(s.StartOutside, this.handleStartOutside.bind(this)), this.player.on(s.WarpStarted, this.handleWarpStarted.bind(this)), this.director.on(l.ActionInterrupted, this.handleActionInterruption.bind(this)), this.mattertagManager.on(d.TagActivated, this.onMattertagActivated.bind(this)), this.mattertagManager.on(d.TagNavigation, this.onNavigationToMattertag.bind(this))
- }, r.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel()
- }, r.prototype.handleWarpStarted = function() {
- this.hidePlayerReticule()
- }, r.prototype.onMattertagActivated = function() {
- this.hidePlayerReticule()
- }, r.prototype.onNavigationToMattertag = function() {
- this.hidePlayerReticule()
- }, r.prototype.handlePlayerModeChanging = function(t, e, i) {
- var n = this.modelManager.getActiveModel(),
- r = this.player.is360View(e, i) || this.director.tourIsPlaying ? 0 : u[e].markerOpacity;
- n.fadePanoMarkers(r), n.setMode(e)
- }, r.prototype.handlePlayerModeChanged = function(t, e) {
- var i = this.modelManager.getActiveModel(),
- n = e === h.PANORAMA ? o.DoubleSide : o.FrontSide;
- i.setSide(n), i.setMode(e), "dollhouse" === e && (G.R.lon = 0, G.R.lastlon = void 0)
- }, r.prototype.handleClosestPanoChanging = function(t, e, i) {
- i !== h.TRANSITIONING && (t && !this.director.tourIsPlaying && t.hoverOff(i), e && !this.director.tourIsPlaying && e.hoverOn(i))
- }, r.prototype.handleActionInterruption = function() {}, r.prototype.handleStartInside = function(t) {
- var e = u[this.player.mode],
- i = t ? 0 : e.transitionTime * e.skyboxOpacityLength;
- this.fadeIn(this.fadeInSpeed), this.model.alpha = 0, this.model.skybox.material.uniforms.opacity.value = 1, this.model.fadePanoMarkers(t ? 0 : e.markerOpacity);
- var n = this.player.reticule;
- p.start(f.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
- }, r.prototype.handleStartOutside = function(t) {
- this.fadeIn(t)
- }, r.prototype.fadeIn = function(t) {
- null != t || (t = 2e3, m.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")), e(this.container)
- .fadeIn(t)
- }, r.prototype.hidePlayerReticule = function() {
- this.player.reticule.hide()
- }, t.exports = r
- })
- .call(this, "/js/DisplayController.js")
- })
- .call(this, i(6))
- }, function(t, e, i) {
- (function(e) {
- var n = i(0),
- r = (i(11), i(1)),
- o = i(2),
- a = i(9),
- s = i(25),
- l = i(19),
- u = i(147),
- h = i(12),
- c = i(8),
- d = i(45),
- p = i(51),
- f = i(74),
- m = i(44),
- g = i(61),
- v = i(62),
- y = i(37),
- b = i(52),
- w = i(54),
- x = i(35),
- M = i(180);
- new o("js/showcase");
- n.ImageUtils.crossOrigin = r.crossOrigin, t.exports = {
- shaders: h,
- transitions: c,
- Model: u,
- Chunk: d,
- Floor: m,
- Skybox: f,
- Reticule: p,
- Panorama: l,
- DollhouseCamera: g,
- FloorplanCamera: v,
- PanoramaCamera: y,
- DollhouseControls: b,
- FloorplanControls: w,
- PanoramaControls: x,
- initS: function(t, i) {
- if (!t.url) throw 'getModel(): missing parameter "url"';
- t.autoload = void 0 === t.autoload || t.autoload;
- var n = s.parseModelid(t.url);
- t.urlBase = n.urlBase, t.urlModel = n.urlModel, t.urlFiles = n.urlFiles;
- var r = this._getPlatformError();
- return r ? e.Deferred()
- .reject(r)
- .promise() : (this.options = t, this.createS(i))
- },
- _getPlatformError: function() {
- var t = (new M)
- .getResult();
- return "IE" === t.browser.name && parseInt(t.browser.major) < 11 ? "webgl-unsupported" : "iOS" === t.os.name && /^[0-7][$\.]/.test(t.os.version) ? "webgl-ios" : window.WebGLRenderingContext ? null : "webgl-unsupported"
- },
- _loadModel: function(t) {
- return e.when(t)
- },
- createS: function(t) {
- t.nestscenes = s.normalizeModeldata(t.nestscenes, a);
- var i = new u(this.options, t);
- return e.when(i)
- }
- }
- })
- .call(this, i(6))
- }, function(t, e, i) {
- (function(e) {
- i(148);
- var n = i(149),
- r = i(0),
- o = i(11),
- a = i(150),
- s = i(151),
- l = i(5),
- u = i(17),
- h = i(44),
- c = i(154),
- d = i(45),
- p = i(1),
- f = i(2),
- m = i(155),
- g = i(19),
- v = i(160),
- y = i(166),
- b = i(175),
- w = i(176),
- x = i(8),
- M = i(7),
- T = i(3),
- S = i(177),
- _ = i(178),
- A = i(72),
- P = i(14),
- C = i(4)
- .EventEmitter,
- E = i(73)(),
- D = new f("/js/model/Model.js");
- function L(t, e) {
- this.settings = e, G.model = this, e.floors = "", r.Object3D.call(this), this.modelid = e.basic.model.modelid, this.moreHouse = e.nestrecommends ? 0 === e.nestrecommends.models.length ? null : e.nestrecommends.models : null;
- var i = e.basic;
- G.settings.basic.menu.compass_enable = !0, window.disclaimer && window.disclaimer.content && i.user && 1 !== parseInt(i.user.group) && (i.model.disclaimer = window.disclaimer), this.data = {
- modelid: i.model.modelid,
- name: i.model.name,
- floors: "",
- image: -1 === e.nestscenes.backgroundimgurl.indexOf("background.") ? e.nestscenes.backgroundimgurl : "",
- mobileimg: e.nestscenes.backgroundmobileimgurl && e.nestscenes.backgroundmobileimgurl.indexOf("mobile.") >= 0 ? e.nestscenes.backgroundmobileimgurl : "",
- images: e.nestscenes,
- player_options: {
- highlight_reel: !0,
- tour_buttons: !0,
- contact_email: !0,
- address: i.menu.address_enable,
- contact_name: i.menu.contact_name_enable,
- presented_by: i.menu.producer_enable,
- floor_plan: !0,
- dollhouse: !0,
- fast_transitions: !1,
- model_summary: i.menu.description_enable,
- contact_phone: i.menu.phone_enable,
- model_name: !0,
- autoplay: !1,
- bottom_presented_by: i.menu.bottom_presented_enable,
- show3d: void 0 === i.menu.single_indoor || !i.menu.single_indoor,
- businessname: i.menu.businessname_enable,
- innerimage: i.menu.innerimage_enable
- },
- camera_start: null,
- summary: i.menu.description,
- description_voice_url: i.menu.description_voice_url,
- presented_by: i.menu.producer,
- address: i.menu.address,
- contact_name: i.menu.contact_name,
- contact_phone: i.menu.phone,
- contact_email: i.menu.contact_email,
- bottom_presented_by: i.menu.bottom_presented_by,
- audio: i.model.audio,
- businessname: i.menu.businessname,
- innerimage: i.menu.innerimage,
- orientations: e.locations.orientations,
- orientationkey: e.locations.orientationkey,
- orientation_correct: i.menu.orientation_correct
- };
- var o = T.valueFromHash("cleanui", 0);
- if (o && (G.conf.isCleanUI = o), this.settings.panorama_settings && (p.panoramaSettings = this.settings.panorama_settings, p.screenshot ? p.insideFOV = p.panoramaSettings.screenshot_fov82 ? 82 : 70 : p.insideFOV = p.panoramaSettings.loading_fov82 ? 82 : 70), e.nestmeasure ? this.nestmeasure = e.nestmeasure : this.nestmeasure = {
- info: [],
- settings: {
- unit: 1
- }
- }, this.scene_enable = i.menu.scene_enable, this.scene_autoplay = i.menu.scene_autoplay, this.single_3D = i.menu.single_3D, this.innermap_enable = !1, this.innermap_type = i.menu.innermap_type, this.innermap_imgurl = i.menu.innermap_imgurl, this.outermap_enable = i.menu.outermap_enable, this.outermap_type = i.menu.outermap_type, this.outermap_url = i.menu.outermap_url, this.visiotors_enable = i.menu.visiotors_enable, this.mlanguage_enable = i.menu.mlanguage_enable, this.measure_enable = i.menu.measure_enable, this.mlanguage_type = null, this.t_logo_enable = i.menu.t_logo_enable, this.t_logo_url = i.menu.t_logo_url, this.house_type_enabled = i.menu.house_type_enabled, this.floorplan_enable = !1 !== i.menu.floorplan_enable, this.inside_limit = 51, this.model_name_style = i.menu.model_name_style, this.menu_autohide = i.menu.menu_autohide, this.share_enable = i.model.share_enable, this.startup_type = i.menu.startup_type || 3, this.switch_scene_type = i.menu.switch_scene_type, this.oauth = i.menu.oauth, this.back_url = i.menu.back_url, this.entrance = e.building.house ? e.building.house.entrance : null, this.entranceMesh = null, this.rooms_real = e.building.rooms, this.panosUV = [], this.buildFloors = e.building, i.menu.house_type_url ? this.house_type_url = i.menu.house_type_url : e.building.floors && e.building.floors[0] && (this.house_type_url = e.building.floors[0].planurl), this.building_tag_enable = i.model.building_tag_enable, this.tour_tag_enable = i.model.tour_tag_enable, G.P = {
- a: .025,
- b: 0,
- c: .01
- }, this.loading_enable = i.menu.loading_enable, this.iframe_screen_enable = i.menu.iframe_screen_enable, this.straight_enable = i.menu.straight_enable, this.catalogue = e.catalogue, this.catalogue && ((!this.catalogue.tagopentime || this.catalogue.tagopentime < 0) && (this.catalogue.tagopentime = 5), (!this.catalogue.mediamaxtime || this.catalogue.mediamaxtime < 0) && (this.catalogue.mediamaxtime = 180), (!this.catalogue.iframemaxtime || this.catalogue.iframemaxtime < 0) && (this.catalogue.iframemaxtime = 20)), p.zoom.enabled = !0, e.nestscenes.scenes && e.nestscenes.scenes.length > 0) {
- for (var s = -1, u = 0; u < e.nestscenes.scenes.length; u++)
- if (1 !== e.nestscenes.scenes[u].script) {
- s = u;
- break
- } - 1 !== s && (e.nestscenes.scenes[s].init_point = !0, this.normalMovie = !0)
- }
- this.outline_fills = e.building.outlines, this.language = null, this.language_type = null, this.options = t, this.urls = new a(t.urlFiles), this.isPublic = 2 !== e.basic.privacy, this.images = new S(this), this.images.extend(e.nestscenes.scenes), this.scenes360 = [], this.points = e.locations.points, this.gotoFrom360Item = -1, e.nestscenes.path = n.Catalogue, this.switch_scene_type = 2, this.jfData = null, e.jf && e.jf.enable && e.jf.dataset.length && (this.jfData = e.jf.dataset, G.R.arrSet = e.jf.dataset, G.R.arrSet.forEach((function(t, e) {
- var i = G.R.arrSet[e].audiourl;
- E.load(i)
- })));
- for (s = -1, u = 0; u < e.nestscenes.scenes.length; u++)
- if (1 === e.nestscenes.scenes[u].script) {
- s = u;
- break
- } - 1 !== s && (this.enableTagMovie = !0);
- var d = null,
- f = null;
- if (this.images.getLength() > 0) {
- var m = this.images.list.length,
- g = this.points.length;
- for (u = 0; u < m; u++) 1 == this.images.list[u].type ? -1 == this.gotoFrom360Item && (d = this.images.list[u]._camera._locationid, f = this.images.list[u]._camera._rotation, this.gotoFrom360Item = u) : 2 == this.images.list[u].type && this.scenes360.push(this.images.list[u]);
- if (!d)
- for (u = 0; u < m; u++)
- for (s = 0; s < g; s++) this.points[s].locationid == this.images.list[u]._camera._locationid && (1 == this.points[s].type ? -1 == this.gotoFrom360Item && (d = this.images.list[u]._camera._locationid, f = this.images.list[u]._camera._rotation, this.gotoFrom360Item = u) : this.scenes360.push(this.images.list[u]));
- if (!d)
- for (u = 0; u < g; u++)
- if (1 == this.points[u].type) {
- d = this.points[u].locationid, f = this.points[u].rotation, this.gotoFrom360Item = this.images.getLength();
- break
- } if (null != d) {
- var y = {
- init_point: !0,
- name: "",
- sceneid: "test",
- shortcuturl: "",
- _camera: {
- _locationid: d,
- _rotation: f,
- _type: 0,
- _viewpoint: new r.Vector3(0, 0, 0),
- _zoom: 0,
- _zoom_enable: 0
- }
- };
- this.images.add(y)
- }
- } - 1 == this.gotoFrom360Item && (this.gotoFrom360Item = 0), this.enableOri = i.model.orientation, T.isMobile() || (this.enableOri = !1), G.ori.flag = !1, this.vr_num = 0, this.vr_enable = !(null != i.menu.vr_enable && !i.menu.vr_enable), this.vr_enable && this.vr_num++, this.enableOri && this.vr_num++, this.heroImage = this.images.getbg(), this.heroLocations = [], this.outdoorPanoLocations = [], this.floors = new c(this), this.floorsEnabled = void 0 === t.floors || t.floors, this.changingFloor = !1, this.chunks = [], this.panos = new v, this.colliders = [], this.loadPanosPromise = null, this.loadMeshTexturesPromise = null, this.meshTexturesLoaded = !1, this.mattertags = {}, this.tagsShown = !1, this.shouldShowMattertags = !1, this.has360Views = !0, this.supportedModes = {}, this.supportedModes[l.PANORAMA] = !0, this.supportedModes[l.DOLLHOUSE] = !e.player_options || e.player_options.dollhouse, this.supportedModes[l.FLOORPLAN] = !e.player_options || e.player_options.floor_plan, this.supportedModes[l.TRANSITIONING] = !0, this.steeringWheel = null, this.steeringWheelVisible = null, this.supportsTiles = !!i.model.multiple, p.tiling.allowUltraHighResolution = !!i.model.hq, p.tiling.mobileHighQualityOverride = !!i.model.mobile2k, this.adjustCompass = parseFloat(i.model.adjustCompass ? i.model.adjustCompass : 0), this.mode = l.DOLLHOUSE, this.size = null, this.center = null, this.boundingBox = new r.Box3, this.currentFloor = null, this.allFloorsVisible = !0, this.projectedPano0 = null, this.projectedPano1 = null, this.floorsEnabled && e.floors && -1 !== e.floors.indexOf(",") && e.floors.split(",")
- .forEach(function(t, e) {
- this.addFloor(new h(this, e, t.trim()))
- }.bind(this)), this.floorsHeight = this.setFloorsHeight(e), this.enablefilter = !1;
- var b = G.settings.locations.points;
- for (u = 0; u < b.length; u++) !b[u].color || 0 === b[u].color.brightness && 0 === b[u].color.contrast && 1 === b[u].color.gamma && 0 === b[u].color.hue && 0 === b[u].color.saturation && 0 === b[u].color.vibrance || (this.enablefilter = !0);
- this.waitQueue = [], this.on("load", function(t) {
- 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter((function(t) {
- return !t.isLoadedCallback()
- })), 0 === this.waitQueue.length && this.emit("waiting-done"))
- }.bind(this)), this.setupCustomProperties()
- }
- L.prototype = Object.create(r.Object3D.prototype), M.extend(L, C), L.prototype.setupCustomProperties = function() {
- var t = p.modelAlpha;
- Object.defineProperty(this, "alpha", {
- get: function() {
- return t
- },
- set: function(e) {
- t = e, this.chunks.forEach((function(e) {
- e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
- }))
- }
- })
- };
- var O = function() {
- var t = parseInt(T.getQueryString("lang"));
- return t || (t = function() {
- var t = null;
- switch (window.navigator.userLanguage ? window.navigator.userLanguage.substring(0, 2)
- .toLowerCase() : window.navigator.language.substring(0, 2)
- .toLowerCase()) {
- case "zh":
- t = 3;
- break;
- case "en":
- t = 1;
- break;
- case "ja":
- t = 2;
- break;
- default:
- t = 1
- }
- return t
- }()), t
- };
- L.prototype.buildDollHouseCompass = function() {
- var t = this,
- e = new r.CircleGeometry(.5, 32),
- i = new r.TextureLoader;
- i.setCrossOrigin(!0);
- var n = new r.Vector3;
- n.x = (t.boundingBox.max.x - t.boundingBox.min.x) / 2, n.y = (t.boundingBox.max.y - t.boundingBox.min.y) / 2, n.z = (t.boundingBox.max.z - t.boundingBox.min.z) / 2, i.load("./images/ewsn_512.png", (function(i) {
- var o = new r.MeshBasicMaterial({
- map: i,
- transparent: !0,
- opacity: .9,
- side: r.DoubleSide,
- depthTest: !1
- }),
- a = new r.Mesh(e, o);
- if (a.visible = null !== t.dollHouseCompass && t.dollHouseCompass, a.rotation.set(-Math.PI / 2, 0, 0), t.data.orientation_correct) {
- var s = -t.data.orientation_correct * Math.PI / 180;
- a.rotation.set(-Math.PI / 2, 0, s)
- }
- a.position.copy(n), t.add(a), t.dollHouseCompass = a
- }))
- }, L.prototype.buildStreeringWheel = function() {
- var t = this,
- e = new r.CircleGeometry(.62, 32),
- i = new r.TextureLoader;
- i.setCrossOrigin(!0);
- var n = O(),
- o = "./images/ewsn_512.png";
- 1 == n ? o = "./images/ewsn_en_512.png" : 2 == n && (o = "./images/ewsn_jp_512.png"), i.load(o, (function(i) {
- var n = new r.MeshBasicMaterial({
- map: i,
- transparent: !0,
- opacity: .5,
- side: r.DoubleSide,
- depthTest: !1
- }),
- o = new r.Mesh(e, n);
- if (o.visible = null !== t.steeringWheelVisible && t.steeringWheelVisible, o.rotation.set(-Math.PI / 2, 0, 0), t.data.orientation_correct) {
- var a = -t.data.orientation_correct * Math.PI / 180;
- o.rotation.set(-Math.PI / 2, 0, a)
- }
- t.add(o), t.steeringWheel = o
- }))
- }, L.prototype.showSteeringWheel = function() {
- this.steeringWheel ? this.steeringWheel.visible = !0 : this.steeringWheelVisible = !0
- }, L.prototype.hideSteeringWheel = function() {
- this.steeringWheel ? this.steeringWheel.visible = !1 : this.steeringWheelVisible = !1
- }, L.prototype.getCurrentHouseTypeImage = function() {
- var t = "",
- e = this.buildFloors.floors;
- return (t = e && e.length > 0 && "number" == typeof this.currentFloor.floorIndex && this.currentFloor.floorIndex < e.lenght ? e[this.currentFloor.floorIndex] && e[this.currentFloor.floorIndex].planurl : this.house_type_url) ? t = "http:" === window.location.protocol ? t : t.replace("http:", "https:") : ""
- }, L.prototype.toggleAlpha = function() {
- this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
- }, L.prototype.load = function(t) {
- var i = function() {
- return e.when(this.loadPanos(), this.loadMesh())
- }.bind(this);
- i = i(), t ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this));
- var n = e.when(this.loadHighlightReel(), this.loadMattertags());
- return e.when(i, n)
- .done(this.build.bind(this))
- }, L.prototype.loadMesh = function() {
- var t = e.Deferred(),
- i = this;
- return y.load(i.urls, (function(e, n) {
- if (0 === e.length) {
- D.warn("No geometry found for model, loading faux geometry, disabling outside mode"), i.supportedModes[l.DOLLHOUSE] = !1, i.supportedModes[l.FLOORPLAN] = !1;
- var o = new d({
- geometry: new r.PlaneBufferGeometry(5, 5, 1, 1)
- });
- o.material.visible = !1, o.rotateX(-Math.PI / 2), o.geometry.computeBoundingBox(), e = [o]
- }
- e.forEach((function(t) {
- var e = i.floorsEnabled ? A.parseFloor(t.name) : 0;
- i.addChunk(e, t)
- })), i.floors.sort(), t.resolve(i)
- }), (function(e, i) {
- t.notify(e, i)
- }), (function(e) {
- D.error(e), t.reject("loading-failed")
- })), t.promise()
- }, L.prototype.flyToTagid = function(t) {
- if (!G.d.tourIsPlaying) {
- G.player.mattertagManager.closeTag();
- var e = this.getTagByTagid(t);
- if (e) {
- var i = {
- pano: this.panos.index[e.locationId],
- lookAtPoint: {
- x: e.position.x,
- y: e.position.y,
- z: e.position.z
- }
- };
- if (G.d.flyingtag) return;
- G.d.flyingtag = !0, G.d.player.flyToPano(i, (function() {
- G.d.player.mattertagManager.openTag(e), G.d.flyingtag = !1
- }))
- }
- }
- }, L.prototype.loadMeshTextures = function() {
- return this.loadTexturesPromise || (this.loadTexturesPromise = b.load(this)
- .then(function() {
- this.meshTexturesLoaded = !0
- }.bind(this))), this.loadTexturesPromise
- }, L.prototype.generateEntrance = function(t) {
- var e = t.world.ep,
- i = t.world.sp,
- n = new r.Vector3(e.x, e.y + .5, e.z),
- o = new r.Vector3(i.x, i.y + .5, i.z),
- a = (new r.Vector3)
- .subVectors(n, o)
- .divideScalar(2),
- s = (new r.Vector3)
- .subVectors(n, o)
- .normalize(),
- l = new r.Vector3(0, 1, 0),
- u = (new r.Vector3)
- .crossVectors(l, s),
- h = l.angleTo(s),
- c = (new r.Quaternion)
- .setFromAxisAngle(u, h),
- d = o.sub(a),
- p = {
- actiontype: 2,
- base: {
- y: d.y + .5,
- x: d.x,
- z: d.z
- },
- details: {
- subtype: 0,
- tagpictype: null,
- title: this.settings.entry_door_text,
- tagpicurl: "",
- time: ""
- },
- enable: !0,
- locationid: "location_10000",
- normal: {
- y: 1,
- x: 0,
- z: 0
- },
- showtitle: !0,
- stem: {
- direction: {
- y: .1,
- x: 0,
- z: 0
- },
- enabled: !1
- },
- tagid: "1",
- tagtitle: ""
- },
- f = new r.CylinderGeometry(.04, .16, .7, 4),
- m = new r.MeshBasicMaterial({
- color: 3342335
- }),
- g = new r.Mesh(f, m);
- return g.position.copy(d), g.quaternion.multiply(c), g.visible = !0, {
- mesh: g,
- info: p
- }
- }, L.prototype.setEntranceState = function(t) {
- this.entrance && this.entranceMesh && (this.entranceMesh.visible = t)
- }, L.prototype.loadMattertags = function() {
- var t = e.Deferred();
- if (!p.mattertags.enabled || G.conf.screenshot) return t.resolve();
- var i = this,
- n = this.options.urlBase + "/play/data/" + this.modelid + "/nesttags";
- return o.get(n, {
- responseType: "json",
- fetchNum: 1,
- prefetchFrom: "nesttags",
- auth: this.isPublic ? null : p.authorizationHeader
- })
- .done(function(e) {
- if (!(e && e.setting && e.setting.display)) return t.resolve();
- var n, r = e.info,
- o = this.building_tag_enable,
- a = this.tour_tag_enable;
- if (o = isNaN(parseInt(o)) ? 1 : parseInt(o), a = isNaN(parseInt(a)) ? 1 : parseInt(a), r = r.filter((function(t) {
- return 1 == o || 2 != parseInt(t.actiontype)
- })), this.entrance && this.entrance.world && 1 == o) {
- var s = this.generateEntrance(this.entrance);
- r.push(s.info), this.entranceMesh = s.mesh, this.add(s.mesh)
- }
- var l = 0;
- for (var u in G.titletags = [], r)(n = r[u])
- .enable && (this.mattertags[u] = new m(this, u, n), n.showtitle && n.tagtitle && 12 !== n.details.templatetype && (n.details.tagpictype = 2, n.details.tagpicurl = n.tagtitle, this.mattertags[1e4 + parseInt(u)] = new m(this, 1e4 + parseInt(u), n)), 12 === n.details.templatetype && G.titletags.push(this.mattertags[u]));
- if (n = {
- actiontype: 1,
- base: {
- x: 1e4,
- y: 1e4,
- z: 1e4
- },
- details: {
- description: "faketag",
- subtype: 1,
- tagpictype: 1,
- tagpicurl: null,
- templatetype: 9,
- title: "faketag"
- },
- enable: !0,
- flooridx: 0,
- locationid: "location_01",
- normal: {
- x: 0,
- y: 0,
- z: 0
- },
- showtitle: !1,
- stem: {
- direction: {
- x: 0,
- y: 0,
- z: 0
- },
- enabled: !1
- },
- tagid: "faketag"
- }, this.mattertags[2e4] = new m(this, 2e4, n), this.buildFloors.rooms && 1 == a) {
- var h = "";
- l = 0;
- this.buildFloors.rooms.forEach((function(t, e) {
- t.connected_rooms && (h = t.roomidx, t.connected_rooms.forEach((function(t, e) {
- t.position.y ? t.position.y = t.position.y + .1 : t.position.x = 0, n = {
- actiontype: 1,
- details: {
- description: "区域跳转标签",
- subtype: 0,
- tagpictype: 2,
- tagpicurl: null,
- templatetype: 13,
- title: t.target_name
- },
- enable: !0,
- flooridx: 0,
- locationid: "location_01",
- showtitle: !1,
- stem: {
- direction: {
- x: 0,
- y: 0,
- z: 0
- },
- enabled: !1
- },
- tagid: "faketag",
- target_room: t.target_room,
- target_scene: t.target_scene,
- end_position: t.end_position,
- base: {
- x: t.position.x || 0,
- y: t.position.y || 0,
- z: t.position.z || 0
- },
- roomidx: h
- }, i.mattertags[3e4 + parseInt(l)] = new m(i, 3e4 + parseInt(l), n), l++
- })))
- }))
- }
- t.resolve()
- }.bind(this))
- .fail((function() {
- D.warn("Getting tags failed, not displaying tags."), t.resolve()
- })), t
- }, L.prototype.buildTagsForAddTag = function(t) {
- var e = 0;
- for (var i in this.mattertags) e++;
- var n = new m(this, e, t);
- this.mattertags[e] = n, this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1
- }, L.prototype.newBuildTagsForAddTag = function(t) {
- var e = 0;
- for (var i in this.delTag(t.tagid), this.mattertags) parseInt(i) < 1e4 && (e = parseInt(i) + 1);
- var n = new m(this, e, t);
- this.mattertags[e] = n, this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1, t.showtitle && t.tagtitle && (e += 1e4, t.details.tagpictype = 2, t.details.tagpicurl = t.tagtitle, this.mattertags[e] = new m(this, e, t), this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1)
- }, L.prototype.delTag = function(t) {
- var e = "closed",
- i = "open",
- n = "active",
- r = null;
- for (var o in this.mattertags)
- if (this.mattertags[o] && this.mattertags[o].tagid && this.mattertags[o].tagid == t) {
- r = this.mattertags[o];
- break
- } null != r && (r.floor.remove(r.obj3d), r.boardState !== i && r.boardState !== n || (r.setClosedState(), r.boardState = e), delete this.mattertags[o])
- }, L.prototype.newAddScene = function(t) {}, L.prototype.getSceneLength = function() {
- for (var t = this.settings.nestscenes.scenes, e = 0, i = 0; i < t.length; i++) 0 !== t[i].script && void 0 !== t[i].script || e++;
- return e
- }, L.prototype.build360TagsForAddTag = function(t) {
- var e = Object.keys(this.mattertags)
- .length,
- i = this.mattertags[0],
- n = JSON.parse(JSON.stringify(i.data));
- n.base.x = t.base.x, n.base.y = t.base.y, n.base.z = t.base.z, n.details.title = t.details.title, n.details.templatetype = t.details.templatetype, n.locationid = t.locationid;
- var r = new m(this, e, n);
- return this.mattertags[e] = r, this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1, n.locationid
- }, L.prototype.removeScene = function(t) {
- for (var e = this.heroLocations.length - 1; e >= 0; e--) this.heroLocations[e].panoId == t && this.heroLocations.splice(e, 1);
- G.d.updateModel()
- }, L.prototype.loadPanos = function() {
- if (this.loadPanosPromise) return this.loadPanosPromise;
- var t = new w(this),
- i = this;
- return this.loadPanosPromise = t.load()
- .then((function(t) {
- return i.data.sweeps && Object.keys(i.data.sweeps)
- .length > 0 && (t = t.filter((function(t) {
- return !(!i.data.sweeps[t.locationid] || void 0 === i.data.sweeps[t.locationid].enabled) && i.data.sweeps[t.locationid].enable
- }))), i.panos.extend(t.map((function(t) {
- return new g(i, t.locationid, t, i.supportsTiles)
- }))), i.panos.forEach((function(t) {
- if (p.delBK && 1 == t.alignmentType) {
- var e = new Object;
- e.id = t.id, e.u = t.u, e.v = t.v, i.panosUV.push(e)
- }
- t.neighbourUUIDs && (t.neighbourUUIDs.forEach((function(e) {
- var n = i.panos.get(e);
- n && i.panos.setNeighbour(t, n, !0)
- })), t.neighbourPanos = i.panos.getNeighbours(t) || i.panos.setNeighbour(t, t, !0))
- })), 0 === i.panos.length && (D.warn("Model has no panos, turning off inside mode"), i.supportedModes[l.PANORAMA] = !1), e.when(i)
- })), this.loadPanosPromise
- }, L.prototype.oldloadPanos = function() {
- if (this.loadPanosPromise) return this.loadPanosPromise;
- var t = new w(this);
- return this.loadPanosPromise = t.load()
- .then(function(t) {
- return this.data.sweeps && Object.keys(this.data.sweeps)
- .length > 0 && (t = t.filter(function(t) {
- return !(!this.data.sweeps[t.locationid] || void 0 === this.data.sweeps[t.locationid].enabled) && this.data.sweeps[t.locationid].enabled
- }.bind(this))), this.panos.extend(t.map(function(t) {
- return new g(this, t.locationid, t, this.supportsTiles)
- }.bind(this))), this.panos.forEach(function(t) {
- if (p.delBK && 1 == t.alignmentType) {
- var e = new Object;
- e.id = t.id, e.u = t.u, e.v = t.v, this.panosUV.push(e)
- }
- }.bind(this)), this.panos.forEach(function(t) {
- t.neighbourUUIDs && (t.neighbourUUIDs.forEach(function(e) {
- var i = this.panos.get(e);
- i && this.panos.setNeighbour(t, i, !0)
- }.bind(this)), t.neighbourPanos = this.panos.getNeighbours(t) || this.panos.setNeighbour(t, t, !0))
- }.bind(this)), 0 === this.panos.length && (D.warn("Model has no panos, turning off inside mode"), this.supportedModes[l.PANORAMA] = !1), e.when(this)
- }.bind(this)), this.loadPanosPromise
- }, L.prototype.loadHighlightReel = function() {
- var t = e.Deferred(),
- i = this.options.urlBase + "/play/data/" + this.modelid + "/nestscenes";
- return o.get(i, {
- responseType: "json",
- fetchNum: 1,
- prefetchFrom: "nestscenes",
- auth: this.isPublic ? null : p.authorizationHeader
- })
- .done(function(e) {
- t.resolve()
- }.bind(this))
- .fail((function() {
- D.warn("Getting highlight reel failed, no highlights available"), t.resolve()
- })), t
- }, L.prototype.loadMeasures = function() {}, L.prototype.waitForLoad = function(t, e) {
- e() || (this.waitQueue.push({
- object: t,
- isLoadedCallback: e
- }), 1 === this.waitQueue.length && this.emit("waiting"))
- }, L.prototype.update = function(t) {
- this.panos.update(t)
- }, L.prototype.hide = function() {
- this.floors.hide()
- }, L.prototype.show = function() {
- this.floors.show()
- }, L.prototype.floorNames = function() {
- return this.floors.names()
- }, L.prototype.warpDestFloors = function(t, e) {
- if (t && this.floors.length === t.length) {
- var i = t.findIndex(function(t) {
- return t
- }.bind(this)); - 1 !== i && this.setFloor(this.floors.list[i], null, e)
- } else this.toggleAllFloors(!0)
- }, L.prototype.setFloor = function(t, e, i) {
- this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor), this.allFloorsVisible = !1, this._setFloor(t, e, i)
- }, L.prototype.toggleAllFloors = function(t) {
- this.allFloorsVisible = void 0 !== t ? t : !this.allFloorsVisible, this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor), this._setFloor(this.currentFloor)
- }, L.prototype._setFloor = function(t, e, i) {
- e = e || this.mode, this.currentFloor = t, this.emit("floor.changed", t, e, this.currentFloor);
- var n = null;
- if (this.floors.list.forEach(function(t) {
- t.toggle(t === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
- }.bind(this)), e === l.PANORAMA) {
- if (this.show(), this.shouldShowMattertags && this.tagsShown)
- for (n in this.mattertags) this.mattertags[n].show(p.showFloorDuration)
- } else if ((e === l.FLOORPLAN || e === l.DOLLHOUSE) && this.shouldShowMattertags && this.tagsShown)
- for (n in this.mattertags) {
- var r = this.mattertags[n];
- this.allFloorsVisible ? r.show(p.showFloorDuration) : r.floor === this.currentFloor ? r.show(p.showFloorDuration, p.showFloorDelay) : r.hide(p.hideFloorDuration, p.hideFloorDelay)
- }
- var o = this,
- a = t;
- x.start((function() {}), p.showFloorDelay, function() {
- o.floors.forEach((function(t) {
- t.chunks.forEach((function(e) {
- e.renderOrder = t === a ? u.visibleFloor : u.ghostFloor
- }))
- }))
- }.bind(this))
- }, L.prototype.toggleExplode = function() {
- this.floors.toggleExplodeHorizontal()
- }, L.prototype.toggleExplodeUp = function() {
- this.floors.toggleExplodeVertical()
- }, L.prototype.nextFloor = function(t) {
- return this.floors.nextFloor(this.currentFloor, t)
- }, L.prototype.addFloor = function(t) {
- this.floors.add(t)
- }, L.prototype.getFloorAtPoint = function(t) {
- return this.floors.getFloorAtPoint(t)
- }, L.prototype.getTagByIdx = function(t) {
- return t >= 1e4 && (t -= 1e4), this.mattertags[t]
- }, L.prototype.getTagByTagid = function(t) {
- for (var e = Object.keys(this.mattertags)
- .length, i = 0; i < e; i++)
- if (this.mattertags[i].tagid === t) return this.mattertags[i];
- return null
- }, L.prototype.addChunk = function(t, e) {
- this.floors.getOrMakeFloor(t)
- .addChunk(e), this.chunks.push(e)
- }, L.prototype.setMode = function(t) {
- if (!this.supportedModes[t]) throw new P("Mode not supported for this model: " + t);
- this.mode = t, this.chunks.forEach((function(e) {
- e.setMode(t)
- }))
- }, L.prototype.build = function() {
- var t = this;
- function i(t, e) {
- return new r.Quaternion(t.x, t.y, t.z, t.w)
- .multiply((new r.Quaternion)
- .setFromAxisAngle(new r.Vector3(1, 0, 0), r.Math.degToRad(e)))
- }
- this.heroLocations = this.images.getHeroLocations(this.panos), this.has360Views = p.show360Views.enabled && this.heroLocations.some(function(t) {
- return t.cameraMode === l.PANORAMA && this.panos.get(t.panoId) && !this.panos.get(t.panoId)
- .isAligned()
- }.bind(this)), null === this.heroImage && D.warn("No hero image defined."), this.currentFloor = this.floors.last(), this.floors.build(), this.colliders = this.floors.reduce((function(t, e) {
- return t.concat(e.collider.children)
- }), []);
- var n = [],
- o = [];
- if (this.panos.forEach(function(t) {
- 2 == t.alignmentType ? o.push(t) : n.push(t)
- }.bind(this)), n.forEach(function(t) {
- t.build1(), t.on("enter", function() {
- t.floor !== this.currentFloor && this.setFloor(t.floor)
- }.bind(this))
- }.bind(this)), o.forEach(function(t) {
- t.build1(), t.on("enter", function() {
- t.floor !== this.currentFloor && this.setFloor(t.floor)
- }.bind(this))
- }.bind(this)), G.conf.isNewEditVersion && (parent.window.showHiddenPano ? G.editPanos = !0 : G.editPanos = !1), this.panos.forEach((function(e) {
- if (e.build2(), 1 === e.alignmentType && G.conf.isNewEditVersion && G.editPanos) {
- var i = {
- actiontype: 1,
- base: {
- x: e.marker.position.x,
- y: e.marker.position.y,
- z: e.marker.position.z
- },
- details: {
- templatetype: 9e3,
- subtype: 0,
- time: "2017-09-15 03:39:33",
- title: "点击隐藏或显示全景点:" + e.id,
- description: "pano使能",
- tagpictype: 1
- },
- enable: !0,
- locationid: e.id,
- normal: {
- x: 0,
- y: 1,
- z: 0
- },
- stem: {
- direction: {
- x: 0,
- y: 1,
- z: 0
- },
- enabled: !0
- },
- tagid: "pano_" + e.id
- };
- t.buildTagsForAddTag(i)
- }
- })), this.floors.forEach(function(t) {
- this.boundingBox.union(t.boundingBox)
- }.bind(this)), this.outline_fills) {
- t = this;
- this.outline_fills.forEach((function(e) {
- var i = t.floors.get(e.flooridx)
- .boundingBox.min.y + .8;
- e.segments.forEach((function(e) {
- var n = new r.Geometry;
- e.forEach((function(t) {
- n.vertices.push(new r.Vector3(t.x, i, -t.y))
- }));
- var o = new r.PointsMaterial({
- color: 16711680,
- size: .01,
- transparent: !0,
- opacity: 0
- }),
- a = new r.Points(n, o);
- a.geometry.computeBoundingBox(), t.boundingBox.union(a.geometry.boundingBox)
- }))
- }))
- }
- for (var a in this.size = this.boundingBox.getSize(new r.Vector3), this.center = this.boundingBox.getCenter(new r.Vector3), this.floors.forEach(function(t) {
- D.info("Floor " + t + ": " + t.children.length + " chunks, " + t.panos.length + " panos.")
- }.bind(this)), this.panos.populate_path_graph(), this.skybox = new s(this.boundingBox), this.skybox.matrixWorldNeedsUpdate = !0, this.add(this.skybox), this.mattertags) 12 !== this.mattertags[a].type && this.mattertags[a].build();
- if (1 == p.thirdCustomer && (null == this.floorNavigationMesh || null == this.floorNavigationMesh)) {
- var u = new r.PlaneBufferGeometry(this.boundingBox.max.x - this.boundingBox.min.x, this.boundingBox.max.z - this.boundingBox.min.z),
- h = new r.TextureLoader;
- h.setCrossOrigin(!0);
- var c = h.load("https://template2.3dnest.cn/dianli/" + this.modelid + ".png"),
- d = new r.MeshBasicMaterial({
- map: c,
- side: r.FrontSide,
- transparent: !0,
- opacity: 1
- });
- this.floorNavigationMesh = new r.Mesh(u, d);
- var f = (new r.Vector3)
- .copy(this.boundingBox.getCenter(new r.Vector3)),
- m = this.boundingBox.max.y,
- v = f.clone()
- .setY(m);
- this.floorNavigationMesh.position.copy(v), "zq_sxex_17" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -95)) : "zq_dnjl_7" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -92)) : "zq_sxsx_18" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -95)) : "zq_ylck_24" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -92)) : this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -90)), this.add(this.floorNavigationMesh)
- }
- return D.debug("Done building model"), g.raycastsDone > 0 && (D.warn("raycasts: " + g.raycastsDone), D.warn("raycasts skipped: " + g.raycastsSkipped)), this.buildRooms(), e.when(this)
- }, L.prototype.buildRooms = function() {
- this.rooms = new _(this), this.rooms.createFromChunks(this.chunks), this.rooms.calcRoomBoundaries()
- }, L.prototype.updateProjectedPanos = function() {
- this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
- }, L.prototype.setProjectedPanos = function(t, e, i) {
- null != i || (i = !0), i = !!i, this.projectedPano0 = t, this.projectedPano1 = e, this.skybox.material.setProjectedPanos(t, e, i), this.chunks.forEach((function(n) {
- n.materialInside.setProjectedPanos(t, e, i)
- }))
- }, L.prototype.setSide = function(t) {
- this.floors.forEach((function(e) {
- e.collider.material.side = t
- }))
- }, L.prototype.setSide = function(t) {
- this.floors.forEach((function(e) {
- e.collider.material.side = t
- }))
- }, L.prototype.heroCount = function() {
- return this.heroLocations ? this.heroLocations.length : 0
- }, L.prototype.getHeroDescriptorByIndex = function(t) {
- if (t < 0) return D.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."), null;
- if (this.heroCount() < 1) return D.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"), null;
- var e = this.heroLocations[t];
- return void 0 === e ? (D.warn("Model.getHeroDescriptorByIndex() -> Index " + t + " is not a validindex"), null) : e
- }, L.prototype.findPanoramicHero = function() {
- for (var t in this.heroLocations)
- if (this.heroLocations[t].cameraMode === l.PANORAMA) return this.heroLocations[t];
- return null
- }, L.prototype.listImagePanos = function() {
- var t = [],
- e = this;
- return this.images.forEach((function(i) {
- if (i._camera && i._camera._locationid) {
- var n = e.panos.get(i._camera._locationid);
- n && (e.supportsTiles || n.isLoaded("high") || t.push(n))
- }
- })), t
- }, L.prototype.fadePanoMarkers = function(t, e) {
- this.panos.fadeMarkerOpacity(t, e)
- }, L.prototype.setSweepVisibility = function(t) {
- this.panos.forEach((function(e) {
- e.marker && (e.marker.visible = t)
- }))
- }, L.prototype.outsideAllowed = function() {
- return this.supportedModes[l.DOLLHOUSE] && this.supportedModes[l.FLOORPLAN]
- }, L.prototype.setFloorsHeight = function(t) {
- var e = t.locations.points,
- i = t.building.totalfloor,
- n = {
- totalfloor: i,
- height: []
- };
- if (i && i > 1) {
- for (var r = [], o = 0; o < i; o++) r.push([]);
- e.forEach((function(t) {
- null !== t.flooridx && r[t.flooridx].push(t.spot.z)
- })), r.forEach((function(t) {
- t.sort((function(t, e) {
- return t - e
- }));
- var e = Math.floor(t.length / 2);
- n.height.push(t[e])
- }))
- }
- return n
- }, t.exports = L
- })
- .call(this, i(6))
- }, function(t, e) {
- t.exports = {
- Chinese: 0,
- English: 1,
- Japanese: 2
- }
- }, function(t, e) {
- t.exports = {
- Default: 0,
- Fastmovie: 1,
- Catalogue: 2
- }
- }, function(t, e, i) {
- (function(e) {
- (function(n) {
- function r(t) {
- this.cache = null, this.expires = 0
- }
- function o() {
- this.baseUrl = null, this.cache = null, this.expires = 0
- }
- function a() {
- this.baseUrl = null, this.expires = 0
- }
- function s(t) {
- this.initialLoadingPromise = null, this.endpoint = t + "?type=3", this.urlContainer = null, this.authorizationHeader = c.getAuthorizationHeader(), this.containerClasses = [a, o, r]
- }
- var l = i(11),
- u = i(2),
- h = i(26),
- c = i(25),
- d = new u(n);
- r.prototype = {
- version: 1,
- validate: function(t) {
- return "catalog.json" in t && Object.keys(t)
- .length > 0
- },
- update: function(t) {
- return this.cache = t, this.expires = Date.now() + h.signedUrlDefaultExpireTime, e.when()
- },
- get: function(t) {
- return this.cache[t]
- }
- }, o.prototype = {
- version: 2,
- validate: function(t) {
- return "catalog.json" in t && "base.url" in t && Object.keys(t)
- .length > 1
- },
- update: function(t) {
- return this.baseUrl = t["base.url"], this.cache = t, this.expires = Date.now() + h.signedUrlDefaultExpireTime, e.when()
- },
- get: function(t) {
- var e = this.cache[t];
- return e ? this.baseUrl.replace("{{filename}}", t) + e : null
- }
- }, a.prototype = {
- version: 3,
- validate: function(t) {
- return !0
- },
- update: function(t) {
- return this.baseUrl = t.locationpics, t.expires ? this.expires = 1e3 * t.expires : this.expires = Date.now() + h.signedUrlDefaultExpireTime, e.when()
- },
- get: function(t) {
- return this.baseUrl.replace("{{filename}}", t)
- }
- }, s.prototype = {
- init: function() {
- return this.initialLoadingPromise || (setInterval(function() {}.bind(this), h.signedUrlCheckInterval), this.initialLoadingPromise = this.refresh()), this.initialLoadingPromise
- },
- refresh: function(t) {
- var i = void 0 === (t = t || {})
- .cache || t.cache;
- return l.get(this.endpoint, {
- responseType: "json",
- prefetchFrom: i ? "basic" : null,
- cache: i,
- auth: this.authorizationHeader
- })
- .then(function(t) {
- if (this.urlContainer && this.urlContainer.validate(t)) return this.urlContainer.update(t);
- for (var n = 0; n < this.containerClasses.length; n++) {
- var r = new(0, this.containerClasses[n]);
- if (r.validate(t)) return d.info("Using urls version " + r.version), this.urlContainer = r, this.urlContainer.update(t)
- }
- return i ? this.refresh({
- cache: !1
- }) : e.Deferred()
- .reject("missing-urls")
- }.bind(this), (function(t) {
- return "loading-failed"
- }))
- },
- get: function(t) {
- return G.url.model + "/" + t
- }
- }, t.exports = s
- })
- .call(this, "/js/util/ModelUrls.js")
- })
- .call(this, i(6))
- }, function(t, e, i) {
- (function(e) {
- function n(t) {
- u.time("Computing a nice bounding cubemap");
- var e = new a({
- side: r.BackSide,
- transparent: !0
- });
- e.uniforms.modelAlpha.value = 0, e.uniforms.opacity.value = 1 - s.modelAlpha, this.renderOrder = l.boundingSkybox, o.call(this, t, e), u.timeEnd("Computing a nice bounding cubemap")
- }
- var r = i(0),
- o = (i(5), i(12), i(152)),
- a = i(43),
- s = i(1),
- l = i(17),
- u = new(i(2))(e);
- n.prototype = Object.create(o.prototype), n.prototype.constructor = n, t.exports = n
- })
- .call(this, "/js/objects/BoundingTextureSkybox.js")
- }, function(t, e, i) {
- function n(t, e, i) {
- var n = (t = t.clone())
- .getSize(new r.Vector3),
- o = new r.BoxGeometry(n.x, n.y, n.z);
- o.boundingBox = t, r.Mesh.call(this, o, e), this.position.copy(t.getCenter(new r.Vector3)), this.frustumCulled = !1, i && this.add(new r.WireframeHelper(this))
- }
- var r = i(0);
- n.prototype = Object.create(r.Mesh.prototype), n.prototype.constructor = n, t.exports = n
- }, function(t, e, i) {
- "use strict";
- i(5);
- var n = i(0);
- function r(t) {
- this.chunksize = t || 10, this.chunks = {}, this.boundingBoxes = {}, this.children = [], this.offset = new n.Vector3(0, .5, 0), this.material = new n.MeshBasicMaterial({
- color: 16777215
- })
- }
- r.prototype.add = function(t) {
- var e, i, r, o, a, s, l, u, h = t.attributes,
- c = new n.Vector3;
- if (h ? (e = h.position.array, i = t.index ? t.index.array : void 0) : (e = t.vertices, t.faces), i)
- for (var d = 0, p = i.length; d < p; d += 3) {
- var f = 3 * i[d],
- m = 3 * i[d + 1],
- g = 3 * i[d + 2];
- r = (e[f] + e[m] + e[g]) / 3, o = (e[f + 1] + e[m + 1] + e[g + 1]) / 3, a = (e[f + 2] + e[m + 2] + e[g + 2]) / 3, (s = Math.floor(r / this.chunksize) + "." + Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize)) in this.chunks ? (u = this.chunks[s], l = this.boundingBoxes[s]) : (u = this.chunks[s] = [], l = this.boundingBoxes[s] = new n.Box3), u.push(e[f], e[f + 1], e[f + 2], e[m], e[m + 1], e[m + 2], e[g], e[g + 1], e[g + 2]), l.expandByPoint(c.set(e[f], e[f + 1], e[f + 2])), l.expandByPoint(c.set(e[m], e[m + 1], e[m + 2])), l.expandByPoint(c.set(e[g], e[g + 1], e[g + 2]))
- } else
- for (d = 0, p = e.length; d < p; d += 9) r = (e[d] + e[d + 3] + e[d + 6]) / 3, o = (e[d + 1] + e[d + 4] + e[d + 7]) / 3, a = (e[d + 2] + e[d + 5] + e[d + 8]) / 3, (s = Math.floor(r / this.chunksize) + "." + Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize)) in this.chunks ? (u = this.chunks[s], l = this.boundingBoxes[s]) : (u = this.chunks[s] = [], l = this.boundingBoxes[s] = new n.Box3), u.push(e[d], e[d + 1], e[d + 2], e[d + 3], e[d + 4], e[d + 5], e[d + 6], e[d + 7], e[d + 8]), l.expandByPoint(c.set(e[d], e[d + 1], e[d + 2])), l.expandByPoint(c.set(e[d + 3], e[d + 4], e[d + 5])), l.expandByPoint(c.set(e[d + 6], e[d + 7], e[d + 8]))
- }, r.prototype.build = function() {
- var t = new n.Object3D;
- for (var e in t.material = this.material, this.chunks) {
- var i = this.chunks[e],
- r = new n.BufferGeometry,
- o = new n.BufferAttribute(new Float32Array(i), 3);
- r.addAttribute("position", o), r.boundingBox = this.boundingBoxes[e];
- var a = new n.Mesh(r, this.material);
- a.material.visible = !1, t.add(a), this.chunks[e] = []
- }
- return t
- }, t.exports = r
- }, function(t, e, i) {
- function n(t) {
- s.call(this), this.model = t, this.exploded = !1
- }
- var r = i(44),
- o = i(2),
- a = i(8),
- s = i(33),
- l = i(7),
- u = i(15),
- h = i(0);
- new o("/js/model/FloorCollection.js"), l.inherit(n, s), n.prototype.add = function(t) {
- s.prototype.add.call(this, t), this.model.add(t)
- }, n.prototype.getIndex = function(t) {
- return t.floorIndex
- }, n.prototype.build = function() {
- this.list.forEach((function(t) {
- t.build()
- }))
- }, n.prototype.size = function() {
- return this.length
- }, n.prototype.sort = function() {
- s.prototype.sort.call(this, (function(t, e) {
- return t.floorIndex - e.floorIndex
- }))
- }, n.prototype.nextFloor = function(t, e) {
- return this.index[t.floorIndex + e] || null
- }, n.prototype.getFloorAtPoint = function(t) {
- for (var e = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
- var r = this.list[n],
- o = r.distanceToPoint(t);
- (!e || i > o) && (i = o, e = r)
- }
- return e
- }, n.prototype.getOrMakeFloor = function(t) {
- var e = this.index[t];
- return e || (e = new r(this.model, t), this.add(e)), e
- }, n.prototype.hide = function() {
- this.list.forEach((function(t) {
- t.hide()
- }))
- }, n.prototype.show = function() {
- this.list.forEach((function(t) {
- t.show()
- }))
- }, n.prototype.names = function() {
- return this.list.reduce((function(t, e) {
- return t.concat(e.name)
- }), [])
- }, n.prototype.toggleExplodeHorizontal = function() {
- function t(t, e) {
- t.position.x = i[t.floorIndex] * e, t.position.y = 1 * t.floorIndex * e
- }
- var e, i = [],
- n = 0;
- this.list.forEach((function(t, r, o) {
- e = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - t.boundingBox.min.x, t.boundingBox.getSize(new h.Vector3)
- .x / 2) : 0, n += e, i[r] = n
- })), i = i.map((function(t) {
- return t - n / 2
- })), this.exploded ? this.list.forEach(function(e) {
- a.start(function(i) {
- t(e, 1 - i)
- }.bind(this), 1500, null, 0, u.easeOutExpo)
- }.bind(this)) : this.list.forEach(function(e) {
- a.start(function(i) {
- t(e, i)
- }.bind(this), 1500, null, 0, u.easeOutExpo)
- }.bind(this)), this.exploded = !this.exploded
- }, n.prototype.toggleExplodeVertical = function() {
- function t(t, i) {
- t.position.y = (5 * t.floorIndex - e.y / 2) * i, t.panos.forEach((function(e) {
- e.position.y = e.origin.y + t.position.y, e.skyboxMesh.position.y = e.origin.y + t.position.y
- }))
- }
- var e = this.model.size;
- this.exploded ? this.list.forEach((function(e) {
- a.start((function(i) {
- t(e, 1 - i)
- }), 1500, null, 0, u.easeOutExpo)
- })) : this.list.forEach((function(e) {
- a.start((function(i) {
- t(e, i)
- }), 1500, null, 0, u.easeOutExpo)
- })), this.exploded = !this.exploded
- }, t.exports = n
- }, function(t, e, i) {
- (function(e) {
- var n, r = i(156),
- o = i(0),
- a = i(2),
- s = i(3),
- l = i(1),
- u = i(5),
- h = i(17),
- c = i(16),
- d = i(19),
- p = i(8),
- f = i(10),
- m = i(15),
- g = i(157),
- v = i(4)
- .EventEmitter,
- y = i(39),
- b = i(71),
- w = new a("/js/mattertag/Mattertag.js"),
- x = i(158),
- M = i(159),
- T = i(22),
- S = "closed",
- _ = "opening",
- A = "open",
- P = "closing",
- C = "active";
- function E(t, e, i, n, r) {
- this.tilesHorizontal = e, this.tilesVertical = i, this.numberOfTiles = n, t.wrapS = t.wrapT = o.RepeatWrapping, t.repeat.set(1 / this.tilesHorizontal, 1 / this.tilesVertical), this.tileDisplayDuration = r, this.currentLoopTime = this.currentTile = this.currentDisplayTime = 0, this.inStop = !1, this.totalcount = 0, this.update = function(e) {
- for (this.inStop ? (this.totalcount++, 800 < this.totalcount && (this.totalcount = 0, this.inStop = !1)) : this.currentDisplayTime += e; this.currentDisplayTime > this.tileDisplayDuration;) this.currentDisplayTime -= this.tileDisplayDuration, this.currentTile++, t.offset.x = this.currentTile % this.tilesHorizontal / this.tilesHorizontal, t.offset.y = Math.floor(this.currentTile / this.tilesHorizontal) / this.tilesVertical
- }
- }
- function D(t, i, n) {
- var r = n.version || "0";
- if ("0" !== r && w.info("nesttags version: " + r), this.data = n, this.model = t, this.player = G.player, this.locationId = n.locationid, this.i = i, this.tagid = n.tagid, this.enabled = l.mattertags.enabled && n.enable, this.label = n.details.title ? n.details.title : "", this.subtype = n.details.subtype, this.tagInfoUrl = n.details.url, this.audioenable = n.details.audioenable, n.details.templatetype === y.Audio && (this.audioenable = !0), this.audiourl = n.details.audiourl || n.details.url, this.videourl = n.details.videourl, this.tagPicUrl = n.details.tagpicurl, this.tagPicType = n.details.tagpictype, this.parsedDescription = [], this.links = [], this.floor = null, this.floorIndex = n.flooridx || 0, this.isBuilt = !1, this.des = this.data.details.description, G.player && G.player.currentPano && 2 === G.player.currentPano.alignmentType ? this.rt360 = !0 : this.rt360 = !1, 2e4 === i && (n.details.templatetype = y.Tag360T1), n.details.templatetype === y.ImageText && n.details.audioenable && n.details.audiourl && (n.details.templatetype = y.ImageTextAudio), n.details.templatetype === y.TextOnly && n.details.audioenable && n.details.audiourl && (n.details.templatetype = y.TextAudio), n.actiontype == y.ClassifyType.Building ? (this.type = y.BuildingType, this.mediatype = b.Normal) : (this.type = n.details.templatetype, n.details.templatetype === y.BuildingType || n.details.templatetype === y.TextOnly || n.details.templatetype === y.ImageText || n.details.templatetype === y.OtherModel ? this.mediatype = b.Normal : n.details.templatetype === y.Audio || n.details.templatetype === y.TextAudio || n.details.templatetype === y.ImageTextAudio ? (this.mediadiv = (n.details.templatetype, y.ImageTextAudio, window.document.getElementById("audio-tag")), this.mediatype = b.Audio) : n.details.templatetype === y.Video ? (this.mediadiv = window.document.getElementById("video-tag"), this.mediatype = b.Video) : n.details.templatetype === y.IFrame ? this.mediatype = b.IFrame : this.mediatype = b.Normal), n.details.audioenable && n.details.audiourl && (n.details.templatetype = y.TextAudio), this.imgaudioControl = {
- loop: ""
- }, this.picDescription = null, this.audioControl = {
- loop: ""
- }, this.audioPauseTime = 0, this.highlightStatus = !1, this.mode = u.PANORAMA, n.preferred_camera && n.preferred_camera.mode && (this.mode = n.preferred_camera.mode), this.obj3d = this.disc = this.billboard = null, this.geometry = {}, this.geometry.disc = new o.PlaneBufferGeometry(1, 1), this.geometry.discGif = new o.PlaneBufferGeometry(2, 2), this.geometry.discBuilding = new o.PlaneBufferGeometry(2, 2), this.geometry.discTo360Tag = new o.PlaneBufferGeometry(1, 1), this.geometry.discFrom360Tag = new o.PlaneBufferGeometry(1, .6), this.geometry.discOtherModel = new o.PlaneBufferGeometry(2, 2), this.geometry.discOtherModelText = new o.PlaneBufferGeometry(2, 2), this.geometry.cutout = new o.SphereBufferGeometry(.5, 16, 8), this.type === y.BuildingType && this.label) {
- var a = G.settings.locations.points;
- if (a && a.forEach((function(t, e) {
- if (n.locationid === t.locationid) return n.base.y = t.viewpoint.z, !1
- })), this.label.length > 6) {
- var s = .22 * this.label.length + .3;
- this.geometry.discBuilding = new o.PlaneBufferGeometry(s, .5)
- } else {
- s = .35 * this.label.length + .3;
- this.geometry.discBuilding = new o.PlaneBufferGeometry(s, .5)
- }
- }
- if (this.type === y.Audio) {
- this.materialsAudio = {};
- var h = T.splitUrl("./images/audioon_128x128.png"),
- d = T.splitUrl("./images/audiooff_128x128.png");
- if (this.tagPicType != M.Pic && this.tagPicType != M.GIF || null == this.tagPicUrl || "" == this.tagPicUrl || (h = this.tagPicUrl, d = this.tagPicUrl.replace(".png", "_hover.png")), this.tagPicType === M.Text) this.materialsAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
- else if (this.tagPicType === M.GIF) {
- var p = this.getTexture(h);
- this.materialsAudio.free = this.buildDiscMaterial(p), this.materialsAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
- } else this.materialsAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsAudio.hover = this.buildDiscMaterial(this.getTexture(d));
- this.materialsAudio.disable = this.materialsAudio.free.clone(), this.materialsAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsAudio.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsAudio.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsAudio = {
- free: this.materialsAudio.free.clone(),
- hover: this.materialsAudio.hover.clone(),
- disable: this.materialsAudio.disable.clone(),
- pole: this.materialsAudio.pole.clone(),
- cutout: this.materialsAudio.cutout.clone()
- }, this.audioControl.loop = n.details.loop, this.tagInfoUrl = n.details.url, this.materials = this.materialsAudio
- } else if (this.type === y.OtherModel || this.type === y.TagTo360 || this.type === y.Tag360T1 || this.type === y.TextOnly) {
- this.materialsOtherModel = {};
- h = T.splitUrl("./images/goto_256x256.png"), d = T.splitUrl("./images/goto_256x256.png");
- if (this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || (h = d = this.tagPicUrl), this.type === y.Title) this.geometry.disc = new o.PlaneBufferGeometry(12, 3), this.materialsOtherModel.free = this.materialsOtherModel.hover = this.buildDiscMaterial();
- else if (this.tagPicType === M.Text) this.materialsOtherModel.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsOtherModel.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
- else if (this.tagPicType === M.GIF) {
- p = this.getTexture(h);
- this.materialsOtherModel.free = this.buildDiscMaterial(p), this.materialsOtherModel.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
- } else this.materialsOtherModel.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsOtherModel.hover = this.buildDiscMaterial(this.getTexture(d));
- this.materialsOtherModel.disable = this.materialsOtherModel.free.clone(), this.materialsOtherModel.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsOtherModel.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsOtherModel.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsOtherModel = {
- free: this.materialsOtherModel.free.clone(),
- hover: this.materialsOtherModel.hover.clone(),
- disable: this.materialsOtherModel.disable.clone(),
- pole: this.materialsOtherModel.pole.clone(),
- cutout: this.materialsOtherModel.cutout.clone()
- }, this.tagInfoUrl = n.details.url, this.materials = this.materialsOtherModel, this.materials.free.map.needsUpdate = !0
- } else if (this.type === y.Title) e(".viewport-tags")
- .append('<a id="titletag' + this.i + '" href="javascript:;" class="viewport-tag js-tag visible" style="z-index:20;"><div class="viewport-tag-point"></div><div class="viewport-tag-label"><span class="viewport-tag-label-name">' + n.details.title + "</span></div></a>");
- else if (this.type === y.ImageText || this.type === y.ImageTextAudio || this.type === y.IKEA || this.type === y.Video) {
- this.materialsNotAudio = {};
- h = T.splitUrl("./images/tagnormal_128x128.png"), d = T.splitUrl("./images/taghover_128x128.png");
- if (this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || (h = d = this.tagPicUrl), this.tagPicType === M.Text) this.materialsNotAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
- else if (this.tagPicType === M.GIF) {
- p = this.getTexture(h);
- this.materialsNotAudio.free = this.buildDiscMaterial(p), this.materialsNotAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
- } else this.materialsNotAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getTexture(d));
- this.materialsNotAudio.disable = this.materialsNotAudio.free.clone(), this.materialsNotAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsNotAudio.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsNotAudio.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsNotAudio = {
- free: this.materialsNotAudio.free.clone(),
- hover: this.materialsNotAudio.hover.clone(),
- disable: this.materialsNotAudio.disable.clone(),
- pole: this.materialsNotAudio.pole.clone(),
- cutout: this.materialsNotAudio.cutout.clone()
- }, this.imgaudioControl = n.details.audioloop ? n.details.audioloop : {
- loop: ""
- }, this.materials = this.materialsNotAudio
- } else if (this.type === y.Tag360T1) {
- if ({
- free: c.loadCanvas(this.label),
- hover: c.loadCanvas(this.label)
- }, this.materials360Type = {}, 2 === this.subtype) {
- this.tagPicType = 3;
- h = T.splitUrl("./images/gif8_128x3200.png"), p = this.getTexture(h);
- this.materials360Type.free = this.buildDiscMaterial(p), this.materials360Type.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
- } else this.materials360Type.free = this.buildDiscMaterial(this.getText(this.label, 1)), this.materials360Type.hover = this.buildDiscMaterial(this.getText(this.label, 1));
- this.materials360Type.disable = this.materials360Type.free.clone(), this.materials360Type.disable.opacity = l.mattertags.disc.disabledOpacity, this.materials360Type.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materials360Type.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materials360Type = {
- free: this.materials360Type.free.clone(),
- hover: this.materials360Type.hover.clone(),
- disable: this.materials360Type.disable.clone(),
- pole: this.materials360Type.pole.clone(),
- cutout: this.materials360Type.cutout.clone()
- }, this.materials = this.materials360Type
- } else if (this.type === y.BuildingType)({
- free: c.loadCanvas(this.label),
- hover: c.loadCanvas(this.label)
- }), this.materialsBuilding = {}, this.materialsBuilding.free = this.buildDiscMaterial(this.getText(this.label)), this.materialsBuilding.hover = this.buildDiscMaterial(this.getText(this.label)), this.materialsBuilding.disable = this.materialsBuilding.free.clone(), this.materialsBuilding.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsBuilding.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsBuilding.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsBuilding = {
- free: this.materialsBuilding.free.clone(),
- hover: this.materialsBuilding.hover.clone(),
- disable: this.materialsBuilding.disable.clone(),
- pole: this.materialsBuilding.pole.clone(),
- cutout: this.materialsBuilding.cutout.clone()
- }, this.materials = this.materialsBuilding;
- else if (this.type === y.RegionalJump) this.materialsRegional = {}, this.materialsRegional.free = this.buildDiscMaterial(c.loadCanvasRe(this.label)), this.materialsRegional.hover = this.buildDiscMaterial(c.loadCanvasRe(this.label)), this.materialsRegional.disable = this.materialsRegional.free.clone(), this.materialsRegional.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsRegional.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsRegional.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsRegional = {
- free: this.materialsRegional.free.clone(),
- hover: this.materialsRegional.hover.clone(),
- disable: this.materialsRegional.disable.clone(),
- pole: this.materialsRegional.pole.clone(),
- cutout: this.materialsRegional.cutout.clone()
- }, this.materials = this.materialsRegional;
- else if (this.type === y.TagTo360) {
- if ({
- free: c.loadCanvas(this.label),
- hover: c.loadCanvas(this.label)
- }, this.materialsTo360 = {}, 2 === this.subtype) {
- this.tagPicType = 3;
- h = T.splitUrl("./images/gif8_128x3200.png"), p = this.getTexture(h);
- this.materialsTo360.free = this.buildDiscMaterial(p), this.materialsTo360.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
- } else this.materialsTo360.free = this.buildDiscMaterial(this.getText(this.label, 1)), this.materialsTo360.hover = this.buildDiscMaterial(this.getText(this.label, 1));
- this.materialsTo360.disable = this.materialsTo360.free.clone(), this.materialsTo360.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsTo360.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsTo360.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsTo360 = {
- free: this.materialsTo360.free.clone(),
- hover: this.materialsTo360.hover.clone(),
- disable: this.materialsTo360.disable.clone(),
- pole: this.materialsTo360.pole.clone(),
- cutout: this.materialsTo360.cutout.clone()
- }, this.tagInfoUrl = n.details.url, this.materials = this.materialsTo360
- } else if (this.type === y.Pano) {
- if (this.materialsNotAudio = {}, t.panos.index[this.locationId].enable ? (h = T.splitUrl("./images/disable_on_256x256.png"), d = T.splitUrl("./images/disable_on_256x256.png")) : (h = T.splitUrl("./images/disable_off_256x256.png"), d = T.splitUrl("./images/disable_off_256x256.png")), this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || void 0 === this.tagPicUrl || (h = d = this.tagPicUrl), this.tagPicType === M.Text) this.materialsNotAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
- else if (this.tagPicType === M.GIF) {
- p = this.getTexture(h);
- this.materialsNotAudio.free = this.buildDiscMaterial(p), this.materialsNotAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
- } else this.materialsNotAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getTexture(d));
- this.materialsNotAudio.disable = this.materialsNotAudio.free.clone(), this.materialsNotAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsNotAudio.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsNotAudio.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsNotAudio = {
- free: this.materialsNotAudio.free.clone(),
- hover: this.materialsNotAudio.hover.clone(),
- disable: this.materialsNotAudio.disable.clone(),
- pole: this.materialsNotAudio.pole.clone(),
- cutout: this.materialsNotAudio.cutout.clone()
- }, this.materials = this.materialsNotAudio
- } else {
- this.materialsNotAudio = {};
- h = T.splitUrl("./images/tagnormal_128x128.png"), d = T.splitUrl("./images/taghover_128x128.png");
- if (this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || (h = d = this.tagPicUrl), this.tagPicType === M.Text) this.materialsNotAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
- else if (this.tagPicType === M.GIF) {
- p = this.getTexture(h);
- this.materialsNotAudio.free = this.buildDiscMaterial(p), this.materialsNotAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
- } else this.materialsNotAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getTexture(d));
- this.materialsNotAudio.disable = this.materialsNotAudio.free.clone(), this.materialsNotAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsNotAudio.cutout = new o.MeshBasicMaterial({
- transparent: !0,
- opacity: 1,
- colorWrite: !1
- }), this.materialsNotAudio.pole = new o.LineBasicMaterial({
- linewidth: l.mattertags.pole.width,
- color: l.mattertags.pole.color,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
- transparent: !0,
- alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
- }), this.materialsNotAudio = {
- free: this.materialsNotAudio.free.clone(),
- hover: this.materialsNotAudio.hover.clone(),
- disable: this.materialsNotAudio.disable.clone(),
- pole: this.materialsNotAudio.pole.clone(),
- cutout: this.materialsNotAudio.cutout.clone()
- }, this.materials = this.materialsNotAudio
- }
- this.position = (new o.Vector3)
- .copy(n.base);
- var f = (new o.Vector3)
- .copy(n.stem.direction);
- if (this.type, y.Title, this.discPosition = f, this.basepos = this.position.clone(), this.discpos2 = this.discPosition.clone(), this.discPosition.y += .03, this.discScale = .05, this.poleEnabled = n.stem.enabled, this.boardOrientation = "", this.boardState = S, this.hoveringBillboard = !1, this.animationScale = 0, this.visibleTransition = null, this.boardTransition = null, this.fadeInTimer = void 0, this.fadeOutTimer = void 0, l.mattertags.enableLinking && (this.type === y.TextOnly || this.type === y.TextAudio)) {
- var m = this.parseLinks(n.details.description, t.modelid);
- this.links = m.links, this.parsedDescription = m.description
- }
- }
- var L = document.getElementById("tag-billboards"),
- O = document.getElementById("audio-tag"),
- I = document.getElementById("audio-tag"),
- R = document.getElementById("video-tag");
- D.prototype = Object.create(v.prototype), D.raycaster = new o.Raycaster, D.prototype.build = function() {
- return this.enabled && !this.isBuilt && l.mattertags.enablePanoSize ? (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(), this.floor && (this.billboard = this.buildBillboard(), this.obj3d = this.buildObject3D(), this.floor.add(this.obj3d)), this.isBuilt = !0, this) : null
- }, D.prototype.draw = function(t, e) {}, D.prototype.buildObject3D = function() {
- var t = new o.Object3D;
- if (t.position.copy(this.position), this.tagPicType === M.Text)
- if (this.tagPicUrl) {
- var e = .35 * this.tagPicUrl.length + .2;
- this.geometry.discOtherModelText = new o.PlaneBufferGeometry(e, .5), this.disc = new o.Mesh(this.geometry.discOtherModelText, this.materials.free)
- } else this.disc = new o.Mesh(this.geometry.discOtherModelText, this.materials.free);
- else this.type === y.BuildingType ? this.disc = new o.Mesh(this.geometry.discBuilding, this.materials.free) : this.type === y.OtherModel ? this.disc = new o.Mesh(this.geometry.discOtherModel, this.materials.free) : this.type === y.Tag360T1 ? this.disc = new o.Mesh(this.geometry.discFrom360Tag, this.materials.free) : this.type === y.TagTo360 ? this.disc = new o.Mesh(this.geometry.discTo360Tag, this.materials.free) : this.tagPicType === M.Text ? this.disc = new o.Mesh(this.geometry.discGif, this.materials.free) : this.disc = new o.Mesh(this.geometry.disc, this.materials.free);
- 2e4 === this.i && (this.geometry.disc = new o.PlaneBufferGeometry(1e-4, 1e-4), this.disc = new o.Mesh(this.geometry.disc, this.materials.free)), this.type != y.Tag360T1 && this.disc.position.copy(this.discPosition), this.disc.renderOrder = h.mattertagDisc, this.disc.tag = this;
- var i = new o.Mesh(this.geometry.cutout, this.materials.cutout);
- if (i.renderOrder = h.mattertagCutout, this.disc.add(i), this.poleEnabled) {
- var n = this.buildPole();
- n.renderOrder = h.mattertagStem, t.add(n)
- }
- return t.add(this.disc)
- }, D.prototype.updateTagMaterial = function(t) {
- this.materials.free = this.buildDiscMaterial(this.getTexture(t)), this.disc.material = this.materials.free, this.disc.material.needUpdate = !0
- }, D.prototype.buildTextObject3D = function(t) {
- var e = Object.create(t);
- e.type = -1;
- var i = new o.Object3D;
- e.position.y += .05, i.position.copy(e.position), e.disc = new o.Mesh(e.geometry.discOtherModel, e.materials.free), e.discPosition.y += .05, e.disc.position.copy(e.discPosition), e.disc.renderOrder = h.mattertagDisc, e.disc.tag = this;
- var n = new o.Mesh(e.geometry.cutout, e.materials.cutout);
- if (n.renderOrder = h.mattertagCutout, e.disc.add(n), e.poleEnabled) {
- var r = e.buildPole();
- r.renderOrder = h.mattertagStem, i.add(r)
- }
- return i.add(e.disc)
- }, D.prototype.buildDiscMaterial = function(t, e) {
- if (this.type === y.Title) {
- var i = document.createElement("canvas");
- i.width = 1024, i.height = 256;
- var n = i.getContext("2d");
- return this.dc = i, this.ctx = n, new o.MeshBasicMaterial({
- map: new o.Texture(i),
- transparent: !0,
- opacity: 1,
- alphaTest: l.mattertags.visibility.alphaTestLevel,
- depthTest: !1
- })
- }
- if (1 == e) {
- var r = new o.SpriteMaterial({
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.disc.opacity,
- transparent: !0,
- map: t
- });
- return r.map.offset = new o.Vector2(0, 0), r.map.repeat = new o.Vector2(1 / 17, 1), r.depthTest = !1, r.blending = o.AdditiveBlending, r
- }
- return new o.MeshBasicMaterial({
- map: t,
- transparent: !0,
- opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.disc.opacity,
- alphaTest: l.mattertags.visibility.alphaTestLevel
- })
- }, D.prototype.initAnimation = function() {
- var t = this.disc.material.map.offset;
- this.cursorAnimate = new TWEEN.Tween(t)
- .to({
- x: 1
- }, 1e3)
- .onStart((function() {}))
- .onStop((function() {
- t.x = 0
- }))
- .onUpdate((function() {}))
- .onComplete((function() {
- t.x = 0, setTimeout((function() {}), 1500)
- })), this.cursorAnimate.easing((function(t) {
- return Math.floor(17 * t) / 17
- })), this.cursorAnimate.repeat(Number.POSITIVE_INFINITY), this.cursorAnimate.start()
- }, D.prototype.getTexture = function(t) {
- return c.loadurl(t)
- }, D.prototype.getText = function(t, e) {
- return e ? c.loadCanvasIn(t) : c.loadCanvas(t)
- }, D.prototype.buildPole = function() {
- return this.geom = new o.BufferGeometry, this.ar = new Float32Array(6), this.ar[0] = this.ar[1] = this.ar[2] = 0, this.ar[3] = this.discPosition.x, this.ar[4] = this.discPosition.y, this.ar[5] = this.discPosition.z, this.geom.addAttribute("position", new o.BufferAttribute(this.ar, 3)), this.line = new o.Line(this.geom, this.materials.pole), this.line
- }, D.prototype.parseLinks = function(t, e) {
- var i = /\[([^\]]*)\]\((.*?)(?:\)(?:\s|$))/,
- n = [],
- r = [],
- o = [];
- for (t = t.slice();;) {
- var a = t.match(i);
- if (!a) break;
- r.push(t.slice(0, a.index)), t = t.slice(a.index + a[0].length), -1 === a[2].indexOf("javascript:") && n.push(a)
- }
- return r.push(t), l.mls || (o = this.buildLinks(n, e)), {
- links: o,
- description: r
- }
- }, D.prototype.buildLinks = function(t, e) {
- return t.map((function(t) {
- var i = g.EXT_LINK,
- n = t[1],
- r = t[2];
- return -1 === r.indexOf("://") && (r = "https://" + r), -1 === r.indexOf("matterport.com/show") && -1 === r.indexOf(window.location.host + "/show") || (-1 !== r.indexOf(e) && -1 !== r.indexOf("start=") ? i = g.NAVIGATION : (i = g.MODEL, r += "&play=1")), {
- label: n,
- URL: r,
- type: i
- }
- }))
- }, D.prototype.buildBillboard = function() {
- var t, i;
- if (this.type === y.Audio) {
- (i = document.createElement("div"))
- .className = "c_circleProgress_wrapper", L.appendChild(i);
- var n = document.createElement("div");
- n.className = "c_wrapper c_right", i.appendChild(n);
- var r = document.createElement("div");
- r.className = "c_circleProgress c_rightcircle", n.appendChild(r);
- var o = document.createElement("div");
- o.className = "c_wrapper c_left", i.appendChild(o);
- var a = document.createElement("div");
- a.className = "c_circleProgress c_leftcircle", o.appendChild(a)
- } else {
- (i = document.createElement("div"))
- .className = "tag-container has-hotzone", L.appendChild(i), (t = document.createElement("div"))
- .className = "tag-body", i.appendChild(t);
- var s = document.createElement("p");
- s.className = "tag-label", s.textContent = this.label, e(".tag-label")
- .css("line-height", 1.5), e(".tag-label")
- .css("letter-spacing", "1px"), t.appendChild(s), this.buildContents(t), t.addEventListener("mouseover", function(t) {
- this.boardState === A && i.classList.remove("has-hotzone")
- }.bind(this)), t.addEventListener("mousedown", (function(t) {
- t.stopPropagation()
- })), t.addEventListener("mouseup", (function(t) {
- t.stopPropagation()
- })), i.addEventListener("mousedown", u("mousedown")), i.addEventListener("mouseup", u("mouseup")), i.addEventListener("mouseenter", function(t) {
- (l.mattertags.animation.hoverOnClosing || this.boardState !== P) && (this.hoveringBillboard = !0, this.emit("enter", this), this.setHoverState())
- }.bind(this)), i.addEventListener("mouseleave", function(t) {
- this.hoveringBillboard = !1, this.emit("leave", this), this.boardState !== C && this.setFreeState()
- }.bind(this))
- }
- function u(t) {
- return function(e) {
- var i, n = document.getElementById("player");
- try {
- i = new MouseEvent(t, e)
- } catch (n) {
- (i = document.createEvent("MouseEvents"))
- .initMouseEvent(t, 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)
- }
- n.dispatchEvent(i)
- }
- }
- return i
- }, D.prototype.buildContents = function(t) {
- function i(t) {
- var i = document.createElement("span");
- return i.className = "tag-desc", e(".tag-desc")
- .css("line-height", 1.6), e(i)
- .html(null != t ? t : ""), i
- }
- this.links.forEach(function(e, n) {
- var r = i(this.parsedDescription[n]);
- t.appendChild(r);
- var o = document.createElement("a");
- if (o.classList.add("tag-link"), o.setAttribute("data-linktype", e.type), o.setAttribute("data-tagID", this.i), o.href = e.URL, o.textContent = e.label + " ", e.type === g.EXT_LINK) {
- r.textContent += "→ ";
- var a = document.createElement("i");
- a.classList.add("icon-ext-link"), a.title = "Link to external web site", o.appendChild(a)
- }
- t.appendChild(o)
- }.bind(this));
- var n = i(this.parsedDescription[this.parsedDescription.length - 1]);
- t.appendChild(n)
- }, D.prototype.scrollAll = function(t) {}, D.prototype.setFreeState = function(t, e) {
- O.volume = 1, this.type === y.ImageText || this.type === y.ImageTextAudio || this.type === y.IKEA || this.type === y.Video ? this.setClosedState() : this.type === y.Audio ? e && (this.setClosedState(), this.stopAudio()) : !t && this.hoveringBillboard || (this.fadeOutTimer || (this.fadeOutTimer = p.setTimeout(function() {
- this.disc.material = this.materials.free, this.boardState !== S && (this.boardState = P, this.animateBoard())
- }.bind(this), l.mattertags.animation.animOutDelay)), p.cancel(this.fadeInTimer), this.fadeInTimer = void 0)
- }, D.prototype.startAudio = function() {
- var t = this;
- function e(t, e, i) {
- return t * (1 - i) + i * e
- }
- function i(i, n) {
- n <= .5 ? (i.firstElementChild.firstElementChild.style.webkitTransform = "rotate(" + e(-135, 45, n) + "deg)", i.lastElementChild.firstElementChild.style.webkitTransform = "rotate(-135deg)") : (i.firstElementChild.firstElementChild.style.webkitTransform = "rotate(45deg)", i.lastElementChild.firstElementChild.style.webkitTransform = "rotate(" + e(-135, 45, n) + "deg)"), G.R.longplaying ? (t.billboard.style.display = "block", t.billboard.style.visibility = "visible") : t.billboard.style.display = "none"
- }
- O.loop = this.audioControl.loop, O.src = this.audiourl, O.currentTime = 0, O.play(), this.played ? (O.oncanplay = function() {}, t.intvl = setInterval((function() {
- var e = O.currentTime / O.duration;
- i(t.billboard, e)
- }), 1e3)) : (this.played = !0, O.oncanplay = function() {
- t.intvl = setInterval((function() {
- var e = O.currentTime / O.duration;
- i(t.billboard, e)
- }), 1e3)
- }), O.onended = function() {
- O.oncanplay = function() {}, t.intvl && (clearInterval(t.intvl), t.intvl = null, t.billboard.style.display = "none")
- }
- }, D.prototype.stopAudio = function() {
- O.ended || (O.oncanplay = function() {}, this.intvl && (clearInterval(this.intvl), this.intvl = null), O.pause(), this.audioPauseTime = O.currentTime, this.billboard.style.display = "none")
- }, D.prototype.setHoverState = function(t, i) {
- var o = this;
- this.model, this.model.language;
- if (this.boardState !== C)
- if (e("#tag-detail")
- .hasClass("open") || (e("#drawer")
- .hasClass("open") ? this.highlightStatus = !0 : this.highlightStatus = !1), this.type === y.ImageText || this.type === y.ImageTextAudio || this.type === y.IKEA || this.type === y.Video) {
- if (this.audioenable && this.audiourl && (O.volume = .7, O.loop = this.imgaudioControl.loop, O.src = this.audiourl, O.currentTime = 0, O.play()), this.type === y.Video ? (R.src = this.videourl, R.oncanplay = function() {
- e("#video-tag")
- .css("display", "block"), e(".topimg")
- .css("height", "0px")
- }) : (s.isMobile() ? e(".topimg")
- .css("height", "240px") : e(".topimg")
- .css("height", "350px"), e("#video-tag")
- .css("display", "none")), e.isArray(this.data.details.imageurl)) ! function(t) {
- e(".topimg")
- .hide(), e("#slidePictures")
- .show();
- for (var i = 0; i < t.length; i++) {
- var n = r.getSize(t[i]);
- if (n.width && n.height) {
- var o = n.width / n.height;
- if (o > 1.5) var a = '<div class="swiper-slide moreImages"><img class="imageCon longimgCon" src=' + t[i] + ' alt=""></div>';
- else if (o < .8) a = '<div class="swiper-slide moreImages"><img class="imageCon highimgCon" src=' + t[i] + ' alt=""></div>';
- else a = '<div class="swiper-slide moreImages"><img class="imageCon commimgCon" src=' + t[i] + ' alt=""></div>'
- }
- e("#wrapperPic")
- .append(a)
- }
- new x("#slidePictures", {
- speed: 500,
- loop: !0,
- setWrapperSize: !0,
- observer: !0,
- observeParents: !0
- }), e(".imageCon")
- .on("click", (function(t) {
- t.stopPropagation(), t.cancelBubble = !0;
- var i = e(this)
- .attr("src"),
- n = r.getWinSize(i);
- e(".originpic")
- .css("background-image", "url(" + i + ")"), e(".picsize")
- .css({
- width: n.width,
- height: n.height
- }), e(".picsize")
- .attr("data-with", n.width), e(".picsize")
- .attr("data-height", n.height), e("#picsizeScroll")
- .css({
- left: "50%",
- top: "50%",
- transform: "translate(-50%, -50%)"
- }), e(".originpic-container")
- .fadeIn(300)
- })), e(".btn-prev3, .btn-next3")
- .delay(750)
- .fadeIn(500)
- .fadeOut(500)
- .fadeIn(500)
- .fadeOut(500)
- }(this.data.details.imageurl);
- else {
- e("#slidePictures")
- .hide(), e(".topimg")
- .show();
- var a = r.getSize(this.data.details.imageurl);
- if (a.width && a.height) {
- var u = a.width / a.height;
- u > 1.5 ? e(".imageCon")
- .removeClass("highimgCon commimgCon")
- .addClass("longimgCon") : u < .8 ? e(".imageCon")
- .removeClass("longimgCon commimgCon")
- .addClass("highimgCon") : e(".imageCon")
- .removeClass("longimgCon highimgCon")
- .addClass("commimgCon")
- }
- e(".topimg .imageCon")
- .attr("src", this.data.details.imageurl), e(".originpic")
- .css("background-image", "url(" + this.data.details.imageurl + ")");
- var h = r.getWinSize(this.data.details.imageurl);
- e(".picsize")
- .css({
- width: h.width,
- height: h.height
- }), e(".topimg")
- .on("click", (function() {
- e(".originpic-container")
- .fadeIn(300)
- })), e(".originpic-container")
- .on("click", (function() {
- e(".originpic-container")
- .fadeOut(300)
- }))
- }
- var c, d = this.data.details.isNew ? '<span style="color: red">新 </span>' : "",
- f = this.data.details.price ? '<br/><span style="font-size: 200%;color:black;">¥ ' + this.data.details.price + "</span>" : "";
- c = s.isMobile() ? "ikea" : "ikeapc", this.type === y.IKEA ? (e(".topimg")
- .addClass(c), e(".middletitle")
- .html(this.data.details.name1 ? d + this.data.details.name1 : ""), e(".middlecontent")
- .html(this.data.details.name2 ? this.data.details.name2 + f : "" + f)) : (e(".topimg")
- .removeClass(c), e(".middletitle")
- .html(this.label ? d + this.label : ""), e(".middlecontent")
- .html(this.data.details.description ? this.data.details.description : "")), void 0 !== this.tagInfoUrl && "" !== this.tagInfoUrl ? (e(".bottomlink")
- .css("display", "block"), n = this.tagInfoUrl, e(".bl-text")
- .on("click", (function(t) {
- window.open(n)
- }))) : e(".bottomlink")
- .css("display", "none"), s.isMobile() && (e(window)
- .width() <= 375 || e(window)
- .height() <= 418) ? e(".middletext")
- .css({
- height: "88px",
- "margin-bottom": "30px",
- "overflow-y": "auto"
- }) : e(".middletext")
- .css({
- height: "110px",
- "margin-bottom": "34px",
- "overflow-y": "auto"
- }), this.label || this.data.details.description || this.tagInfoUrl || e(".middletext")
- .css({
- height: "0px",
- "margin-bottom": "0",
- "overflow-y": "hidden"
- }), e(".pctagcontainer")
- .fadeIn(300), e(".middletext")
- .scrollTop(0)
- } else if (this.type === y.Audio) {
- o = this;
- O.addEventListener("ended", (function() {
- "loop" !== O.loop && (o.setFreeState(!0, !0), O.currentTime = 0)
- })), 0 == i ? (1 === !this.subtype && (this.disc.material = this.materials.hover), this.startAudio()) : 1 == i && (1 === !this.subtype && (this.disc.material = this.materials.hover), O.loop = this.audioControl.loop, O.src = this.audiourl, O.currentTime = O.ended ? 0 : this.audioPauseTime, O.play())
- } else if (8 === this.type) this.hoveringBillboard || this.billboard.classList.add("has-hotzone"), this.fadeInTimer && t && this.setActiveState(), p.cancel(this.fadeOutTimer), this.fadeOutTimer = void 0;
- else if (this.type === y.OtherModel) 0 === i && this.tagInfoUrl && window.open(this.tagInfoUrl);
- else if (this.type === y.Video) {
- window.document.getElementById("audio-bar")
- .pause(), e(".pwVideo")
- .fadeIn(300, (function() {
- document.getElementById("iframe-video")
- .clientHeight;
- s.isMobile() ? e(".video-play")
- .hide() : e(".video-play")
- .fadeIn(200)
- }))
- .css("display", "flex"), e(".help_back")
- .fadeIn(500)
- } else(this.type === y.TextOnly || this.type === y.TextAudio) && this.audioenable && this.audiourl && 0 === i && (O.volume = .7, I.loop = "", I.src = this.audiourl, I.currentTime = 0, I.play()), e(".tag-body")
- .scrollTop(0), this.hoveringBillboard || this.billboard.classList.add("has-hotzone"), this.fadeInTimer ? t && this.setActiveState() : this.type === y.TextOnly && (this.fadeInTimer = p.setTimeout(function() {
- 1 === !this.subtype && (this.disc.material = this.materials.hover), this.boardState !== A && (this.boardState = _, this.animateBoard(function() {
- t && this.setActiveState()
- }.bind(this)))
- }.bind(this), l.mattertags.animation.animInDelay)), p.cancel(this.fadeOutTimer), this.fadeOutTimer = void 0
- }, D.prototype.setClosedState = function() {
- this.disc.material = this.materials.free, this.emit("tag.closed"), this.boardState = S, this.billboard.style.visibility = "hidden", this.billboard.classList.contains("has-hotzone") || this.billboard.classList.add("has-hotzone"), this.type === y.Video && (e("#video-tag")[0].pause(), e("#video-tag")[0].currentTime = 0), this.type === y.ImageTextAudio && O.pause()
- }, D.prototype.setActiveState = function() {
- this.type !== y.OtherModel && this.type !== y.IFrame && this.type !== y.Audio && (this.boardState = C, this.billboard.classList.remove("has-hotzone"))
- }, D.prototype.hide = function(t, i) {
- this.disc.visible = !1;
- var n = e.Deferred();
- if (0 === this.materials.free.opacity && !p.isRunning(this.visibleTransition)) return n.resolve()
- .promise();
- t = t || 0, i = i || 0, p.cancel(this.visibleTransition), this.type === y.Audio && (this.billboard.style.display = "none");
- var r = this.materials.free.opacity / l.mattertags.disc.opacity,
- o = i + t,
- a = i / o;
- return this.visibleTransition = p.start(function(t) {
- f.property(this.materials.free, "opacity", 0)(t), f.property(this.materials.hover, "opacity", 0)(t), f.property(this.materials.pole, "opacity", 0)(t)
- }.bind(this), o * r, (function() {
- n.resolve()
- }), a, m[l.warp.blendEasing]), n.promise()
- }, D.prototype.show = function(t, i) {
- this.disc.visible = !0;
- var n = e.Deferred();
- if (this.materials.free.opacity === l.mattertags.disc.opacity && !p.isRunning(this.visibleTransition)) return n.resolve()
- .promise();
- t = t || 0, i = i || 0, p.cancel(this.visibleTransition);
- var r = (l.mattertags.disc.opacity - this.materials.free.opacity) / l.mattertags.disc.opacity,
- o = i + t,
- a = i / o;
- return this.type === y.Audio && this.intvl && (this.billboard.style.display = "block", this.billboard.style.visibility = "visible"), this.visibleTransition = p.start(function(t) {
- f.property(this.materials.free, "opacity", l.mattertags.disc.opacity)(t), f.property(this.materials.hover, "opacity", l.mattertags.disc.opacity)(t), f.property(this.materials.pole, "opacity", l.mattertags.pole.opacity)(t)
- }.bind(this), o * r, (function() {
- n.resolve()
- }), a, m[l.warp.blendEasing]), n.promise()
- }, D.prototype.closestPanoTowardTag = function(t, e) {
- var i = [],
- n = [],
- r = this.disc.getWorldPosition(new o.Vector3);
- if (t === u.PANORAMA) {
- var a = e.position.clone()
- .sub(r)
- .normalize();
- i.push(d.filters.isPanoAligned()), i.push(d.filters.inPanoDirection(r, a, .5)), i.push(d.filters.isNeighbourPanoTo(e)), n.push(d.scoreFunctions.direction(r, a))
- }
- var s = new o.Vector3;
- i.push((function(t) {
- return Math.abs(t.position.x - r.x) > l.mattertags.visibility.cameraClearance || Math.abs(t.position.z - r.z) > l.mattertags.visibility.cameraClearance
- }), (function(t) {
- s.copy(r)
- .sub(t.position);
- var e = -o.Math.radToDeg(Math.atan(s.y / Math.sqrt(s.x * s.x + s.z * s.z))),
- i = l.mattertags.navigate.tiltTolerance;
- return l.insideLookLimitDown - i < e && e < l.insideLookLimitUp + i
- })), n.push(d.scoreFunctions.distanceSquared(this, -2));
- var h = this.model.panos.sortByScore(i, n);
- if (l.mattertags.navigate.lineOfSight) {
- for (var c = 0; c < h.length; c++) {
- var p = h[c].pano,
- f = p.position.distanceTo(r);
- if (!l.mattertags.visibility.anyDistance && f > l.mattertags.visibility.visibleDistance) return null;
- D.raycaster.set(p.position, r.clone()
- .sub(p.position)
- .normalize());
- var m = D.raycaster.intersectObjects(this.model.colliders);
- if (0 === m.length || m[0].distance > f) return p
- }
- return null
- }
- return h.length > 0 ? h[0].pano : null
- }, D.prototype.examineMattertag = function(t, e) {
- var i, n, r, a = t.mode;
- if (l.mattertags.navigate.nearestPano && 1 !== this.subtype && (i = this.closestPanoTowardTag(a, t.currentPano)), i || (i = t.currentPano), n = "disc" === l.mattertags.navigate.aimAt ? this.disc.getWorldPosition(new o.Vector3) : "object" === l.mattertags.navigate.aimAt ? this.obj3d.getWorldPosition(new o.Vector3) : "nothing" === l.mattertags.navigate.aimAt ? null : this.obj3d.getWorldPosition(new o.Vector3)
- .add(this.discPosition.clone()
- .multiplyScalar(.5)), r = l.mattertags.navigate.reactivate ? function() {
- e(this), this.setActiveState()
- }.bind(this) : null, a === u.PANORAMA) t.flyToPano({
- pano: i,
- lookAtPoint: n,
- duration: null,
- maxDistanceOverride: null,
- skipWarpingCheck: !1
- }, r);
- else {
- var s = {
- pano: i
- };
- if (n) {
- var h = (new o.Matrix4)
- .lookAt(i.position, n, new o.Vector3(0, 1, 0));
- s.quaternion = (new o.Quaternion)
- .setFromRotationMatrix(h)
- }
- l.mattertags.navigate.reactivate && (s.callback = r), s.duration = 1500, s.mode = u.PANORAMA, t.flyToNewMode(s)
- }
- }, D.prototype.update = function(t, e, i, n, r) {
- var o = this.model;
- if (this.type !== y.Title) {
- if (this.i >= 1e4 && this.disc && this.disc.position && e && e.position) {
- var a = this.basepos.distanceTo(e.position);
- if (G && G.P) {
- var s = Math.max(a * G.P.a - G.P.b, G.P.c);
- this.disc.position.y = this.discpos2.y - s
- }
- }
- this.type === y.BuildingType ? t === u.DOLLHOUSE ? this.enabled = !0 : (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n)) : this.type === y.RegionalJump ? t === u.PANORAMA ? this.enabled = !0 : (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n)) : this.type === y.Tag360T1 || 1 === this.subtype ? t !== u.PANORAMA ? (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n)) : i && (this.obj3d.position.copy(i.position.clone()
- .add(this.position)), !this.i >= 1e4 && this.disc.position.copy(this.discPosition), this.locationId == r ? this.enabled = !0 : (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n))) : (G.settings.nesttags.setting.show_in_3d || (t !== u.PANORAMA ? this.materials.free.opacity = 0 : this.materials.free.opacity = l.mattertags.disc.opacity), l.mattertags.enablePanoSize && (this.enabled = !0)), l.mattertags.enablePanoSize || (this.materials.free.opacity = 0, this.enabled = !1), this.enabled && (this.updateDisc(t, e, i, n, o), this.boardState === S && this.type !== y.Audio || this.updateBillboard(e))
- }
- }, D.prototype.updateDisc = function(t, e, i, n, r) {
- if (G.conf.isNewEditVersion && ("-1" == this.tagid || "-2" == this.tagid))
- if (this.rt360) {
- var a = this.player.getMouseDirection(),
- s = Math.sqrt(4 / (a.x * a.x + a.y * a.y + a.z * a.z));
- a.multiplyScalar(s), this.obj3d.position.copy(i.position.clone()
- .add(a)), this.disc.position.copy(this.discPosition)
- } else {
- var h = this.player.intersect;
- if (null != h) {
- (s = {})
- .point = h.point.clone(), s.normal = h.normal.clone();
- var c = s.normal.clone()
- .multiplyScalar(.1);
- this.obj3d.position.copy(s.point), this.disc.position.copy(c), null != this.ar && (this.ar[3] = c.x, this.ar[4] = c.y, this.ar[5] = c.z, this.geom.addAttribute("position", new o.BufferAttribute(this.ar, 3)))
- }
- } var d, p = G.settings.nesttags.setting,
- f = l.mattertags.visibility,
- m = l.mattertags.disc.scale,
- g = this.disc.getWorldPosition(new o.Vector3);
- if (t === u.PANORAMA ? (d = e.position.distanceTo(g), this.type !== y.RegionalJump && (1 != this.subtype && this.type != y.Tag360T1 && this.type !== y.Title ? p.autohide && (d > p.autohide_length ? this.materials.free.opacity = 0 : this.materials.free.opacity = l.mattertags.disc.opacity) : this.type === y.Title || (this.materials.free.opacity = l.mattertags.disc.opacity))) : d = f.visibleDistance, this.obj3d.visible = 0 !== this.disc.material.opacity && (f.anyDistance || d <= f.visibleDistance || t === u.TRANSITIONING) && (!f.hideViaFloor || this.tagVisibleOnCurrentFloor(t)) && (!f.hideOffScreenDisc || !this.offScreen(this.disc, e)) && (!f.hideOffScreenObject || !this.offScreen(this.obj3d, e)), this.obj3d.visible) {
- this.disc.quaternion.copy(e.quaternion);
- var v = m.maxSize - (m.maxSize - m.minSize) * o.Math.smoothstep(d, m.nearBound, m.farBound),
- b = g.clone()
- .project(e),
- w = new o.Vector3((window.renderWidth || window.innerWidth) / 2, (window.renderHeight || window.innerHeight) / 2, 1)
- .multiply(b),
- x = new o.Vector3(v / 2, 0, 0)
- .add(w),
- M = (s = new o.Vector3(2 / (window.renderWidth || window.innerWidth), 2 / (window.renderHeight || window.innerHeight), 1)
- .multiply(x))
- .clone()
- .unproject(e)
- .clone()
- .distanceTo(g),
- T = 1 + m.responsiveness / 100 * (D.viewportScale(this.type) - 1);
- this.discScale = M * T, this.disc.scale.set(this.discScale, this.discScale, this.discScale), this.type === y.RegionalJump && this.obj3d.visible
- }
- }, D.prototype.hideDisc = function(t, e, i, n) {
- this.obj3d.visible = !1, this.billboard.style.display = "none"
- }, D.prototype.tagVisibleOnCurrentFloor = function(t) {
- if (this.clock && this.gifObject) {
- var e = this.clock.getDelta();
- this.gifObject.update(1e3 * e)
- }
- return t !== u.DOLLHOUSE && t !== u.FLOORPLAN || this.model.allFloorsVisible || !this.floor.hidden
- }, D.prototype.offScreen = function(t, e) {
- var i = t.getWorldPosition(new o.Vector3)
- .project(e);
- return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
- }, D.viewportScale = function(t) {
- return D.viewportWidth === (window.renderWidth || window.innerWidth) && D.viewportHeight === (window.renderHeight || window.innerHeight) || (D.viewportWidth = (window.renderWidth || window.innerWidth), D.viewportHeight = (window.renderHeight || window.innerHeight)), t === y.BuildingType ? (D.currentViewportScaleBuilding = Math.sqrt(Math.min(D.viewportWidth, D.viewportHeight) / l.mattertags.disc.scale.buildingViewportSize), D.currentViewportScaleBuilding) : (D.currentViewportScaleCommon = Math.sqrt(Math.min(D.viewportWidth, D.viewportHeight) / l.mattertags.disc.scale.baseViewportSize), D.currentViewportScaleCommon)
- }, D.prototype.newBillboardOrientation = function(t) {
- if (this.boardOrientation && this.boardState !== _) return this.boardOrientation;
- var e = 1 / 3,
- i = t.y < -e ? 0 : t.y < e ? 1 : 2,
- n = t.x < -e ? 0 : t.x < e ? 1 : 2,
- r = "";
- return r += 0 === n ? "right" : 2 === n ? "left" : "", r += 0 === i ? "-down" : 2 === i ? "-up" : "", 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "", 1 === i && (r = (window.renderWidth || window.innerWidth) > (window.renderHeight || window.innerHeight) ? t.x < 0 ? "right" : "left" : t.y < 0 ? "bottom" : "top")), r
- }, D.prototype.regionalJumpOrientation = function(t) {
- var e = this.disc.getWorldPosition(new o.Vector3)
- .clone()
- .project(t);
- return e.x < -.5 ? "Left" : e.x < .5 ? "Center" : "Right"
- }, D.prototype.updateBillboard = function(t) {
- var e = this.disc.getWorldPosition(new o.Vector3),
- i = e.clone()
- .project(t);
- if (i.y *= -1, this.type !== y.Audio) {
- var n = this.newBillboardOrientation(i);
- if (n !== this.boardOrientation) {
- this.billboard.style.transform = this.billboard.style.webkitTransform = "", this.billboard.classList.remove("tag-container-" + this.boardOrientation), this.billboard.classList.add("tag-container-" + n);
- var r = window.getComputedStyle(this.billboard);
- this.billboard.initialTransform = r.transform || r.webkitTransform, "none" === this.billboard.initialTransform && (this.billboard.initialTransform = "");
- var a = window.getComputedStyle(this.billboard)
- .transform.slice(7, -1)
- .split(","),
- s = -a[4],
- u = -a[5];
- this.billboard.style.webkitTransformOrigin = s + "px " + u + "px", this.billboard.style.transformOrigin = s + "px " + u + "px", this.boardOrientation = n
- }
- }
- var h = new o.Vector3(-this.discScale / 2, 0, 0)
- .applyQuaternion(t.quaternion)
- .add(e)
- .project(t),
- c = Math.abs(i.x - h.x) * (window.renderWidth || window.innerWidth),
- d = Math.sqrt(c / 40) * l.mattertags.boardScale.boardToDiscRatio,
- p = (i.x + 1) * (window.renderWidth || window.innerWidth) / 2,
- f = (i.y + 1) * (window.renderHeight || window.innerHeight) / 2;
- this.type === y.IFrame || this.type === y.ImageTextAudio ? (this.billboard.screenTransform = this.billboard.initialTransform + " translate(" + p + "px, " + f + "px) scale(0)", this.billboard.style.visibility = "hidden") : this.type === y.Audio ? (this.billboard.screenTransform = " translate(" + p + "px, " + f + "px) scale(" + 1 * d + ")", this.billboard.style.webkitTransform = this.billboard.screenTransform, this.billboard.style.transform = this.billboard.screenTransform) : (this.billboard.screenTransform = this.billboard.initialTransform + " translate(" + p + "px, " + f + "px) scale(" + d * this.animationScale + ")", this.billboard.style.webkitTransform = this.billboard.screenTransform, this.billboard.style.transform = this.billboard.screenTransform)
- }, D.prototype.animateBoard = function(t, i) {
- this.boardState === _ ? (e(".tag-container")
- .show(), p.cancel(this.boardTransition), s.detectSamsungNative() ? (this.boardOrientation = null, this.billboard.style.visibility = "visible", this.emit("tag.opened"), this.boardState = A, t && t()) : (this.billboard.style.webkitTransform = "scale(0)", this.billboard.style.transform = "scale(0)", this.billboard.style.visibility = "visible", this.boardTransition = p.start(f.property(this, "animationScale", 1), l.mattertags.animation.animInTime, function() {
- this.emit("tag.opened"), this.boardState = A, t && t()
- }.bind(this)))) : this.boardState === P && (p.cancel(this.boardTransition), this.boardTransition = p.start(f.property(this, "animationScale", 0), l.mattertags.animation.animOutTime, function() {
- this.emit("tag.closed"), this.boardState = S, this.billboard.style.visibility = "hidden", this.billboard.classList.contains("has-hotzone") || this.billboard.classList.add("has-hotzone"), i && i()
- }.bind(this)))
- }, t.exports = D
- })
- .call(this, i(6))
- }, function(t, e) {
- t.exports = {
- getSize: function(t) {
- var e = 0,
- i = 0;
- if (null != t) {
- var n = t.substring(t.lastIndexOf("_") + 1, t.lastIndexOf("."));
- if (null != n) {
- var r = n.split("x");
- null != r && r.length > 1 && (e = parseInt(r[0], 0), i = parseInt(r[1], 0))
- }
- }
- return {
- width: e,
- height: i
- }
- },
- getWinSize: function(t) {
- var e = this.getSize(t);
- if (!e.width || !e.height || e.width <= (window.renderWidth || window.innerWidth) && e.height <= (window.renderHeight || window.innerHeight)) return e;
- var i = e.width / e.height;
- return i >= (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight) ? (e.width = (window.renderWidth || window.innerWidth), e.height = e.width / i) : (e.height = (window.renderHeight || window.innerHeight), e.width = e.height * i), e
- }
- }
- }, function(t, e) {
- t.exports = {
- NAVIGATION: "navigation",
- MODEL: "model",
- EXT_LINK: "ext-link"
- }
- }, function(t, e, i) {
- (function(e) {
- (function() {
- "use strict";
- var i, n, r, o = function(t, n) {
- if (!(this instanceof o)) return new o(t, n);
- var r = {
- direction: "horizontal",
- touchEventsTarget: "container",
- initialSlide: 0,
- speed: 300,
- autoplay: !1,
- autoplayDisableOnInteraction: !0,
- autoplayStopOnLast: !1,
- iOSEdgeSwipeDetection: !1,
- iOSEdgeSwipeThreshold: 20,
- freeMode: !1,
- freeModeMomentum: !0,
- freeModeMomentumRatio: 1,
- freeModeMomentumBounce: !0,
- freeModeMomentumBounceRatio: 1,
- freeModeMomentumVelocityRatio: 1,
- freeModeSticky: !1,
- freeModeMinimumVelocity: .02,
- autoHeight: !1,
- setWrapperSize: !1,
- virtualTranslate: !1,
- effect: "slide",
- coverflow: {
- rotate: 50,
- stretch: 0,
- depth: 100,
- modifier: 1,
- slideShadows: !0
- },
- flip: {
- slideShadows: !0,
- limitRotation: !0
- },
- cube: {
- slideShadows: !0,
- shadow: !0,
- shadowOffset: 20,
- shadowScale: .94
- },
- fade: {
- crossFade: !1
- },
- parallax: !1,
- zoom: !1,
- zoomMax: 3,
- zoomMin: 1,
- zoomToggle: !0,
- scrollbar: null,
- scrollbarHide: !0,
- scrollbarDraggable: !1,
- scrollbarSnapOnRelease: !1,
- keyboardControl: !1,
- mousewheelControl: !1,
- mousewheelReleaseOnEdges: !1,
- mousewheelInvert: !1,
- mousewheelForceToAxis: !1,
- mousewheelSensitivity: 1,
- mousewheelEventsTarged: "container",
- hashnav: !1,
- hashnavWatchState: !1,
- history: !1,
- replaceState: !1,
- breakpoints: void 0,
- spaceBetween: 0,
- slidesPerView: 1,
- slidesPerColumn: 1,
- slidesPerColumnFill: "column",
- slidesPerGroup: 1,
- centeredSlides: !1,
- slidesOffsetBefore: 0,
- slidesOffsetAfter: 0,
- roundLengths: !1,
- touchRatio: 1,
- touchAngle: 45,
- simulateTouch: !0,
- shortSwipes: !0,
- longSwipes: !0,
- longSwipesRatio: .5,
- longSwipesMs: 300,
- followFinger: !0,
- onlyExternal: !1,
- threshold: 0,
- touchMoveStopPropagation: !0,
- touchReleaseOnEdges: !1,
- uniqueNavElements: !0,
- pagination: null,
- paginationElement: "span",
- paginationClickable: !1,
- paginationHide: !1,
- paginationBulletRender: null,
- paginationProgressRender: null,
- paginationFractionRender: null,
- paginationCustomRender: null,
- paginationType: "bullets",
- resistance: !0,
- resistanceRatio: .85,
- nextButton: null,
- prevButton: null,
- watchSlidesProgress: !1,
- watchSlidesVisibility: !1,
- grabCursor: !1,
- preventClicks: !0,
- preventClicksPropagation: !0,
- slideToClickedSlide: !1,
- lazyLoading: !1,
- lazyLoadingInPrevNext: !1,
- lazyLoadingInPrevNextAmount: 1,
- lazyLoadingOnTransitionStart: !1,
- preloadImages: !0,
- updateOnImagesReady: !0,
- loop: !1,
- loopAdditionalSlides: 0,
- loopedSlides: null,
- control: void 0,
- controlInverse: !1,
- controlBy: "slide",
- normalizeSlideIndex: !0,
- allowSwipeToPrev: !0,
- allowSwipeToNext: !0,
- swipeHandler: null,
- noSwiping: !0,
- noSwipingClass: "swiper-no-swiping",
- passiveListeners: !0,
- containerModifierClass: "swiper-container-",
- slideClass: "swiper-slide",
- slideActiveClass: "swiper-slide-active",
- slideDuplicateActiveClass: "swiper-slide-duplicate-active",
- slideVisibleClass: "swiper-slide-visible",
- slideDuplicateClass: "swiper-slide-duplicate",
- slideNextClass: "swiper-slide-next",
- slideDuplicateNextClass: "swiper-slide-duplicate-next",
- slidePrevClass: "swiper-slide-prev",
- slideDuplicatePrevClass: "swiper-slide-duplicate-prev",
- wrapperClass: "swiper-wrapper",
- bulletClass: "swiper-pagination-bullet",
- bulletActiveClass: "swiper-pagination-bullet-active",
- buttonDisabledClass: "swiper-button-disabled",
- paginationCurrentClass: "swiper-pagination-current",
- paginationTotalClass: "swiper-pagination-total",
- paginationHiddenClass: "swiper-pagination-hidden",
- paginationProgressbarClass: "swiper-pagination-progressbar",
- paginationClickableClass: "swiper-pagination-clickable",
- paginationModifierClass: "swiper-pagination-",
- lazyLoadingClass: "swiper-lazy",
- lazyStatusLoadingClass: "swiper-lazy-loading",
- lazyStatusLoadedClass: "swiper-lazy-loaded",
- lazyPreloaderClass: "swiper-lazy-preloader",
- notificationClass: "swiper-notification",
- preloaderClass: "preloader",
- zoomContainerClass: "swiper-zoom-container",
- observer: !1,
- observeParents: !1,
- a11y: !1,
- prevSlideMessage: "Previous slide",
- nextSlideMessage: "Next slide",
- firstSlideMessage: "This is the first slide",
- lastSlideMessage: "This is the last slide",
- paginationBulletMessage: "Go to slide {{index}}",
- runCallbacksOnInit: !0
- },
- a = n && n.virtualTranslate;
- n = n || {};
- var l = {};
- for (var u in n)
- if ("object" != typeof n[u] || null === n[u] || (n[u].nodeType || n[u] === window || n[u] === document || void 0 !== s && n[u] instanceof s || void 0 !== e && n[u] instanceof e)) l[u] = n[u];
- else
- for (var h in l[u] = {}, n[u]) l[u][h] = n[u][h];
- for (var c in r)
- if (void 0 === n[c]) n[c] = r[c];
- else if ("object" == typeof n[c])
- for (var d in r[c]) void 0 === n[c][d] && (n[c][d] = r[c][d]);
- var p = this;
- if (p.params = n, p.originalParams = l, p.classNames = [], void 0 !== i && void 0 !== s && (i = s), (void 0 !== i || (i = void 0 === s ? window.Dom7 || window.Zepto || window.jQuery : s)) && (p.$ = i, p.currentBreakpoint = void 0, p.getActiveBreakpoint = function() {
- if (!p.params.breakpoints) return !1;
- var t, e = !1,
- i = [];
- for (t in p.params.breakpoints) p.params.breakpoints.hasOwnProperty(t) && i.push(t);
- i.sort((function(t, e) {
- return parseInt(t, 10) > parseInt(e, 10)
- }));
- for (var n = 0; n < i.length; n++)(t = i[n]) >= (window.renderWidth || window.innerWidth) && !e && (e = t);
- return e || "max"
- }, p.setBreakpoint = function() {
- var t = p.getActiveBreakpoint();
- if (t && p.currentBreakpoint !== t) {
- var e = t in p.params.breakpoints ? p.params.breakpoints[t] : p.originalParams,
- i = p.params.loop && e.slidesPerView !== p.params.slidesPerView;
- for (var n in e) p.params[n] = e[n];
- p.currentBreakpoint = t, i && p.destroyLoop && p.reLoop(!0)
- }
- }, p.params.breakpoints && p.setBreakpoint(), p.container = i(t), 0 !== p.container.length)) {
- if (p.container.length > 1) {
- var f = [];
- return p.container.each((function() {
- f.push(new o(this, n))
- })), f
- }
- p.container[0].swiper = p, p.container.data("swiper", p), p.classNames.push(p.params.containerModifierClass + p.params.direction), p.params.freeMode && p.classNames.push(p.params.containerModifierClass + "free-mode"), p.support.flexbox || (p.classNames.push(p.params.containerModifierClass + "no-flexbox"), p.params.slidesPerColumn = 1), p.params.autoHeight && p.classNames.push(p.params.containerModifierClass + "autoheight"), (p.params.parallax || p.params.watchSlidesVisibility) && (p.params.watchSlidesProgress = !0), p.params.touchReleaseOnEdges && (p.params.resistanceRatio = 0), ["cube", "coverflow", "flip"].indexOf(p.params.effect) >= 0 && (p.support.transforms3d ? (p.params.watchSlidesProgress = !0, p.classNames.push(p.params.containerModifierClass + "3d")) : p.params.effect = "slide"), "slide" !== p.params.effect && p.classNames.push(p.params.containerModifierClass + p.params.effect), "cube" === p.params.effect && (p.params.resistanceRatio = 0, p.params.slidesPerView = 1, p.params.slidesPerColumn = 1, p.params.slidesPerGroup = 1, p.params.centeredSlides = !1, p.params.spaceBetween = 0, p.params.virtualTranslate = !0), "fade" !== p.params.effect && "flip" !== p.params.effect || (p.params.slidesPerView = 1, p.params.slidesPerColumn = 1, p.params.slidesPerGroup = 1, p.params.watchSlidesProgress = !0, p.params.spaceBetween = 0, void 0 === a && (p.params.virtualTranslate = !0)), p.params.grabCursor && p.support.touch && (p.params.grabCursor = !1), p.wrapper = p.container.children("." + p.params.wrapperClass), p.params.pagination && (p.paginationContainer = i(p.params.pagination), p.params.uniqueNavElements && "string" == typeof p.params.pagination && p.paginationContainer.length > 1 && 1 === p.container.find(p.params.pagination)
- .length && (p.paginationContainer = p.container.find(p.params.pagination)), "bullets" === p.params.paginationType && p.params.paginationClickable ? p.paginationContainer.addClass(p.params.paginationModifierClass + "clickable") : p.params.paginationClickable = !1, p.paginationContainer.addClass(p.params.paginationModifierClass + p.params.paginationType)), (p.params.nextButton || p.params.prevButton) && (p.params.nextButton && (p.nextButton = i(p.params.nextButton), p.params.uniqueNavElements && "string" == typeof p.params.nextButton && p.nextButton.length > 1 && 1 === p.container.find(p.params.nextButton)
- .length && (p.nextButton = p.container.find(p.params.nextButton))), p.params.prevButton && (p.prevButton = i(p.params.prevButton), p.params.uniqueNavElements && "string" == typeof p.params.prevButton && p.prevButton.length > 1 && 1 === p.container.find(p.params.prevButton)
- .length && (p.prevButton = p.container.find(p.params.prevButton)))), p.isHorizontal = function() {
- return "horizontal" === p.params.direction
- }, p.rtl = p.isHorizontal() && ("rtl" === p.container[0].dir.toLowerCase() || "rtl" === p.container.css("direction")), p.rtl && p.classNames.push(p.params.containerModifierClass + "rtl"), p.rtl && (p.wrongRTL = "-webkit-box" === p.wrapper.css("display")), p.params.slidesPerColumn > 1 && p.classNames.push(p.params.containerModifierClass + "multirow"), p.device.android && p.classNames.push(p.params.containerModifierClass + "android"), p.container.addClass(p.classNames.join(" ")), p.translate = 0, p.progress = 0, p.velocity = 0, p.lockSwipeToNext = function() {
- p.params.allowSwipeToNext = !1, !1 === p.params.allowSwipeToPrev && p.params.grabCursor && p.unsetGrabCursor()
- }, p.lockSwipeToPrev = function() {
- p.params.allowSwipeToPrev = !1, !1 === p.params.allowSwipeToNext && p.params.grabCursor && p.unsetGrabCursor()
- }, p.lockSwipes = function() {
- p.params.allowSwipeToNext = p.params.allowSwipeToPrev = !1, p.params.grabCursor && p.unsetGrabCursor()
- }, p.unlockSwipeToNext = function() {
- p.params.allowSwipeToNext = !0, !0 === p.params.allowSwipeToPrev && p.params.grabCursor && p.setGrabCursor()
- }, p.unlockSwipeToPrev = function() {
- p.params.allowSwipeToPrev = !0, !0 === p.params.allowSwipeToNext && p.params.grabCursor && p.setGrabCursor()
- }, p.unlockSwipes = function() {
- p.params.allowSwipeToNext = p.params.allowSwipeToPrev = !0, p.params.grabCursor && p.setGrabCursor()
- }, p.setGrabCursor = function(t) {
- p.container[0].style.cursor = "move", p.container[0].style.cursor = t ? "-webkit-grabbing" : "-webkit-grab", p.container[0].style.cursor = t ? "-moz-grabbin" : "-moz-grab", p.container[0].style.cursor = t ? "grabbing" : "grab"
- }, p.unsetGrabCursor = function() {
- p.container[0].style.cursor = ""
- }, p.params.grabCursor && p.setGrabCursor(), p.imagesToLoad = [], p.imagesLoaded = 0, p.loadImage = function(t, e, i, n, r, o) {
- var a;
- function s() {
- o && o()
- }
- t.complete && r ? s() : e ? ((a = new window.Image)
- .onload = s, a.onerror = s, n && (a.sizes = n), i && (a.srcset = i), e && (a.src = e)) : s()
- }, p.preloadImages = function() {
- function t() {
- null != p && p && (void 0 !== p.imagesLoaded && p.imagesLoaded++, p.imagesLoaded === p.imagesToLoad.length && (p.params.updateOnImagesReady && p.update(), p.emit("onImagesReady", p)))
- }
- p.imagesToLoad = p.container.find("img");
- for (var e = 0; e < p.imagesToLoad.length; e++) p.loadImage(p.imagesToLoad[e], p.imagesToLoad[e].currentSrc || p.imagesToLoad[e].getAttribute("src"), p.imagesToLoad[e].srcset || p.imagesToLoad[e].getAttribute("srcset"), p.imagesToLoad[e].sizes || p.imagesToLoad[e].getAttribute("sizes"), !0, t)
- }, p.autoplayTimeoutId = void 0, p.autoplaying = !1, p.autoplayPaused = !1, p.startAutoplay = function() {
- return void 0 === p.autoplayTimeoutId && (!!p.params.autoplay && (!p.autoplaying && (p.autoplaying = !0, p.emit("onAutoplayStart", p), void I())))
- }, p.stopAutoplay = function(t) {
- p.autoplayTimeoutId && (p.autoplayTimeoutId && clearTimeout(p.autoplayTimeoutId), p.autoplaying = !1, p.autoplayTimeoutId = void 0, p.emit("onAutoplayStop", p))
- }, p.pauseAutoplay = function(t) {
- p.autoplayPaused || (p.autoplayTimeoutId && clearTimeout(p.autoplayTimeoutId), p.autoplayPaused = !0, 0 === t ? (p.autoplayPaused = !1, I()) : p.wrapper.transitionEnd((function() {
- p && (p.autoplayPaused = !1, p.autoplaying ? I() : p.stopAutoplay())
- })))
- }, p.minTranslate = function() {
- return -p.snapGrid[0]
- }, p.maxTranslate = function() {
- return -p.snapGrid[p.snapGrid.length - 1]
- }, p.updateAutoHeight = function() {
- var t, e = [],
- i = 0;
- if ("auto" !== p.params.slidesPerView && p.params.slidesPerView > 1)
- for (t = 0; t < Math.ceil(p.params.slidesPerView); t++) {
- var n = p.activeIndex + t;
- if (n > p.slides.length) break;
- e.push(p.slides.eq(n)[0])
- } else e.push(p.slides.eq(p.activeIndex)[0]);
- for (t = 0; t < e.length; t++)
- if (void 0 !== e[t]) {
- var r = e[t].offsetHeight;
- i = r > i ? r : i
- } i && p.wrapper.css("height", i + "px")
- }, p.updateContainerSize = function() {
- var t, e;
- t = void 0 !== p.params.width ? p.params.width : p.container[0].clientWidth, e = void 0 !== p.params.height ? p.params.height : p.container[0].clientHeight, 0 === t && p.isHorizontal() || 0 === e && !p.isHorizontal() || (t = t - parseInt(p.container.css("padding-left"), 10) - parseInt(p.container.css("padding-right"), 10), e = e - parseInt(p.container.css("padding-top"), 10) - parseInt(p.container.css("padding-bottom"), 10), p.width = t, p.height = e, p.size = p.isHorizontal() ? p.width : p.height)
- }, p.updateSlidesSize = function() {
- p.slides = p.wrapper.children("." + p.params.slideClass), p.snapGrid = [], p.slidesGrid = [], p.slidesSizesGrid = [];
- var t, e = p.params.spaceBetween,
- i = -p.params.slidesOffsetBefore,
- n = 0,
- r = 0;
- if (void 0 !== p.size) {
- var o, a;
- "string" == typeof e && e.indexOf("%") >= 0 && (e = parseFloat(e.replace("%", "")) / 100 * p.size), p.virtualSize = -e, p.rtl ? p.slides.css({
- marginLeft: "",
- marginTop: ""
- }) : p.slides.css({
- marginRight: "",
- marginBottom: ""
- }), p.params.slidesPerColumn > 1 && (o = Math.floor(p.slides.length / p.params.slidesPerColumn) === p.slides.length / p.params.slidesPerColumn ? p.slides.length : Math.ceil(p.slides.length / p.params.slidesPerColumn) * p.params.slidesPerColumn, "auto" !== p.params.slidesPerView && "row" === p.params.slidesPerColumnFill && (o = Math.max(o, p.params.slidesPerView * p.params.slidesPerColumn)));
- var s, l = p.params.slidesPerColumn,
- u = o / l,
- h = u - (p.params.slidesPerColumn * u - p.slides.length);
- for (t = 0; t < p.slides.length; t++) {
- a = 0;
- var c, d, f, m = p.slides.eq(t);
- if (p.params.slidesPerColumn > 1) "column" === p.params.slidesPerColumnFill ? (f = t - (d = Math.floor(t / l)) * l, (d > h || d === h && f === l - 1) && ++f >= l && (f = 0, d++), c = d + f * o / l, m.css({
- "-webkit-box-ordinal-group": c,
- "-moz-box-ordinal-group": c,
- "-ms-flex-order": c,
- "-webkit-order": c,
- order: c
- })) : d = t - (f = Math.floor(t / u)) * u, m.css("margin-" + (p.isHorizontal() ? "top" : "left"), 0 !== f && p.params.spaceBetween && p.params.spaceBetween + "px")
- .attr("data-swiper-column", d)
- .attr("data-swiper-row", f);
- "none" !== m.css("display") && ("auto" === p.params.slidesPerView ? (a = p.isHorizontal() ? m.outerWidth(!0) : m.outerHeight(!0), p.params.roundLengths && (a = O(a))) : (a = (p.size - (p.params.slidesPerView - 1) * e) / p.params.slidesPerView, p.params.roundLengths && (a = O(a)), p.isHorizontal() ? p.slides[t].style.width = a + "px" : p.slides[t].style.height = a + "px"), p.slides[t].swiperSlideSize = a, p.slidesSizesGrid.push(a), p.params.centeredSlides ? (i = i + a / 2 + n / 2 + e, 0 === n && 0 !== t && (i = i - p.size / 2 - e), 0 === t && (i = i - p.size / 2 - e), Math.abs(i) < .001 && (i = 0), r % p.params.slidesPerGroup == 0 && p.snapGrid.push(i), p.slidesGrid.push(i)) : (r % p.params.slidesPerGroup == 0 && p.snapGrid.push(i), p.slidesGrid.push(i), i = i + a + e), p.virtualSize += a + e, n = a, r++)
- }
- if (p.virtualSize = Math.max(p.virtualSize, p.size) + p.params.slidesOffsetAfter, p.rtl && p.wrongRTL && ("slide" === p.params.effect || "coverflow" === p.params.effect) && p.wrapper.css({
- width: p.virtualSize + p.params.spaceBetween + "px"
- }), p.support.flexbox && !p.params.setWrapperSize || (p.isHorizontal() ? p.wrapper.css({
- width: p.virtualSize + p.params.spaceBetween + "px"
- }) : p.wrapper.css({
- height: p.virtualSize + p.params.spaceBetween + "px"
- })), p.params.slidesPerColumn > 1 && (p.virtualSize = (a + p.params.spaceBetween) * o, p.virtualSize = Math.ceil(p.virtualSize / p.params.slidesPerColumn) - p.params.spaceBetween, p.isHorizontal() ? p.wrapper.css({
- width: p.virtualSize + p.params.spaceBetween + "px"
- }) : p.wrapper.css({
- height: p.virtualSize + p.params.spaceBetween + "px"
- }), p.params.centeredSlides)) {
- for (s = [], t = 0; t < p.snapGrid.length; t++) p.snapGrid[t] < p.virtualSize + p.snapGrid[0] && s.push(p.snapGrid[t]);
- p.snapGrid = s
- }
- if (!p.params.centeredSlides) {
- for (s = [], t = 0; t < p.snapGrid.length; t++) p.snapGrid[t] <= p.virtualSize - p.size && s.push(p.snapGrid[t]);
- p.snapGrid = s, Math.floor(p.virtualSize - p.size) - Math.floor(p.snapGrid[p.snapGrid.length - 1]) > 1 && p.snapGrid.push(p.virtualSize - p.size)
- }
- 0 === p.snapGrid.length && (p.snapGrid = [0]), 0 !== p.params.spaceBetween && (p.isHorizontal() ? p.rtl ? p.slides.css({
- marginLeft: e + "px"
- }) : p.slides.css({
- marginRight: e + "px"
- }) : p.slides.css({
- marginBottom: e + "px"
- })), p.params.watchSlidesProgress && p.updateSlidesOffset()
- }
- }, p.updateSlidesOffset = function() {
- for (var t = 0; t < p.slides.length; t++) p.slides[t].swiperSlideOffset = p.isHorizontal() ? p.slides[t].offsetLeft : p.slides[t].offsetTop
- }, p.currentSlidesPerView = function() {
- var t, e, i = 1;
- if (p.params.centeredSlides) {
- var n, r = p.slides[p.activeIndex].swiperSlideSize;
- for (t = p.activeIndex + 1; t < p.slides.length; t++) p.slides[t] && !n && (i++, (r += p.slides[t].swiperSlideSize) > p.size && (n = !0));
- for (e = p.activeIndex - 1; e >= 0; e--) p.slides[e] && !n && (i++, (r += p.slides[e].swiperSlideSize) > p.size && (n = !0))
- } else
- for (t = p.activeIndex + 1; t < p.slides.length; t++) p.slidesGrid[t] - p.slidesGrid[p.activeIndex] < p.size && i++;
- return i
- }, p.updateSlidesProgress = function(t) {
- if (void 0 === t && (t = p.translate || 0), 0 !== p.slides.length) {
- void 0 === p.slides[0].swiperSlideOffset && p.updateSlidesOffset();
- var e = -t;
- p.rtl && (e = t), p.slides.removeClass(p.params.slideVisibleClass);
- for (var i = 0; i < p.slides.length; i++) {
- var n = p.slides[i],
- r = (e + (p.params.centeredSlides ? p.minTranslate() : 0) - n.swiperSlideOffset) / (n.swiperSlideSize + p.params.spaceBetween);
- if (p.params.watchSlidesVisibility) {
- var o = -(e - n.swiperSlideOffset),
- a = o + p.slidesSizesGrid[i];
- (o >= 0 && o < p.size || a > 0 && a <= p.size || o <= 0 && a >= p.size) && p.slides.eq(i)
- .addClass(p.params.slideVisibleClass)
- }
- n.progress = p.rtl ? -r : r
- }
- }
- }, p.updateProgress = function(t) {
- void 0 === t && (t = p.translate || 0);
- var e = p.maxTranslate() - p.minTranslate(),
- i = p.isBeginning,
- n = p.isEnd;
- 0 === e ? (p.progress = 0, p.isBeginning = p.isEnd = !0) : (p.progress = (t - p.minTranslate()) / e, p.isBeginning = p.progress <= 0, p.isEnd = p.progress >= 1), p.isBeginning && !i && p.emit("onReachBeginning", p), p.isEnd && !n && p.emit("onReachEnd", p), p.params.watchSlidesProgress && p.updateSlidesProgress(t), p.emit("onProgress", p, p.progress)
- }, p.updateActiveIndex = function() {
- var t, e, i, n = p.rtl ? p.translate : -p.translate;
- for (e = 0; e < p.slidesGrid.length; e++) void 0 !== p.slidesGrid[e + 1] ? n >= p.slidesGrid[e] && n < p.slidesGrid[e + 1] - (p.slidesGrid[e + 1] - p.slidesGrid[e]) / 2 ? t = e : n >= p.slidesGrid[e] && n < p.slidesGrid[e + 1] && (t = e + 1) : n >= p.slidesGrid[e] && (t = e);
- p.params.normalizeSlideIndex && (t < 0 || void 0 === t) && (t = 0), (i = Math.floor(t / p.params.slidesPerGroup)) >= p.snapGrid.length && (i = p.snapGrid.length - 1), t !== p.activeIndex && (p.snapIndex = i, p.previousIndex = p.activeIndex, p.activeIndex = t, p.updateClasses(), p.updateRealIndex())
- }, p.updateRealIndex = function() {
- p.realIndex = parseInt(p.slides.eq(p.activeIndex)
- .attr("data-swiper-slide-index") || p.activeIndex, 10)
- }, p.updateClasses = function() {
- p.slides.removeClass(p.params.slideActiveClass + " " + p.params.slideNextClass + " " + p.params.slidePrevClass + " " + p.params.slideDuplicateActiveClass + " " + p.params.slideDuplicateNextClass + " " + p.params.slideDuplicatePrevClass);
- var t = p.slides.eq(p.activeIndex);
- t.addClass(p.params.slideActiveClass), n.loop && (t.hasClass(p.params.slideDuplicateClass) ? p.wrapper.children("." + p.params.slideClass + ":not(." + p.params.slideDuplicateClass + ')[data-swiper-slide-index="' + p.realIndex + '"]')
- .addClass(p.params.slideDuplicateActiveClass) : p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + p.realIndex + '"]')
- .addClass(p.params.slideDuplicateActiveClass));
- var e = t.next("." + p.params.slideClass)
- .addClass(p.params.slideNextClass);
- p.params.loop && 0 === e.length && (e = p.slides.eq(0))
- .addClass(p.params.slideNextClass);
- var r = t.prev("." + p.params.slideClass)
- .addClass(p.params.slidePrevClass);
- if (p.params.loop && 0 === r.length && (r = p.slides.eq(-1))
- .addClass(p.params.slidePrevClass), n.loop && (e.hasClass(p.params.slideDuplicateClass) ? p.wrapper.children("." + p.params.slideClass + ":not(." + p.params.slideDuplicateClass + ')[data-swiper-slide-index="' + e.attr("data-swiper-slide-index") + '"]')
- .addClass(p.params.slideDuplicateNextClass) : p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + e.attr("data-swiper-slide-index") + '"]')
- .addClass(p.params.slideDuplicateNextClass), r.hasClass(p.params.slideDuplicateClass) ? p.wrapper.children("." + p.params.slideClass + ":not(." + p.params.slideDuplicateClass + ')[data-swiper-slide-index="' + r.attr("data-swiper-slide-index") + '"]')
- .addClass(p.params.slideDuplicatePrevClass) : p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + r.attr("data-swiper-slide-index") + '"]')
- .addClass(p.params.slideDuplicatePrevClass)), p.paginationContainer && p.paginationContainer.length > 0) {
- var o, a = p.params.loop ? Math.ceil((p.slides.length - 2 * p.loopedSlides) / p.params.slidesPerGroup) : p.snapGrid.length;
- if (p.params.loop ? ((o = Math.ceil((p.activeIndex - p.loopedSlides) / p.params.slidesPerGroup)) > p.slides.length - 1 - 2 * p.loopedSlides && (o -= p.slides.length - 2 * p.loopedSlides), o > a - 1 && (o -= a), o < 0 && "bullets" !== p.params.paginationType && (o = a + o)) : o = void 0 !== p.snapIndex ? p.snapIndex : p.activeIndex || 0, "bullets" === p.params.paginationType && p.bullets && p.bullets.length > 0 && (p.bullets.removeClass(p.params.bulletActiveClass), p.paginationContainer.length > 1 ? p.bullets.each((function() {
- i(this)
- .index() === o && i(this)
- .addClass(p.params.bulletActiveClass)
- })) : p.bullets.eq(o)
- .addClass(p.params.bulletActiveClass)), "fraction" === p.params.paginationType && (p.paginationContainer.find("." + p.params.paginationCurrentClass)
- .text(o + 1), p.paginationContainer.find("." + p.params.paginationTotalClass)
- .text(a)), "progress" === p.params.paginationType) {
- var s = (o + 1) / a,
- l = s,
- u = 1;
- p.isHorizontal() || (u = s, l = 1), p.paginationContainer.find("." + p.params.paginationProgressbarClass)
- .transform("translate3d(0,0,0) scaleX(" + l + ") scaleY(" + u + ")")
- .transition(p.params.speed)
- }
- "custom" === p.params.paginationType && p.params.paginationCustomRender && (p.paginationContainer.html(p.params.paginationCustomRender(p, o + 1, a)), p.emit("onPaginationRendered", p, p.paginationContainer[0]))
- }
- p.params.loop || (p.params.prevButton && p.prevButton && p.prevButton.length > 0 && (p.isBeginning ? (p.prevButton.addClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.disable(p.prevButton)) : (p.prevButton.removeClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.enable(p.prevButton))), p.params.nextButton && p.nextButton && p.nextButton.length > 0 && (p.isEnd ? (p.nextButton.addClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.disable(p.nextButton)) : (p.nextButton.removeClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.enable(p.nextButton))))
- }, p.updatePagination = function() {
- if (p.params.pagination && p.paginationContainer && p.paginationContainer.length > 0) {
- var t = "";
- if ("bullets" === p.params.paginationType) {
- for (var e = p.params.loop ? Math.ceil((p.slides.length - 2 * p.loopedSlides) / p.params.slidesPerGroup) : p.snapGrid.length, i = 0; i < e; i++) p.params.paginationBulletRender ? t += p.params.paginationBulletRender(p, i, p.params.bulletClass) : t += "<" + p.params.paginationElement + ' class="' + p.params.bulletClass + '"></' + p.params.paginationElement + ">";
- p.paginationContainer.html(t), p.bullets = p.paginationContainer.find("." + p.params.bulletClass), p.params.paginationClickable && p.params.a11y && p.a11y && p.a11y.initPagination()
- }
- "fraction" === p.params.paginationType && (t = p.params.paginationFractionRender ? p.params.paginationFractionRender(p, p.params.paginationCurrentClass, p.params.paginationTotalClass) : '<span class="' + p.params.paginationCurrentClass + '"></span> / <span class="' + p.params.paginationTotalClass + '"></span>', p.paginationContainer.html(t)), "progress" === p.params.paginationType && (t = p.params.paginationProgressRender ? p.params.paginationProgressRender(p, p.params.paginationProgressbarClass) : '<span class="' + p.params.paginationProgressbarClass + '"></span>', p.paginationContainer.html(t)), "custom" !== p.params.paginationType && p.emit("onPaginationRendered", p, p.paginationContainer[0])
- }
- }, p.update = function(t) {
- var e;
- p && (p.updateContainerSize(), p.updateSlidesSize(), p.updateProgress(), p.updatePagination(), p.updateClasses(), p.params.scrollbar && p.scrollbar && p.scrollbar.set(), t ? (p.controller && p.controller.spline && (p.controller.spline = void 0), p.params.freeMode ? (i(), p.params.autoHeight && p.updateAutoHeight()) : (("auto" === p.params.slidesPerView || p.params.slidesPerView > 1) && p.isEnd && !p.params.centeredSlides ? p.slideTo(p.slides.length - 1, 0, !1, !0) : p.slideTo(p.activeIndex, 0, !1, !0)) || i()) : p.params.autoHeight && p.updateAutoHeight());
- function i() {
- p.rtl, p.translate;
- e = Math.min(Math.max(p.translate, p.maxTranslate()), p.minTranslate()), p.setWrapperTranslate(e), p.updateActiveIndex(), p.updateClasses()
- }
- }, p.onResize = function(t) {
- p.params.onBeforeResize && p.params.onBeforeResize(p), p.params.breakpoints && p.setBreakpoint();
- var e = p.params.allowSwipeToPrev,
- i = p.params.allowSwipeToNext;
- p.params.allowSwipeToPrev = p.params.allowSwipeToNext = !0, p.updateContainerSize(), p.updateSlidesSize(), ("auto" === p.params.slidesPerView || p.params.freeMode || t) && p.updatePagination(), p.params.scrollbar && p.scrollbar && p.scrollbar.set(), p.controller && p.controller.spline && (p.controller.spline = void 0);
- var n = !1;
- if (p.params.freeMode) {
- var r = Math.min(Math.max(p.translate, p.maxTranslate()), p.minTranslate());
- p.setWrapperTranslate(r), p.updateActiveIndex(), p.updateClasses(), p.params.autoHeight && p.updateAutoHeight()
- } else p.updateClasses(), n = ("auto" === p.params.slidesPerView || p.params.slidesPerView > 1) && p.isEnd && !p.params.centeredSlides ? p.slideTo(p.slides.length - 1, 0, !1, !0) : p.slideTo(p.activeIndex, 0, !1, !0);
- p.params.lazyLoading && !n && p.lazy && p.lazy.load(), p.params.allowSwipeToPrev = e, p.params.allowSwipeToNext = i, p.params.onAfterResize && p.params.onAfterResize(p)
- }, p.touchEventsDesktop = {
- start: "mousedown",
- move: "mousemove",
- end: "mouseup"
- }, window.navigator.pointerEnabled ? p.touchEventsDesktop = {
- start: "pointerdown",
- move: "pointermove",
- end: "pointerup"
- } : window.navigator.msPointerEnabled && (p.touchEventsDesktop = {
- start: "MSPointerDown",
- move: "MSPointerMove",
- end: "MSPointerUp"
- }), p.touchEvents = {
- start: p.support.touch || !p.params.simulateTouch ? "touchstart" : p.touchEventsDesktop.start,
- move: p.support.touch || !p.params.simulateTouch ? "touchmove" : p.touchEventsDesktop.move,
- end: p.support.touch || !p.params.simulateTouch ? "touchend" : p.touchEventsDesktop.end
- }, (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) && ("container" === p.params.touchEventsTarget ? p.container : p.wrapper)
- .addClass("swiper-wp8-" + p.params.direction), p.initEvents = function(t) {
- var e = t ? "off" : "on",
- i = t ? "removeEventListener" : "addEventListener",
- r = "container" === p.params.touchEventsTarget ? p.container[0] : p.wrapper[0],
- o = p.support.touch ? r : document,
- a = !!p.params.nested;
- if (p.browser.ie) r[i](p.touchEvents.start, p.onTouchStart, !1), o[i](p.touchEvents.move, p.onTouchMove, a), o[i](p.touchEvents.end, p.onTouchEnd, !1);
- else {
- if (p.support.touch) {
- var s = !("touchstart" !== p.touchEvents.start || !p.support.passiveListener || !p.params.passiveListeners) && {
- passive: !0,
- capture: !1
- };
- r[i](p.touchEvents.start, p.onTouchStart, s), r[i](p.touchEvents.move, p.onTouchMove, a), r[i](p.touchEvents.end, p.onTouchEnd, s)
- }(n.simulateTouch && !p.device.ios && !p.device.android || n.simulateTouch && !p.support.touch && p.device.ios) && (r[i]("mousedown", p.onTouchStart, !1), document[i]("mousemove", p.onTouchMove, a), document[i]("mouseup", p.onTouchEnd, !1))
- }
- window[i]("resize", p.onResize), p.params.nextButton && p.nextButton && p.nextButton.length > 0 && (p.nextButton[e]("click", p.onClickNext), p.params.a11y && p.a11y && p.nextButton[e]("keydown", p.a11y.onEnterKey)), p.params.prevButton && p.prevButton && p.prevButton.length > 0 && (p.prevButton[e]("click", p.onClickPrev), p.params.a11y && p.a11y && p.prevButton[e]("keydown", p.a11y.onEnterKey)), p.params.pagination && p.params.paginationClickable && (p.paginationContainer[e]("click", "." + p.params.bulletClass, p.onClickIndex), p.params.a11y && p.a11y && p.paginationContainer[e]("keydown", "." + p.params.bulletClass, p.a11y.onEnterKey)), (p.params.preventClicks || p.params.preventClicksPropagation) && r[i]("click", p.preventClicks, !0)
- }, p.attachEvents = function() {
- p.initEvents()
- }, p.detachEvents = function() {
- p.initEvents(!0)
- }, p.allowClick = !0, p.preventClicks = function(t) {
- p.allowClick || (p.params.preventClicks && t.preventDefault(), p.params.preventClicksPropagation && p.animating && (t.stopPropagation(), t.stopImmediatePropagation()))
- }, p.onClickNext = function(t) {
- t.preventDefault(), p.isEnd && !p.params.loop || p.slideNext()
- }, p.onClickPrev = function(t) {
- t.preventDefault(), p.isBeginning && !p.params.loop || p.slidePrev()
- }, p.onClickIndex = function(t) {
- t.preventDefault();
- var e = i(this)
- .index() * p.params.slidesPerGroup;
- p.params.loop && (e += p.loopedSlides), p.slideTo(e)
- }, p.updateClickedSlide = function(t) {
- var e = R(t, "." + p.params.slideClass),
- n = !1;
- if (e)
- for (var r = 0; r < p.slides.length; r++) p.slides[r] === e && (n = !0);
- if (!e || !n) return p.clickedSlide = void 0, void(p.clickedIndex = void 0);
- if (p.clickedSlide = e, p.clickedIndex = i(e)
- .index(), p.params.slideToClickedSlide && void 0 !== p.clickedIndex && p.clickedIndex !== p.activeIndex) {
- var o, a = p.clickedIndex,
- s = "auto" === p.params.slidesPerView ? p.currentSlidesPerView() : p.params.slidesPerView;
- if (p.params.loop) {
- if (p.animating) return;
- o = parseInt(i(p.clickedSlide)
- .attr("data-swiper-slide-index"), 10), p.params.centeredSlides ? a < p.loopedSlides - s / 2 || a > p.slides.length - p.loopedSlides + s / 2 ? (p.fixLoop(), a = p.wrapper.children("." + p.params.slideClass + '[data-swiper-slide-index="' + o + '"]:not(.' + p.params.slideDuplicateClass + ")")
- .eq(0)
- .index(), setTimeout((function() {
- p.slideTo(a)
- }), 0)) : p.slideTo(a) : a > p.slides.length - s ? (p.fixLoop(), a = p.wrapper.children("." + p.params.slideClass + '[data-swiper-slide-index="' + o + '"]:not(.' + p.params.slideDuplicateClass + ")")
- .eq(0)
- .index(), setTimeout((function() {
- p.slideTo(a)
- }), 0)) : p.slideTo(a)
- } else p.slideTo(a)
- }
- };
- var m, g, v, y, b, w, x, M, T, S, _, A, P = "input, select, textarea, button, video",
- C = Date.now(),
- E = [];
- for (var D in p.animating = !1, p.touches = {
- startX: 0,
- startY: 0,
- currentX: 0,
- currentY: 0,
- diff: 0
- }, p.onTouchStart = function(t) {
- if (t.originalEvent && (t = t.originalEvent), (_ = "touchstart" === t.type) || !("which" in t) || 3 !== t.which)
- if (p.params.noSwiping && R(t, "." + p.params.noSwipingClass)) p.allowClick = !0;
- else if (!p.params.swipeHandler || R(t, p.params.swipeHandler)) {
- var e = p.touches.currentX = "touchstart" === t.type ? t.targetTouches[0].pageX : t.pageX,
- n = p.touches.currentY = "touchstart" === t.type ? t.targetTouches[0].pageY : t.pageY;
- if (!(p.device.ios && p.params.iOSEdgeSwipeDetection && e <= p.params.iOSEdgeSwipeThreshold)) {
- if (m = !0, g = !1, v = !0, b = void 0, A = void 0, p.touches.startX = e, p.touches.startY = n, y = Date.now(), p.allowClick = !0, p.updateContainerSize(), p.swipeDirection = void 0, p.params.threshold > 0 && (M = !1), "touchstart" !== t.type) {
- var r = !0;
- i(t.target)
- .is(P) && (r = !1), document.activeElement && i(document.activeElement)
- .is(P) && document.activeElement.blur(), r && t.preventDefault()
- }
- p.emit("onTouchStart", p, t)
- }
- }
- }, p.onTouchMove = function(t) {
- if (t.originalEvent && (t = t.originalEvent), !_ || "mousemove" !== t.type) {
- if (t.preventedByNestedSwiper) return p.touches.startX = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, void(p.touches.startY = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY);
- if (p.params.onlyExternal) return p.allowClick = !1, void(m && (p.touches.startX = p.touches.currentX = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, p.touches.startY = p.touches.currentY = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY, y = Date.now()));
- if (_ && p.params.touchReleaseOnEdges && !p.params.loop)
- if (p.isHorizontal()) {
- if (p.touches.currentX < p.touches.startX && p.translate <= p.maxTranslate() || p.touches.currentX > p.touches.startX && p.translate >= p.minTranslate()) return
- } else if (p.touches.currentY < p.touches.startY && p.translate <= p.maxTranslate() || p.touches.currentY > p.touches.startY && p.translate >= p.minTranslate()) return;
- if (_ && document.activeElement && t.target === document.activeElement && i(t.target)
- .is(P)) return g = !0, void(p.allowClick = !1);
- if (v && p.emit("onTouchMove", p, t), !(t.targetTouches && t.targetTouches.length > 1)) {
- var e;
- if (p.touches.currentX = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, p.touches.currentY = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY, void 0 === b) p.isHorizontal() && p.touches.currentY === p.touches.startY || !p.isHorizontal() && p.touches.currentX === p.touches.startX ? b = !1 : (e = 180 * Math.atan2(Math.abs(p.touches.currentY - p.touches.startY), Math.abs(p.touches.currentX - p.touches.startX)) / Math.PI, b = p.isHorizontal() ? e > p.params.touchAngle : 90 - e > p.params.touchAngle);
- if (b && p.emit("onTouchMoveOpposite", p, t), void 0 === A && (p.touches.currentX === p.touches.startX && p.touches.currentY === p.touches.startY || (A = !0)), m)
- if (b) m = !1;
- else if (A) {
- p.allowClick = !1, p.emit("onSliderMove", p, t), t.preventDefault(), p.params.touchMoveStopPropagation && !p.params.nested && t.stopPropagation(), g || (n.loop && p.fixLoop(), x = p.getWrapperTranslate(), p.setWrapperTransition(0), p.animating && p.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"), p.params.autoplay && p.autoplaying && (p.params.autoplayDisableOnInteraction ? p.stopAutoplay() : p.pauseAutoplay()), S = !1, !p.params.grabCursor || !0 !== p.params.allowSwipeToNext && !0 !== p.params.allowSwipeToPrev || p.setGrabCursor(!0)), g = !0;
- var r = p.touches.diff = p.isHorizontal() ? p.touches.currentX - p.touches.startX : p.touches.currentY - p.touches.startY;
- r *= p.params.touchRatio, p.rtl && (r = -r), p.swipeDirection = r > 0 ? "prev" : "next", w = r + x;
- var o = !0;
- if (r > 0 && w > p.minTranslate() ? (o = !1, p.params.resistance && (w = p.minTranslate() - 1 + Math.pow(-p.minTranslate() + x + r, p.params.resistanceRatio))) : r < 0 && w < p.maxTranslate() && (o = !1, p.params.resistance && (w = p.maxTranslate() + 1 - Math.pow(p.maxTranslate() - x - r, p.params.resistanceRatio))), o && (t.preventedByNestedSwiper = !0), !p.params.allowSwipeToNext && "next" === p.swipeDirection && w < x && (w = x), !p.params.allowSwipeToPrev && "prev" === p.swipeDirection && w > x && (w = x), p.params.threshold > 0) {
- if (!(Math.abs(r) > p.params.threshold || M)) return void(w = x);
- if (!M) return M = !0, p.touches.startX = p.touches.currentX, p.touches.startY = p.touches.currentY, w = x, void(p.touches.diff = p.isHorizontal() ? p.touches.currentX - p.touches.startX : p.touches.currentY - p.touches.startY)
- }
- p.params.followFinger && ((p.params.freeMode || p.params.watchSlidesProgress) && p.updateActiveIndex(), p.params.freeMode && (0 === E.length && E.push({
- position: p.touches[p.isHorizontal() ? "startX" : "startY"],
- time: y
- }), E.push({
- position: p.touches[p.isHorizontal() ? "currentX" : "currentY"],
- time: (new window.Date)
- .getTime()
- })), p.updateProgress(w), p.setWrapperTranslate(w))
- }
- }
- }
- }, p.onTouchEnd = function(t) {
- if (t.originalEvent && (t = t.originalEvent), v && p.emit("onTouchEnd", p, t), v = !1, m) {
- p.params.grabCursor && g && m && (!0 === p.params.allowSwipeToNext || !0 === p.params.allowSwipeToPrev) && p.setGrabCursor(!1);
- var e, n = Date.now(),
- r = n - y;
- if (p.allowClick && (p.updateClickedSlide(t), p.emit("onTap", p, t), r < 300 && n - C > 300 && (T && clearTimeout(T), T = setTimeout((function() {
- p && (p.params.paginationHide && p.paginationContainer.length > 0 && !i(t.target)
- .hasClass(p.params.bulletClass) && p.paginationContainer.toggleClass(p.params.paginationHiddenClass), p.emit("onClick", p, t))
- }), 300)), r < 300 && n - C < 300 && (T && clearTimeout(T), p.emit("onDoubleTap", p, t))), C = Date.now(), setTimeout((function() {
- p && (p.allowClick = !0)
- }), 0), m && g && p.swipeDirection && 0 !== p.touches.diff && w !== x)
- if (m = g = !1, e = p.params.followFinger ? p.rtl ? p.translate : -p.translate : -w, p.params.freeMode) {
- if (e < -p.minTranslate()) return void p.slideTo(p.activeIndex);
- if (e > -p.maxTranslate()) return void(p.slides.length < p.snapGrid.length ? p.slideTo(p.snapGrid.length - 1) : p.slideTo(p.slides.length - 1));
- if (p.params.freeModeMomentum) {
- if (E.length > 1) {
- var o = E.pop(),
- a = E.pop(),
- s = o.position - a.position,
- l = o.time - a.time;
- p.velocity = s / l, p.velocity = p.velocity / 2, Math.abs(p.velocity) < p.params.freeModeMinimumVelocity && (p.velocity = 0), (l > 150 || (new window.Date)
- .getTime() - o.time > 300) && (p.velocity = 0)
- } else p.velocity = 0;
- p.velocity = p.velocity * p.params.freeModeMomentumVelocityRatio, E.length = 0;
- var u = 1e3 * p.params.freeModeMomentumRatio,
- h = p.velocity * u,
- c = p.translate + h;
- p.rtl && (c = -c);
- var d, f = !1,
- b = 20 * Math.abs(p.velocity) * p.params.freeModeMomentumBounceRatio;
- if (c < p.maxTranslate()) p.params.freeModeMomentumBounce ? (c + p.maxTranslate() < -b && (c = p.maxTranslate() - b), d = p.maxTranslate(), f = !0, S = !0) : c = p.maxTranslate();
- else if (c > p.minTranslate()) p.params.freeModeMomentumBounce ? (c - p.minTranslate() > b && (c = p.minTranslate() + b), d = p.minTranslate(), f = !0, S = !0) : c = p.minTranslate();
- else if (p.params.freeModeSticky) {
- var M, _ = 0;
- for (_ = 0; _ < p.snapGrid.length; _ += 1)
- if (p.snapGrid[_] > -c) {
- M = _;
- break
- } c = Math.abs(p.snapGrid[M] - c) < Math.abs(p.snapGrid[M - 1] - c) || "next" === p.swipeDirection ? p.snapGrid[M] : p.snapGrid[M - 1], p.rtl || (c = -c)
- }
- if (0 !== p.velocity) u = p.rtl ? Math.abs((-c - p.translate) / p.velocity) : Math.abs((c - p.translate) / p.velocity);
- else if (p.params.freeModeSticky) return void p.slideReset();
- p.params.freeModeMomentumBounce && f ? (p.updateProgress(d), p.setWrapperTransition(u), p.setWrapperTranslate(c), p.onTransitionStart(), p.animating = !0, p.wrapper.transitionEnd((function() {
- p && S && (p.emit("onMomentumBounce", p), p.setWrapperTransition(p.params.speed), p.setWrapperTranslate(d), p.wrapper.transitionEnd((function() {
- p && p.onTransitionEnd()
- })))
- }))) : p.velocity ? (p.updateProgress(c), p.setWrapperTransition(u), p.setWrapperTranslate(c), p.onTransitionStart(), p.animating || (p.animating = !0, p.wrapper.transitionEnd((function() {
- p && p.onTransitionEnd()
- })))) : p.updateProgress(c), p.updateActiveIndex()
- }(!p.params.freeModeMomentum || r >= p.params.longSwipesMs) && (p.updateProgress(), p.updateActiveIndex())
- } else {
- var A, P = 0,
- D = p.slidesSizesGrid[0];
- for (A = 0; A < p.slidesGrid.length; A += p.params.slidesPerGroup) void 0 !== p.slidesGrid[A + p.params.slidesPerGroup] ? e >= p.slidesGrid[A] && e < p.slidesGrid[A + p.params.slidesPerGroup] && (P = A, D = p.slidesGrid[A + p.params.slidesPerGroup] - p.slidesGrid[A]) : e >= p.slidesGrid[A] && (P = A, D = p.slidesGrid[p.slidesGrid.length - 1] - p.slidesGrid[p.slidesGrid.length - 2]);
- var L = (e - p.slidesGrid[P]) / D;
- if (r > p.params.longSwipesMs) {
- if (!p.params.longSwipes) return void p.slideTo(p.activeIndex);
- "next" === p.swipeDirection && (L >= p.params.longSwipesRatio ? p.slideTo(P + p.params.slidesPerGroup) : p.slideTo(P)), "prev" === p.swipeDirection && (L > 1 - p.params.longSwipesRatio ? p.slideTo(P + p.params.slidesPerGroup) : p.slideTo(P))
- } else {
- if (!p.params.shortSwipes) return void p.slideTo(p.activeIndex);
- "next" === p.swipeDirection && p.slideTo(P + p.params.slidesPerGroup), "prev" === p.swipeDirection && p.slideTo(P)
- }
- }
- else m = g = !1
- }
- }, p._slideTo = function(t, e) {
- return p.slideTo(t, e, !0, !0)
- }, p.slideTo = function(t, e, i, n) {
- void 0 === i && (i = !0), void 0 === t && (t = 0), t < 0 && (t = 0), p.snapIndex = Math.floor(t / p.params.slidesPerGroup), p.snapIndex >= p.snapGrid.length && (p.snapIndex = p.snapGrid.length - 1);
- var r = -p.snapGrid[p.snapIndex];
- if (p.params.autoplay && p.autoplaying && (n || !p.params.autoplayDisableOnInteraction ? p.pauseAutoplay(e) : p.stopAutoplay()), p.updateProgress(r), p.params.normalizeSlideIndex)
- for (var o = 0; o < p.slidesGrid.length; o++) - Math.floor(100 * r) >= Math.floor(100 * p.slidesGrid[o]) && (t = o);
- return !(!p.params.allowSwipeToNext && r < p.translate && r < p.minTranslate()) && (!(!p.params.allowSwipeToPrev && r > p.translate && r > p.maxTranslate() && (p.activeIndex || 0) !== t) && (void 0 === e && (e = p.params.speed), p.previousIndex = p.activeIndex || 0, p.activeIndex = t, p.updateRealIndex(), p.rtl && -r === p.translate || !p.rtl && r === p.translate ? (p.params.autoHeight && p.updateAutoHeight(), p.updateClasses(), "slide" !== p.params.effect && p.setWrapperTranslate(r), !1) : (p.updateClasses(), p.onTransitionStart(i), 0 === e || p.browser.lteIE9 ? (p.setWrapperTranslate(r), p.setWrapperTransition(0), p.onTransitionEnd(i)) : (p.setWrapperTranslate(r), p.setWrapperTransition(e), p.animating || (p.animating = !0, p.wrapper.transitionEnd((function() {
- p && p.onTransitionEnd(i)
- })))), !0)))
- }, p.onTransitionStart = function(t) {
- void 0 === t && (t = !0), p.params.autoHeight && p.updateAutoHeight(), p.lazy && p.lazy.onTransitionStart(), t && (p.emit("onTransitionStart", p), p.activeIndex !== p.previousIndex && (p.emit("onSlideChangeStart", p), p.activeIndex > p.previousIndex ? p.emit("onSlideNextStart", p) : p.emit("onSlidePrevStart", p)))
- }, p.onTransitionEnd = function(t) {
- p.animating = !1, p.setWrapperTransition(0), void 0 === t && (t = !0), p.lazy && p.lazy.onTransitionEnd(), t && (p.emit("onTransitionEnd", p), p.activeIndex !== p.previousIndex && (p.emit("onSlideChangeEnd", p), p.activeIndex > p.previousIndex ? p.emit("onSlideNextEnd", p) : p.emit("onSlidePrevEnd", p))), p.params.history && p.history && p.history.setHistory(p.params.history, p.activeIndex), p.params.hashnav && p.hashnav && p.hashnav.setHash()
- }, p.slideNext = function(t, e, i) {
- if (p.params.loop) {
- if (p.animating) return !1;
- p.fixLoop();
- p.container[0].clientLeft;
- return p.slideTo(p.activeIndex + p.params.slidesPerGroup, e, t, i)
- }
- return p.slideTo(p.activeIndex + p.params.slidesPerGroup, e, t, i)
- }, p._slideNext = function(t) {
- return p.slideNext(!0, t, !0)
- }, p.slidePrev = function(t, e, i) {
- if (p.params.loop) {
- if (p.animating) return !1;
- p.fixLoop();
- p.container[0].clientLeft;
- return p.slideTo(p.activeIndex - 1, e, t, i)
- }
- return p.slideTo(p.activeIndex - 1, e, t, i)
- }, p._slidePrev = function(t) {
- return p.slidePrev(!0, t, !0)
- }, p.slideReset = function(t, e, i) {
- return p.slideTo(p.activeIndex, e, t)
- }, p.disableTouchControl = function() {
- return p.params.onlyExternal = !0, !0
- }, p.enableTouchControl = function() {
- return p.params.onlyExternal = !1, !0
- }, p.setWrapperTransition = function(t, e) {
- p.wrapper.transition(t), "slide" !== p.params.effect && p.effects[p.params.effect] && p.effects[p.params.effect].setTransition(t), p.params.parallax && p.parallax && p.parallax.setTransition(t), p.params.scrollbar && p.scrollbar && p.scrollbar.setTransition(t), p.params.control && p.controller && p.controller.setTransition(t, e), p.emit("onSetTransition", p, t)
- }, p.setWrapperTranslate = function(t, e, i) {
- var n = 0,
- r = 0;
- p.isHorizontal() ? n = p.rtl ? -t : t : r = t, p.params.roundLengths && (n = O(n), r = O(r)), p.params.virtualTranslate || (p.support.transforms3d ? p.wrapper.transform("translate3d(" + n + "px, " + r + "px, 0px)") : p.wrapper.transform("translate(" + n + "px, " + r + "px)")), p.translate = p.isHorizontal() ? n : r;
- var o = p.maxTranslate() - p.minTranslate();
- (0 === o ? 0 : (t - p.minTranslate()) / o) !== p.progress && p.updateProgress(t), e && p.updateActiveIndex(), "slide" !== p.params.effect && p.effects[p.params.effect] && p.effects[p.params.effect].setTranslate(p.translate), p.params.parallax && p.parallax && p.parallax.setTranslate(p.translate), p.params.scrollbar && p.scrollbar && p.scrollbar.setTranslate(p.translate), p.params.control && p.controller && p.controller.setTranslate(p.translate, i), p.emit("onSetTranslate", p, p.translate)
- }, p.getTranslate = function(t, e) {
- var i, n, r, o;
- return void 0 === e && (e = "x"), p.params.virtualTranslate ? p.rtl ? -p.translate : p.translate : (r = window.getComputedStyle(t, null), window.WebKitCSSMatrix ? ((n = r.transform || r.webkitTransform)
- .split(",")
- .length > 6 && (n = n.split(", ")
- .map((function(t) {
- return t.replace(",", ".")
- }))
- .join(", ")), o = new window.WebKitCSSMatrix("none" === n ? "" : n)) : i = (o = r.MozTransform || r.OTransform || r.MsTransform || r.msTransform || r.transform || r.getPropertyValue("transform")
- .replace("translate(", "matrix(1, 0, 0, 1,"))
- .toString()
- .split(","), "x" === e && (n = window.WebKitCSSMatrix ? o.m41 : 16 === i.length ? parseFloat(i[12]) : parseFloat(i[4])), "y" === e && (n = window.WebKitCSSMatrix ? o.m42 : 16 === i.length ? parseFloat(i[13]) : parseFloat(i[5])), p.rtl && n && (n = -n), n || 0)
- }, p.getWrapperTranslate = function(t) {
- return void 0 === t && (t = p.isHorizontal() ? "x" : "y"), p.getTranslate(p.wrapper[0], t)
- }, p.observers = [], p.initObservers = function() {
- if (p.params.observeParents)
- for (var t = p.container.parents(), e = 0; e < t.length; e++) N(t[e]);
- N(p.container[0], {
- childList: !1
- }), N(p.wrapper[0], {
- attributes: !1
- })
- }, p.disconnectObservers = function() {
- for (var t = 0; t < p.observers.length; t++) p.observers[t].disconnect();
- p.observers = []
- }, p.createLoop = function() {
- p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass)
- .remove();
- var t = p.wrapper.children("." + p.params.slideClass);
- "auto" !== p.params.slidesPerView || p.params.loopedSlides || (p.params.loopedSlides = t.length), p.loopedSlides = parseInt(p.params.loopedSlides || p.params.slidesPerView, 10), p.loopedSlides = p.loopedSlides + p.params.loopAdditionalSlides, p.loopedSlides > t.length && (p.loopedSlides = t.length);
- var e, n = [],
- r = [];
- for (t.each((function(e, o) {
- var a = i(this);
- e < p.loopedSlides && r.push(o), e < t.length && e >= t.length - p.loopedSlides && n.push(o), a.attr("data-swiper-slide-index", e)
- })), e = 0; e < r.length; e++) p.wrapper.append(i(r[e].cloneNode(!0))
- .addClass(p.params.slideDuplicateClass));
- for (e = n.length - 1; e >= 0; e--) p.wrapper.prepend(i(n[e].cloneNode(!0))
- .addClass(p.params.slideDuplicateClass))
- }, p.destroyLoop = function() {
- p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass)
- .remove(), p.slides.removeAttr("data-swiper-slide-index")
- }, p.reLoop = function(t) {
- var e = p.activeIndex - p.loopedSlides;
- p.destroyLoop(), p.createLoop(), p.updateSlidesSize(), t && p.slideTo(e + p.loopedSlides, 0, !1)
- }, p.fixLoop = function() {
- var t;
- p.activeIndex < p.loopedSlides ? (t = p.slides.length - 3 * p.loopedSlides + p.activeIndex, t += p.loopedSlides, p.slideTo(t, 0, !1, !0)) : ("auto" === p.params.slidesPerView && p.activeIndex >= 2 * p.loopedSlides || p.activeIndex > p.slides.length - 2 * p.params.slidesPerView) && (t = -p.slides.length + p.activeIndex + p.loopedSlides, t += p.loopedSlides, p.slideTo(t, 0, !1, !0))
- }, p.appendSlide = function(t) {
- if (p.params.loop && p.destroyLoop(), "object" == typeof t && t.length)
- for (var e = 0; e < t.length; e++) t[e] && p.wrapper.append(t[e]);
- else p.wrapper.append(t);
- p.params.loop && p.createLoop(), p.params.observer && p.support.observer || p.update(!0)
- }, p.prependSlide = function(t) {
- p.params.loop && p.destroyLoop();
- var e = p.activeIndex + 1;
- if ("object" == typeof t && t.length) {
- for (var i = 0; i < t.length; i++) t[i] && p.wrapper.prepend(t[i]);
- e = p.activeIndex + t.length
- } else p.wrapper.prepend(t);
- p.params.loop && p.createLoop(), p.params.observer && p.support.observer || p.update(!0), p.slideTo(e, 0, !1)
- }, p.removeSlide = function(t) {
- p.params.loop && (p.destroyLoop(), p.slides = p.wrapper.children("." + p.params.slideClass));
- var e, i = p.activeIndex;
- if ("object" == typeof t && t.length) {
- for (var n = 0; n < t.length; n++) e = t[n], p.slides[e] && p.slides.eq(e)
- .remove(), e < i && i--;
- i = Math.max(i, 0)
- } else e = t, p.slides[e] && p.slides.eq(e)
- .remove(), e < i && i--, i = Math.max(i, 0);
- p.params.loop && p.createLoop(), p.params.observer && p.support.observer || p.update(!0), p.params.loop ? p.slideTo(i + p.loopedSlides, 0, !1) : p.slideTo(i, 0, !1)
- }, p.removeAllSlides = function() {
- for (var t = [], e = 0; e < p.slides.length; e++) t.push(e);
- p.removeSlide(t)
- }, p.effects = {
- fade: {
- setTranslate: function() {
- for (var t = 0; t < p.slides.length; t++) {
- var e = p.slides.eq(t),
- i = -e[0].swiperSlideOffset;
- p.params.virtualTranslate || (i -= p.translate);
- var n = 0;
- p.isHorizontal() || (n = i, i = 0);
- var r = p.params.fade.crossFade ? Math.max(1 - Math.abs(e[0].progress), 0) : 1 + Math.min(Math.max(e[0].progress, -1), 0);
- e.css({
- opacity: r
- })
- .transform("translate3d(" + i + "px, " + n + "px, 0px)")
- }
- },
- setTransition: function(t) {
- if (p.slides.transition(t), p.params.virtualTranslate && 0 !== t) {
- var e = !1;
- p.slides.transitionEnd((function() {
- if (!e && p) {
- e = !0, p.animating = !1;
- for (var t = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"], i = 0; i < t.length; i++) p.wrapper.trigger(t[i])
- }
- }))
- }
- }
- },
- flip: {
- setTranslate: function() {
- for (var t = 0; t < p.slides.length; t++) {
- var e = p.slides.eq(t),
- n = e[0].progress;
- p.params.flip.limitRotation && (n = Math.max(Math.min(e[0].progress, 1), -1));
- var r = -180 * n,
- o = 0,
- a = -e[0].swiperSlideOffset,
- s = 0;
- if (p.isHorizontal() ? p.rtl && (r = -r) : (s = a, a = 0, o = -r, r = 0), e[0].style.zIndex = -Math.abs(Math.round(n)) + p.slides.length, p.params.flip.slideShadows) {
- var l = p.isHorizontal() ? e.find(".swiper-slide-shadow-left") : e.find(".swiper-slide-shadow-top"),
- u = p.isHorizontal() ? e.find(".swiper-slide-shadow-right") : e.find(".swiper-slide-shadow-bottom");
- 0 === l.length && (l = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "left" : "top") + '"></div>'), e.append(l)), 0 === u.length && (u = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "right" : "bottom") + '"></div>'), e.append(u)), l.length && (l[0].style.opacity = Math.max(-n, 0)), u.length && (u[0].style.opacity = Math.max(n, 0))
- }
- e.transform("translate3d(" + a + "px, " + s + "px, 0px) rotateX(" + o + "deg) rotateY(" + r + "deg)")
- }
- },
- setTransition: function(t) {
- if (p.slides.transition(t)
- .find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left")
- .transition(t), p.params.virtualTranslate && 0 !== t) {
- var e = !1;
- p.slides.eq(p.activeIndex)
- .transitionEnd((function() {
- if (!e && p && i(this)
- .hasClass(p.params.slideActiveClass)) {
- e = !0, p.animating = !1;
- for (var t = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"], n = 0; n < t.length; n++) p.wrapper.trigger(t[n])
- }
- }))
- }
- }
- },
- cube: {
- setTranslate: function() {
- var t, e = 0;
- p.params.cube.shadow && (p.isHorizontal() ? (0 === (t = p.wrapper.find(".swiper-cube-shadow"))
- .length && (t = i('<div class="swiper-cube-shadow"></div>'), p.wrapper.append(t)), t.css({
- height: p.width + "px"
- })) : 0 === (t = p.container.find(".swiper-cube-shadow"))
- .length && (t = i('<div class="swiper-cube-shadow"></div>'), p.container.append(t)));
- for (var n = 0; n < p.slides.length; n++) {
- var r = p.slides.eq(n),
- o = 90 * n,
- a = Math.floor(o / 360);
- p.rtl && (o = -o, a = Math.floor(-o / 360));
- var s = Math.max(Math.min(r[0].progress, 1), -1),
- l = 0,
- u = 0,
- h = 0;
- n % 4 == 0 ? (l = 4 * -a * p.size, h = 0) : (n - 1) % 4 == 0 ? (l = 0, h = 4 * -a * p.size) : (n - 2) % 4 == 0 ? (l = p.size + 4 * a * p.size, h = p.size) : (n - 3) % 4 == 0 && (l = -p.size, h = 3 * p.size + 4 * p.size * a), p.rtl && (l = -l), p.isHorizontal() || (u = l, l = 0);
- var c = "rotateX(" + (p.isHorizontal() ? 0 : -o) + "deg) rotateY(" + (p.isHorizontal() ? o : 0) + "deg) translate3d(" + l + "px, " + u + "px, " + h + "px)";
- if (s <= 1 && s > -1 && (e = 90 * n + 90 * s, p.rtl && (e = 90 * -n - 90 * s)), r.transform(c), p.params.cube.slideShadows) {
- var d = p.isHorizontal() ? r.find(".swiper-slide-shadow-left") : r.find(".swiper-slide-shadow-top"),
- f = p.isHorizontal() ? r.find(".swiper-slide-shadow-right") : r.find(".swiper-slide-shadow-bottom");
- 0 === d.length && (d = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "left" : "top") + '"></div>'), r.append(d)), 0 === f.length && (f = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "right" : "bottom") + '"></div>'), r.append(f)), d.length && (d[0].style.opacity = Math.max(-s, 0)), f.length && (f[0].style.opacity = Math.max(s, 0))
- }
- }
- if (p.wrapper.css({
- "-webkit-transform-origin": "50% 50% -" + p.size / 2 + "px",
- "-moz-transform-origin": "50% 50% -" + p.size / 2 + "px",
- "-ms-transform-origin": "50% 50% -" + p.size / 2 + "px",
- "transform-origin": "50% 50% -" + p.size / 2 + "px"
- }), p.params.cube.shadow)
- if (p.isHorizontal()) t.transform("translate3d(0px, " + (p.width / 2 + p.params.cube.shadowOffset) + "px, " + -p.width / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + p.params.cube.shadowScale + ")");
- else {
- var m = Math.abs(e) - 90 * Math.floor(Math.abs(e) / 90),
- g = 1.5 - (Math.sin(2 * m * Math.PI / 360) / 2 + Math.cos(2 * m * Math.PI / 360) / 2),
- v = p.params.cube.shadowScale,
- y = p.params.cube.shadowScale / g,
- b = p.params.cube.shadowOffset;
- t.transform("scale3d(" + v + ", 1, " + y + ") translate3d(0px, " + (p.height / 2 + b) + "px, " + -p.height / 2 / y + "px) rotateX(-90deg)")
- } var w = p.isSafari || p.isUiWebView ? -p.size / 2 : 0;
- p.wrapper.transform("translate3d(0px,0," + w + "px) rotateX(" + (p.isHorizontal() ? 0 : e) + "deg) rotateY(" + (p.isHorizontal() ? -e : 0) + "deg)")
- },
- setTransition: function(t) {
- p.slides.transition(t)
- .find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left")
- .transition(t), p.params.cube.shadow && !p.isHorizontal() && p.container.find(".swiper-cube-shadow")
- .transition(t)
- }
- },
- coverflow: {
- setTranslate: function() {
- for (var t = p.translate, e = p.isHorizontal() ? -t + p.width / 2 : -t + p.height / 2, n = p.isHorizontal() ? p.params.coverflow.rotate : -p.params.coverflow.rotate, r = p.params.coverflow.depth, o = 0, a = p.slides.length; o < a; o++) {
- var s = p.slides.eq(o),
- l = p.slidesSizesGrid[o],
- u = (e - s[0].swiperSlideOffset - l / 2) / l * p.params.coverflow.modifier,
- h = p.isHorizontal() ? n * u : 0,
- c = p.isHorizontal() ? 0 : n * u,
- d = -r * Math.abs(u),
- f = p.isHorizontal() ? 0 : p.params.coverflow.stretch * u,
- m = p.isHorizontal() ? p.params.coverflow.stretch * u : 0;
- Math.abs(m) < .001 && (m = 0), Math.abs(f) < .001 && (f = 0), Math.abs(d) < .001 && (d = 0), Math.abs(h) < .001 && (h = 0), Math.abs(c) < .001 && (c = 0);
- var g = "translate3d(" + m + "px," + f + "px," + d + "px) rotateX(" + c + "deg) rotateY(" + h + "deg)";
- if (s.transform(g), s[0].style.zIndex = 1 - Math.abs(Math.round(u)), p.params.coverflow.slideShadows) {
- var v = p.isHorizontal() ? s.find(".swiper-slide-shadow-left") : s.find(".swiper-slide-shadow-top"),
- y = p.isHorizontal() ? s.find(".swiper-slide-shadow-right") : s.find(".swiper-slide-shadow-bottom");
- 0 === v.length && (v = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "left" : "top") + '"></div>'), s.append(v)), 0 === y.length && (y = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "right" : "bottom") + '"></div>'), s.append(y)), v.length && (v[0].style.opacity = u > 0 ? u : 0), y.length && (y[0].style.opacity = -u > 0 ? -u : 0)
- }
- }
- p.browser.ie && (p.wrapper[0].style.perspectiveOrigin = e + "px 50%")
- },
- setTransition: function(t) {
- p.slides.transition(t)
- .find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left")
- .transition(t)
- }
- }
- }, p.lazy = {
- initialImageLoaded: !1,
- loadImageInSlide: function(t, e) {
- if (void 0 !== t && (void 0 === e && (e = !0), 0 !== p.slides.length)) {
- var n = p.slides.eq(t),
- r = n.find("." + p.params.lazyLoadingClass + ":not(." + p.params.lazyStatusLoadedClass + "):not(." + p.params.lazyStatusLoadingClass + ")");
- !n.hasClass(p.params.lazyLoadingClass) || n.hasClass(p.params.lazyStatusLoadedClass) || n.hasClass(p.params.lazyStatusLoadingClass) || (r = r.add(n[0])), 0 !== r.length && r.each((function() {
- var t = i(this);
- t.addClass(p.params.lazyStatusLoadingClass);
- var r = t.attr("data-background"),
- o = t.attr("data-src"),
- a = t.attr("data-srcset"),
- s = t.attr("data-sizes");
- p.loadImage(t[0], o || r, a, s, !1, (function() {
- if (null != p && p) {
- if (r ? (t.css("background-image", 'url("' + r + '")'), t.removeAttr("data-background")) : (a && (t.attr("srcset", a), t.removeAttr("data-srcset")), s && (t.attr("sizes", s), t.removeAttr("data-sizes")), o && (t.attr("src", o), t.removeAttr("data-src"))), t.addClass(p.params.lazyStatusLoadedClass)
- .removeClass(p.params.lazyStatusLoadingClass), n.find("." + p.params.lazyPreloaderClass + ", ." + p.params.preloaderClass)
- .remove(), p.params.loop && e) {
- var i = n.attr("data-swiper-slide-index");
- if (n.hasClass(p.params.slideDuplicateClass)) {
- var l = p.wrapper.children('[data-swiper-slide-index="' + i + '"]:not(.' + p.params.slideDuplicateClass + ")");
- p.lazy.loadImageInSlide(l.index(), !1)
- } else {
- var u = p.wrapper.children("." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + i + '"]');
- p.lazy.loadImageInSlide(u.index(), !1)
- }
- }
- p.emit("onLazyImageReady", p, n[0], t[0])
- }
- })), p.emit("onLazyImageLoad", p, n[0], t[0])
- }))
- }
- },
- load: function() {
- var t, e = p.params.slidesPerView;
- if ("auto" === e && (e = 0), p.lazy.initialImageLoaded || (p.lazy.initialImageLoaded = !0), p.params.watchSlidesVisibility) p.wrapper.children("." + p.params.slideVisibleClass)
- .each((function() {
- p.lazy.loadImageInSlide(i(this)
- .index())
- }));
- else if (e > 1)
- for (t = p.activeIndex; t < p.activeIndex + e; t++) p.slides[t] && p.lazy.loadImageInSlide(t);
- else p.lazy.loadImageInSlide(p.activeIndex);
- if (p.params.lazyLoadingInPrevNext)
- if (e > 1 || p.params.lazyLoadingInPrevNextAmount && p.params.lazyLoadingInPrevNextAmount > 1) {
- var n = p.params.lazyLoadingInPrevNextAmount,
- r = e,
- o = Math.min(p.activeIndex + r + Math.max(n, r), p.slides.length),
- a = Math.max(p.activeIndex - Math.max(r, n), 0);
- for (t = p.activeIndex + e; t < o; t++) p.slides[t] && p.lazy.loadImageInSlide(t);
- for (t = a; t < p.activeIndex; t++) p.slides[t] && p.lazy.loadImageInSlide(t)
- } else {
- var s = p.wrapper.children("." + p.params.slideNextClass);
- s.length > 0 && p.lazy.loadImageInSlide(s.index());
- var l = p.wrapper.children("." + p.params.slidePrevClass);
- l.length > 0 && p.lazy.loadImageInSlide(l.index())
- }
- },
- onTransitionStart: function() {
- p.params.lazyLoading && (p.params.lazyLoadingOnTransitionStart || !p.params.lazyLoadingOnTransitionStart && !p.lazy.initialImageLoaded) && p.lazy.load()
- },
- onTransitionEnd: function() {
- p.params.lazyLoading && !p.params.lazyLoadingOnTransitionStart && p.lazy.load()
- }
- }, p.scrollbar = {
- isTouched: !1,
- setDragPosition: function(t) {
- var e = p.scrollbar,
- i = (p.isHorizontal() ? "touchstart" === t.type || "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX || t.clientX : "touchstart" === t.type || "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY || t.clientY) - e.track.offset()[p.isHorizontal() ? "left" : "top"] - e.dragSize / 2,
- n = -p.minTranslate() * e.moveDivider,
- r = -p.maxTranslate() * e.moveDivider;
- i < n ? i = n : i > r && (i = r), i = -i / e.moveDivider, p.updateProgress(i), p.setWrapperTranslate(i, !0)
- },
- dragStart: function(t) {
- var e = p.scrollbar;
- e.isTouched = !0, t.preventDefault(), t.stopPropagation(), e.setDragPosition(t), clearTimeout(e.dragTimeout), e.track.transition(0), p.params.scrollbarHide && e.track.css("opacity", 1), p.wrapper.transition(100), e.drag.transition(100), p.emit("onScrollbarDragStart", p)
- },
- dragMove: function(t) {
- var e = p.scrollbar;
- e.isTouched && (t.preventDefault ? t.preventDefault() : t.returnValue = !1, e.setDragPosition(t), p.wrapper.transition(0), e.track.transition(0), e.drag.transition(0), p.emit("onScrollbarDragMove", p))
- },
- dragEnd: function(t) {
- var e = p.scrollbar;
- e.isTouched && (e.isTouched = !1, p.params.scrollbarHide && (clearTimeout(e.dragTimeout), e.dragTimeout = setTimeout((function() {
- e.track.css("opacity", 0), e.track.transition(400)
- }), 1e3)), p.emit("onScrollbarDragEnd", p), p.params.scrollbarSnapOnRelease && p.slideReset())
- },
- draggableEvents: !1 !== p.params.simulateTouch || p.support.touch ? p.touchEvents : p.touchEventsDesktop,
- enableDraggable: function() {
- var t = p.scrollbar,
- e = p.support.touch ? t.track : document;
- i(t.track)
- .on(t.draggableEvents.start, t.dragStart), i(e)
- .on(t.draggableEvents.move, t.dragMove), i(e)
- .on(t.draggableEvents.end, t.dragEnd)
- },
- disableDraggable: function() {
- var t = p.scrollbar,
- e = p.support.touch ? t.track : document;
- i(t.track)
- .off(t.draggableEvents.start, t.dragStart), i(e)
- .off(t.draggableEvents.move, t.dragMove), i(e)
- .off(t.draggableEvents.end, t.dragEnd)
- },
- set: function() {
- if (p.params.scrollbar) {
- var t = p.scrollbar;
- t.track = i(p.params.scrollbar), p.params.uniqueNavElements && "string" == typeof p.params.scrollbar && t.track.length > 1 && 1 === p.container.find(p.params.scrollbar)
- .length && (t.track = p.container.find(p.params.scrollbar)), t.drag = t.track.find(".swiper-scrollbar-drag"), 0 === t.drag.length && (t.drag = i('<div class="swiper-scrollbar-drag"></div>'), t.track.append(t.drag)), t.drag[0].style.width = "", t.drag[0].style.height = "", t.trackSize = p.isHorizontal() ? t.track[0].offsetWidth : t.track[0].offsetHeight, t.divider = p.size / p.virtualSize, t.moveDivider = t.divider * (t.trackSize / p.size), t.dragSize = t.trackSize * t.divider, p.isHorizontal() ? t.drag[0].style.width = t.dragSize + "px" : t.drag[0].style.height = t.dragSize + "px", t.divider >= 1 ? t.track[0].style.display = "none" : t.track[0].style.display = "", p.params.scrollbarHide && (t.track[0].style.opacity = 0)
- }
- },
- setTranslate: function() {
- if (p.params.scrollbar) {
- var t, e = p.scrollbar,
- i = (p.translate, e.dragSize);
- t = (e.trackSize - e.dragSize) * p.progress, p.rtl && p.isHorizontal() ? (t = -t) > 0 ? (i = e.dragSize - t, t = 0) : -t + e.dragSize > e.trackSize && (i = e.trackSize + t) : t < 0 ? (i = e.dragSize + t, t = 0) : t + e.dragSize > e.trackSize && (i = e.trackSize - t), p.isHorizontal() ? (p.support.transforms3d ? e.drag.transform("translate3d(" + t + "px, 0, 0)") : e.drag.transform("translateX(" + t + "px)"), e.drag[0].style.width = i + "px") : (p.support.transforms3d ? e.drag.transform("translate3d(0px, " + t + "px, 0)") : e.drag.transform("translateY(" + t + "px)"), e.drag[0].style.height = i + "px"), p.params.scrollbarHide && (clearTimeout(e.timeout), e.track[0].style.opacity = 1, e.timeout = setTimeout((function() {
- e.track[0].style.opacity = 0, e.track.transition(400)
- }), 1e3))
- }
- },
- setTransition: function(t) {
- p.params.scrollbar && p.scrollbar.drag.transition(t)
- }
- }, p.controller = {
- LinearSpline: function(t, e) {
- var i, n, r, o, a, s = function(t, e) {
- for (n = -1, i = t.length; i - n > 1;) t[r = i + n >> 1] <= e ? n = r : i = r;
- return i
- };
- this.x = t, this.y = e, this.lastIndex = t.length - 1;
- this.x.length;
- this.interpolate = function(t) {
- return t ? (a = s(this.x, t), o = a - 1, (t - this.x[o]) * (this.y[a] - this.y[o]) / (this.x[a] - this.x[o]) + this.y[o]) : 0
- }
- },
- getInterpolateFunction: function(t) {
- p.controller.spline || (p.controller.spline = p.params.loop ? new p.controller.LinearSpline(p.slidesGrid, t.slidesGrid) : new p.controller.LinearSpline(p.snapGrid, t.snapGrid))
- },
- setTranslate: function(t, e) {
- var i, n, r = p.params.control;
- function a(e) {
- t = e.rtl && "horizontal" === e.params.direction ? -p.translate : p.translate, "slide" === p.params.controlBy && (p.controller.getInterpolateFunction(e), n = -p.controller.spline.interpolate(-t)), n && "container" !== p.params.controlBy || (i = (e.maxTranslate() - e.minTranslate()) / (p.maxTranslate() - p.minTranslate()), n = (t - p.minTranslate()) * i + e.minTranslate()), p.params.controlInverse && (n = e.maxTranslate() - n), e.updateProgress(n), e.setWrapperTranslate(n, !1, p), e.updateActiveIndex()
- }
- if (Array.isArray(r))
- for (var s = 0; s < r.length; s++) r[s] !== e && r[s] instanceof o && a(r[s]);
- else r instanceof o && e !== r && a(r)
- },
- setTransition: function(t, e) {
- var i, n = p.params.control;
- function r(e) {
- e.setWrapperTransition(t, p), 0 !== t && (e.onTransitionStart(), e.wrapper.transitionEnd((function() {
- n && (e.params.loop && "slide" === p.params.controlBy && e.fixLoop(), e.onTransitionEnd())
- })))
- }
- if (Array.isArray(n))
- for (i = 0; i < n.length; i++) n[i] !== e && n[i] instanceof o && r(n[i]);
- else n instanceof o && e !== n && r(n)
- }
- }, p.hashnav = {
- onHashCange: function(t, e) {
- var i = document.location.hash.replace("#", "");
- i !== p.slides.eq(p.activeIndex)
- .attr("data-hash") && p.slideTo(p.wrapper.children("." + p.params.slideClass + '[data-hash="' + i + '"]')
- .index())
- },
- attachEvents: function(t) {
- var e = t ? "off" : "on";
- i(window)[e]("hashchange", p.hashnav.onHashCange)
- },
- setHash: function() {
- if (p.hashnav.initialized && p.params.hashnav)
- if (p.params.replaceState && window.history && window.history.replaceState) window.history.replaceState(null, null, "#" + p.slides.eq(p.activeIndex)
- .attr("data-hash") || !1);
- else {
- var t = p.slides.eq(p.activeIndex),
- e = t.attr("data-hash") || t.attr("data-history");
- document.location.hash = e || ""
- }
- },
- init: function() {
- if (p.params.hashnav && !p.params.history) {
- p.hashnav.initialized = !0;
- var t = document.location.hash.replace("#", "");
- if (t)
- for (var e = 0, i = p.slides.length; e < i; e++) {
- var n = p.slides.eq(e);
- if ((n.attr("data-hash") || n.attr("data-history")) === t && !n.hasClass(p.params.slideDuplicateClass)) {
- var r = n.index();
- p.slideTo(r, 0, p.params.runCallbacksOnInit, !0)
- }
- }
- p.params.hashnavWatchState && p.hashnav.attachEvents()
- }
- },
- destroy: function() {
- p.params.hashnavWatchState && p.hashnav.attachEvents(!0)
- }
- }, p.history = {
- init: function() {
- if (p.params.history) {
- if (!window.history || !window.history.pushState) return p.params.history = !1, void(p.params.hashnav = !0);
- p.history.initialized = !0, this.paths = this.getPathValues(), (this.paths.key || this.paths.value) && (this.scrollToSlide(0, this.paths.value, p.params.runCallbacksOnInit), p.params.replaceState || window.addEventListener("popstate", this.setHistoryPopState))
- }
- },
- setHistoryPopState: function() {
- p.history.paths = p.history.getPathValues(), p.history.scrollToSlide(p.params.speed, p.history.paths.value, !1)
- },
- getPathValues: function() {
- var t = window.location.pathname.slice(1)
- .split("/"),
- e = t.length;
- return {
- key: t[e - 2],
- value: t[e - 1]
- }
- },
- setHistory: function(t, e) {
- if (p.history.initialized && p.params.history) {
- var i = p.slides.eq(e),
- n = this.slugify(i.attr("data-history"));
- window.location.pathname.includes(t) || (n = t + "/" + n), p.params.replaceState ? window.history.replaceState(null, null, n) : window.history.pushState(null, null, n)
- }
- },
- slugify: function(t) {
- return t.toString()
- .toLowerCase()
- .replace(/\s+/g, "-")
- .replace(/[^\w\-]+/g, "")
- .replace(/\-\-+/g, "-")
- .replace(/^-+/, "")
- .replace(/-+$/, "")
- },
- scrollToSlide: function(t, e, i) {
- if (e)
- for (var n = 0, r = p.slides.length; n < r; n++) {
- var o = p.slides.eq(n);
- if (this.slugify(o.attr("data-history")) === e && !o.hasClass(p.params.slideDuplicateClass)) {
- var a = o.index();
- p.slideTo(a, t, i)
- }
- } else p.slideTo(0, t, i)
- }
- }, p.disableKeyboardControl = function() {
- p.params.keyboardControl = !1, i(document)
- .off("keydown", k)
- }, p.enableKeyboardControl = function() {
- p.params.keyboardControl = !0, i(document)
- .on("keydown", k)
- }, p.mousewheel = {
- event: !1,
- lastScrollTime: (new window.Date)
- .getTime()
- }, p.params.mousewheelControl && (p.mousewheel.event = navigator.userAgent.indexOf("firefox") > -1 ? "DOMMouseScroll" : function() {
- var t = "onwheel" in document;
- if (!t) {
- var e = document.createElement("div");
- e.setAttribute("onwheel", "return;"), t = "function" == typeof e.onwheel
- }
- return !t && document.implementation && document.implementation.hasFeature && !0 !== document.implementation.hasFeature("", "") && (t = document.implementation.hasFeature("Events.wheel", "3.0")), t
- }() ? "wheel" : "mousewheel"), p.disableMousewheelControl = function() {
- if (!p.mousewheel.event) return !1;
- var t = p.container;
- return "container" !== p.params.mousewheelEventsTarged && (t = i(p.params.mousewheelEventsTarged)), t.off(p.mousewheel.event, F), p.params.mousewheelControl = !1, !0
- }, p.enableMousewheelControl = function() {
- if (!p.mousewheel.event) return !1;
- var t = p.container;
- return "container" !== p.params.mousewheelEventsTarged && (t = i(p.params.mousewheelEventsTarged)), t.on(p.mousewheel.event, F), p.params.mousewheelControl = !0, !0
- }, p.parallax = {
- setTranslate: function() {
- p.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]")
- .each((function() {
- B(this, p.progress)
- })), p.slides.each((function() {
- var t = i(this);
- t.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]")
- .each((function() {
- B(this, Math.min(Math.max(t[0].progress, -1), 1))
- }))
- }))
- },
- setTransition: function(t) {
- void 0 === t && (t = p.params.speed), p.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]")
- .each((function() {
- var e = i(this),
- n = parseInt(e.attr("data-swiper-parallax-duration"), 10) || t;
- 0 === t && (n = 0), e.transition(n)
- }))
- }
- }, p.zoom = {
- scale: 1,
- currentScale: 1,
- isScaling: !1,
- gesture: {
- slide: void 0,
- slideWidth: void 0,
- slideHeight: void 0,
- image: void 0,
- imageWrap: void 0,
- zoomMax: p.params.zoomMax
- },
- image: {
- isTouched: void 0,
- isMoved: void 0,
- currentX: void 0,
- currentY: void 0,
- minX: void 0,
- minY: void 0,
- maxX: void 0,
- maxY: void 0,
- width: void 0,
- height: void 0,
- startX: void 0,
- startY: void 0,
- touchesStart: {},
- touchesCurrent: {}
- },
- velocity: {
- x: void 0,
- y: void 0,
- prevPositionX: void 0,
- prevPositionY: void 0,
- prevTime: void 0
- },
- getDistanceBetweenTouches: function(t) {
- if (t.targetTouches.length < 2) return 1;
- var e = t.targetTouches[0].pageX,
- i = t.targetTouches[0].pageY,
- n = t.targetTouches[1].pageX,
- r = t.targetTouches[1].pageY;
- return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - i, 2))
- },
- onGestureStart: function(t) {
- var e = p.zoom;
- if (!p.support.gestures) {
- if ("touchstart" !== t.type || "touchstart" === t.type && t.targetTouches.length < 2) return;
- e.gesture.scaleStart = e.getDistanceBetweenTouches(t)
- }
- e.gesture.slide && e.gesture.slide.length || (e.gesture.slide = i(this), 0 === e.gesture.slide.length && (e.gesture.slide = p.slides.eq(p.activeIndex)), e.gesture.image = e.gesture.slide.find("img, svg, canvas"), e.gesture.imageWrap = e.gesture.image.parent("." + p.params.zoomContainerClass), e.gesture.zoomMax = e.gesture.imageWrap.attr("data-swiper-zoom") || p.params.zoomMax, 0 !== e.gesture.imageWrap.length) ? (e.gesture.image.transition(0), e.isScaling = !0) : e.gesture.image = void 0
- },
- onGestureChange: function(t) {
- var e = p.zoom;
- if (!p.support.gestures) {
- if ("touchmove" !== t.type || "touchmove" === t.type && t.targetTouches.length < 2) return;
- e.gesture.scaleMove = e.getDistanceBetweenTouches(t)
- }
- e.gesture.image && 0 !== e.gesture.image.length && (p.support.gestures ? e.scale = t.scale * e.currentScale : e.scale = e.gesture.scaleMove / e.gesture.scaleStart * e.currentScale, e.scale > e.gesture.zoomMax && (e.scale = e.gesture.zoomMax - 1 + Math.pow(e.scale - e.gesture.zoomMax + 1, .5)), e.scale < p.params.zoomMin && (e.scale = p.params.zoomMin + 1 - Math.pow(p.params.zoomMin - e.scale + 1, .5)), e.gesture.image.transform("translate3d(0,0,0) scale(" + e.scale + ")"))
- },
- onGestureEnd: function(t) {
- var e = p.zoom;
- !p.support.gestures && ("touchend" !== t.type || "touchend" === t.type && t.changedTouches.length < 2) || e.gesture.image && 0 !== e.gesture.image.length && (e.scale = Math.max(Math.min(e.scale, e.gesture.zoomMax), p.params.zoomMin), e.gesture.image.transition(p.params.speed)
- .transform("translate3d(0,0,0) scale(" + e.scale + ")"), e.currentScale = e.scale, e.isScaling = !1, 1 === e.scale && (e.gesture.slide = void 0))
- },
- onTouchStart: function(t, e) {
- var i = t.zoom;
- i.gesture.image && 0 !== i.gesture.image.length && (i.image.isTouched || ("android" === t.device.os && e.preventDefault(), i.image.isTouched = !0, i.image.touchesStart.x = "touchstart" === e.type ? e.targetTouches[0].pageX : e.pageX, i.image.touchesStart.y = "touchstart" === e.type ? e.targetTouches[0].pageY : e.pageY))
- },
- onTouchMove: function(t) {
- var e = p.zoom;
- if (e.gesture.image && 0 !== e.gesture.image.length && (p.allowClick = !1, e.image.isTouched && e.gesture.slide)) {
- e.image.isMoved || (e.image.width = e.gesture.image[0].offsetWidth, e.image.height = e.gesture.image[0].offsetHeight, e.image.startX = p.getTranslate(e.gesture.imageWrap[0], "x") || 0, e.image.startY = p.getTranslate(e.gesture.imageWrap[0], "y") || 0, e.gesture.slideWidth = e.gesture.slide[0].offsetWidth, e.gesture.slideHeight = e.gesture.slide[0].offsetHeight, e.gesture.imageWrap.transition(0), p.rtl && (e.image.startX = -e.image.startX), p.rtl && (e.image.startY = -e.image.startY));
- var i = e.image.width * e.scale,
- n = e.image.height * e.scale;
- if (!(i < e.gesture.slideWidth && n < e.gesture.slideHeight)) {
- if (e.image.minX = Math.min(e.gesture.slideWidth / 2 - i / 2, 0), e.image.maxX = -e.image.minX, e.image.minY = Math.min(e.gesture.slideHeight / 2 - n / 2, 0), e.image.maxY = -e.image.minY, e.image.touchesCurrent.x = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, e.image.touchesCurrent.y = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY, !e.image.isMoved && !e.isScaling) {
- if (p.isHorizontal() && Math.floor(e.image.minX) === Math.floor(e.image.startX) && e.image.touchesCurrent.x < e.image.touchesStart.x || Math.floor(e.image.maxX) === Math.floor(e.image.startX) && e.image.touchesCurrent.x > e.image.touchesStart.x) return void(e.image.isTouched = !1);
- if (!p.isHorizontal() && Math.floor(e.image.minY) === Math.floor(e.image.startY) && e.image.touchesCurrent.y < e.image.touchesStart.y || Math.floor(e.image.maxY) === Math.floor(e.image.startY) && e.image.touchesCurrent.y > e.image.touchesStart.y) return void(e.image.isTouched = !1)
- }
- t.preventDefault(), t.stopPropagation(), e.image.isMoved = !0, e.image.currentX = e.image.touchesCurrent.x - e.image.touchesStart.x + e.image.startX, e.image.currentY = e.image.touchesCurrent.y - e.image.touchesStart.y + e.image.startY, e.image.currentX < e.image.minX && (e.image.currentX = e.image.minX + 1 - Math.pow(e.image.minX - e.image.currentX + 1, .8)), e.image.currentX > e.image.maxX && (e.image.currentX = e.image.maxX - 1 + Math.pow(e.image.currentX - e.image.maxX + 1, .8)), e.image.currentY < e.image.minY && (e.image.currentY = e.image.minY + 1 - Math.pow(e.image.minY - e.image.currentY + 1, .8)), e.image.currentY > e.image.maxY && (e.image.currentY = e.image.maxY - 1 + Math.pow(e.image.currentY - e.image.maxY + 1, .8)), e.velocity.prevPositionX || (e.velocity.prevPositionX = e.image.touchesCurrent.x), e.velocity.prevPositionY || (e.velocity.prevPositionY = e.image.touchesCurrent.y), e.velocity.prevTime || (e.velocity.prevTime = Date.now()), e.velocity.x = (e.image.touchesCurrent.x - e.velocity.prevPositionX) / (Date.now() - e.velocity.prevTime) / 2, e.velocity.y = (e.image.touchesCurrent.y - e.velocity.prevPositionY) / (Date.now() - e.velocity.prevTime) / 2, Math.abs(e.image.touchesCurrent.x - e.velocity.prevPositionX) < 2 && (e.velocity.x = 0), Math.abs(e.image.touchesCurrent.y - e.velocity.prevPositionY) < 2 && (e.velocity.y = 0), e.velocity.prevPositionX = e.image.touchesCurrent.x, e.velocity.prevPositionY = e.image.touchesCurrent.y, e.velocity.prevTime = Date.now(), e.gesture.imageWrap.transform("translate3d(" + e.image.currentX + "px, " + e.image.currentY + "px,0)")
- }
- }
- },
- onTouchEnd: function(t, e) {
- var i = t.zoom;
- if (i.gesture.image && 0 !== i.gesture.image.length) {
- if (!i.image.isTouched || !i.image.isMoved) return i.image.isTouched = !1, void(i.image.isMoved = !1);
- i.image.isTouched = !1, i.image.isMoved = !1;
- var n = 300,
- r = 300,
- o = i.velocity.x * n,
- a = i.image.currentX + o,
- s = i.velocity.y * r,
- l = i.image.currentY + s;
- 0 !== i.velocity.x && (n = Math.abs((a - i.image.currentX) / i.velocity.x)), 0 !== i.velocity.y && (r = Math.abs((l - i.image.currentY) / i.velocity.y));
- var u = Math.max(n, r);
- i.image.currentX = a, i.image.currentY = l;
- var h = i.image.width * i.scale,
- c = i.image.height * i.scale;
- i.image.minX = Math.min(i.gesture.slideWidth / 2 - h / 2, 0), i.image.maxX = -i.image.minX, i.image.minY = Math.min(i.gesture.slideHeight / 2 - c / 2, 0), i.image.maxY = -i.image.minY, i.image.currentX = Math.max(Math.min(i.image.currentX, i.image.maxX), i.image.minX), i.image.currentY = Math.max(Math.min(i.image.currentY, i.image.maxY), i.image.minY), i.gesture.imageWrap.transition(u)
- .transform("translate3d(" + i.image.currentX + "px, " + i.image.currentY + "px,0)")
- }
- },
- onTransitionEnd: function(t) {
- var e = t.zoom;
- e.gesture.slide && t.previousIndex !== t.activeIndex && (e.gesture.image.transform("translate3d(0,0,0) scale(1)"), e.gesture.imageWrap.transform("translate3d(0,0,0)"), e.gesture.slide = e.gesture.image = e.gesture.imageWrap = void 0, e.scale = e.currentScale = 1)
- },
- toggleZoom: function(t, e) {
- var n, r, o, a, s, l, u, h, c, d, p, f, m, g, v, y, b = t.zoom;
- (b.gesture.slide || (b.gesture.slide = t.clickedSlide ? i(t.clickedSlide) : t.slides.eq(t.activeIndex), b.gesture.image = b.gesture.slide.find("img, svg, canvas"), b.gesture.imageWrap = b.gesture.image.parent("." + t.params.zoomContainerClass)), b.gesture.image && 0 !== b.gesture.image.length) && (void 0 === b.image.touchesStart.x && e ? (n = "touchend" === e.type ? e.changedTouches[0].pageX : e.pageX, r = "touchend" === e.type ? e.changedTouches[0].pageY : e.pageY) : (n = b.image.touchesStart.x, r = b.image.touchesStart.y), b.scale && 1 !== b.scale ? (b.scale = b.currentScale = 1, b.gesture.imageWrap.transition(300)
- .transform("translate3d(0,0,0)"), b.gesture.image.transition(300)
- .transform("translate3d(0,0,0) scale(1)"), b.gesture.slide = void 0) : (b.scale = b.currentScale = b.gesture.imageWrap.attr("data-swiper-zoom") || t.params.zoomMax, e ? (v = b.gesture.slide[0].offsetWidth, y = b.gesture.slide[0].offsetHeight, o = b.gesture.slide.offset()
- .left + v / 2 - n, a = b.gesture.slide.offset()
- .top + y / 2 - r, u = b.gesture.image[0].offsetWidth, h = b.gesture.image[0].offsetHeight, c = u * b.scale, d = h * b.scale, m = -(p = Math.min(v / 2 - c / 2, 0)), g = -(f = Math.min(y / 2 - d / 2, 0)), (s = o * b.scale) < p && (s = p), s > m && (s = m), (l = a * b.scale) < f && (l = f), l > g && (l = g)) : (s = 0, l = 0), b.gesture.imageWrap.transition(300)
- .transform("translate3d(" + s + "px, " + l + "px,0)"), b.gesture.image.transition(300)
- .transform("translate3d(0,0,0) scale(" + b.scale + ")")))
- },
- attachEvents: function(t) {
- var e = t ? "off" : "on";
- if (p.params.zoom) {
- p.slides;
- var n = !("touchstart" !== p.touchEvents.start || !p.support.passiveListener || !p.params.passiveListeners) && {
- passive: !0,
- capture: !1
- };
- p.support.gestures ? (p.slides[e]("gesturestart", p.zoom.onGestureStart, n), p.slides[e]("gesturechange", p.zoom.onGestureChange, n), p.slides[e]("gestureend", p.zoom.onGestureEnd, n)) : "touchstart" === p.touchEvents.start && (p.slides[e](p.touchEvents.start, p.zoom.onGestureStart, n), p.slides[e](p.touchEvents.move, p.zoom.onGestureChange, n), p.slides[e](p.touchEvents.end, p.zoom.onGestureEnd, n)), p[e]("touchStart", p.zoom.onTouchStart), p.slides.each((function(t, n) {
- i(n)
- .find("." + p.params.zoomContainerClass)
- .length > 0 && i(n)[e](p.touchEvents.move, p.zoom.onTouchMove)
- })), p[e]("touchEnd", p.zoom.onTouchEnd), p[e]("transitionEnd", p.zoom.onTransitionEnd), p.params.zoomToggle && p.on("doubleTap", p.zoom.toggleZoom)
- }
- },
- init: function() {
- p.zoom.attachEvents()
- },
- destroy: function() {
- p.zoom.attachEvents(!0)
- }
- }, p._plugins = [], p.plugins) {
- var L = p.plugins[D](p, p.params[D]);
- L && p._plugins.push(L)
- }
- return p.callPlugins = function(t) {
- for (var e = 0; e < p._plugins.length; e++) t in p._plugins[e] && p._plugins[e][t](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5])
- }, p.emitterEventListeners = {}, p.emit = function(t) {
- var e;
- if (p.params[t] && p.params[t](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]), p.emitterEventListeners[t])
- for (e = 0; e < p.emitterEventListeners[t].length; e++) p.emitterEventListeners[t][e](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
- p.callPlugins && p.callPlugins(t, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5])
- }, p.on = function(t, e) {
- return t = z(t), p.emitterEventListeners[t] || (p.emitterEventListeners[t] = []), p.emitterEventListeners[t].push(e), p
- }, p.off = function(t, e) {
- var i;
- if (t = z(t), void 0 === e) return p.emitterEventListeners[t] = [], p;
- if (p.emitterEventListeners[t] && 0 !== p.emitterEventListeners[t].length) {
- for (i = 0; i < p.emitterEventListeners[t].length; i++) p.emitterEventListeners[t][i] === e && p.emitterEventListeners[t].splice(i, 1);
- return p
- }
- }, p.once = function(t, e) {
- t = z(t);
- var i = function() {
- e(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]), p.off(t, i)
- };
- return p.on(t, i), p
- }, p.a11y = {
- makeFocusable: function(t) {
- return t.attr("tabIndex", "0"), t
- },
- addRole: function(t, e) {
- return t.attr("role", e), t
- },
- addLabel: function(t, e) {
- return t.attr("aria-label", e), t
- },
- disable: function(t) {
- return t.attr("aria-disabled", !0), t
- },
- enable: function(t) {
- return t.attr("aria-disabled", !1), t
- },
- onEnterKey: function(t) {
- 13 === t.keyCode && (i(t.target)
- .is(p.params.nextButton) ? (p.onClickNext(t), p.isEnd ? p.a11y.notify(p.params.lastSlideMessage) : p.a11y.notify(p.params.nextSlideMessage)) : i(t.target)
- .is(p.params.prevButton) && (p.onClickPrev(t), p.isBeginning ? p.a11y.notify(p.params.firstSlideMessage) : p.a11y.notify(p.params.prevSlideMessage)), i(t.target)
- .is("." + p.params.bulletClass) && i(t.target)[0].click())
- },
- liveRegion: i('<span class="' + p.params.notificationClass + '" aria-live="assertive" aria-atomic="true"></span>'),
- notify: function(t) {
- var e = p.a11y.liveRegion;
- 0 !== e.length && (e.html(""), e.html(t))
- },
- init: function() {
- p.params.nextButton && p.nextButton && p.nextButton.length > 0 && (p.a11y.makeFocusable(p.nextButton), p.a11y.addRole(p.nextButton, "button"), p.a11y.addLabel(p.nextButton, p.params.nextSlideMessage)), p.params.prevButton && p.prevButton && p.prevButton.length > 0 && (p.a11y.makeFocusable(p.prevButton), p.a11y.addRole(p.prevButton, "button"), p.a11y.addLabel(p.prevButton, p.params.prevSlideMessage)), i(p.container)
- .append(p.a11y.liveRegion)
- },
- initPagination: function() {
- p.params.pagination && p.params.paginationClickable && p.bullets && p.bullets.length && p.bullets.each((function() {
- var t = i(this);
- p.a11y.makeFocusable(t), p.a11y.addRole(t, "button"), p.a11y.addLabel(t, p.params.paginationBulletMessage.replace(/{{index}}/, t.index() + 1))
- }))
- },
- destroy: function() {
- p.a11y.liveRegion && p.a11y.liveRegion.length > 0 && p.a11y.liveRegion.remove()
- }
- }, p.init = function() {
- p.params.loop && p.createLoop(), p.updateContainerSize(), p.updateSlidesSize(), p.updatePagination(), p.params.scrollbar && p.scrollbar && (p.scrollbar.set(), p.params.scrollbarDraggable && p.scrollbar.enableDraggable()), "slide" !== p.params.effect && p.effects[p.params.effect] && (p.params.loop || p.updateProgress(), p.effects[p.params.effect].setTranslate()), p.params.loop ? p.slideTo(p.params.initialSlide + p.loopedSlides, 0, p.params.runCallbacksOnInit) : (p.slideTo(p.params.initialSlide, 0, p.params.runCallbacksOnInit), 0 === p.params.initialSlide && (p.parallax && p.params.parallax && p.parallax.setTranslate(), p.lazy && p.params.lazyLoading && (p.lazy.load(), p.lazy.initialImageLoaded = !0))), p.attachEvents(), p.params.observer && p.support.observer && p.initObservers(), p.params.preloadImages && !p.params.lazyLoading && p.preloadImages(), p.params.zoom && p.zoom && p.zoom.init(), p.params.autoplay && p.startAutoplay(), p.params.keyboardControl && p.enableKeyboardControl && p.enableKeyboardControl(), p.params.mousewheelControl && p.enableMousewheelControl && p.enableMousewheelControl(), p.params.hashnavReplaceState && (p.params.replaceState = p.params.hashnavReplaceState), p.params.history && p.history && p.history.init(), p.params.hashnav && p.hashnav && p.hashnav.init(), p.params.a11y && p.a11y && p.a11y.init(), p.emit("onInit", p)
- }, p.cleanupStyles = function() {
- p.container.removeClass(p.classNames.join(" "))
- .removeAttr("style"), p.wrapper.removeAttr("style"), p.slides && p.slides.length && p.slides.removeClass([p.params.slideVisibleClass, p.params.slideActiveClass, p.params.slideNextClass, p.params.slidePrevClass].join(" "))
- .removeAttr("style")
- .removeAttr("data-swiper-column")
- .removeAttr("data-swiper-row"), p.paginationContainer && p.paginationContainer.length && p.paginationContainer.removeClass(p.params.paginationHiddenClass), p.bullets && p.bullets.length && p.bullets.removeClass(p.params.bulletActiveClass), p.params.prevButton && i(p.params.prevButton)
- .removeClass(p.params.buttonDisabledClass), p.params.nextButton && i(p.params.nextButton)
- .removeClass(p.params.buttonDisabledClass), p.params.scrollbar && p.scrollbar && (p.scrollbar.track && p.scrollbar.track.length && p.scrollbar.track.removeAttr("style"), p.scrollbar.drag && p.scrollbar.drag.length && p.scrollbar.drag.removeAttr("style"))
- }, p.destroy = function(t, e) {
- p.detachEvents(), p.stopAutoplay(), p.params.scrollbar && p.scrollbar && p.params.scrollbarDraggable && p.scrollbar.disableDraggable(), p.params.loop && p.destroyLoop(), e && p.cleanupStyles(), p.disconnectObservers(), p.params.zoom && p.zoom && p.zoom.destroy(), p.params.keyboardControl && p.disableKeyboardControl && p.disableKeyboardControl(), p.params.mousewheelControl && p.disableMousewheelControl && p.disableMousewheelControl(), p.params.a11y && p.a11y && p.a11y.destroy(), p.params.history && !p.params.replaceState && window.removeEventListener("popstate", p.history.setHistoryPopState), p.params.hashnav && p.hashnav && p.hashnav.destroy(), p.emit("onDestroy"), !1 !== t && (p = null)
- }, p.init(), p
- }
- function O(t) {
- return Math.floor(t)
- }
- function I() {
- var t = p.params.autoplay,
- e = p.slides.eq(p.activeIndex);
- e.attr("data-swiper-autoplay") && (t = e.attr("data-swiper-autoplay") || p.params.autoplay), p.autoplayTimeoutId = setTimeout((function() {
- p.params.loop ? (p.fixLoop(), p._slideNext(), p.emit("onAutoplay", p)) : p.isEnd ? n.autoplayStopOnLast ? p.stopAutoplay() : (p._slideTo(0), p.emit("onAutoplay", p)) : (p._slideNext(), p.emit("onAutoplay", p))
- }), t)
- }
- function R(t, e) {
- var n = i(t.target);
- if (!n.is(e))
- if ("string" == typeof e) n = n.parents(e);
- else if (e.nodeType) {
- var r;
- return n.parents()
- .each((function(t, i) {
- i === e && (r = e)
- })), r ? e : void 0
- }
- if (0 !== n.length) return n[0]
- }
- function N(t, e) {
- e = e || {};
- var i = new(window.MutationObserver || window.WebkitMutationObserver)((function(t) {
- t.forEach((function(t) {
- p.onResize(!0), p.emit("onObserverUpdate", p, t)
- }))
- }));
- i.observe(t, {
- attributes: void 0 === e.attributes || e.attributes,
- childList: void 0 === e.childList || e.childList,
- characterData: void 0 === e.characterData || e.characterData
- }), p.observers.push(i)
- }
- function k(t) {
- t.originalEvent && (t = t.originalEvent);
- var e = t.keyCode || t.charCode;
- if (!p.params.allowSwipeToNext && (p.isHorizontal() && 39 === e || !p.isHorizontal() && 40 === e)) return !1;
- if (!p.params.allowSwipeToPrev && (p.isHorizontal() && 37 === e || !p.isHorizontal() && 38 === e)) return !1;
- if (!(t.shiftKey || t.altKey || t.ctrlKey || t.metaKey || document.activeElement && document.activeElement.nodeName && ("input" === document.activeElement.nodeName.toLowerCase() || "textarea" === document.activeElement.nodeName.toLowerCase()))) {
- if (37 === e || 39 === e || 38 === e || 40 === e) {
- var i = !1;
- if (p.container.parents("." + p.params.slideClass)
- .length > 0 && 0 === p.container.parents("." + p.params.slideActiveClass)
- .length) return;
- var n = {
- left: window.pageXOffset,
- top: window.pageYOffset
- },
- r = (window.renderWidth || window.innerWidth),
- o = (window.renderHeight || window.innerHeight),
- a = p.container.offset();
- p.rtl && (a.left = a.left - p.container[0].scrollLeft);
- for (var s = [
- [a.left, a.top],
- [a.left + p.width, a.top],
- [a.left, a.top + p.height],
- [a.left + p.width, a.top + p.height]
- ], l = 0; l < s.length; l++) {
- var u = s[l];
- u[0] >= n.left && u[0] <= n.left + r && u[1] >= n.top && u[1] <= n.top + o && (i = !0)
- }
- if (!i) return
- }
- p.isHorizontal() ? (37 !== e && 39 !== e || (t.preventDefault ? t.preventDefault() : t.returnValue = !1), (39 === e && !p.rtl || 37 === e && p.rtl) && p.slideNext(), (37 === e && !p.rtl || 39 === e && p.rtl) && p.slidePrev()) : (38 !== e && 40 !== e || (t.preventDefault ? t.preventDefault() : t.returnValue = !1), 40 === e && p.slideNext(), 38 === e && p.slidePrev()), p.emit("onKeyPress", p, e)
- }
- }
- function F(t) {
- t.originalEvent && (t = t.originalEvent);
- var e = 0,
- i = p.rtl ? -1 : 1,
- n = function(t) {
- var e = 0,
- i = 0,
- n = 0,
- r = 0;
- return "detail" in t && (i = t.detail), "wheelDelta" in t && (i = -t.wheelDelta / 120), "wheelDeltaY" in t && (i = -t.wheelDeltaY / 120), "wheelDeltaX" in t && (e = -t.wheelDeltaX / 120), "axis" in t && t.axis === t.HORIZONTAL_AXIS && (e = i, i = 0), n = 10 * e, r = 10 * i, "deltaY" in t && (r = t.deltaY), "deltaX" in t && (n = t.deltaX), (n || r) && t.deltaMode && (1 === t.deltaMode ? (n *= 40, r *= 40) : (n *= 800, r *= 800)), n && !e && (e = n < 1 ? -1 : 1), r && !i && (i = r < 1 ? -1 : 1), {
- spinX: e,
- spinY: i,
- pixelX: n,
- pixelY: r
- }
- }(t);
- if (p.params.mousewheelForceToAxis)
- if (p.isHorizontal()) {
- if (!(Math.abs(n.pixelX) > Math.abs(n.pixelY))) return;
- e = n.pixelX * i
- } else {
- if (!(Math.abs(n.pixelY) > Math.abs(n.pixelX))) return;
- e = n.pixelY
- }
- else e = Math.abs(n.pixelX) > Math.abs(n.pixelY) ? -n.pixelX * i : -n.pixelY;
- if (0 !== e) {
- if (p.params.mousewheelInvert && (e = -e), p.params.freeMode) {
- var r = p.getWrapperTranslate() + e * p.params.mousewheelSensitivity,
- o = p.isBeginning,
- a = p.isEnd;
- if (r >= p.minTranslate() && (r = p.minTranslate()), r <= p.maxTranslate() && (r = p.maxTranslate()), p.setWrapperTransition(0), p.setWrapperTranslate(r), p.updateProgress(), p.updateActiveIndex(), (!o && p.isBeginning || !a && p.isEnd) && p.updateClasses(), p.params.freeModeSticky ? (clearTimeout(p.mousewheel.timeout), p.mousewheel.timeout = setTimeout((function() {
- p.slideReset()
- }), 300)) : p.params.lazyLoading && p.lazy && p.lazy.load(), p.emit("onScroll", p, t), p.params.autoplay && p.params.autoplayDisableOnInteraction && p.stopAutoplay(), 0 === r || r === p.maxTranslate()) return
- } else {
- if ((new window.Date)
- .getTime() - p.mousewheel.lastScrollTime > 60)
- if (e < 0)
- if (p.isEnd && !p.params.loop || p.animating) {
- if (p.params.mousewheelReleaseOnEdges) return !0
- } else p.slideNext(), p.emit("onScroll", p, t);
- else if (p.isBeginning && !p.params.loop || p.animating) {
- if (p.params.mousewheelReleaseOnEdges) return !0
- } else p.slidePrev(), p.emit("onScroll", p, t);
- p.mousewheel.lastScrollTime = (new window.Date)
- .getTime()
- }
- return t.preventDefault ? t.preventDefault() : t.returnValue = !1, !1
- }
- }
- function B(t, e) {
- var n, r, o;
- t = i(t);
- var a = p.rtl ? -1 : 1;
- n = t.attr("data-swiper-parallax") || "0", r = t.attr("data-swiper-parallax-x"), o = t.attr("data-swiper-parallax-y"), r || o ? (r = r || "0", o = o || "0") : p.isHorizontal() ? (r = n, o = "0") : (o = n, r = "0"), r = r.indexOf("%") >= 0 ? parseInt(r, 10) * e * a + "%" : r * e * a + "px", o = o.indexOf("%") >= 0 ? parseInt(o, 10) * e + "%" : o * e + "px", t.transform("translate3d(" + r + ", " + o + ",0px)")
- }
- function z(t) {
- return 0 !== t.indexOf("on") && (t = t[0] !== t[0].toUpperCase() ? "on" + t[0].toUpperCase() + t.substring(1) : "on" + t), t
- }
- };
- o.prototype = {
- isSafari: (r = window.navigator.userAgent.toLowerCase(), r.indexOf("safari") >= 0 && r.indexOf("chrome") < 0 && r.indexOf("android") < 0),
- isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),
- isArray: function(t) {
- return "[object Array]" === Object.prototype.toString.apply(t)
- },
- browser: {
- ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
- ieTouch: window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1 || window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1,
- lteIE9: (n = document.createElement("div"), n.innerHTML = "\x3c!--[if lte IE 9]><i></i><![endif]--\x3e", 1 === n.getElementsByTagName("i")
- .length)
- },
- device: function() {
- var t = window.navigator.userAgent,
- e = t.match(/(Android);?[\s\/]+([\d.]+)?/),
- i = t.match(/(iPad).*OS\s([\d_]+)/),
- n = t.match(/(iPod)(.*OS\s([\d_]+))?/),
- r = !i && t.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
- return {
- ios: i || r || n,
- android: e
- }
- }(),
- support: {
- touch: window.Modernizr && !0 === Modernizr.touch || !!("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch),
- transforms3d: window.Modernizr && !0 === Modernizr.csstransforms3d || function() {
- var t = document.createElement("div")
- .style;
- return "webkitPerspective" in t || "MozPerspective" in t || "OPerspective" in t || "MsPerspective" in t || "perspective" in t
- }(),
- flexbox: function() {
- for (var t = document.createElement("div")
- .style, e = "alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "), i = 0; i < e.length; i++)
- if (e[i] in t) return !0
- }(),
- observer: "MutationObserver" in window || "WebkitMutationObserver" in window,
- passiveListener: function() {
- var t = !1;
- try {
- var e = Object.defineProperty({}, "passive", {
- get: function() {
- t = !0
- }
- });
- window.addEventListener("testPassiveListener", null, e)
- } catch (t) {}
- return t
- }(),
- gestures: "ongesturestart" in window
- },
- plugins: {}
- };
- for (var a, s = function() {
- var t = function(t) {
- var e = 0;
- for (e = 0; e < t.length; e++) this[e] = t[e];
- return this.length = t.length, this
- },
- e = function(e, i) {
- var n = [],
- r = 0;
- if (e && !i && e instanceof t) return e;
- if (e)
- if ("string" == typeof e) {
- var o, a, s = e.trim();
- if (s.indexOf("<") >= 0 && s.indexOf(">") >= 0) {
- var l = "div";
- for (0 === s.indexOf("<li") && (l = "ul"), 0 === s.indexOf("<tr") && (l = "tbody"), 0 !== s.indexOf("<td") && 0 !== s.indexOf("<th") || (l = "tr"), 0 === s.indexOf("<tbody") && (l = "table"), 0 === s.indexOf("<option") && (l = "select"), (a = document.createElement(l))
- .innerHTML = e, r = 0; r < a.childNodes.length; r++) n.push(a.childNodes[r])
- } else
- for (o = i || "#" !== e[0] || e.match(/[ .<>:~]/) ? (i || document)
- .querySelectorAll(e) : [document.getElementById(e.split("#")[1])], r = 0; r < o.length; r++) o[r] && n.push(o[r])
- } else if (e.nodeType || e === window || e === document) n.push(e);
- else if (e.length > 0 && e[0].nodeType)
- for (r = 0; r < e.length; r++) n.push(e[r]);
- return new t(n)
- };
- return t.prototype = {
- addClass: function(t) {
- if (void 0 === t) return this;
- for (var e = t.split(" "), i = 0; i < e.length; i++)
- for (var n = 0; n < this.length; n++) this[n].classList.add(e[i]);
- return this
- },
- removeClass: function(t) {
- for (var e = t.split(" "), i = 0; i < e.length; i++)
- for (var n = 0; n < this.length; n++) this[n].classList.remove(e[i]);
- return this
- },
- hasClass: function(t) {
- return !!this[0] && this[0].classList.contains(t)
- },
- toggleClass: function(t) {
- for (var e = t.split(" "), i = 0; i < e.length; i++)
- for (var n = 0; n < this.length; n++) this[n].classList.toggle(e[i]);
- return this
- },
- attr: function(t, e) {
- if (1 === arguments.length && "string" == typeof t) return this[0] ? this[0].getAttribute(t) : void 0;
- for (var i = 0; i < this.length; i++)
- if (2 === arguments.length) this[i].setAttribute(t, e);
- else
- for (var n in t) this[i][n] = t[n], this[i].setAttribute(n, t[n]);
- return this
- },
- removeAttr: function(t) {
- for (var e = 0; e < this.length; e++) this[e].removeAttribute(t);
- return this
- },
- data: function(t, e) {
- if (void 0 !== e) {
- for (var i = 0; i < this.length; i++) {
- var n = this[i];
- n.dom7ElementDataStorage || (n.dom7ElementDataStorage = {}), n.dom7ElementDataStorage[t] = e
- }
- return this
- }
- if (this[0]) {
- var r = this[0].getAttribute("data-" + t);
- return r || (this[0].dom7ElementDataStorage && t in this[0].dom7ElementDataStorage ? this[0].dom7ElementDataStorage[t] : void 0)
- }
- },
- transform: function(t) {
- for (var e = 0; e < this.length; e++) {
- var i = this[e].style;
- i.webkitTransform = i.MsTransform = i.msTransform = i.MozTransform = i.OTransform = i.transform = t
- }
- return this
- },
- transition: function(t) {
- "string" != typeof t && (t += "ms");
- for (var e = 0; e < this.length; e++) {
- var i = this[e].style;
- i.webkitTransitionDuration = i.MsTransitionDuration = i.msTransitionDuration = i.MozTransitionDuration = i.OTransitionDuration = i.transitionDuration = t
- }
- return this
- },
- on: function(t, i, n, r) {
- function o(t) {
- var r = t.target;
- if (e(r)
- .is(i)) n.call(r, t);
- else
- for (var o = e(r)
- .parents(), a = 0; a < o.length; a++) e(o[a])
- .is(i) && n.call(o[a], t)
- }
- var a, s, l = t.split(" ");
- for (a = 0; a < this.length; a++)
- if ("function" == typeof i || !1 === i)
- for ("function" == typeof i && (n = arguments[1], r = arguments[2] || !1), s = 0; s < l.length; s++) this[a].addEventListener(l[s], n, r);
- else
- for (s = 0; s < l.length; s++) this[a].dom7LiveListeners || (this[a].dom7LiveListeners = []), this[a].dom7LiveListeners.push({
- listener: n,
- liveListener: o
- }), this[a].addEventListener(l[s], o, r);
- return this
- },
- off: function(t, e, i, n) {
- for (var r = t.split(" "), o = 0; o < r.length; o++)
- for (var a = 0; a < this.length; a++)
- if ("function" == typeof e || !1 === e) "function" == typeof e && (i = arguments[1], n = arguments[2] || !1), this[a].removeEventListener(r[o], i, n);
- else if (this[a].dom7LiveListeners)
- for (var s = 0; s < this[a].dom7LiveListeners.length; s++) this[a].dom7LiveListeners[s].listener === i && this[a].removeEventListener(r[o], this[a].dom7LiveListeners[s].liveListener, n);
- return this
- },
- once: function(t, e, i, n) {
- var r = this;
- function o(a) {
- i(a), r.off(t, e, o, n)
- }
- "function" == typeof e && (e = !1, i = arguments[1], n = arguments[2]), r.on(t, e, o, n)
- },
- trigger: function(t, e) {
- for (var i = 0; i < this.length; i++) {
- var n;
- try {
- n = new window.CustomEvent(t, {
- detail: e,
- bubbles: !0,
- cancelable: !0
- })
- } catch (i) {
- (n = document.createEvent("Event"))
- .initEvent(t, !0, !0), n.detail = e
- }
- this[i].dispatchEvent(n)
- }
- return this
- },
- transitionEnd: function(t) {
- var e, i = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"],
- n = this;
- function r(o) {
- if (o.target === this)
- for (t.call(this, o), e = 0; e < i.length; e++) n.off(i[e], r)
- }
- if (t)
- for (e = 0; e < i.length; e++) n.on(i[e], r);
- return this
- },
- width: function() {
- return this[0] === window ? (window.renderWidth || window.innerWidth) : this.length > 0 ? parseFloat(this.css("width")) : null
- },
- outerWidth: function(t) {
- return this.length > 0 ? t ? this[0].offsetWidth + parseFloat(this.css("margin-right")) + parseFloat(this.css("margin-left")) : this[0].offsetWidth : null
- },
- height: function() {
- return this[0] === window ? (window.renderHeight || window.innerHeight) : this.length > 0 ? parseFloat(this.css("height")) : null
- },
- outerHeight: function(t) {
- return this.length > 0 ? t ? this[0].offsetHeight + parseFloat(this.css("margin-top")) + parseFloat(this.css("margin-bottom")) : this[0].offsetHeight : null
- },
- offset: function() {
- if (this.length > 0) {
- var t = this[0],
- e = t.getBoundingClientRect(),
- i = document.body,
- n = t.clientTop || i.clientTop || 0,
- r = t.clientLeft || i.clientLeft || 0,
- o = window.pageYOffset || t.scrollTop,
- a = window.pageXOffset || t.scrollLeft;
- return {
- top: e.top + o - n,
- left: e.left + a - r
- }
- }
- return null
- },
- css: function(t, e) {
- var i;
- if (1 === arguments.length) {
- if ("string" != typeof t) {
- for (i = 0; i < this.length; i++)
- for (var n in t) this[i].style[n] = t[n];
- return this
- }
- if (this[0]) return window.getComputedStyle(this[0], null)
- .getPropertyValue(t)
- }
- if (2 === arguments.length && "string" == typeof t) {
- for (i = 0; i < this.length; i++) this[i].style[t] = e;
- return this
- }
- return this
- },
- each: function(t) {
- for (var e = 0; e < this.length; e++) t.call(this[e], e, this[e]);
- return this
- },
- html: function(t) {
- if (void 0 === t) return this[0] ? this[0].innerHTML : void 0;
- for (var e = 0; e < this.length; e++) this[e].innerHTML = t;
- return this
- },
- text: function(t) {
- if (void 0 === t) return this[0] ? this[0].textContent.trim() : null;
- for (var e = 0; e < this.length; e++) this[e].textContent = t;
- return this
- },
- is: function(i) {
- if (!this[0]) return !1;
- var n, r;
- if ("string" == typeof i) {
- var o = this[0];
- if (o === document) return i === document;
- if (o === window) return i === window;
- if (o.matches) return o.matches(i);
- if (o.webkitMatchesSelector) return o.webkitMatchesSelector(i);
- if (o.mozMatchesSelector) return o.mozMatchesSelector(i);
- if (o.msMatchesSelector) return o.msMatchesSelector(i);
- for (n = e(i), r = 0; r < n.length; r++)
- if (n[r] === this[0]) return !0;
- return !1
- }
- if (i === document) return this[0] === document;
- if (i === window) return this[0] === window;
- if (i.nodeType || i instanceof t) {
- for (n = i.nodeType ? [i] : i, r = 0; r < n.length; r++)
- if (n[r] === this[0]) return !0;
- return !1
- }
- return !1
- },
- index: function() {
- if (this[0]) {
- for (var t = this[0], e = 0; null !== (t = t.previousSibling);) 1 === t.nodeType && e++;
- return e
- }
- },
- eq: function(e) {
- if (void 0 === e) return this;
- var i, n = this.length;
- return new t(e > n - 1 ? [] : e < 0 ? (i = n + e) < 0 ? [] : [this[i]] : [this[e]])
- },
- append: function(e) {
- var i, n;
- for (i = 0; i < this.length; i++)
- if ("string" == typeof e) {
- var r = document.createElement("div");
- for (r.innerHTML = e; r.firstChild;) this[i].appendChild(r.firstChild)
- } else if (e instanceof t)
- for (n = 0; n < e.length; n++) this[i].appendChild(e[n]);
- else this[i].appendChild(e);
- return this
- },
- prepend: function(e) {
- var i, n;
- for (i = 0; i < this.length; i++)
- if ("string" == typeof e) {
- var r = document.createElement("div");
- for (r.innerHTML = e, n = r.childNodes.length - 1; n >= 0; n--) this[i].insertBefore(r.childNodes[n], this[i].childNodes[0])
- } else if (e instanceof t)
- for (n = 0; n < e.length; n++) this[i].insertBefore(e[n], this[i].childNodes[0]);
- else this[i].insertBefore(e, this[i].childNodes[0]);
- return this
- },
- insertBefore: function(t) {
- for (var i = e(t), n = 0; n < this.length; n++)
- if (1 === i.length) i[0].parentNode.insertBefore(this[n], i[0]);
- else if (i.length > 1)
- for (var r = 0; r < i.length; r++) i[r].parentNode.insertBefore(this[n].cloneNode(!0), i[r])
- },
- insertAfter: function(t) {
- for (var i = e(t), n = 0; n < this.length; n++)
- if (1 === i.length) i[0].parentNode.insertBefore(this[n], i[0].nextSibling);
- else if (i.length > 1)
- for (var r = 0; r < i.length; r++) i[r].parentNode.insertBefore(this[n].cloneNode(!0), i[r].nextSibling)
- },
- next: function(i) {
- return this.length > 0 ? i ? this[0].nextElementSibling && e(this[0].nextElementSibling)
- .is(i) ? new t([this[0].nextElementSibling]) : new t([]) : this[0].nextElementSibling ? new t([this[0].nextElementSibling]) : new t([]) : new t([])
- },
- nextAll: function(i) {
- var n = [],
- r = this[0];
- if (!r) return new t([]);
- for (; r.nextElementSibling;) {
- var o = r.nextElementSibling;
- i ? e(o)
- .is(i) && n.push(o) : n.push(o), r = o
- }
- return new t(n)
- },
- prev: function(i) {
- return this.length > 0 ? i ? this[0].previousElementSibling && e(this[0].previousElementSibling)
- .is(i) ? new t([this[0].previousElementSibling]) : new t([]) : this[0].previousElementSibling ? new t([this[0].previousElementSibling]) : new t([]) : new t([])
- },
- prevAll: function(i) {
- var n = [],
- r = this[0];
- if (!r) return new t([]);
- for (; r.previousElementSibling;) {
- var o = r.previousElementSibling;
- i ? e(o)
- .is(i) && n.push(o) : n.push(o), r = o
- }
- return new t(n)
- },
- parent: function(t) {
- for (var i = [], n = 0; n < this.length; n++) t ? e(this[n].parentNode)
- .is(t) && i.push(this[n].parentNode) : i.push(this[n].parentNode);
- return e(e.unique(i))
- },
- parents: function(t) {
- for (var i = [], n = 0; n < this.length; n++)
- for (var r = this[n].parentNode; r;) t ? e(r)
- .is(t) && i.push(r) : i.push(r), r = r.parentNode;
- return e(e.unique(i))
- },
- find: function(e) {
- for (var i = [], n = 0; n < this.length; n++)
- for (var r = this[n].querySelectorAll(e), o = 0; o < r.length; o++) i.push(r[o]);
- return new t(i)
- },
- children: function(i) {
- for (var n = [], r = 0; r < this.length; r++)
- for (var o = this[r].childNodes, a = 0; a < o.length; a++) i ? 1 === o[a].nodeType && e(o[a])
- .is(i) && n.push(o[a]) : 1 === o[a].nodeType && n.push(o[a]);
- return new t(e.unique(n))
- },
- remove: function() {
- for (var t = 0; t < this.length; t++) this[t].parentNode && this[t].parentNode.removeChild(this[t]);
- return this
- },
- add: function() {
- var t, i, n = this;
- for (t = 0; t < arguments.length; t++) {
- var r = e(arguments[t]);
- for (i = 0; i < r.length; i++) n[n.length] = r[i], n.length++
- }
- return n
- }
- }, e.fn = t.prototype, e.unique = function(t) {
- for (var e = [], i = 0; i < t.length; i++) - 1 === e.indexOf(t[i]) && e.push(t[i]);
- return e
- }, e
- }(), l = ["jQuery", "Zepto", "Dom7"], u = 0; u < l.length; u++) window[l[u]] && h(window[l[u]]);
- function h(t) {
- t.fn.swiper = function(e) {
- var i;
- return t(this)
- .each((function() {
- var t = new o(this, e);
- i || (i = t)
- })), i
- }
- }(a = void 0 === s ? window.Dom7 || window.Zepto || window.jQuery : s) && ("transitionEnd" in a.fn || (a.fn.transitionEnd = function(t) {
- var e, i = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"],
- n = this;
- function r(o) {
- if (o.target === this)
- for (t.call(this, o), e = 0; e < i.length; e++) n.off(i[e], r)
- }
- if (t)
- for (e = 0; e < i.length; e++) n.on(i[e], r);
- return this
- }), "transform" in a.fn || (a.fn.transform = function(t) {
- for (var e = 0; e < this.length; e++) {
- var i = this[e].style;
- i.webkitTransform = i.MsTransform = i.msTransform = i.MozTransform = i.OTransform = i.transform = t
- }
- return this
- }), "transition" in a.fn || (a.fn.transition = function(t) {
- "string" != typeof t && (t += "ms");
- for (var e = 0; e < this.length; e++) {
- var i = this[e].style;
- i.webkitTransitionDuration = i.MsTransitionDuration = i.msTransitionDuration = i.MozTransitionDuration = i.OTransitionDuration = i.transitionDuration = t
- }
- return this
- }), "outerWidth" in a.fn || (a.fn.outerWidth = function(t) {
- return this.length > 0 ? t ? this[0].offsetWidth + parseFloat(this.css("margin-right")) + parseFloat(this.css("margin-left")) : this[0].offsetWidth : null
- })), t.exports = o
- })
- .call(this, "/js/util/Swiper.js")
- })
- .call(this, i(6))
- }, function(t, e) {
- t.exports = {
- Pic: 1,
- Text: 2,
- GIF: 3
- }
- }, function(t, e, i) {
- (function(e) {
- function n() {
- h.call(this), this.neighbourMap = {}, this.map = null
- }
- var r = i(0),
- o = i(7),
- a = i(1),
- s = i(19),
- l = i(161),
- u = new(i(2))(e),
- h = i(33),
- c = i(8);
- o.inherit(n, h), n.prototype.getIndex = function(t) {
- return t.id
- }, n.prototype.find = function(t, e) {
- var i = o.filterAll(this.list, t);
- if (i.length > 0) return e && e.forEach((function(t) {
- i = o.stableSort(i, t)
- })), i[0]
- }, n.prototype.sortByScore = function(t, e) {
- var i = o.filterAll(this.list, t);
- return i.length > 0 ? i = i.map((function(t) {
- return {
- pano: t,
- score: e.reduce((function(e, i) {
- return e + i(t)
- }), 0)
- }
- }))
- .sort((function(t, e) {
- return e.score - t.score
- })) : null
- }, n.prototype.lowestByScore = function(t, e, i) {
- return this.findRankedByScore(0, t, e, i)
- }, n.prototype.findRankedByScore = function(t, e, i, n) {
- n && (n.candidates = null, n.pano = null), t || (t = 0);
- var r = this.sortByScore(e, i);
- return r && 0 !== r.length && t < r.length ? (n && (n.candidates = r, n.pano = r[t].pano), r[t].pano) : null
- }, n.prototype.showPanoScores = function(t) {
- this.list.forEach((function(t) {
- t.removeTextSprite()
- }));
- var e = 6344768;
- t.forEach((function(t) {
- t.pano.addTextSprite(t.score.toFixed(2), e), e = 16428055
- }))
- }, n.prototype.isNeighbour = function(t, e) {
- return this.neighbourMap[t.id][e.id]
- }, n.prototype.getNeighbours = function(t) {
- return this.neighbourMap[t.id]
- }, n.prototype.setNeighbour = function(t, e, i) {
- return this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}), this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}), this.neighbourMap[t.id][t.id] = !0, this.neighbourMap[e.id][e.id] = !0, this.neighbourMap[t.id][e.id] = i, this.neighbourMap[e.id][t.id] = i, this.neighbourMap[t.id]
- }, n.prototype.findClosest = function(t, e) {
- var i = [s.filters.isPanoAligned()];
- return e && i.push(s.filters.inDirection(t, e, .75)), this.find(i, [s.sortFunctions.distanceToPoint(t)])
- }, n.prototype.dualNeighbors = function(t, e) {
- var i, n = [];
- for (i in this.neighbourMap[t.id]) this.neighbourMap[e.id][i] && n.push(i);
- return n
- }, n.prototype.populate_path_graph = function() {
- var t, e, i, n, o, a, s, l, h = Date.now(),
- c = {},
- d = 0,
- p = new r.Vector3(0, 0, 0);
- for (t = 0; t < this.list.length; t++) {
- for (e in s = {}, l = !1, i = (o = this.list[t])
- .neighbourPanos || o.findNeighourPanos())
- if (i[e]) {
- a = this.index[e], p.copy(o.floorPosition), p.sub(a.floorPosition);
- var f = Math.sqrt(p.x * p.x + p.z * p.z),
- m = (Math.abs(p.y), Math.max(f, .01), Math.max(0, Math.abs(p.y) - .2));
- m > 0 ? (m = Math.pow(4 * m, 2), f = Math.pow(f, 2), n = Math.sqrt(m * m + f * f)) : n = p.length(), s[a.id] = n, l = !0
- } l ? c[o.id] = s : d += 1
- }
- this.map = c, u.info("graph ready in " + (Date.now() - h) + "ms, " + d + " had no neighbors")
- }, n.prototype.aStarSearch = function(t, e) {
- var i = Date.now(),
- n = new l({
- start: t,
- isEnd: function(t) {
- return t === e
- },
- neighbor: function(t) {
- var e = t.neighbourPanos || t.findNeighourPanos(),
- i = [];
- for (var n in e) i.push(this.index[n]);
- return i
- }.bind(this),
- distance: function(t, e) {
- return this.map[t.id][e.id]
- }.bind(this),
- heuristic: function(t, e) {
- return 1
- }.bind(this),
- hash: function(t) {
- return t.id
- },
- timeout: 5e3
- });
- if (u.debug("A* search in " + (Date.now() - i) + "ms"), "success" !== n.status) return u.debug("Did not find A* path from " + t + " to " + e), null;
- u.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
- var r = [];
- return n.path.forEach((function(t) {
- r.push(t.id)
- })), r
- }, n.prototype.includeNodesNearPath = function() {
- var t = new r.Vector3,
- e = new r.Vector3,
- i = new r.Vector3,
- n = new r.Vector3,
- o = new r.Vector3,
- a = new r.Vector3,
- s = new r.Vector3,
- l = new r.Vector3,
- u = [],
- h = new r.Vector3,
- c = new r.Vector3;
- return function(r, d) {
- if (r)
- for (var p = function(t, e, i) {
- return o.copy(e)
- .sub(t), o.dot(i)
- }, f = function(t, e) {
- return p(h, t.position, i) - p(h, e.position, i)
- }, m = 0; m < r.length - 1;) {
- var g = r[m],
- v = r[m + 1],
- y = this.index[g],
- b = this.index[v];
- h.copy(y.position), c.copy(b.position), u.length = 0, t.copy(c)
- .sub(h), i.copy(t)
- .normalize();
- for (var w = 0; w < this.list.length; w++) {
- var x = this.list[w];
- o.copy(x.position)
- .sub(h);
- var M = o.dot(i);
- if (M > 0)
- if (s.copy(i), s.multiplyScalar(M), a.copy(o), a.sub(s), a.length() < d) e.copy(t)
- .negate(), n.copy(e)
- .normalize(), l.copy(x.position)
- .sub(c), l.dot(n) > 0 && u.push(x)
- }
- if (u.length > 0) {
- u.sort(f);
- for (var T = r.length + u.length - 1; T >= m + u.length; T--) r[T] = r[T - u.length];
- for (var S = 0; S < u.length; S++) r[S + m + 1] = u[S].id
- }
- m += u.length + 1
- }
- }
- }(), n.prototype.fadeMarkerOpacity = function(t, e) {
- var i = void 0 === t ? a.panorama.markerOpacity : t,
- n = this.list.findIndex((function(t) {
- return t.marker
- }));
- if (n >= 0) {
- var r = this.list[n].marker.material.opacity;
- if (r !== t) {
- var o = i - r;
- c.trigger({
- func: function(t, e) {
- var i = r + t * o;
- this.forEach((function(t) {
- t.marker && (t.marker.material.opacity = i)
- }))
- }.bind(this),
- duration: void 0 === e ? a.markerOpacityTransitionTime : e,
- name: "_fpm"
- })
- }
- }
- }, n.prototype.update = function(t) {
- this.forEach((function(e) {
- e.update(t)
- }))
- }, t.exports = n
- })
- .call(this, "/js/util/PanoramaCollection.js")
- }, function(t, e, i) {
- function n(t) {
- if (void 0 !== t.parent) {
- var e = n(t.parent);
- return e.push(t.data), e
- }
- return [t.data]
- }
- function r(t) {
- return t.toString()
- }
- function o(t, e) {
- return t.f - e.f
- }
- var a = i(162),
- s = i(163),
- l = i(165);
- t.exports = function(t) {
- void 0 === t.timeout && (t.timeout = 1 / 0);
- var e = t.hash || r,
- i = {
- data: t.start,
- g: 0,
- h: t.heuristic(t.start)
- },
- u = i;
- i.f = i.h;
- var h = new a,
- c = new s(o),
- d = l();
- c.push(i), d.set(e(i.data), i);
- for (var p = new Date; c.size();) {
- if (new Date - p > t.timeout) return {
- status: "timeout",
- cost: u.g,
- path: n(u)
- };
- var f = c.pop();
- if (d.delete(e(f.data)), t.isEnd(f.data)) {
- var m = n(f);
- return {
- status: "success",
- cost: f.g,
- path: m
- }
- }
- h.add(e(f.data));
- for (var g = t.neighbor(f.data), v = 0; v < g.length; v++) {
- var y = g[v];
- if (!h.contains(e(y))) {
- var b = f.g + t.distance(f.data, y),
- w = d.get(e(y)),
- x = !1;
- if (void 0 === w) w = {
- data: y
- }, d.set(e(y), w);
- else {
- if (w.g < b) continue;
- x = !0
- }
- w.parent = f, w.g = b, w.h = t.heuristic(y), w.f = b + w.h, w.h < u.h && (u = w), x ? c.heapify() : c.push(w)
- }
- }
- }
- return {
- status: "noPath",
- cost: u.g,
- path: n(u)
- }
- }
- }, function(t, e, i) {
- function n(t) {
- if (this.set = {}, this.infContains = function() {
- return !0
- }, "object" == typeof t)
- if (t instanceof Array)
- for (var e = 0; e < t.length; e++) this.set[t[e]] = !0;
- else this.set = t;
- else if ("function" == typeof t) this.infContains = t;
- else if (void 0 !== t) throw new Error("set must be either an array or an object.")
- }
- t.exports = n, n.prototype.contains = function(t) {
- return !!this.set[t]
- }, n.prototype.has = n.prototype.contains, n.prototype.add = function(t) {
- if (1 == arguments.length) this.set[t] = !0;
- else
- for (var e = 0; e < arguments.length; e++) this.set[arguments[e]] = !0
- }, n.prototype.addAll = function(t) {
- if ("object" != typeof t && !(t instanceof Array)) throw new Error("arr must be an array.");
- for (var e = 0; e < t.length; e++) this.add(t[e])
- }, n.prototype.remove = function(t) {
- if (1 == arguments.length) delete this.set[t];
- else
- for (var e = 0; e < arguments.length; e++) delete this.set[arguments[e]]
- }, n.prototype.delete = n.prototype.remove, n.prototype.clear = function() {
- this.set = {}
- }, n.prototype.size = function() {
- return Object.keys(this.set)
- .length
- }, n.prototype.toString = function() {
- return "{" + Object.keys(this.set)
- .toString() + "}"
- }, n.prototype.toArray = function() {
- return void 0 === this.set ? [] : Object.keys(this.set)
- }, n.prototype["*values"] = n.prototype.toArray
- }, function(t, e, i) {
- t.exports = i(164)
- }, function(t, e, i) {
- var n, r, o;
- (function() {
- var i, a, s, l, u, h, c, d, p, f, m, g, v, y, b;
- s = Math.floor, f = Math.min, a = function(t, e) {
- return t < e ? -1 : t > e ? 1 : 0
- }, p = function(t, e, i, n, r) {
- var o;
- if (null == i && (i = 0), null == r && (r = a), i < 0) throw new Error("lo must be non-negative");
- for (null == n && (n = t.length); i < n;) r(e, t[o = s((i + n) / 2)]) < 0 ? n = o : i = o + 1;
- return [].splice.apply(t, [i, i - i].concat(e)), e
- }, h = function(t, e, i) {
- return null == i && (i = a), t.push(e), y(t, 0, t.length - 1, i)
- }, u = function(t, e) {
- var i, n;
- return null == e && (e = a), i = t.pop(), t.length ? (n = t[0], t[0] = i, b(t, 0, e)) : n = i, n
- }, d = function(t, e, i) {
- var n;
- return null == i && (i = a), n = t[0], t[0] = e, b(t, 0, i), n
- }, c = function(t, e, i) {
- var n;
- return null == i && (i = a), t.length && i(t[0], e) < 0 && (e = (n = [t[0], e])[0], t[0] = n[1], b(t, 0, i)), e
- }, l = function(t, e) {
- var i, n, r, o, l, u;
- for (null == e && (e = a), l = [], n = 0, r = (o = function() {
- u = [];
- for (var e = 0, i = s(t.length / 2); 0 <= i ? e < i : e > i; 0 <= i ? e++ : e--) u.push(e);
- return u
- }.apply(this)
- .reverse())
- .length; n < r; n++) i = o[n], l.push(b(t, i, e));
- return l
- }, v = function(t, e, i) {
- var n;
- if (null == i && (i = a), -1 !== (n = t.indexOf(e))) return y(t, 0, n, i), b(t, n, i)
- }, m = function(t, e, i) {
- var n, r, o, s, u;
- if (null == i && (i = a), !(r = t.slice(0, e))
- .length) return r;
- for (l(r, i), o = 0, s = (u = t.slice(e))
- .length; o < s; o++) n = u[o], c(r, n, i);
- return r.sort(i)
- .reverse()
- }, g = function(t, e, i) {
- var n, r, o, s, h, c, d, m, g;
- if (null == i && (i = a), 10 * e <= t.length) {
- if (!(o = t.slice(0, e)
- .sort(i))
- .length) return o;
- for (r = o[o.length - 1], s = 0, c = (d = t.slice(e))
- .length; s < c; s++) i(n = d[s], r) < 0 && (p(o, n, 0, null, i), o.pop(), r = o[o.length - 1]);
- return o
- }
- for (l(t, i), g = [], h = 0, m = f(e, t.length); 0 <= m ? h < m : h > m; 0 <= m ? ++h : --h) g.push(u(t, i));
- return g
- }, y = function(t, e, i, n) {
- var r, o, s;
- for (null == n && (n = a), r = t[i]; i > e && n(r, o = t[s = i - 1 >> 1]) < 0;) t[i] = o, i = s;
- return t[i] = r
- }, b = function(t, e, i) {
- var n, r, o, s, l;
- for (null == i && (i = a), r = t.length, l = e, o = t[e], n = 2 * e + 1; n < r;)(s = n + 1) < r && !(i(t[n], t[s]) < 0) && (n = s), t[e] = t[n], n = 2 * (e = n) + 1;
- return t[e] = o, y(t, l, e, i)
- }, i = function() {
- function t(t) {
- this.cmp = null != t ? t : a, this.nodes = []
- }
- return t.push = h, t.pop = u, t.replace = d, t.pushpop = c, t.heapify = l, t.updateItem = v, t.nlargest = m, t.nsmallest = g, t.prototype.push = function(t) {
- return h(this.nodes, t, this.cmp)
- }, t.prototype.pop = function() {
- return u(this.nodes, this.cmp)
- }, t.prototype.peek = function() {
- return this.nodes[0]
- }, t.prototype.contains = function(t) {
- return -1 !== this.nodes.indexOf(t)
- }, t.prototype.replace = function(t) {
- return d(this.nodes, t, this.cmp)
- }, t.prototype.pushpop = function(t) {
- return c(this.nodes, t, this.cmp)
- }, t.prototype.heapify = function() {
- return l(this.nodes, this.cmp)
- }, t.prototype.updateItem = function(t) {
- return v(this.nodes, t, this.cmp)
- }, t.prototype.clear = function() {
- return this.nodes = []
- }, t.prototype.empty = function() {
- return 0 === this.nodes.length
- }, t.prototype.size = function() {
- return this.nodes.length
- }, t.prototype.clone = function() {
- var e;
- return (e = new t)
- .nodes = this.nodes.slice(0), e
- }, t.prototype.toArray = function() {
- return this.nodes.slice(0)
- }, t.prototype.insert = t.prototype.push, t.prototype.top = t.prototype.peek, t.prototype.front = t.prototype.peek, t.prototype.has = t.prototype.contains, t.prototype.copy = t.prototype.clone, t
- }(), r = [], void 0 === (o = "function" == typeof(n = function() {
- return i
- }) ? n.apply(e, r) : n) || (t.exports = o)
- })
- .call(this)
- }, function(t, e, i) {
- "use strict";
- var n = Object.prototype.hasOwnProperty;
- function r(t) {
- return "~" + t
- }
- function o(t) {
- return t.substring("~".length)
- }
- function a(t) {
- if ("string" != typeof t) throw new TypeError("key must be a string.")
- }
- t.exports = function(t) {
- var e = Object.create(null),
- i = 0,
- s = {};
- return function(t, e) {
- for (var i in e) Object.defineProperty(t, i, {
- value: e[i],
- configurable: !0,
- writable: !0
- })
- }(s, {
- get: function(t, i) {
- a(t);
- var n = r(t);
- return n in e ? e[n] : i
- },
- set: function(t, n) {
- a(t);
- var o = r(t);
- return o in e || ++i, e[o] = n
- },
- has: function(t) {
- return a(t), r(t) in e
- },
- delete: function(t) {
- a(t);
- var n = r(t);
- return n in e && (--i, delete e[n], !0)
- },
- clear: function() {
- e = Object.create(null), i = 0
- },
- forEach: function(t, i) {
- if ("function" != typeof t) throw new TypeError("`callback` must be a function");
- for (var r in e)
- if (n.call(e, r)) {
- var a = o(r),
- l = e[r];
- t.call(i, l, a, s)
- }
- }
- }), Object.defineProperty(s, "size", {
- get: function() {
- return i
- },
- configurable: !0
- }), "object" == typeof t && null !== t && Object.keys(t)
- .forEach((function(e) {
- s.set(e, t[e])
- })), s
- }
- }, function(t, e, i) {
- (function(e) {
- var n = (i(0), i(1), i(3), i(167)),
- r = new(i(2))(e);
- t.exports = {
- getLoaders: function(t) {
- return [
- ["_50k", ".dam", n],
- ["", ".dam", n]
- ][t]
- },
- load: function(t, e, i, n, o) {
- o = o || 0;
- var a = this.getLoaders(o);
- if (a) {
- var s = a[0],
- l = a[1],
- u = new a[2](t),
- h = G.url.model + "/model.nest",
- c = this;
- h ? (r.debug("Trying " + s + l), u.load(h, e, i, (function() {
- c.load(t, e, i, n, ++o)
- }))) : (r.debug("Skipping " + l + ", not available"), this.load(t, e, i, n, ++o))
- } else n && n("No suitable model file found...")
- }
- }
- })
- .call(this, "/js/loaders/ModelLoader.js")
- }, function(t, e, i) {
- (function(e, n) {
- var r = i(0),
- o = i(46),
- a = i(2),
- s = (i(7), i(11)),
- l = i(45),
- u = new a(n);
- function h(t) {
- this.urls = t;
- var i = e("bWVzc2FnZSBtZXNoZXMgew0KICAgIHJlcXVpcmVkIHN0cmluZyB2ZXJzaW9uID0gMTsNCiAgICByZXBlYXRlZCBibG9ja19kZWZhdWx0IGJsb2NrX2RlZmF1bHQgPSAyOw0KICAgIHJlcGVhdGVkIGJsb2NrX21vZGVsIGJsb2NrX21vZGVsID0gMzsNCiAgICByZXBlYXRlZCBibG9ja19jdXN0b21pemVkIGJsb2NrX2N1c3RvbWl6ZWQgPSA0Ow0KfQ0KDQptZXNzYWdlIHZlcnRpY2VzX3NpbXBsZSB7DQogICAgcmVwZWF0ZWQgZmxvYXQgdXYgPSAxIFtwYWNrZWQ9dHJ1ZV07DQogICAgcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMiBbcGFja2VkPXRydWVdOw0KfQ0KDQptZXNzYWdlIGZhY2VzX3NpbXBsZSB7DQogICAgcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOw0KfQ0KDQptZXNzYWdlIGJsb2NrX21vZGVsIHsNCiAgICBvcHRpb25hbCB2ZXJ0aWNlc19zaW1wbGUgdmVydGljZXMgPSAxOw0KICAgIG9wdGlvbmFsIGZhY2VzX3NpbXBsZSBmYWNlcyA9IDI7DQogICAgb3B0aW9uYWwgc3RyaW5nIGJsb2NrX25hbWUgPSAzOw0KICAgIG9wdGlvbmFsIHN0cmluZyB0eHRuYW1lID0gNDsNCn0NCg0KbWVzc2FnZSBibG9ja19kZWZhdWx0IHsNCiAgICByZXBlYXRlZCBibG9ja19kZWZhdWx0X3VuaXQgZGVmYXVsdF91bml0cyA9IDE7DQp9DQoNCm1lc3NhZ2UgYmxvY2tfZGVmYXVsdF91bml0IHsNCiAgICByZXF1aXJlZCBzdHJpbmcgdW5pdF9pZCA9IDE7DQogICAgb3B0aW9uYWwgdmVydGljZXNfc2ltcGxlIHZlcnRpY2VzID0gMjsNCiAgICBvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAzOw0KICAgIG9wdGlvbmFsIHN0cmluZyBibG9ja19kZXMgPSA0Ow0KICAgIG9wdGlvbmFsIHN0cmluZyB0eHRuYW1lID0gNTsNCn0NCg0KbWVzc2FnZSBibG9ja19jdXN0b21pemVkIHsNCiAgICByZXBlYXRlZCBibG9ja19jdXN0b21pemVkX3VuaXQgY3VzdG9taXplZF91bml0cyA9IDE7DQp9DQoNCm1lc3NhZ2UgYmxvY2tfY3VzdG9taXplZF91bml0IHsNCiAgICByZXF1aXJlZCBzdHJpbmcgdW5pdF9pZCA9IDE7DQogICAgcmVxdWlyZWQgc3RyaW5nIHJlbGF0ZWRfaWQgPSAyOw0KICAgIG9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDM7DQogICAgb3B0aW9uYWwgZmFjZXNfc2ltcGxlIGZhY2VzID0gNDsNCiAgICBvcHRpb25hbCBzdHJpbmcgYmxvY2tfZGVzID0gNTsNCiAgICBvcHRpb25hbCBzdHJpbmcgdHh0bmFtZSA9IDY7DQp9DQo=", "base64");
- this.decoder = o.loadProto(i)
- .build("meshes")
- }
- window.dcodeIO && (o = window.dcodeIO.ProtoBuf), h.prototype = {
- constructor: h,
- load: function(t, e, i, n) {
- return u.time("download"), s.get(t, {
- responseType: "arraybuffer"
- })
- .done(function(r) {
- u.timeEnd("download"), this.parse(r, t, e, i, n)
- }.bind(this))
- .fail(n)
- },
- parse: function(t, e, i, n, r) {
- var o = this.readProtobuf(t);
- if (!o) return r();
- try {
- u.time("convert to webgl"), this.convertProtobufToSceneObject(o, e, i, n, r), u.timeEnd("convert to webgl")
- } catch (t) {
- return u.error("failed parsing .dam"), u.error(t.message), r()
- }
- },
- readProtobuf: function(t) {
- var e;
- try {
- u.time("parse proto"), e = this.decoder.decode(t), u.timeEnd("parse proto")
- } catch (t) {
- return u.error("failed parsing proto for .dam"), u.error(t.message), null
- }
- return e
- },
- convertProtobufToSceneObject: function(t, e, i, n, o) {
- if (0 === t.block_model.length) return u.warn("No chunks in damfile..."), i([]);
- var a = new r.Matrix4;
- a.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
- var s = t.block_model.map((function(t) {
- var i = new r.BufferGeometry;
- return i.addAttribute("position", new r.BufferAttribute(new Float32Array(t.vertices.xyz, 0, 3), 3)), t.vertices.uv.length > 0 && i.addAttribute("uv", new r.BufferAttribute(new Float32Array(t.vertices.uv, 0, 2), 2)), i.setIndex(new r.BufferAttribute(new Uint32Array(t.faces.faces, 0, 1), 1)), i.applyMatrix(a), i.computeBoundingBox(), new l({
- geometry: i,
- textureName: t.txtname,
- name: t.block_name,
- meshUrl: e
- })
- }));
- return s ? i(s) : (u.error("no blocks..."), o())
- }
- }, t.exports = h
- })
- .call(this, i(47)
- .Buffer, "/js/loaders/DamLoader.js")
- }, function(t, e, i) {
- var n, r, o;
- r = [i(169)], void 0 === (o = "function" == typeof(n = function(t) {
- "use strict";
- var e = function(t, i, r) {
- if (void 0 === t && (t = e.DEFAULT_CAPACITY), void 0 === i && (i = e.DEFAULT_ENDIAN), void 0 === r && (r = e.DEFAULT_NOASSERT), !r) {
- if ((t |= 0) < 0) throw RangeError("Illegal capacity");
- i = !!i, r = !!r
- }
- this.buffer = 0 === t ? n : new ArrayBuffer(t), this.view = 0 === t ? null : new Uint8Array(this.buffer), this.offset = 0, this.markedOffset = -1, this.limit = t, this.littleEndian = i, this.noAssert = r
- };
- e.VERSION = "5.0.1", e.LITTLE_ENDIAN = !0, e.BIG_ENDIAN = !1, e.DEFAULT_CAPACITY = 16, e.DEFAULT_ENDIAN = e.BIG_ENDIAN, e.DEFAULT_NOASSERT = !1, e.Long = t || null;
- var i = e.prototype;
- i.__isByteBuffer__, Object.defineProperty(i, "__isByteBuffer__", {
- value: !0,
- enumerable: !1,
- configurable: !1
- });
- var n = new ArrayBuffer(0),
- r = String.fromCharCode;
- function o(t) {
- var e = 0;
- return function() {
- return e < t.length ? t.charCodeAt(e++) : null
- }
- }
- function a() {
- var t = [],
- e = [];
- return function() {
- if (0 === arguments.length) return e.join("") + r.apply(String, t);
- t.length + arguments.length > 1024 && (e.push(r.apply(String, t)), t.length = 0), Array.prototype.push.apply(t, arguments)
- }
- }
- function s(t, e, i, n, r) {
- var o, a, s = 8 * r - n - 1,
- l = (1 << s) - 1,
- u = l >> 1,
- h = -7,
- c = i ? r - 1 : 0,
- d = i ? -1 : 1,
- p = t[e + c];
- for (c += d, o = p & (1 << -h) - 1, p >>= -h, h += s; h > 0; o = 256 * o + t[e + c], c += d, h -= 8);
- for (a = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; a = 256 * a + t[e + c], c += d, h -= 8);
- if (0 === o) o = 1 - u;
- else {
- if (o === l) return a ? NaN : 1 / 0 * (p ? -1 : 1);
- a += Math.pow(2, n), o -= u
- }
- return (p ? -1 : 1) * a * Math.pow(2, o - n)
- }
- function l(t, e, i, n, r, o) {
- var a, s, l, u = 8 * o - r - 1,
- h = (1 << u) - 1,
- c = h >> 1,
- d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
- p = n ? 0 : o - 1,
- f = n ? 1 : -1,
- m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, a = h) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), (e += a + c >= 1 ? d / l : d * Math.pow(2, 1 - c)) * l >= 2 && (a++, l /= 2), a + c >= h ? (s = 0, a = h) : a + c >= 1 ? (s = (e * l - 1) * Math.pow(2, r), a += c) : (s = e * Math.pow(2, c - 1) * Math.pow(2, r), a = 0)); r >= 8; t[i + p] = 255 & s, p += f, s /= 256, r -= 8);
- for (a = a << r | s, u += r; u > 0; t[i + p] = 255 & a, p += f, a /= 256, u -= 8);
- t[i + p - f] |= 128 * m
- }
- e.accessor = function() {
- return Uint8Array
- }, e.allocate = function(t, i, n) {
- return new e(t, i, n)
- }, e.concat = function(t, i, n, r) {
- "boolean" != typeof i && "string" == typeof i || (r = n, n = i, i = void 0);
- for (var o, a = 0, s = 0, l = t.length; s < l; ++s) e.isByteBuffer(t[s]) || (t[s] = e.wrap(t[s], i)), (o = t[s].limit - t[s].offset) > 0 && (a += o);
- if (0 === a) return new e(0, n, r);
- var u, h = new e(a, n, r);
- for (s = 0; s < l;)(o = (u = t[s++])
- .limit - u.offset) <= 0 || (h.view.set(u.view.subarray(u.offset, u.limit), h.offset), h.offset += o);
- return h.limit = h.offset, h.offset = 0, h
- }, e.isByteBuffer = function(t) {
- return !0 === (t && t.__isByteBuffer__)
- }, e.type = function() {
- return ArrayBuffer
- }, e.wrap = function(t, n, r, o) {
- if ("string" != typeof n && (o = r, r = n, n = void 0), "string" == typeof t) switch (void 0 === n && (n = "utf8"), n) {
- case "base64":
- return e.fromBase64(t, r);
- case "hex":
- return e.fromHex(t, r);
- case "binary":
- return e.fromBinary(t, r);
- case "utf8":
- return e.fromUTF8(t, r);
- case "debug":
- return e.fromDebug(t, r);
- default:
- throw Error("Unsupported encoding: " + n)
- }
- if (null === t || "object" != typeof t) throw TypeError("Illegal buffer");
- var a;
- if (e.isByteBuffer(t)) return (a = i.clone.call(t))
- .markedOffset = -1, a;
- if (t instanceof Uint8Array) a = new e(0, r, o), t.length > 0 && (a.buffer = t.buffer, a.offset = t.byteOffset, a.limit = t.byteOffset + t.byteLength, a.view = new Uint8Array(t.buffer));
- else if (t instanceof ArrayBuffer) a = new e(0, r, o), t.byteLength > 0 && (a.buffer = t, a.offset = 0, a.limit = t.byteLength, a.view = t.byteLength > 0 ? new Uint8Array(t) : null);
- else {
- if ("[object Array]" !== Object.prototype.toString.call(t)) throw TypeError("Illegal buffer");
- (a = new e(t.length, r, o))
- .limit = t.length;
- for (var s = 0; s < t.length; ++s) a.view[s] = t[s]
- }
- return a
- }, i.writeBitSet = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if (!(t instanceof Array)) throw TypeError("Illegal BitSet: Not an array");
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- var n, r = e,
- o = t.length,
- a = o >> 3,
- s = 0;
- for (e += this.writeVarint32(o, e); a--;) n = 1 & !!t[s++] | (1 & !!t[s++]) << 1 | (1 & !!t[s++]) << 2 | (1 & !!t[s++]) << 3 | (1 & !!t[s++]) << 4 | (1 & !!t[s++]) << 5 | (1 & !!t[s++]) << 6 | (1 & !!t[s++]) << 7, this.writeByte(n, e++);
- if (s < o) {
- var l = 0;
- for (n = 0; s < o;) n |= (1 & !!t[s++]) << l++;
- this.writeByte(n, e++)
- }
- return i ? (this.offset = e, this) : e - r
- }, i.readBitSet = function(t) {
- var e = void 0 === t;
- e && (t = this.offset);
- var i, n = this.readVarint32(t),
- r = n.value,
- o = r >> 3,
- a = 0,
- s = [];
- for (t += n.length; o--;) i = this.readByte(t++), 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);
- if (a < r) {
- var l = 0;
- for (i = this.readByte(t++); a < r;) s[a++] = !!(i >> l++ & 1)
- }
- return e && (this.offset = t), s
- }, i.readBytes = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + t > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+" + t + ") <= " + this.buffer.byteLength)
- }
- var n = this.slice(e, e + t);
- return i && (this.offset += t), n
- }, i.writeBytes = i.append, i.writeInt8 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 1;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 1, this.view[e] = t, i && (this.offset += 1), this
- }, i.writeByte = i.writeInt8, i.readInt8 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
- }
- var i = this.view[t];
- return 128 == (128 & i) && (i = -(255 - i + 1)), e && (this.offset += 1), i
- }, i.readByte = i.readInt8, i.writeUint8 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 1;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 1, this.view[e] = t, i && (this.offset += 1), this
- }, i.writeUInt8 = i.writeUint8, i.readUint8 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
- }
- var i = this.view[t];
- return e && (this.offset += 1), i
- }, i.readUInt8 = i.readUint8, i.writeInt16 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 2;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (65280 & t) >>> 8, this.view[e] = 255 & t) : (this.view[e] = (65280 & t) >>> 8, this.view[e + 1] = 255 & t), i && (this.offset += 2), this
- }, i.writeShort = i.writeInt16, i.readInt16 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+2) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[t], i |= this.view[t + 1] << 8) : (i = this.view[t] << 8, i |= this.view[t + 1]), 32768 == (32768 & i) && (i = -(65535 - i + 1)), e && (this.offset += 2), i
- }, i.readShort = i.readInt16, i.writeUint16 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 2;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (65280 & t) >>> 8, this.view[e] = 255 & t) : (this.view[e] = (65280 & t) >>> 8, this.view[e + 1] = 255 & t), i && (this.offset += 2), this
- }, i.writeUInt16 = i.writeUint16, i.readUint16 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+2) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[t], i |= this.view[t + 1] << 8) : (i = this.view[t] << 8, i |= this.view[t + 1]), e && (this.offset += 2), i
- }, i.readUInt16 = i.readUint16, i.writeInt32 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 4;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = 255 & t) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = 255 & t), i && (this.offset += 4), this
- }, i.writeInt = i.writeInt32, i.readInt32 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[t + 2] << 16, i |= this.view[t + 1] << 8, i |= this.view[t], i += this.view[t + 3] << 24 >>> 0) : (i = this.view[t + 1] << 16, i |= this.view[t + 2] << 8, i |= this.view[t + 3], i += this.view[t] << 24 >>> 0), i |= 0, e && (this.offset += 4), i
- }, i.readInt = i.readInt32, i.writeUint32 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 4;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = 255 & t) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = 255 & t), i && (this.offset += 4), this
- }, i.writeUInt32 = i.writeUint32, i.readUint32 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[t + 2] << 16, i |= this.view[t + 1] << 8, i |= this.view[t], i += this.view[t + 3] << 24 >>> 0) : (i = this.view[t + 1] << 16, i |= this.view[t + 2] << 8, i |= this.view[t + 3], i += this.view[t] << 24 >>> 0), e && (this.offset += 4), i
- }, i.readUInt32 = i.readUint32, t && (i.writeInt64 = function(e, i) {
- var n = void 0 === i;
- if (n && (i = this.offset), !this.noAssert) {
- if ("number" == typeof e) e = t.fromNumber(e);
- else if ("string" == typeof e) e = t.fromString(e);
- else if (!(e && e instanceof t)) throw TypeError("Illegal value: " + e + " (not an integer or Long)");
- if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
- }
- "number" == typeof e ? e = t.fromNumber(e) : "string" == typeof e && (e = t.fromString(e)), i += 8;
- var r = this.buffer.byteLength;
- i > r && this.resize((r *= 2) > i ? r : i), i -= 8;
- var o = e.low,
- a = e.high;
- return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255, this.view[i + 2] = o >>> 16 & 255, this.view[i + 1] = o >>> 8 & 255, this.view[i] = 255 & o, i += 4, this.view[i + 3] = a >>> 24 & 255, this.view[i + 2] = a >>> 16 & 255, this.view[i + 1] = a >>> 8 & 255, this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255, this.view[i + 1] = a >>> 16 & 255, this.view[i + 2] = a >>> 8 & 255, this.view[i + 3] = 255 & a, i += 4, this.view[i] = o >>> 24 & 255, this.view[i + 1] = o >>> 16 & 255, this.view[i + 2] = o >>> 8 & 255, this.view[i + 3] = 255 & o), n && (this.offset += 8), this
- }, i.writeLong = i.writeInt64, i.readInt64 = function(e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
- }
- var n = 0,
- r = 0;
- this.littleEndian ? (n = this.view[e + 2] << 16, n |= this.view[e + 1] << 8, n |= this.view[e], n += this.view[e + 3] << 24 >>> 0, e += 4, r = this.view[e + 2] << 16, r |= this.view[e + 1] << 8, r |= this.view[e], r += this.view[e + 3] << 24 >>> 0) : (r = this.view[e + 1] << 16, r |= this.view[e + 2] << 8, r |= this.view[e + 3], r += this.view[e] << 24 >>> 0, e += 4, n = this.view[e + 1] << 16, n |= this.view[e + 2] << 8, n |= this.view[e + 3], n += this.view[e] << 24 >>> 0);
- var o = new t(n, r, !1);
- return i && (this.offset += 8), o
- }, i.readLong = i.readInt64, i.writeUint64 = function(e, i) {
- var n = void 0 === i;
- if (n && (i = this.offset), !this.noAssert) {
- if ("number" == typeof e) e = t.fromNumber(e);
- else if ("string" == typeof e) e = t.fromString(e);
- else if (!(e && e instanceof t)) throw TypeError("Illegal value: " + e + " (not an integer or Long)");
- if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
- }
- "number" == typeof e ? e = t.fromNumber(e) : "string" == typeof e && (e = t.fromString(e)), i += 8;
- var r = this.buffer.byteLength;
- i > r && this.resize((r *= 2) > i ? r : i), i -= 8;
- var o = e.low,
- a = e.high;
- return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255, this.view[i + 2] = o >>> 16 & 255, this.view[i + 1] = o >>> 8 & 255, this.view[i] = 255 & o, i += 4, this.view[i + 3] = a >>> 24 & 255, this.view[i + 2] = a >>> 16 & 255, this.view[i + 1] = a >>> 8 & 255, this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255, this.view[i + 1] = a >>> 16 & 255, this.view[i + 2] = a >>> 8 & 255, this.view[i + 3] = 255 & a, i += 4, this.view[i] = o >>> 24 & 255, this.view[i + 1] = o >>> 16 & 255, this.view[i + 2] = o >>> 8 & 255, this.view[i + 3] = 255 & o), n && (this.offset += 8), this
- }, i.writeUInt64 = i.writeUint64, i.readUint64 = function(e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
- }
- var n = 0,
- r = 0;
- this.littleEndian ? (n = this.view[e + 2] << 16, n |= this.view[e + 1] << 8, n |= this.view[e], n += this.view[e + 3] << 24 >>> 0, e += 4, r = this.view[e + 2] << 16, r |= this.view[e + 1] << 8, r |= this.view[e], r += this.view[e + 3] << 24 >>> 0) : (r = this.view[e + 1] << 16, r |= this.view[e + 2] << 8, r |= this.view[e + 3], r += this.view[e] << 24 >>> 0, e += 4, n = this.view[e + 1] << 16, n |= this.view[e + 2] << 8, n |= this.view[e + 3], n += this.view[e] << 24 >>> 0);
- var o = new t(n, r, !0);
- return i && (this.offset += 8), o
- }, i.readUInt64 = i.readUint64), i.writeFloat32 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t) throw TypeError("Illegal value: " + t + " (not a number)");
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 4;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 4, l(this.view, t, e, this.littleEndian, 23, 4), i && (this.offset += 4), this
- }, i.writeFloat = i.writeFloat32, i.readFloat32 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
- }
- var i = s(this.view, t, this.littleEndian, 23, 4);
- return e && (this.offset += 4), i
- }, i.readFloat = i.readFloat32, i.writeFloat64 = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof t) throw TypeError("Illegal value: " + t + " (not a number)");
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- e += 8;
- var n = this.buffer.byteLength;
- return e > n && this.resize((n *= 2) > e ? n : e), e -= 8, l(this.view, t, e, this.littleEndian, 52, 8), i && (this.offset += 8), this
- }, i.writeDouble = i.writeFloat64, i.readFloat64 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
- }
- var i = s(this.view, t, this.littleEndian, 52, 8);
- return e && (this.offset += 8), i
- }, i.readDouble = i.readFloat64, e.MAX_VARINT32_BYTES = 5, e.calculateVarint32 = function(t) {
- return (t >>>= 0) < 128 ? 1 : t < 16384 ? 2 : t < 1 << 21 ? 3 : t < 1 << 28 ? 4 : 5
- }, e.zigZagEncode32 = function(t) {
- return ((t |= 0) << 1 ^ t >> 31) >>> 0
- }, e.zigZagDecode32 = function(t) {
- return t >>> 1 ^ -(1 & t) | 0
- }, i.writeVarint32 = function(t, i) {
- var n = void 0 === i;
- if (n && (i = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t |= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
- }
- var r, o = e.calculateVarint32(t);
- i += o;
- var a = this.buffer.byteLength;
- for (i > a && this.resize((a *= 2) > i ? a : i), i -= o, t >>>= 0; t >= 128;) r = 127 & t | 128, this.view[i++] = r, t >>>= 7;
- return this.view[i++] = t, n ? (this.offset = i, this) : o
- }, i.writeVarint32ZigZag = function(t, i) {
- return this.writeVarint32(e.zigZagEncode32(t), i)
- }, i.readVarint32 = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
- }
- var i, n = 0,
- r = 0;
- do {
- if (!this.noAssert && t > this.limit) {
- var o = Error("Truncated");
- throw o.truncated = !0, o
- }
- i = this.view[t++], n < 5 && (r |= (127 & i) << 7 * n), ++n
- } while (0 != (128 & i));
- return r |= 0, e ? (this.offset = t, r) : {
- value: r,
- length: n
- }
- }, i.readVarint32ZigZag = function(t) {
- var i = this.readVarint32(t);
- return "object" == typeof i ? i.value = e.zigZagDecode32(i.value) : i = e.zigZagDecode32(i), i
- }, t && (e.MAX_VARINT64_BYTES = 10, e.calculateVarint64 = function(e) {
- "number" == typeof e ? e = t.fromNumber(e) : "string" == typeof e && (e = t.fromString(e));
- var i = e.toInt() >>> 0,
- n = e.shiftRightUnsigned(28)
- .toInt() >>> 0,
- r = e.shiftRightUnsigned(56)
- .toInt() >>> 0;
- return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
- }, e.zigZagEncode64 = function(e) {
- return "number" == typeof e ? e = t.fromNumber(e, !1) : "string" == typeof e ? e = t.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()), e.shiftLeft(1)
- .xor(e.shiftRight(63))
- .toUnsigned()
- }, e.zigZagDecode64 = function(e) {
- return "number" == typeof e ? e = t.fromNumber(e, !1) : "string" == typeof e ? e = t.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()), e.shiftRightUnsigned(1)
- .xor(e.and(t.ONE)
- .toSigned()
- .negate())
- .toSigned()
- }, i.writeVarint64 = function(i, n) {
- var r = void 0 === n;
- if (r && (n = this.offset), !this.noAssert) {
- if ("number" == typeof i) i = t.fromNumber(i);
- else if ("string" == typeof i) i = t.fromString(i);
- else if (!(i && i instanceof t)) throw TypeError("Illegal value: " + i + " (not an integer or Long)");
- if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
- if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
- }
- "number" == typeof i ? i = t.fromNumber(i, !1) : "string" == typeof i ? i = t.fromString(i, !1) : !1 !== i.unsigned && (i = i.toSigned());
- var o = e.calculateVarint64(i),
- a = i.toInt() >>> 0,
- s = i.shiftRightUnsigned(28)
- .toInt() >>> 0,
- l = i.shiftRightUnsigned(56)
- .toInt() >>> 0;
- n += o;
- var u = this.buffer.byteLength;
- switch (n > u && this.resize((u *= 2) > n ? u : n), n -= o, o) {
- case 10:
- this.view[n + 9] = l >>> 7 & 1;
- case 9:
- this.view[n + 8] = 9 !== o ? 128 | l : 127 & l;
- case 8:
- this.view[n + 7] = 8 !== o ? s >>> 21 | 128 : s >>> 21 & 127;
- case 7:
- this.view[n + 6] = 7 !== o ? s >>> 14 | 128 : s >>> 14 & 127;
- case 6:
- this.view[n + 5] = 6 !== o ? s >>> 7 | 128 : s >>> 7 & 127;
- case 5:
- this.view[n + 4] = 5 !== o ? 128 | s : 127 & s;
- case 4:
- this.view[n + 3] = 4 !== o ? a >>> 21 | 128 : a >>> 21 & 127;
- case 3:
- this.view[n + 2] = 3 !== o ? a >>> 14 | 128 : a >>> 14 & 127;
- case 2:
- this.view[n + 1] = 2 !== o ? a >>> 7 | 128 : a >>> 7 & 127;
- case 1:
- this.view[n] = 1 !== o ? 128 | a : 127 & a
- }
- return r ? (this.offset += o, this) : o
- }, i.writeVarint64ZigZag = function(t, i) {
- return this.writeVarint64(e.zigZagEncode64(t), i)
- }, i.readVarint64 = function(e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
- }
- var n = e,
- r = 0,
- o = 0,
- a = 0,
- s = 0;
- if (r = 127 & (s = this.view[e++]), 128 & s && (r |= (127 & (s = this.view[e++])) << 7, (128 & s || this.noAssert && void 0 === s) && (r |= (127 & (s = this.view[e++])) << 14, (128 & s || this.noAssert && void 0 === s) && (r |= (127 & (s = this.view[e++])) << 21, (128 & s || this.noAssert && void 0 === s) && (o = 127 & (s = this.view[e++]), (128 & s || this.noAssert && void 0 === s) && (o |= (127 & (s = this.view[e++])) << 7, (128 & s || this.noAssert && void 0 === s) && (o |= (127 & (s = this.view[e++])) << 14, (128 & s || this.noAssert && void 0 === s) && (o |= (127 & (s = this.view[e++])) << 21, (128 & s || this.noAssert && void 0 === s) && (a = 127 & (s = this.view[e++]), (128 & s || this.noAssert && void 0 === s) && (a |= (127 & (s = this.view[e++])) << 7, 128 & s || this.noAssert && void 0 === s)))))))))) throw Error("Buffer overrun");
- var l = t.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
- return i ? (this.offset = e, l) : {
- value: l,
- length: e - n
- }
- }, i.readVarint64ZigZag = function(i) {
- var n = this.readVarint64(i);
- return n && n.value instanceof t ? n.value = e.zigZagDecode64(n.value) : n = e.zigZagDecode64(n), n
- }), i.writeCString = function(t, e) {
- var i = void 0 === e;
- i && (e = this.offset);
- var n, r = t.length;
- if (!this.noAssert) {
- if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
- for (n = 0; n < r; ++n)
- if (0 === t.charCodeAt(n)) throw RangeError("Illegal str: Contains NULL-characters");
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- r = h.calculateUTF16asUTF8(o(t))[1], e += r + 1;
- var a = this.buffer.byteLength;
- return e > a && this.resize((a *= 2) > e ? a : e), e -= r + 1, h.encodeUTF16toUTF8(o(t), function(t) {
- this.view[e++] = t
- }.bind(this)), this.view[e++] = 0, i ? (this.offset = e, this) : r
- }, i.readCString = function(t) {
- var e = void 0 === t;
- if (e && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
- }
- var i, n = t,
- r = -1;
- return h.decodeUTF8toUTF16(function() {
- if (0 === r) return null;
- if (t >= this.limit) throw RangeError("Illegal range: Truncated data, " + t + " < " + this.limit);
- return 0 === (r = this.view[t++]) ? null : r
- }.bind(this), i = a(), !0), e ? (this.offset = t, i()) : {
- string: i(),
- length: t - n
- }
- }, i.writeIString = function(t, e) {
- var i = void 0 === e;
- if (i && (e = this.offset), !this.noAssert) {
- if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- var n, r = e;
- n = h.calculateUTF16asUTF8(o(t), this.noAssert)[1], e += 4 + n;
- var a = this.buffer.byteLength;
- if (e > a && this.resize((a *= 2) > e ? a : e), e -= 4 + n, this.littleEndian ? (this.view[e + 3] = n >>> 24 & 255, this.view[e + 2] = n >>> 16 & 255, this.view[e + 1] = n >>> 8 & 255, this.view[e] = 255 & n) : (this.view[e] = n >>> 24 & 255, this.view[e + 1] = n >>> 16 & 255, this.view[e + 2] = n >>> 8 & 255, this.view[e + 3] = 255 & n), e += 4, h.encodeUTF16toUTF8(o(t), function(t) {
- this.view[e++] = t
- }.bind(this)), e !== r + 4 + n) throw RangeError("Illegal range: Truncated data, " + e + " == " + (e + 4 + n));
- return i ? (this.offset = e, this) : e - r
- }, i.readIString = function(t) {
- var i = void 0 === t;
- if (i && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
- }
- var n = t,
- r = this.readUint32(t),
- o = this.readUTF8String(r, e.METRICS_BYTES, t += 4);
- return t += o.length, i ? (this.offset = t, o.string) : {
- string: o.string,
- length: t - n
- }
- }, e.METRICS_CHARS = "c", e.METRICS_BYTES = "b", i.writeUTF8String = function(t, e) {
- var i, n = void 0 === e;
- if (n && (e = this.offset), !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- var r = e;
- i = h.calculateUTF16asUTF8(o(t))[1], e += i;
- var a = this.buffer.byteLength;
- return e > a && this.resize((a *= 2) > e ? a : e), e -= i, h.encodeUTF16toUTF8(o(t), function(t) {
- this.view[e++] = t
- }.bind(this)), n ? (this.offset = e, this) : e - r
- }, i.writeString = i.writeUTF8String, e.calculateUTF8Chars = function(t) {
- return h.calculateUTF16asUTF8(o(t))[0]
- }, e.calculateUTF8Bytes = function(t) {
- return h.calculateUTF16asUTF8(o(t))[1]
- }, e.calculateString = e.calculateUTF8Bytes, i.readUTF8String = function(t, i, n) {
- "number" == typeof i && (n = i, i = void 0);
- var r = void 0 === n;
- if (r && (n = this.offset), void 0 === i && (i = e.METRICS_CHARS), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal length: " + t + " (not an integer)");
- if (t |= 0, "number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
- if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
- }
- var o, s = 0,
- l = n;
- if (i === e.METRICS_CHARS) {
- if (o = a(), h.decodeUTF8(function() {
- return s < t && n < this.limit ? this.view[n++] : null
- }.bind(this), (function(t) {
- ++s, h.UTF8toUTF16(t, o)
- })), s !== t) throw RangeError("Illegal range: Truncated data, " + s + " == " + t);
- return r ? (this.offset = n, o()) : {
- string: o(),
- length: n - l
- }
- }
- if (i === e.METRICS_BYTES) {
- if (!this.noAssert) {
- if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
- if ((n >>>= 0) < 0 || n + t > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+" + t + ") <= " + this.buffer.byteLength)
- }
- var u = n + t;
- if (h.decodeUTF8toUTF16(function() {
- return n < u ? this.view[n++] : null
- }.bind(this), o = a(), this.noAssert), n !== u) throw RangeError("Illegal range: Truncated data, " + n + " == " + u);
- return r ? (this.offset = n, o()) : {
- string: o(),
- length: n - l
- }
- }
- throw TypeError("Unsupported metrics: " + i)
- }, i.readString = i.readUTF8String, i.writeVString = function(t, i) {
- var n = void 0 === i;
- if (n && (i = this.offset), !this.noAssert) {
- if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
- if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
- }
- var r, a, s = i;
- r = h.calculateUTF16asUTF8(o(t), this.noAssert)[1], a = e.calculateVarint32(r), i += a + r;
- var l = this.buffer.byteLength;
- if (i > l && this.resize((l *= 2) > i ? l : i), i -= a + r, i += this.writeVarint32(r, i), h.encodeUTF16toUTF8(o(t), function(t) {
- this.view[i++] = t
- }.bind(this)), i !== s + r + a) throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
- return n ? (this.offset = i, this) : i - s
- }, i.readVString = function(t) {
- var i = void 0 === t;
- if (i && (t = this.offset), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
- }
- var n = t,
- r = this.readVarint32(t),
- o = this.readUTF8String(r.value, e.METRICS_BYTES, t += r.length);
- return t += o.length, i ? (this.offset = t, o.string) : {
- string: o.string,
- length: t - n
- }
- }, i.append = function(t, i, n) {
- "number" != typeof i && "string" == typeof i || (n = i, i = void 0);
- var r = void 0 === n;
- if (r && (n = this.offset), !this.noAssert) {
- if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
- if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
- }
- t instanceof e || (t = e.wrap(t, i));
- var o = t.limit - t.offset;
- if (o <= 0) return this;
- n += o;
- var a = this.buffer.byteLength;
- return n > a && this.resize((a *= 2) > n ? a : n), n -= o, this.view.set(t.view.subarray(t.offset, t.limit), n), t.offset += o, r && (this.offset += o), this
- }, i.appendTo = function(t, e) {
- return t.append(this, e), this
- }, i.assert = function(t) {
- return this.noAssert = !t, this
- }, i.capacity = function() {
- return this.buffer.byteLength
- }, i.clear = function() {
- return this.offset = 0, this.limit = this.buffer.byteLength, this.markedOffset = -1, this
- }, i.clone = function(t) {
- var i = new e(0, this.littleEndian, this.noAssert);
- return t ? (i.buffer = new ArrayBuffer(this.buffer.byteLength), i.view = new Uint8Array(i.buffer)) : (i.buffer = this.buffer, i.view = this.view), i.offset = this.offset, i.markedOffset = this.markedOffset, i.limit = this.limit, i
- }, i.compact = function(t, e) {
- if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
- if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
- }
- if (0 === t && e === this.buffer.byteLength) return this;
- var i = e - t;
- if (0 === i) return this.buffer = n, this.view = null, this.markedOffset >= 0 && (this.markedOffset -= t), this.offset = 0, this.limit = 0, this;
- var r = new ArrayBuffer(i),
- o = new Uint8Array(r);
- return o.set(this.view.subarray(t, e)), this.buffer = r, this.view = o, this.markedOffset >= 0 && (this.markedOffset -= t), this.offset = 0, this.limit = i, this
- }, i.copy = function(t, i) {
- if (void 0 === t && (t = this.offset), void 0 === i && (i = this.limit), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal end: Not an integer");
- if (i >>>= 0, t < 0 || t > i || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
- }
- if (t === i) return new e(0, this.littleEndian, this.noAssert);
- var n = i - t,
- r = new e(n, this.littleEndian, this.noAssert);
- return r.offset = 0, r.limit = n, r.markedOffset >= 0 && (r.markedOffset -= t), this.copyTo(r, 0, t, i), r
- }, i.copyTo = function(t, i, n, r) {
- var o, a;
- if (!this.noAssert && !e.isByteBuffer(t)) throw TypeError("Illegal target: Not a ByteBuffer");
- if (i = (a = void 0 === i) ? t.offset : 0 | i, n = (o = void 0 === n) ? this.offset : 0 | n, r = void 0 === r ? this.limit : 0 | r, i < 0 || i > t.buffer.byteLength) throw RangeError("Illegal target range: 0 <= " + i + " <= " + t.buffer.byteLength);
- if (n < 0 || r > this.buffer.byteLength) throw RangeError("Illegal source range: 0 <= " + n + " <= " + this.buffer.byteLength);
- var s = r - n;
- return 0 === s ? t : (t.ensureCapacity(i + s), t.view.set(this.view.subarray(n, r), i), o && (this.offset += s), a && (t.offset += s), this)
- }, i.ensureCapacity = function(t) {
- var e = this.buffer.byteLength;
- return e < t ? this.resize((e *= 2) > t ? e : t) : this
- }, i.fill = function(t, e, i) {
- var n = void 0 === e;
- if (n && (e = this.offset), "string" == typeof t && t.length > 0 && (t = t.charCodeAt(0)), void 0 === e && (e = this.offset), void 0 === i && (i = this.limit), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
- if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal begin: Not an integer");
- if (e >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal end: Not an integer");
- if (i >>>= 0, e < 0 || e > i || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + i + " <= " + this.buffer.byteLength)
- }
- if (e >= i) return this;
- for (; e < i;) this.view[e++] = t;
- return n && (this.offset = e), this
- }, i.flip = function() {
- return this.limit = this.offset, this.offset = 0, this
- }, i.mark = function(t) {
- if (t = void 0 === t ? this.offset : t, !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- return this.markedOffset = t, this
- }, i.order = function(t) {
- if (!this.noAssert && "boolean" != typeof t) throw TypeError("Illegal littleEndian: Not a boolean");
- return this.littleEndian = !!t, this
- }, i.LE = function(t) {
- return this.littleEndian = void 0 === t || !!t, this
- }, i.BE = function(t) {
- return this.littleEndian = void 0 !== t && !t, this
- }, i.prepend = function(t, i, n) {
- "number" != typeof i && "string" == typeof i || (n = i, i = void 0);
- var r = void 0 === n;
- if (r && (n = this.offset), !this.noAssert) {
- if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
- if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
- }
- t instanceof e || (t = e.wrap(t, i));
- var o = t.limit - t.offset;
- if (o <= 0) return this;
- var a = o - n;
- if (a > 0) {
- var s = new ArrayBuffer(this.buffer.byteLength + a),
- l = new Uint8Array(s);
- l.set(this.view.subarray(n, this.buffer.byteLength), o), this.buffer = s, this.view = l, this.offset += a, this.markedOffset >= 0 && (this.markedOffset += a), this.limit += a, n += a
- } else new Uint8Array(this.buffer);
- return this.view.set(t.view.subarray(t.offset, t.limit), n - o), t.offset = t.limit, r && (this.offset -= o), this
- }, i.prependTo = function(t, e) {
- return t.prepend(this, e), this
- }, i.printDebug = function(t) {
- "function" != typeof t && (t = void 0), t(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
- }, i.remaining = function() {
- return this.limit - this.offset
- }, i.reset = function() {
- return this.markedOffset >= 0 ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this
- }, i.resize = function(t) {
- if (!this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal capacity: " + t + " (not an integer)");
- if ((t |= 0) < 0) throw RangeError("Illegal capacity: 0 <= " + t)
- }
- if (this.buffer.byteLength < t) {
- var e = new ArrayBuffer(t),
- i = new Uint8Array(e);
- i.set(this.view), this.buffer = e, this.view = i
- }
- return this
- }, i.reverse = function(t, e) {
- if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
- if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
- }
- return t === e || Array.prototype.reverse.call(this.view.subarray(t, e)), this
- }, i.skip = function(t) {
- if (!this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal length: " + t + " (not an integer)");
- t |= 0
- }
- var e = this.offset + t;
- if (!this.noAssert && (e < 0 || e > this.buffer.byteLength)) throw RangeError("Illegal length: 0 <= " + this.offset + " + " + t + " <= " + this.buffer.byteLength);
- return this.offset = e, this
- }, i.slice = function(t, e) {
- if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
- if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
- }
- var i = this.clone();
- return i.offset = t, i.limit = e, i
- }, i.toBuffer = function(t) {
- var e = this.offset,
- i = this.limit;
- if (!this.noAssert) {
- if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: Not an integer");
- if (e >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal limit: Not an integer");
- if (i >>>= 0, e < 0 || e > i || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + i + " <= " + this.buffer.byteLength)
- }
- if (!t && 0 === e && i === this.buffer.byteLength) return this.buffer;
- if (e === i) return n;
- var r = new ArrayBuffer(i - e);
- return new Uint8Array(r)
- .set(new Uint8Array(this.buffer)
- .subarray(e, i), 0), r
- }, i.toArrayBuffer = i.toBuffer, i.toString = function(t, e, i) {
- if (void 0 === t) return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
- switch ("number" == typeof t && (i = e = t = "utf8"), t) {
- case "utf8":
- return this.toUTF8(e, i);
- case "base64":
- return this.toBase64(e, i);
- case "hex":
- return this.toHex(e, i);
- case "binary":
- return this.toBinary(e, i);
- case "debug":
- return this.toDebug();
- case "columns":
- return this.toColumns();
- default:
- throw Error("Unsupported encoding: " + t)
- }
- };
- var u = function() {
- for (var t = {}, e = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = e.length; n < r; ++n) i[e[n]] = n;
- return t.encode = function(t, i) {
- for (var n, r; null !== (n = t());) i(e[n >> 2 & 63]), r = (3 & n) << 4, null !== (n = t()) ? (i(e[63 & ((r |= n >> 4 & 15) | n >> 4 & 15)]), r = (15 & n) << 2, null !== (n = t()) ? (i(e[63 & (r | n >> 6 & 3)]), i(e[63 & n])) : (i(e[63 & r]), i(61))) : (i(e[63 & r]), i(61), i(61))
- }, t.decode = function(t, e) {
- var n, r, o;
- function a(t) {
- throw Error("Illegal character code: " + t)
- }
- for (; null !== (n = t());)
- if (void 0 === (r = i[n]) && a(n), null !== (n = t()) && (void 0 === (o = i[n]) && a(n), e(r << 2 >>> 0 | (48 & o) >> 4), null !== (n = t()))) {
- if (void 0 === (r = i[n])) {
- if (61 === n) break;
- a(n)
- }
- if (e((15 & o) << 4 >>> 0 | (60 & r) >> 2), null !== (n = t())) {
- if (void 0 === (o = i[n])) {
- if (61 === n) break;
- a(n)
- }
- e((3 & r) << 6 >>> 0 | o)
- }
- }
- }, t.test = function(t) {
- return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)
- }, t
- }();
- i.toBase64 = function(t, e) {
- if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), e |= 0, (t |= 0) < 0 || e > this.capacity || t > e) throw RangeError("begin, end");
- var i;
- return u.encode(function() {
- return t < e ? this.view[t++] : null
- }.bind(this), i = a()), i()
- }, e.fromBase64 = function(t, i) {
- if ("string" != typeof t) throw TypeError("str");
- var n = new e(t.length / 4 * 3, i),
- r = 0;
- return u.decode(o(t), (function(t) {
- n.view[r++] = t
- })), n.limit = r, n
- }, e.btoa = function(t) {
- return e.fromBinary(t)
- .toBase64()
- }, e.atob = function(t) {
- return e.fromBase64(t)
- .toBinary()
- }, i.toBinary = function(t, e) {
- if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), e |= 0, (t |= 0) < 0 || e > this.capacity() || t > e) throw RangeError("begin, end");
- if (t === e) return "";
- for (var i = [], n = []; t < e;) i.push(this.view[t++]), i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), i = []);
- return n.join("") + String.fromCharCode.apply(String, i)
- }, e.fromBinary = function(t, i) {
- if ("string" != typeof t) throw TypeError("str");
- for (var n, r = 0, o = t.length, a = new e(o, i); r < o;) {
- if ((n = t.charCodeAt(r)) > 255) throw RangeError("illegal char code: " + n);
- a.view[r++] = n
- }
- return a.limit = o, a
- }, i.toDebug = function(t) {
- for (var e, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n;) {
- if (-1 !== i && (r += (e = this.view[i]) < 16 ? "0" + e.toString(16)
- .toUpperCase() : e.toString(16)
- .toUpperCase(), t && (o += e > 32 && e < 127 ? String.fromCharCode(e) : ".")), ++i, t && i > 0 && i % 16 == 0 && i !== n) {
- for (; r.length < 51;) r += " ";
- a += r + o + "\n", r = o = ""
- }
- i === this.offset && i === this.limit ? r += i === this.markedOffset ? "!" : "|" : i === this.offset ? r += i === this.markedOffset ? "[" : "<" : i === this.limit ? r += i === this.markedOffset ? "]" : ">" : r += i === this.markedOffset ? "'" : t || 0 !== i && i !== n ? " " : ""
- }
- if (t && " " !== r) {
- for (; r.length < 51;) r += " ";
- a += r + o + "\n"
- }
- return t ? a : r
- }, e.fromDebug = function(t, i, n) {
- for (var r, o, a = t.length, s = new e((a + 1) / 3 | 0, i, n), l = 0, u = 0, h = !1, c = !1, d = !1, p = !1, f = !1; l < a;) {
- switch (r = t.charAt(l++)) {
- case "!":
- if (!n) {
- if (c || d || p) {
- f = !0;
- break
- }
- c = d = p = !0
- }
- s.offset = s.markedOffset = s.limit = u, h = !1;
- break;
- case "|":
- if (!n) {
- if (c || p) {
- f = !0;
- break
- }
- c = p = !0
- }
- s.offset = s.limit = u, h = !1;
- break;
- case "[":
- if (!n) {
- if (c || d) {
- f = !0;
- break
- }
- c = d = !0
- }
- s.offset = s.markedOffset = u, h = !1;
- break;
- case "<":
- if (!n) {
- if (c) {
- f = !0;
- break
- }
- c = !0
- }
- s.offset = u, h = !1;
- break;
- case "]":
- if (!n) {
- if (p || d) {
- f = !0;
- break
- }
- p = d = !0
- }
- s.limit = s.markedOffset = u, h = !1;
- break;
- case ">":
- if (!n) {
- if (p) {
- f = !0;
- break
- }
- p = !0
- }
- s.limit = u, h = !1;
- break;
- case "'":
- if (!n) {
- if (d) {
- f = !0;
- break
- }
- d = !0
- }
- s.markedOffset = u, h = !1;
- break;
- case " ":
- h = !1;
- break;
- default:
- if (!n && h) {
- f = !0;
- break
- }
- if (o = parseInt(r + t.charAt(l++), 16), !n && (isNaN(o) || o < 0 || o > 255)) throw TypeError("Illegal str: Not a debug encoded string");
- s.view[u++] = o, h = !0
- }
- if (f) throw TypeError("Illegal str: Invalid symbol at " + l)
- }
- if (!n) {
- if (!c || !p) throw TypeError("Illegal str: Missing offset or limit");
- if (u < s.buffer.byteLength) throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + u + " < " + a)
- }
- return s
- }, i.toHex = function(t, e) {
- if (t = void 0 === t ? this.offset : t, e = void 0 === e ? this.limit : e, !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
- if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
- }
- for (var i, n = new Array(e - t); t < e;)(i = this.view[t++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
- return n.join("")
- }, e.fromHex = function(t, i, n) {
- if (!n) {
- if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
- if (t.length % 2 != 0) throw TypeError("Illegal str: Length not a multiple of 2")
- }
- for (var r, o = t.length, a = new e(o / 2 | 0, i), s = 0, l = 0; s < o; s += 2) {
- if (r = parseInt(t.substring(s, s + 2), 16), !n && (!isFinite(r) || r < 0 || r > 255)) throw TypeError("Illegal str: Contains non-hex characters");
- a.view[l++] = r
- }
- return a.limit = l, a
- };
- var h = function() {
- var t = {
- MAX_CODEPOINT: 1114111,
- encodeUTF8: function(t, e) {
- var i = null;
- for ("number" == typeof t && (i = t, t = function() {
- return null
- }); null !== i || null !== (i = t());) i < 128 ? e(127 & i) : i < 2048 ? (e(i >> 6 & 31 | 192), e(63 & i | 128)) : i < 65536 ? (e(i >> 12 & 15 | 224), e(i >> 6 & 63 | 128), e(63 & i | 128)) : (e(i >> 18 & 7 | 240), e(i >> 12 & 63 | 128), e(i >> 6 & 63 | 128), e(63 & i | 128)), i = null
- },
- decodeUTF8: function(t, e) {
- for (var i, n, r, o, a = function(t) {
- t = t.slice(0, t.indexOf(null));
- var e = Error(t.toString());
- throw e.name = "TruncatedError", e.bytes = t, e
- }; null !== (i = t());)
- if (0 == (128 & i)) e(i);
- else if (192 == (224 & i)) null === (n = t()) && a([i, n]), e((31 & i) << 6 | 63 & n);
- else if (224 == (240 & i))(null === (n = t()) || null === (r = t())) && a([i, n, r]), e((15 & i) << 12 | (63 & n) << 6 | 63 & r);
- else {
- if (240 != (248 & i)) throw RangeError("Illegal starting byte: " + i);
- (null === (n = t()) || null === (r = t()) || null === (o = t())) && a([i, n, r, o]), e((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
- }
- },
- UTF16toUTF8: function(t, e) {
- for (var i, n = null; null !== (i = null !== n ? n : t());) i >= 55296 && i <= 57343 && null !== (n = t()) && n >= 56320 && n <= 57343 ? (e(1024 * (i - 55296) + n - 56320 + 65536), n = null) : e(i);
- null !== n && e(n)
- },
- UTF8toUTF16: function(t, e) {
- var i = null;
- for ("number" == typeof t && (i = t, t = function() {
- return null
- }); null !== i || null !== (i = t());) i <= 65535 ? e(i) : (e(55296 + ((i -= 65536) >> 10)), e(i % 1024 + 56320)), i = null
- },
- encodeUTF16toUTF8: function(e, i) {
- t.UTF16toUTF8(e, (function(e) {
- t.encodeUTF8(e, i)
- }))
- },
- decodeUTF8toUTF16: function(e, i) {
- t.decodeUTF8(e, (function(e) {
- t.UTF8toUTF16(e, i)
- }))
- },
- calculateCodePoint: function(t) {
- return t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
- },
- calculateUTF8: function(t) {
- for (var e, i = 0; null !== (e = t());) i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
- return i
- },
- calculateUTF16asUTF8: function(e) {
- var i = 0,
- n = 0;
- return t.UTF16toUTF8(e, (function(t) {
- ++i, n += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
- })), [i, n]
- }
- };
- return t
- }();
- return i.toUTF8 = function(t, e) {
- if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
- if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
- }
- var i;
- try {
- h.decodeUTF8toUTF16(function() {
- return t < e ? this.view[t++] : null
- }.bind(this), i = a())
- } catch (i) {
- if (t !== e) throw RangeError("Illegal range: Truncated data, " + t + " != " + e)
- }
- return i()
- }, e.fromUTF8 = function(t, i, n) {
- if (!n && "string" != typeof t) throw TypeError("Illegal str: Not a string");
- var r = new e(h.calculateUTF16asUTF8(o(t), !0)[1], i, n),
- a = 0;
- return h.encodeUTF16toUTF8(o(t), (function(t) {
- r.view[a++] = t
- })), r.limit = a, r
- }, e
- }) ? n.apply(e, r) : n) || (t.exports = o)
- }, function(t, e, i) {
- var n, r, o;
- r = [], void 0 === (o = "function" == typeof(n = function() {
- "use strict";
- function t(t, e, i) {
- this.low = 0 | t, this.high = 0 | e, this.unsigned = !!i
- }
- function e(t) {
- return !0 === (t && t.__isLong__)
- }
- t.prototype.__isLong__, Object.defineProperty(t.prototype, "__isLong__", {
- value: !0,
- enumerable: !1,
- configurable: !1
- }), t.isLong = e;
- var i = {},
- n = {};
- function r(t, e) {
- var r, o, s;
- return e ? (s = 0 <= (t >>>= 0) && t < 256) && (o = n[t]) ? o : (r = a(t, (0 | t) < 0 ? -1 : 0, !0), s && (n[t] = r), r) : (s = -128 <= (t |= 0) && t < 128) && (o = i[t]) ? o : (r = a(t, t < 0 ? -1 : 0, !1), s && (i[t] = r), r)
- }
- function o(t, e) {
- if (isNaN(t) || !isFinite(t)) return e ? m : f;
- if (e) {
- if (t < 0) return m;
- if (t >= c) return w
- } else {
- if (t <= -d) return x;
- if (t + 1 >= d) return b
- }
- return t < 0 ? o(-t, e)
- .neg() : a(t % h | 0, t / h | 0, e)
- }
- function a(e, i, n) {
- return new t(e, i, n)
- }
- t.fromInt = r, t.fromNumber = o, t.fromBits = a;
- var s = Math.pow;
- function l(t, e, i) {
- if (0 === t.length) throw Error("empty string");
- if ("NaN" === t || "Infinity" === t || "+Infinity" === t || "-Infinity" === t) return f;
- if ("number" == typeof e ? (i = e, e = !1) : e = !!e, (i = i || 10) < 2 || 36 < i) throw RangeError("radix");
- var n;
- if ((n = t.indexOf("-")) > 0) throw Error("interior hyphen");
- if (0 === n) return l(t.substring(1), e, i)
- .neg();
- for (var r = o(s(i, 8)), a = f, u = 0; u < t.length; u += 8) {
- var h = Math.min(8, t.length - u),
- c = parseInt(t.substring(u, u + h), i);
- if (h < 8) {
- var d = o(s(i, h));
- a = a.mul(d)
- .add(o(c))
- } else a = (a = a.mul(r))
- .add(o(c))
- }
- return a.unsigned = e, a
- }
- function u(e) {
- return e instanceof t ? e : "number" == typeof e ? o(e) : "string" == typeof e ? l(e) : a(e.low, e.high, e.unsigned)
- }
- t.fromString = l, t.fromValue = u;
- var h = 4294967296,
- c = h * h,
- d = c / 2,
- p = r(1 << 24),
- f = r(0);
- t.ZERO = f;
- var m = r(0, !0);
- t.UZERO = m;
- var g = r(1);
- t.ONE = g;
- var v = r(1, !0);
- t.UONE = v;
- var y = r(-1);
- t.NEG_ONE = y;
- var b = a(-1, 2147483647, !1);
- t.MAX_VALUE = b;
- var w = a(-1, -1, !0);
- t.MAX_UNSIGNED_VALUE = w;
- var x = a(0, -2147483648, !1);
- t.MIN_VALUE = x;
- var M = t.prototype;
- return M.toInt = function() {
- return this.unsigned ? this.low >>> 0 : this.low
- }, M.toNumber = function() {
- return this.unsigned ? (this.high >>> 0) * h + (this.low >>> 0) : this.high * h + (this.low >>> 0)
- }, M.toString = function(t) {
- if ((t = t || 10) < 2 || 36 < t) throw RangeError("radix");
- if (this.isZero()) return "0";
- if (this.isNegative()) {
- if (this.eq(x)) {
- var e = o(t),
- i = this.div(e),
- n = i.mul(e)
- .sub(this);
- return i.toString(t) + n.toInt()
- .toString(t)
- }
- return "-" + this.neg()
- .toString(t)
- }
- for (var r = o(s(t, 6), this.unsigned), a = this, l = "";;) {
- var u = a.div(r),
- h = (a.sub(u.mul(r))
- .toInt() >>> 0)
- .toString(t);
- if ((a = u)
- .isZero()) return h + l;
- for (; h.length < 6;) h = "0" + h;
- l = "" + h + l
- }
- }, M.getHighBits = function() {
- return this.high
- }, M.getHighBitsUnsigned = function() {
- return this.high >>> 0
- }, M.getLowBits = function() {
- return this.low
- }, M.getLowBitsUnsigned = function() {
- return this.low >>> 0
- }, M.getNumBitsAbs = function() {
- if (this.isNegative()) return this.eq(x) ? 64 : this.neg()
- .getNumBitsAbs();
- for (var t = 0 != this.high ? this.high : this.low, e = 31; e > 0 && 0 == (t & 1 << e); e--);
- return 0 != this.high ? e + 33 : e + 1
- }, M.isZero = function() {
- return 0 === this.high && 0 === this.low
- }, M.isNegative = function() {
- return !this.unsigned && this.high < 0
- }, M.isPositive = function() {
- return this.unsigned || this.high >= 0
- }, M.isOdd = function() {
- return 1 == (1 & this.low)
- }, M.isEven = function() {
- return 0 == (1 & this.low)
- }, M.equals = function(t) {
- return e(t) || (t = u(t)), (this.unsigned === t.unsigned || this.high >>> 31 != 1 || t.high >>> 31 != 1) && this.high === t.high && this.low === t.low
- }, M.eq = M.equals, M.notEquals = function(t) {
- return !this.eq(t)
- }, M.neq = M.notEquals, M.lessThan = function(t) {
- return this.comp(t) < 0
- }, M.lt = M.lessThan, M.lessThanOrEqual = function(t) {
- return this.comp(t) <= 0
- }, M.lte = M.lessThanOrEqual, M.greaterThan = function(t) {
- return this.comp(t) > 0
- }, M.gt = M.greaterThan, M.greaterThanOrEqual = function(t) {
- return this.comp(t) >= 0
- }, M.gte = M.greaterThanOrEqual, M.compare = function(t) {
- if (e(t) || (t = u(t)), this.eq(t)) return 0;
- var i = this.isNegative(),
- n = t.isNegative();
- return i && !n ? -1 : !i && n ? 1 : this.unsigned ? t.high >>> 0 > this.high >>> 0 || t.high === this.high && t.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(t)
- .isNegative() ? -1 : 1
- }, M.comp = M.compare, M.negate = function() {
- return !this.unsigned && this.eq(x) ? x : this.not()
- .add(g)
- }, M.neg = M.negate, M.add = function(t) {
- e(t) || (t = u(t));
- var i = this.high >>> 16,
- n = 65535 & this.high,
- r = this.low >>> 16,
- o = 65535 & this.low,
- s = t.high >>> 16,
- l = 65535 & t.high,
- h = t.low >>> 16,
- c = 0,
- d = 0,
- p = 0,
- f = 0;
- return p += (f += o + (65535 & t.low)) >>> 16, d += (p += r + h) >>> 16, c += (d += n + l) >>> 16, c += i + s, a((p &= 65535) << 16 | (f &= 65535), (c &= 65535) << 16 | (d &= 65535), this.unsigned)
- }, M.subtract = function(t) {
- return e(t) || (t = u(t)), this.add(t.neg())
- }, M.sub = M.subtract, M.multiply = function(t) {
- if (this.isZero()) return f;
- if (e(t) || (t = u(t)), t.isZero()) return f;
- if (this.eq(x)) return t.isOdd() ? x : f;
- if (t.eq(x)) return this.isOdd() ? x : f;
- if (this.isNegative()) return t.isNegative() ? this.neg()
- .mul(t.neg()) : this.neg()
- .mul(t)
- .neg();
- if (t.isNegative()) return this.mul(t.neg())
- .neg();
- if (this.lt(p) && t.lt(p)) return o(this.toNumber() * t.toNumber(), this.unsigned);
- var i = this.high >>> 16,
- n = 65535 & this.high,
- r = this.low >>> 16,
- s = 65535 & this.low,
- l = t.high >>> 16,
- h = 65535 & t.high,
- c = t.low >>> 16,
- d = 65535 & t.low,
- m = 0,
- g = 0,
- v = 0,
- y = 0;
- return v += (y += s * d) >>> 16, g += (v += r * d) >>> 16, v &= 65535, g += (v += s * c) >>> 16, m += (g += n * d) >>> 16, g &= 65535, m += (g += r * c) >>> 16, g &= 65535, m += (g += s * h) >>> 16, m += i * d + n * c + r * h + s * l, a((v &= 65535) << 16 | (y &= 65535), (m &= 65535) << 16 | (g &= 65535), this.unsigned)
- }, M.mul = M.multiply, M.divide = function(t) {
- if (e(t) || (t = u(t)), t.isZero()) throw Error("division by zero");
- if (this.isZero()) return this.unsigned ? m : f;
- var i, n, r;
- if (this.unsigned) {
- if (t.unsigned || (t = t.toUnsigned()), t.gt(this)) return m;
- if (t.gt(this.shru(1))) return v;
- r = m
- } else {
- if (this.eq(x)) return t.eq(g) || t.eq(y) ? x : t.eq(x) ? g : (i = this.shr(1)
- .div(t)
- .shl(1))
- .eq(f) ? t.isNegative() ? g : y : (n = this.sub(t.mul(i)), r = i.add(n.div(t)));
- if (t.eq(x)) return this.unsigned ? m : f;
- if (this.isNegative()) return t.isNegative() ? this.neg()
- .div(t.neg()) : this.neg()
- .div(t)
- .neg();
- if (t.isNegative()) return this.div(t.neg())
- .neg();
- r = f
- }
- for (n = this; n.gte(t);) {
- i = Math.max(1, Math.floor(n.toNumber() / t.toNumber()));
- for (var a = Math.ceil(Math.log(i) / Math.LN2), l = a <= 48 ? 1 : s(2, a - 48), h = o(i), c = h.mul(t); c.isNegative() || c.gt(n);) c = (h = o(i -= l, this.unsigned))
- .mul(t);
- h.isZero() && (h = g), r = r.add(h), n = n.sub(c)
- }
- return r
- }, M.div = M.divide, M.modulo = function(t) {
- return e(t) || (t = u(t)), this.sub(this.div(t)
- .mul(t))
- }, M.mod = M.modulo, M.not = function() {
- return a(~this.low, ~this.high, this.unsigned)
- }, M.and = function(t) {
- return e(t) || (t = u(t)), a(this.low & t.low, this.high & t.high, this.unsigned)
- }, M.or = function(t) {
- return e(t) || (t = u(t)), a(this.low | t.low, this.high | t.high, this.unsigned)
- }, M.xor = function(t) {
- return e(t) || (t = u(t)), a(this.low ^ t.low, this.high ^ t.high, this.unsigned)
- }, M.shiftLeft = function(t) {
- return e(t) && (t = t.toInt()), 0 == (t &= 63) ? this : t < 32 ? a(this.low << t, this.high << t | this.low >>> 32 - t, this.unsigned) : a(0, this.low << t - 32, this.unsigned)
- }, M.shl = M.shiftLeft, M.shiftRight = function(t) {
- return e(t) && (t = t.toInt()), 0 == (t &= 63) ? this : t < 32 ? a(this.low >>> t | this.high << 32 - t, this.high >> t, this.unsigned) : a(this.high >> t - 32, this.high >= 0 ? 0 : -1, this.unsigned)
- }, M.shr = M.shiftRight, M.shiftRightUnsigned = function(t) {
- if (e(t) && (t = t.toInt()), 0 == (t &= 63)) return this;
- var i = this.high;
- return t < 32 ? a(this.low >>> t | i << 32 - t, i >>> t, this.unsigned) : a(32 === t ? i : i >>> t - 32, 0, this.unsigned)
- }, M.shru = M.shiftRightUnsigned, M.toSigned = function() {
- return this.unsigned ? a(this.low, this.high, !1) : this
- }, M.toUnsigned = function() {
- return this.unsigned ? this : a(this.low, this.high, !0)
- }, M.toBytes = function(t) {
- return t ? this.toBytesLE() : this.toBytesBE()
- }, M.toBytesLE = function() {
- var t = this.high,
- e = this.low;
- return [255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255, 255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255]
- }, M.toBytesBE = function() {
- var t = this.high,
- e = this.low;
- return [t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t, e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e]
- }, t
- }) ? n.apply(e, r) : n) || (t.exports = o)
- }, function(t, e) {}, function(t, e) {
- var i;
- i = function() {
- return this
- }();
- try {
- i = i || new Function("return this")()
- } catch (t) {
- "object" == typeof window && (i = window)
- }
- t.exports = i
- }, function(t, e, i) {
- "use strict";
- e.byteLength = function(t) {
- var e = u(t),
- i = e[0],
- n = e[1];
- return 3 * (i + n) / 4 - n
- }, e.toByteArray = function(t) {
- var e, i, n = u(t),
- a = n[0],
- s = n[1],
- l = new o(function(t, e, i) {
- return 3 * (e + i) / 4 - i
- }(0, a, s)),
- h = 0,
- c = s > 0 ? a - 4 : a;
- for (i = 0; i < c; i += 4) e = r[t.charCodeAt(i)] << 18 | r[t.charCodeAt(i + 1)] << 12 | r[t.charCodeAt(i + 2)] << 6 | r[t.charCodeAt(i + 3)], l[h++] = e >> 16 & 255, l[h++] = e >> 8 & 255, l[h++] = 255 & e;
- 2 === s && (e = r[t.charCodeAt(i)] << 2 | r[t.charCodeAt(i + 1)] >> 4, l[h++] = 255 & e);
- 1 === s && (e = r[t.charCodeAt(i)] << 10 | r[t.charCodeAt(i + 1)] << 4 | r[t.charCodeAt(i + 2)] >> 2, l[h++] = e >> 8 & 255, l[h++] = 255 & e);
- return l
- }, e.fromByteArray = function(t) {
- for (var e, i = t.length, r = i % 3, o = [], a = 0, s = i - r; a < s; a += 16383) o.push(h(t, a, a + 16383 > s ? s : a + 16383));
- 1 === r ? (e = t[i - 1], o.push(n[e >> 2] + n[e << 4 & 63] + "==")) : 2 === r && (e = (t[i - 2] << 8) + t[i - 1], o.push(n[e >> 10] + n[e >> 4 & 63] + n[e << 2 & 63] + "="));
- return o.join("")
- };
- for (var n = [], r = [], o = "undefined" != typeof Uint8Array ? Uint8Array : Array, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, l = a.length; s < l; ++s) n[s] = a[s], r[a.charCodeAt(s)] = s;
- function u(t) {
- var e = t.length;
- if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
- var i = t.indexOf("=");
- return -1 === i && (i = e), [i, i === e ? 0 : 4 - i % 4]
- }
- function h(t, e, i) {
- for (var r, o, a = [], s = e; s < i; s += 3) r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (255 & t[s + 2]), a.push(n[(o = r) >> 18 & 63] + n[o >> 12 & 63] + n[o >> 6 & 63] + n[63 & o]);
- return a.join("")
- }
- r["-".charCodeAt(0)] = 62, r["_".charCodeAt(0)] = 63
- }, function(t, e) {
- e.read = function(t, e, i, n, r) {
- var o, a, s = 8 * r - n - 1,
- l = (1 << s) - 1,
- u = l >> 1,
- h = -7,
- c = i ? r - 1 : 0,
- d = i ? -1 : 1,
- p = t[e + c];
- for (c += d, o = p & (1 << -h) - 1, p >>= -h, h += s; h > 0; o = 256 * o + t[e + c], c += d, h -= 8);
- for (a = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; a = 256 * a + t[e + c], c += d, h -= 8);
- if (0 === o) o = 1 - u;
- else {
- if (o === l) return a ? NaN : 1 / 0 * (p ? -1 : 1);
- a += Math.pow(2, n), o -= u
- }
- return (p ? -1 : 1) * a * Math.pow(2, o - n)
- }, e.write = function(t, e, i, n, r, o) {
- var a, s, l, u = 8 * o - r - 1,
- h = (1 << u) - 1,
- c = h >> 1,
- d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
- p = n ? 0 : o - 1,
- f = n ? 1 : -1,
- m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, a = h) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), (e += a + c >= 1 ? d / l : d * Math.pow(2, 1 - c)) * l >= 2 && (a++, l /= 2), a + c >= h ? (s = 0, a = h) : a + c >= 1 ? (s = (e * l - 1) * Math.pow(2, r), a += c) : (s = e * Math.pow(2, c - 1) * Math.pow(2, r), a = 0)); r >= 8; t[i + p] = 255 & s, p += f, s /= 256, r -= 8);
- for (a = a << r | s, u += r; u > 0; t[i + p] = 255 & a, p += f, a /= 256, u -= 8);
- t[i + p - f] |= 128 * m
- }
- }, function(t, e) {
- var i = {}.toString;
- t.exports = Array.isArray || function(t) {
- return "[object Array]" == i.call(t)
- }
- }, function(t, e, i) {
- (function(e) {
- var n = i(7),
- r = i(16),
- o = i(3),
- a = i(2),
- s = i(1),
- l = new a("/js/loaders/ModelTextureLoader.js");
- t.exports.load = function(t) {
- function i(t) {
- t || (c++, h.notify(c, a), c === a && h.resolve())
- }
- if (!t.chunks[0] || !t.chunks[0].meshUrl) return e.when();
- var a = n.countUnique(t.chunks.map((function(t) {
- return t.textureName
- }))),
- u = "high";
- o.isMobile() && "high" === u && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."), u = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."), u = "low"));
- var h = e.Deferred(),
- c = 0,
- d = G.url.model + "/texture_" + u + "/";
- return t.chunks.forEach((function(t) {
- if (!t.material.map && t.textureName) {
- var e = d + t.textureName;
- t.setTextureMap(r.load(e, i.bind(this, r.isLoaded(e))))
- }
- })), h.promise()
- }
- })
- .call(this, i(6))
- }, function(t, e, i) {
- (function(e) {
- (function(n, r) {
- i(1), i(46);
- var o = i(11),
- a = (i(7), i(9)),
- s = i(2),
- l = i(0),
- u = new s(r);
- function h(t) {
- this.model = t, this.modelDataPath = G.url.model + "/vision.modeldata"
- }
- h.prototype.load = function() {
- return this.modelDataPath ? (u.info("Using vision.modeldata"), this.loadVisionModelData()) : (u.warn("No sweep file found"), e.when([]))
- }, h.prototype.loadVisionModelData = function() {
- var t = this;
- return o.get(this.modelDataPath, {
- responseType: "json",
- fetchNum: 1,
- prefetchFrom: "locations"
- })
- .then(function(e) {
- var i = e.points.map((function(t) {
- var e = t.color;
- return e ? (e.brightness || (e.brightness = 0), e.contrast || (e.contrast = 0), null !== e.gamma && void 0 !== e.gamma || (e.gamma = 1), e.hue || (e.hue = 0), e.saturation || (e.saturation = 0), e.vibrance || (e.vibrance = 0), e.balance || (e.balance = new l.Vector3(0, 0, 0))) : e = {
- brightness: 0,
- contrast: 0,
- gamma: 1,
- hue: 0,
- saturation: 0,
- vibrance: 0,
- balance: new l.Vector3(0, 0, 0)
- }, {
- enable: t.enable,
- locationid: t.locationid,
- position: {
- x: t.viewpoint.x,
- y: t.viewpoint.y,
- z: t.viewpoint.z
- },
- quaternion: {
- x: t.rotation.x,
- y: t.rotation.y,
- z: t.rotation.z,
- w: t.rotation.w
- },
- puck: {
- x: t.spot.x,
- y: t.spot.y,
- z: t.spot.z
- },
- u: t.u,
- v: t.v,
- floor: t.flooridx,
- neighbours: t.vps,
- alignmentType: t.type,
- angle_enable: t.angle_enable,
- angle_x: t.angle_x,
- angle_y: t.angle_y,
- angle_z: t.angle_z,
- launch: t.launch,
- color: e,
- roomid: t.roomidx
- }
- }))
- .map((function(e) {
- if (t.model.straight_enable) {
- var i = new l.Euler;
- i.setFromQuaternion(new l.Quaternion(e.quaternion.x, e.quaternion.y, e.quaternion.z, e.quaternion.w), "ZYX", !1), i._x = 0, i._y = 0;
- var n = new l.Quaternion;
- n.setFromEuler(i, !1), e.quaternion.x = n.x, e.quaternion.y = n.y, e.quaternion.z = n.z, e.quaternion.w = n.w
- }
- return e.position = a.convertVisionVector(e.position), e.quaternion = a.convertVisionQuaternion(e.quaternion), e.quaternionAutoScene = a.convertVisionQuaternionAutoScene(e.quaternion), e.puck = a.convertVisionVector(e.puck), e
- }));
- return i.forEach((function(t) {
- t.neighbours = t.neighbours.map((function(t) {
- return i[t].locationid
- }))
- })), !G.conf.jfedit && G.conf.isNewEditVersion || (i = i.filter((function(t) {
- return t.enable
- }))), i
- }.bind(this))
- }, t.exports = h
- })
- .call(this, i(47)
- .Buffer, "/js/loaders/SweepDataLoader.js"),
- function(n, r) {
- i(1), i(46);
- var o = i(11),
- a = (i(7), i(9)),
- s = i(2),
- l = i(0),
- u = new s(r);
- function h(t) {
- this.model = t, this.modelDataPath = G.url.model + "/vision.modeldata"
- }
- h.prototype.load = function() {
- return this.modelDataPath ? (u.info("Using vision.modeldata"), this.loadVisionModelData()) : (u.warn("No sweep file found"), e.when([]))
- }, h.prototype.loadVisionModelData = function() {
- var t = this;
- return o.get(this.modelDataPath, {
- responseType: "json",
- fetchNum: 1,
- prefetchFrom: "locations"
- })
- .then(function(e) {
- var i = e.points.map((function(t) {
- var e = t.color;
- return e ? (e.brightness || (e.brightness = 0), e.contrast || (e.contrast = 0), null !== e.gamma && void 0 !== e.gamma || (e.gamma = 1), e.hue || (e.hue = 0), e.saturation || (e.saturation = 0), e.vibrance || (e.vibrance = 0), e.balance || (e.balance = new l.Vector3(0, 0, 0))) : e = {
- brightness: 0,
- contrast: 0,
- gamma: 1,
- hue: 0,
- saturation: 0,
- vibrance: 0,
- balance: new l.Vector3(0, 0, 0)
- }, {
- enable: t.enable,
- locationid: t.locationid,
- position: {
- x: t.viewpoint.x,
- y: t.viewpoint.y,
- z: t.viewpoint.z
- },
- quaternion: {
- x: t.rotation.x,
- y: t.rotation.y,
- z: t.rotation.z,
- w: t.rotation.w
- },
- puck: {
- x: t.spot.x,
- y: t.spot.y,
- z: t.spot.z
- },
- u: t.u,
- v: t.v,
- floor: t.flooridx,
- neighbours: t.vps,
- alignmentType: t.type,
- angle_enable: t.angle_enable,
- angle_x: t.angle_x,
- angle_y: t.angle_y,
- angle_z: t.angle_z,
- launch: t.launch,
- color: e,
- roomid: t.roomidx
- }
- }))
- .map((function(e) {
- if (t.model.straight_enable) {
- var i = new l.Euler;
- i.setFromQuaternion(new l.Quaternion(e.quaternion.x, e.quaternion.y, e.quaternion.z, e.quaternion.w), "ZYX", !1), i._x = 0, i._y = 0;
- var n = new l.Quaternion;
- n.setFromEuler(i, !1), e.quaternion.x = n.x, e.quaternion.y = n.y, e.quaternion.z = n.z, e.quaternion.w = n.w
- }
- return e.position = a.convertVisionVector(e.position), e.quaternion = a.convertVisionQuaternion(e.quaternion), e.quaternionAutoScene = a.convertVisionQuaternionAutoScene(e.quaternion), e.puck = a.convertVisionVector(e.puck), e
- }));
- return i.forEach((function(t) {
- t.neighbours = t.neighbours.map((function(t) {
- return i[t].locationid
- }))
- })), !G.conf.jfedit && G.conf.isNewEditVersion || (i = i.filter((function(t) {
- return t.enable
- }))), i
- }.bind(this))
- }, t.exports = h
- }.call(this, i(47)
- .Buffer, "/js/loaders/SweepDataLoader.js")
- })
- .call(this, i(6))
- }, function(t, e, i) {
- (function(e) {
- function n() {
- u.call(this)
- }
- var r = i(1),
- o = i(2),
- a = i(5),
- s = i(57),
- l = (i(9), i(7)),
- u = i(33),
- h = new o(e);
- l.inherit(n, u), n.prototype.getbg = function() {
- for (var t = 0; t < this.list.length; t++)
- if (this.list[t].init_point) return this.list[t];
- return null
- }, n.prototype.filterByModesAndReel = function(t, e) {
- for (var i, n = t[a.DOLLHOUSE], r = t[a.FLOORPLAN], o = [], s = 0; s < e.length; s++) i = this.index[e[s].sceneid], 0 == s && (i.isHero = !0), i && o.push(i);
- (o = o.filter((function(t) {
- var e;
- if (t._camera && void 0 !== t._camera._type) {
- try {
- e = a.convertWorkshopModeInt(t._camera._type)
- } catch (t) {
- return void h.debug(t.message)
- }
- return e === a.PANORAMA || e === a.FLOORPLAN && r || e === a.DOLLHOUSE && n
- }
- })))
- .length !== this.list.length && (h.info("Disallowed " + (this.list.length - o.length) + " highlight images"), this.list = o, this.reIndex()), this.list = o, this.reIndex()
- }, n.prototype.getHeroLocations = function(t) {
- var e = [],
- i = !1;
- if (0 === this.list.length) return [];
- for (var o = 0; o < this.list.length; ++o) {
- var l = this.list[o],
- u = l.shortcuturl,
- h = l.name;
- if (l.script = l.script ? l.script : 0, l._camera && void 0 !== l._camera._rotation) {
- if (!r.show360Views.enabled && l._camera._locationid) {
- var c = t.get(l._camera._locationid);
- if (c && !c.isAligned()) continue
- }
- if (a.convertWorkshopModeInt(l._camera._type) === a.MESH) continue;
- var d = new s({
- cameraMode: "panorama",
- position: l._camera._viewpoint,
- quaternion: l._camera._rotation,
- panoId: l._camera._locationid,
- orthoZoom: l._camera._zoom,
- floorVisibility: void 0 !== l._camera.floor_visibility ? l._camera.floor_visibility.slice(0) : [],
- thumbUrl: u,
- name: n.filterImageName(h),
- isHero: l.init_point,
- script: l.script,
- cameraType: l._camera._type
- });
- e.push(d), i = i || l.init_point
- }
- }
- return e.length > 0 && !i && (e[0].isHero = !0), e
- }, n.prototype.getIndex = function(t) {
- return t.sceneid
- }, n.filterImageName = function(t) {
- return "" === t || t.match(/^[0-9.]+_[0-9.]+$/) ? null : t
- }, t.exports = n
- })
- .call(this, "/js/model/ImageCollection.js")
- }, function(t, e, i) {
- (function(e) {
- function n() {
- s.call(this)
- }
- var r = i(179),
- o = (i(1), i(2)),
- a = (i(8), i(15), i(7)),
- s = i(33),
- l = i(72);
- new o(e), a.inherit(n, s), n.prototype.getIndex = function(t) {
- return t.roomId
- }, n.prototype.calcRoomBoundaries = function() {
- this.forEach((function(t) {
- t.calcBoundaries()
- }))
- }, n.prototype.createFromChunks = function(t) {
- var e = {
- floorId: -1,
- roomId: -1
- },
- i = {};
- t.forEach(function(t) {
- l.parseIdsFromChunkName(t.name, e);
- var o = i[e.roomId];
- if (!o) {
- var a = n.generateRoomId(e.floorId, e.roomId);
- o = new r(e.floorId, a), this.add(o), i[e.roomId] = o
- }
- o.addChunk(t)
- }.bind(this)), this.calcRoomBoundaries()
- }, n.generateRoomId = function(t, e) {
- return t + "_" + e
- }, t.exports = n
- })
- .call(this, "/js/model/RoomCollection.js")
- }, function(t, e, i) {
- function n(t, e) {
- this.chunks = [], this.floorId = t, this.roomId = e, this.position = new r.Vector3
- }
- var r = i(0);
- n.prototype.addChunk = function(t) {
- this.chunks.push(t)
- }, n.prototype.calcBoundaries = function() {
- for (var t = new r.Vector3, e = new r.Vector3(0, 0, 0), i = new r.Vector3(0, 0, 0), n = new r.Vector3(0, 0, 0), o = 0, a = 0; a < this.chunks.length; a++) {
- var s = this.chunks[a].geometry.attributes.position;
- if (s)
- for (var l = 0; l < s.array.length; l += 3) t.set(s.array[l], s.array[l + 1], s.array[l + 2]), e.add(t), 0 === l ? (i.copy(t), n.copy(t)) : (i.max(t), n.min(t)), o++
- }
- o > 0 ? (e.multiplyScalar(1 / o), this.average = e) : this.average = null, this.boundsMax = i, this.boundsMin = n, this.center = new r.Vector3, this.center.copy(i)
- .sub(n)
- .multiplyScalar(.5)
- .add(n)
- }, t.exports = n
- }, function(t, e, i) {
- var n;
- ! function(r, o) {
- "use strict";
- var a = "model",
- s = "name",
- l = "type",
- u = "vendor",
- h = "version",
- c = "mobile",
- d = "tablet",
- p = "smarttv",
- f = function(t) {
- for (var e = {}, i = 0; i < t.length; i++) e[t[i].toUpperCase()] = t[i];
- return e
- },
- m = function(t, e) {
- return "string" == typeof t && -1 !== g(e)
- .indexOf(g(t))
- },
- g = function(t) {
- return t.toLowerCase()
- },
- v = function(t, e) {
- if ("string" == typeof t) return t = t.replace(/^\s\s*/, ""), void 0 === e ? t : t.substring(0, 350)
- },
- y = function(t, e) {
- for (var i, n, r, o, a, s, l = 0; l < e.length && !a;) {
- var u = e[l],
- h = e[l + 1];
- for (i = n = 0; i < u.length && !a && u[i];)
- if (a = u[i++].exec(t))
- for (r = 0; r < h.length; r++) s = a[++n], "object" == typeof(o = h[r]) && o.length > 0 ? 2 === o.length ? "function" == typeof o[1] ? this[o[0]] = o[1].call(this, s) : this[o[0]] = o[1] : 3 === o.length ? "function" != typeof o[1] || o[1].exec && o[1].test ? this[o[0]] = s ? s.replace(o[1], o[2]) : void 0 : this[o[0]] = s ? o[1].call(this, s, o[2]) : void 0 : 4 === o.length && (this[o[0]] = s ? o[3].call(this, s.replace(o[1], o[2])) : void 0) : this[o] = s || void 0;
- l += 2
- }
- },
- b = function(t, e) {
- for (var i in e)
- if ("object" == typeof e[i] && e[i].length > 0) {
- for (var n = 0; n < e[i].length; n++)
- if (m(e[i][n], t)) return "?" === i ? void 0 : i
- } else if (m(e[i], t)) return "?" === i ? void 0 : i;
- return t
- },
- w = {
- ME: "4.90",
- "NT 3.11": "NT3.51",
- "NT 4.0": "NT4.0",
- 2e3: "NT 5.0",
- XP: ["NT 5.1", "NT 5.2"],
- Vista: "NT 6.0",
- 7: "NT 6.1",
- 8: "NT 6.2",
- 8.1: "NT 6.3",
- 10: ["NT 6.4", "NT 10.0"],
- RT: "ARM"
- },
- x = {
- browser: [
- [/\b(?:crmo|crios)\/([\w\.]+)/i],
- [h, [s, "Chrome"]],
- [/edg(?:e|ios|a)?\/([\w\.]+)/i],
- [h, [s, "Edge"]],
- [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],
- [s, h],
- [/opios[\/ ]+([\w\.]+)/i],
- [h, [s, "Opera Mini"]],
- [/\bopr\/([\w\.]+)/i],
- [h, [s, "Opera"]],
- [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, /(ba?idubrowser)[\/ ]?([\w\.]+)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i],
- [s, h],
- [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],
- [h, [s, "UCBrowser"]],
- [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i],
- [h, [s, "WeChat(Win) Desktop"]],
- [/micromessenger\/([\w\.]+)/i],
- [h, [s, "WeChat"]],
- [/konqueror\/([\w\.]+)/i],
- [h, [s, "Konqueror"]],
- [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],
- [h, [s, "IE"]],
- [/ya(?:search)?browser\/([\w\.]+)/i],
- [h, [s, "Yandex"]],
- [/(avast|avg)\/([\w\.]+)/i],
- [
- [s, /(.+)/, "$1 Secure Browser"], h
- ],
- [/\bfocus\/([\w\.]+)/i],
- [h, [s, "Firefox Focus"]],
- [/\bopt\/([\w\.]+)/i],
- [h, [s, "Opera Touch"]],
- [/coc_coc\w+\/([\w\.]+)/i],
- [h, [s, "Coc Coc"]],
- [/dolfin\/([\w\.]+)/i],
- [h, [s, "Dolphin"]],
- [/coast\/([\w\.]+)/i],
- [h, [s, "Opera Coast"]],
- [/miuibrowser\/([\w\.]+)/i],
- [h, [s, "MIUI Browser"]],
- [/fxios\/([-\w\.]+)/i],
- [h, [s, "Firefox"]],
- [/\bqihu|(qi?ho?o?|360)browser/i],
- [
- [s, "360 Browser"]
- ],
- [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],
- [
- [s, /(.+)/, "$1 Browser"], h
- ],
- [/(comodo_dragon)\/([\w\.]+)/i],
- [
- [s, /_/g, " "], h
- ],
- [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],
- [s, h],
- [/(metasr)[\/ ]?([\w\.]+)/i, /(lbbrowser)/i, /\[(linkedin)app\]/i],
- [s],
- [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],
- [
- [s, "Facebook"], h
- ],
- [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/ ]([-\w\.]+)/i],
- [s, h],
- [/\bgsa\/([\w\.]+) .*safari\//i],
- [h, [s, "GSA"]],
- [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],
- [h, [s, "TikTok"]],
- [/headlesschrome(?:\/([\w\.]+)| )/i],
- [h, [s, "Chrome Headless"]],
- [/ wv\).+(chrome)\/([\w\.]+)/i],
- [
- [s, "Chrome WebView"], h
- ],
- [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],
- [h, [s, "Android Browser"]],
- [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],
- [s, h],
- [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],
- [h, [s, "Mobile Safari"]],
- [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],
- [h, s],
- [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],
- [s, [h, b, {
- "1.0": "/8",
- 1.2: "/1",
- 1.3: "/3",
- "2.0": "/412",
- "2.0.2": "/416",
- "2.0.3": "/417",
- "2.0.4": "/419",
- "?": "/"
- }]],
- [/(webkit|khtml)\/([\w\.]+)/i],
- [s, h],
- [/(navigator|netscape\d?)\/([-\w\.]+)/i],
- [
- [s, "Netscape"], h
- ],
- [/mobile vr; rv:([\w\.]+)\).+firefox/i],
- [h, [s, "Firefox Reality"]],
- [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i, /panasonic;(viera)/i],
- [s, h],
- [/(cobalt)\/([\w\.]+)/i],
- [s, [h, /master.|lts./, ""]]
- ],
- cpu: [
- [/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],
- [
- ["architecture", "amd64"]
- ],
- [/(ia32(?=;))/i],
- [
- ["architecture", g]
- ],
- [/((?:i[346]|x)86)[;\)]/i],
- [
- ["architecture", "ia32"]
- ],
- [/\b(aarch64|arm(v?8e?l?|_?64))\b/i],
- [
- ["architecture", "arm64"]
- ],
- [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],
- [
- ["architecture", "armhf"]
- ],
- [/windows (ce|mobile); ppc;/i],
- [
- ["architecture", "arm"]
- ],
- [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],
- [
- ["architecture", /ower/, "", g]
- ],
- [/(sun4\w)[;\)]/i],
- [
- ["architecture", "sparc"]
- ],
- [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],
- [
- ["architecture", g]
- ]
- ],
- device: [
- [/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],
- [a, [u, "Samsung"],
- [l, d]
- ],
- [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i],
- [a, [u, "Samsung"],
- [l, c]
- ],
- [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],
- [a, [u, "Apple"],
- [l, c]
- ],
- [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i],
- [a, [u, "Apple"],
- [l, d]
- ],
- [/(macintosh);/i],
- [a, [u, "Apple"]],
- [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],
- [a, [u, "Sharp"],
- [l, c]
- ],
- [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],
- [a, [u, "Huawei"],
- [l, d]
- ],
- [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],
- [a, [u, "Huawei"],
- [l, c]
- ],
- [/\b(poco[\w ]+)(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],
- [
- [a, /_/g, " "],
- [u, "Xiaomi"],
- [l, c]
- ],
- [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],
- [
- [a, /_/g, " "],
- [u, "Xiaomi"],
- [l, d]
- ],
- [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],
- [a, [u, "OPPO"],
- [l, c]
- ],
- [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i],
- [a, [u, "Vivo"],
- [l, c]
- ],
- [/\b(rmx[12]\d{3})(?: bui|;|\))/i],
- [a, [u, "Realme"],
- [l, c]
- ],
- [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],
- [a, [u, "Motorola"],
- [l, c]
- ],
- [/\b(mz60\d|xoom[2 ]{0,2}) build\//i],
- [a, [u, "Motorola"],
- [l, d]
- ],
- [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],
- [a, [u, "LG"],
- [l, d]
- ],
- [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i],
- [a, [u, "LG"],
- [l, c]
- ],
- [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],
- [a, [u, "Lenovo"],
- [l, d]
- ],
- [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i],
- [
- [a, /_/g, " "],
- [u, "Nokia"],
- [l, c]
- ],
- [/(pixel c)\b/i],
- [a, [u, "Google"],
- [l, d]
- ],
- [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],
- [a, [u, "Google"],
- [l, c]
- ],
- [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],
- [a, [u, "Sony"],
- [l, c]
- ],
- [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i],
- [
- [a, "Xperia Tablet"],
- [u, "Sony"],
- [l, d]
- ],
- [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],
- [a, [u, "OnePlus"],
- [l, c]
- ],
- [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i],
- [a, [u, "Amazon"],
- [l, d]
- ],
- [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],
- [
- [a, /(.+)/g, "Fire Phone $1"],
- [u, "Amazon"],
- [l, c]
- ],
- [/(playbook);[-\w\),; ]+(rim)/i],
- [a, u, [l, d]],
- [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i],
- [a, [u, "BlackBerry"],
- [l, c]
- ],
- [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],
- [a, [u, "ASUS"],
- [l, d]
- ],
- [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],
- [a, [u, "ASUS"],
- [l, c]
- ],
- [/(nexus 9)/i],
- [a, [u, "HTC"],
- [l, d]
- ],
- [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],
- [u, [a, /_/g, " "],
- [l, c]
- ],
- [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],
- [a, [u, "Acer"],
- [l, d]
- ],
- [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i],
- [a, [u, "Meizu"],
- [l, c]
- ],
- [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i],
- [u, a, [l, c]],
- [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i],
- [u, a, [l, d]],
- [/(surface duo)/i],
- [a, [u, "Microsoft"],
- [l, d]
- ],
- [/droid [\d\.]+; (fp\du?)(?: b|\))/i],
- [a, [u, "Fairphone"],
- [l, c]
- ],
- [/(u304aa)/i],
- [a, [u, "AT&T"],
- [l, c]
- ],
- [/\bsie-(\w*)/i],
- [a, [u, "Siemens"],
- [l, c]
- ],
- [/\b(rct\w+) b/i],
- [a, [u, "RCA"],
- [l, d]
- ],
- [/\b(venue[\d ]{2,7}) b/i],
- [a, [u, "Dell"],
- [l, d]
- ],
- [/\b(q(?:mv|ta)\w+) b/i],
- [a, [u, "Verizon"],
- [l, d]
- ],
- [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],
- [a, [u, "Barnes & Noble"],
- [l, d]
- ],
- [/\b(tm\d{3}\w+) b/i],
- [a, [u, "NuVision"],
- [l, d]
- ],
- [/\b(k88) b/i],
- [a, [u, "ZTE"],
- [l, d]
- ],
- [/\b(nx\d{3}j) b/i],
- [a, [u, "ZTE"],
- [l, c]
- ],
- [/\b(gen\d{3}) b.+49h/i],
- [a, [u, "Swiss"],
- [l, c]
- ],
- [/\b(zur\d{3}) b/i],
- [a, [u, "Swiss"],
- [l, d]
- ],
- [/\b((zeki)?tb.*\b) b/i],
- [a, [u, "Zeki"],
- [l, d]
- ],
- [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i],
- [
- [u, "Dragon Touch"], a, [l, d]
- ],
- [/\b(ns-?\w{0,9}) b/i],
- [a, [u, "Insignia"],
- [l, d]
- ],
- [/\b((nxa|next)-?\w{0,9}) b/i],
- [a, [u, "NextBook"],
- [l, d]
- ],
- [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],
- [
- [u, "Voice"], a, [l, c]
- ],
- [/\b(lvtel\-)?(v1[12]) b/i],
- [
- [u, "LvTel"], a, [l, c]
- ],
- [/\b(ph-1) /i],
- [a, [u, "Essential"],
- [l, c]
- ],
- [/\b(v(100md|700na|7011|917g).*\b) b/i],
- [a, [u, "Envizen"],
- [l, d]
- ],
- [/\b(trio[-\w\. ]+) b/i],
- [a, [u, "MachSpeed"],
- [l, d]
- ],
- [/\btu_(1491) b/i],
- [a, [u, "Rotor"],
- [l, d]
- ],
- [/(shield[\w ]+) b/i],
- [a, [u, "Nvidia"],
- [l, d]
- ],
- [/(sprint) (\w+)/i],
- [u, a, [l, c]],
- [/(kin\.[onetw]{3})/i],
- [
- [a, /\./g, " "],
- [u, "Microsoft"],
- [l, c]
- ],
- [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],
- [a, [u, "Zebra"],
- [l, d]
- ],
- [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],
- [a, [u, "Zebra"],
- [l, c]
- ],
- [/smart-tv.+(samsung)/i],
- [u, [l, p]],
- [/hbbtv.+maple;(\d+)/i],
- [
- [a, /^/, "SmartTV"],
- [u, "Samsung"],
- [l, p]
- ],
- [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],
- [
- [u, "LG"],
- [l, p]
- ],
- [/(apple) ?tv/i],
- [u, [a, "Apple TV"],
- [l, p]
- ],
- [/crkey/i],
- [
- [a, "Chromecast"],
- [u, "Google"],
- [l, p]
- ],
- [/droid.+aft(\w)( bui|\))/i],
- [a, [u, "Amazon"],
- [l, p]
- ],
- [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i],
- [a, [u, "Sharp"],
- [l, p]
- ],
- [/(bravia[\w ]+)( bui|\))/i],
- [a, [u, "Sony"],
- [l, p]
- ],
- [/(mitv-\w{5}) bui/i],
- [a, [u, "Xiaomi"],
- [l, p]
- ],
- [/Hbbtv.*(technisat) (.*);/i],
- [u, a, [l, p]],
- [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],
- [
- [u, v],
- [a, v],
- [l, p]
- ],
- [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],
- [
- [l, p]
- ],
- [/(ouya)/i, /(nintendo) ([wids3utch]+)/i],
- [u, a, [l, "console"]],
- [/droid.+; (shield) bui/i],
- [a, [u, "Nvidia"],
- [l, "console"]
- ],
- [/(playstation [345portablevi]+)/i],
- [a, [u, "Sony"],
- [l, "console"]
- ],
- [/\b(xbox(?: one)?(?!; xbox))[\); ]/i],
- [a, [u, "Microsoft"],
- [l, "console"]
- ],
- [/((pebble))app/i],
- [u, a, [l, "wearable"]],
- [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],
- [a, [u, "Apple"],
- [l, "wearable"]
- ],
- [/droid.+; (glass) \d/i],
- [a, [u, "Google"],
- [l, "wearable"]
- ],
- [/droid.+; (wt63?0{2,3})\)/i],
- [a, [u, "Zebra"],
- [l, "wearable"]
- ],
- [/(quest( 2| pro)?)/i],
- [a, [u, "Facebook"],
- [l, "wearable"]
- ],
- [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],
- [u, [l, "embedded"]],
- [/(aeobc)\b/i],
- [a, [u, "Amazon"],
- [l, "embedded"]
- ],
- [/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],
- [a, [l, c]],
- [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],
- [a, [l, d]],
- [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],
- [
- [l, d]
- ],
- [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],
- [
- [l, c]
- ],
- [/(android[-\w\. ]{0,9});.+buil/i],
- [a, [u, "Generic"]]
- ],
- engine: [
- [/windows.+ edge\/([\w\.]+)/i],
- [h, [s, "EdgeHTML"]],
- [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],
- [h, [s, "Blink"]],
- [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i],
- [s, h],
- [/rv\:([\w\.]{1,9})\b.+(gecko)/i],
- [h, s]
- ],
- os: [
- [/microsoft (windows) (vista|xp)/i],
- [s, h],
- [/(windows) nt 6\.2; (arm)/i, /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],
- [s, [h, b, w]],
- [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],
- [
- [s, "Windows"],
- [h, b, w]
- ],
- [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i],
- [
- [h, /_/g, "."],
- [s, "iOS"]
- ],
- [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i],
- [
- [s, "Mac OS"],
- [h, /_/g, "."]
- ],
- [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],
- [h, s],
- [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i],
- [s, h],
- [/\(bb(10);/i],
- [h, [s, "BlackBerry"]],
- [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],
- [h, [s, "Symbian"]],
- [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],
- [h, [s, "Firefox OS"]],
- [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],
- [h, [s, "webOS"]],
- [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],
- [h, [s, "watchOS"]],
- [/crkey\/([\d\.]+)/i],
- [h, [s, "Chromecast"]],
- [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],
- [
- [s, "Chromium OS"], h
- ],
- [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i],
- [s, h],
- [/(sunos) ?([\w\.\d]*)/i],
- [
- [s, "Solaris"], h
- ],
- [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i],
- [s, h]
- ]
- },
- M = function(t, e) {
- if ("object" == typeof t && (e = t, t = void 0), !(this instanceof M)) return new M(t, e)
- .getResult();
- var i = void 0 !== r && r.navigator ? r.navigator : void 0,
- n = t || (i && i.userAgent ? i.userAgent : ""),
- o = i && i.userAgentData ? i.userAgentData : void 0,
- u = e ? function(t, e) {
- var i = {};
- for (var n in t) e[n] && e[n].length % 2 == 0 ? i[n] = e[n].concat(t[n]) : i[n] = t[n];
- return i
- }(x, e) : x,
- p = i && i.userAgent == n;
- return this.getBrowser = function() {
- var t, e = {};
- return e[s] = void 0, e[h] = void 0, y.call(e, n, u.browser), e.major = "string" == typeof(t = e[h]) ? t.replace(/[^\d\.]/g, "")
- .split(".")[0] : void 0, p && i && i.brave && "function" == typeof i.brave.isBrave && (e[s] = "Brave"), e
- }, this.getCPU = function() {
- var t = {
- architecture: void 0
- };
- return y.call(t, n, u.cpu), t
- }, this.getDevice = function() {
- var t = {
- vendor: void 0,
- model: void 0,
- type: void 0
- };
- return y.call(t, n, u.device), p && !t[l] && o && o.mobile && (t[l] = c), p && "Macintosh" == t[a] && i && void 0 !== i.standalone && i.maxTouchPoints && i.maxTouchPoints > 2 && (t[a] = "iPad", t[l] = d), t
- }, this.getEngine = function() {
- var t = {
- name: void 0,
- version: void 0
- };
- return y.call(t, n, u.engine), t
- }, this.getOS = function() {
- var t = {
- name: void 0,
- version: void 0
- };
- return y.call(t, n, u.os), p && !t[s] && o && "Unknown" != o.platform && (t[s] = o.platform.replace(/chrome os/i, "Chromium OS")
- .replace(/macos/i, "Mac OS")), t
- }, this.getResult = function() {
- return {
- ua: this.getUA(),
- browser: this.getBrowser(),
- engine: this.getEngine(),
- os: this.getOS(),
- device: this.getDevice(),
- cpu: this.getCPU()
- }
- }, this.getUA = function() {
- return n
- }, this.setUA = function(t) {
- return n = "string" == typeof t && t.length > 350 ? v(t, 350) : t, this
- }, this.setUA(n), this
- };
- M.VERSION = "0.7.35", M.BROWSER = f([s, h, "major"]), M.CPU = f(["architecture"]), M.DEVICE = f([a, u, l, "console", c, p, d, "wearable", "embedded"]), M.ENGINE = M.OS = f([s, h]), void 0 !== e ? (void 0 !== t && t.exports && (e = t.exports = M), e.UAParser = M) : i(181) ? void 0 === (n = function() {
- return M
- }.call(e, i, e, t)) || (t.exports = n) : void 0 !== r && (r.UAParser = M);
- var T = void 0 !== r && (r.jQuery || r.Zepto);
- if (T && !T.ua) {
- var S = new M;
- T.ua = S.getResult(), T.ua.get = function() {
- return S.getUA()
- }, T.ua.set = function(t) {
- S.setUA(t);
- var e = S.getResult();
- for (var i in e) T.ua[i] = e[i]
- }
- }
- }("object" == typeof window ? window : this)
- }, function(t, e) {
- (function(e) {
- t.exports = e
- })
- .call(this, {})
- }, function(t, e, i) {
- (function(e) {
- var n = i(0),
- r = i(5),
- o = new(i(2))(e);
- t.exports = {
- serialize: function(t) {
- return encodeURI(JSON.stringify(t))
- },
- deserialize: function(t) {
- try {
- var e = JSON.parse(decodeURI(t));
- return {
- mode: r.fromInt(e._type),
- panoId: e._locationid,
- position: (new n.Vector3)
- .copy(e._viewpoint),
- quaternion: (new n.Quaternion)
- .copy(e._rotation),
- zoom: e._zoom,
- floorVisibility: e.floor_visibility
- }
- } catch (e) {
- o.debug("Not able to parse start location as JSON; falling back to old array style parsing");
- try {
- var i = t.split(","),
- a = {
- x: parseFloat(i[2]),
- y: parseFloat(i[3]),
- z: parseFloat(i[4])
- },
- s = {
- x: parseFloat(i[5]),
- y: parseFloat(i[6]),
- z: parseFloat(i[7]),
- w: parseFloat(i[8])
- };
- return {
- mode: r.fromInt(i[0]),
- panoId: i[1],
- position: (new n.Vector3)
- .copy(a),
- quaternion: (new n.Quaternion)
- .copy(s)
- }
- } catch (e) {
- o.warn('Invalid start override, ignoring: "' + t + '"', e.message)
- }
- }
- return null
- }
- }
- })
- .call(this, "/js/controls/serializer.js")
- }, function(t, e, i) {
- (function(e) {
- function n(t, e) {
- this.model = t, this.panos = t.panos, this.player = e, this.imagePanos = this.listImagePanos(), this.retryMinimumTime = 1e4
- }
- var r = (i(0), i(5)),
- o = (i(1), i(19)),
- a = new(i(2))(e);
- n.prototype.start = function() {
- this.loadNextPano(function(t) {
- t ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"), setTimeout(function() {
- this.start()
- }.bind(this), 1e3))
- }.bind(this))
- }, n.prototype.validLoadTarget = function(t) {
- return t && !t.isLoaded("high") && Date.now() - t.failedLoadingAt > this.retryMinimumTime
- }, n.prototype.listImagePanos = function() {
- var t = [],
- e = this;
- return this.model.images.forEach((function(i) {
- if (i._camera && i._camera._locationid) {
- var n = e.model.panos.get(i._camera._locationid);
- n && !n.isLoaded("high") && t.push(n)
- }
- })), t
- }, n.prototype.nextNotLoadedImage = function() {
- for (; this.imagePanos.length > 0;) {
- var t = this.imagePanos[0];
- if (!t.isLoaded("high")) return t;
- this.imagePanos.shift()
- }
- return null
- }, n.prototype.loadNextPano = function(t) {
- var e, i, n = this.model.waitQueue.filter((function(t) {
- return t.object instanceof o
- }));
- n.length > 0 ? (e = n[0].object, a.debug("Overrode pano selection: Flying to an unloaded pano " + e.id)) : this.validLoadTarget(this.player.currentPano) ? (e = this.player.currentPano, a.debug("Overrode pano selection: Currently at an unloaded pano " + e.id)) : this.validLoadTarget(this.player.closestPano) ? (e = this.player.closestPano, a.debug("Overrode pano selection: Hovering over an unloaded pano " + e.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high", e = this.imagePanos[0], a.debug("Overrode pano selection: Highlight image " + e.id)) : this.player.mode === r.PANORAMA && ((e = 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 " + e.id)), e ? (i = i || e.isLoaded("low") ? "high" : "low", a.debug("Preloading " + i + "-res pano " + e.id), e.loadCube(i)
- .done(t)
- .fail((function() {
- a.warn("Failed preloading pano", e.id, ", marking it as failed and forgetting it for a while"), t()
- }))) : t && t(null)
- }, t.exports = n
- })
- .call(this, "/js/preloaders.js")
- }, function(t, e, i) {
- (function(e) {
- function n(t, e, i) {
- t && (t = t.toLowerCase()
- .trim());
- var n = new h.Vector3(0, 1, 0),
- r = Math.PI / 3,
- o = Math.PI / 2;
- switch (t) {
- case "left":
- i.copy(e), i.applyAxisAngle(n, o);
- break;
- case "right":
- i.copy(e), i.applyAxisAngle(n, -o);
- break;
- case "forwardleft":
- i.copy(e), i.applyAxisAngle(n, r);
- break;
- case "forwardright":
- i.copy(e), i.applyAxisAngle(n, -r);
- break;
- case "forward":
- default:
- i.copy(e)
- }
- return i
- }
- function r(t, e) {
- if (t) {
- var i = {
- pano: t,
- lookAtPoint: null,
- duration: null,
- maxDistanceOverride: null,
- skipWarpingCheck: !1
- };
- this.player.flyToPano(i, (function() {
- e && e({
- success: !0,
- message: "Transition complete."
- })
- }))
- } else y.warn("Automation -> clickPanoObject: Unable to find pano."), e && e({
- success: !1,
- error: "Unable to find pano."
- })
- }
- function o(t, e) {
- var i = this.findRankedPano(t, e);
- return i >= 0 ? this.handleToObject[i] : (y.warn("Automation -> findRankedPanoObject: Unable to find nearby pano."), null)
- }
- function a(t, e) {
- var i = this.findRankedMattertag(t, e);
- return i >= 0 ? this.handleToObject[i] : (y.warn("Automation -> findRankedMattertagObject: Unable to find nearby Mattertag."), null)
- }
- function s(t, e) {
- e.copy(m.FORWARD), t.getDirection(e)
- }
- var l, u, h = i(0),
- c = i(2),
- d = i(5),
- p = i(32),
- f = i(1),
- m = i(18),
- g = i(185),
- v = i(9),
- y = new c(e),
- b = null,
- w = (u = new h.Vector3, function(t) {
- t ? (u.copy(t.position), u.add(t.discPosition), v.projectPositionToCanvas(u, this.player.camera, u), this.click(u.x, u.y)) : y.warn("Automation -> clickMattertagObject: Unable to find Mattertag.")
- }),
- x = (l = new h.Vector3, function(t) {
- var e = this.player.getDirection(),
- i = 0,
- n = 0;
- if (this.player.mode === d.PANORAMA) i = f.insideLookLimitUp, n = f.insideLookLimitDown;
- else {
- if (this.player.mode !== d.DOLLHOUSE) return t;
- i = f.dollhouseDefault.maxPolarAngle, n = f.dollhouseDefault.minPolarAngle
- }
- l.copy(e), l.y = 0, l.normalize();
- var r = -h.Math.radToDeg(l.angleTo(e));
- return t > (i -= r) && (t = i), t < (n -= r) && (t = n), t
- });
- g.setReceiver((function(t, e, i) {
- if (e) {
- var n = e.targetFunction,
- r = e.params;
- if (n) {
- var o = b[n];
- if (o) {
- (r = r || {})
- .onDone = function(t) {
- g.respondToMessage(i, t)
- };
- var a = [];
- for (var s in r) r.hasOwnProperty(s) && a.push(r[s]);
- o.apply(b, a)
- }
- }
- }
- }));
- var M = {};
- b = {
- handleToObject: {},
- objectToHandle: {},
- handleCount: 0,
- director: null,
- player: null,
- init: function(t, e) {
- this.director = t, this.player = e;
- var i = M.onInitComplete;
- i ? function(t) {
- t({
- success: !0,
- message: "Init complete."
- })
- }(i) : M.onInitComplete = {
- completed: !0
- }
- },
- findRankedPano: function(t, e) {
- var i = new h.Vector3,
- r = new h.Vector3;
- return function(t, e) {
- s(this.player, r), n(e, r, i);
- var o = this.player.rankedPanoInDirection(t, i);
- if (o) {
- var a = this.objectToHandle[o.id];
- return a || (this.objectToHandle[o.id] = a = this.handleCount++, this.handleToObject[a] = o), a
- }
- return y.warn("Automation -> findRankedPano: Unable to find nearby pano."), -1
- }
- }(),
- findRankedMattertag: function(t, e) {
- var i = new h.Vector3,
- r = new h.Vector3;
- return function(t, e) {
- s(this.player, r), n(e, r, i);
- var o = this.player.rankedMattertagInDirection(t, i);
- if (o) {
- var a = this.objectToHandle[o.i];
- return a || (this.objectToHandle[o.i] = a = this.handleCount++, this.handleToObject[a] = o), a
- }
- return y.warn("Automation -> findRankedMattertag: Unable to find nearby Mattertag."), -1
- }
- }(),
- clickNearestMattertag: function(t) {
- this.clickRankedMattertag(0, t)
- },
- clickRankedMattertag: function(t, e) {
- var i = a.call(this, t, e);
- i && w.call(this, i)
- },
- clickNearestPano: function(t, e) {
- this.clickRankedPano(0, t, e)
- },
- clickRankedPano: function(t, e, i) {
- var n = o.call(this, t, e);
- n ? r.call(this, n, i) : i(null)
- },
- clickPano: function(t, e) {
- var i = this.handleTable[t];
- i ? r.call(this, i, e) : e(null)
- },
- rotate: function() {
- function t(t) {
- return "right" === t ? p.RIGHTARROW : "left" === t ? p.LEFTARROW : "up" === t ? p.I : "down" === t ? p.K : void 0
- }
- var e = (new h.Vector3, new h.Vector3),
- i = new h.Vector3(0, 0, 0),
- n = !1,
- r = new h.Vector3;
- return function(o, a, s) {
- if (!n) {
- if (!a || isNaN(a)) return y.warn("Automation -> rotate: Invalid rotation angle."), void(s && s({
- success: !1,
- error: "Invalid rotation angle."
- }));
- "right" === o || "left" === o ? (i.set(0, 1, 0), "right" === o && (a = -a)) : "up" === o || "down" === o ? (i.set(1, 0, 0), "down" === o && (a = -a), a = x.call(this, a)) : (y.warn("Automation -> rotate: Invalid direction for rotation: " + o), s && s({
- success: !1,
- error: "Invalid direction for rotation."
- })), a = h.Math.degToRad(a), e = this.player.getDirection(), n = !0;
- var l = this.player.controls[this.player.mode];
- l.handleKeyDown(t(o));
- var u = 0;
- (function i() {
- r.copy(m.FORWARD), this.player.getDirection(r);
- var h = r.angleTo(e);
- (u += Math.abs(h)) >= Math.abs(a) ? (n = !1, l.handleKeyUp(t(o)), s && s({
- success: !0,
- message: "Rotation complete."
- })) : (e.copy(r), window.setTimeout(i.bind(this), 4))
- })
- .bind(this)()
- }
- }
- }(),
- click: function(t, e, i) {
- !0 === i && (t = t / 100 * (window.renderWidth || window.innerWidth), e = e / 100 * (window.renderHeight || window.innerHeight)), this.player.handleInputStart(t, e), this.player.updateIntersect(), this.player.handleInputEnd(t, e)
- },
- mouseOver: function(t, e, i) {
- !0 === i && (t = t / 100 * (window.renderWidth || window.innerWidth), e = e / 100 * (window.renderHeight || window.innerHeight)), this.player.handleInputMove(t, e), this.player.updateIntersect()
- }
- }, t.exports = b, window.__showcaseAutomationApi = b
- })
- .call(this, "/js/automation.js")
- }, function(t, e, i) {
- ! function() {
- if ("performance" in window == 0 && (window.performance = {}), Date.now = Date.now || function() {
- return (new Date)
- .getTime()
- }, "now" in window.performance == 0) {
- var t = Date.now();
- performance.timing && performance.timing.navigationStart && (t = performance.timing.navigationStart), window.performance.now = function() {
- return Date.now() - t
- }
- }
- }();
- var n = n || {};
- ! function(t) {
- var e = 0,
- i = 0,
- n = 1,
- r = function(t, e, i, n) {
- return {
- uid: t,
- message: e,
- type: i,
- waitForResponse: n
- }
- },
- o = {},
- a = {},
- s = null;
- window.addEventListener("message", (function(e) {
- var i = e.origin || e.originalEvent.origin;
- t.receiveMessage(i, e.data, e.source)
- }), !1), t.setReceiver = function(t) {
- s = t
- }, t.sendMessage = function(t, n, a, s) {
- var l = e++;
- if (s) {
- var u = {
- targetWindow: t,
- uid: l,
- timestamp: performance.now(),
- onResponse: s
- };
- o[l] = u
- }
- var h = r(l, a, i, !!s);
- t.postMessage(h, n)
- }, t.receiveMessage = function(t, e, r) {
- if (e) {
- if (e.type === i && e.waitForResponse) {
- var l = {
- uid: e.uid,
- timestamp: performance.now(),
- sourceWindow: r
- };
- a[e.uid] = l
- }
- if (e.type === n) {
- var u = e.uid,
- h = o[u];
- o[u] = null, h.onResponse && h.onResponse(e.message)
- }
- }
- s && s(t, e.message, e.uid)
- }, t.respondToMessage = function(t, e) {
- var i = a[t];
- if (i && i.sourceWindow) {
- var o = r(t, e, n, !1);
- i.sourceWindow.postMessage(o, "*"), a[o.uid] = null
- }
- }
- }(n), t.exports = n
- }, function(t, e, i) {
- "use strict";
- (function(e) {
- var n, r, o, a = i(49),
- s = i(0),
- l = i(12),
- u = i(187),
- h = i(29),
- c = i(48),
- d = i(14),
- p = (i(188), i(3)),
- f = i(1),
- m = i(189),
- g = i(4)
- .EventEmitter,
- v = i(22),
- y = i(190),
- b = -1,
- w = 0;
- function x(t, e, i) {
- this.scene = t, this.camera = e, this.renderer = null, this.stats = null, this.effects = i, this.animateCallback = null, this.composer = null, this.qualityManager = null, t.renderWidth = 0, t.renderHeight = 0, this.updateClock = new s.Clock, this.components = [], this.updateListeners = [], this.resizeListeners = [], this.forceUpdateSize = !1, this.started = !1, this.outlinePass = null, this.miniCameraControls = new y(this)
- }
- window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame, x.prototype = Object.create(g.prototype), x.prototype.addComponent = function(t) {
- this.components.push(t), t.update && this.updateListeners.push(t), t.setSize && (this.resizeListeners.push(t), this.forceUpdateSize = !0)
- }, x.prototype.removeComponent = function(t) {
- var e = function(e) {
- return e != t
- };
- this.components = this.components.filter(e), this.updateListeners = this.updateListeners.filter(e), this.resizeListeners = this.resizeListeners.filter(e)
- }, x.prototype.start = function(t) {
- if (this.started) throw new d("Can't start SceneRenderer, already started");
- this.createContext(t), this.boluoVrInit(), this.initComposer(), this.started = !0, this.miniCameraControls.init(), (M = M.bind(this))()
- }, x.prototype.createContext = function(t) {
- this.renderer = new s.WebGLRenderer({
- preserveDrawingBuffer: !0
- });
- var e = (window.renderWidth || window.innerWidth),
- i = (window.renderHeight || window.innerHeight);
- this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1), this.renderer.setSize(e, i), this.emit(c.ContextCreated), this.renderer.domElement.id = "house-player", t.appendChild(this.renderer.domElement)
- }, x.prototype.getTextureTypeFromTarget = function(t, e) {
- switch (e) {
- case t.TEXTURE_CUBE_MAP_POSITIVE_X:
- case t.TEXTURE_CUBE_MAP_NEGATIVE_X:
- case t.TEXTURE_CUBE_MAP_POSITIVE_Y:
- case t.TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case t.TEXTURE_CUBE_MAP_POSITIVE_Z:
- case t.TEXTURE_CUBE_MAP_NEGATIVE_Z:
- return u.TextureCube;
- case t.TEXTURE_2D:
- return u.Texture2D;
- default:
- return null
- }
- }, x.prototype.overrideTextures = function() {
- var t = this.renderer.context,
- e = 0,
- i = t.createTexture;
- t.createTexture = function() {
- var n = i.call(t);
- return n.id = e++, this.textures[n.id] = n, n
- }.bind(this);
- var n = t.texImage2D;
- t.texImage2D = function(e, i, r, o, a, s, l, h, c) {
- var d, p = this.getTextureTypeFromTarget(t, e);
- d = p === u.TextureCube ? t.getParameter(t.TEXTURE_BINDING_CUBE_MAP) : t.getParameter(t.TEXTURE_BINDING_2D), void 0 !== l ? n.call(t, e, i, r, o, a, s, l, h, c) : (l = o, h = a, o = (c = s)
- .naturalWidth, a = c.naturalHeight, n.call(t, e, i, r, l, h, c));
- var f = this.textures[d.id];
- f.width = p === u.TextureCube ? 6 * o : o, f.height = a
- }.bind(this);
- var r = t.deleteTexture;
- t.deleteTexture = function(e) {
- delete this.textures[e.id], r.call(t, e)
- }.bind(this)
- }, x.prototype.initComposer = function() {
- var t = (window.renderWidth || window.innerWidth) * this.renderer.getPixelRatio(),
- e = (window.renderHeight || window.innerHeight) * this.renderer.getPixelRatio();
- this.composer = new s.EffectComposer(this.renderer);
- var i = new s.RenderPass(this.scene, this.camera);
- this.composer.addPass(i), this.outlinePass = new s.OutlinePass(new s.Vector2(t, e), this.scene, this.camera), this.outlinePass.visibleEdgeColor.set(59381), this.outlinePass.hiddenEdgeColor.set(59381), this.outlinePass.edgeThickness = 1, this.outlinePass.edgeStrength = 3, this.composer.addPass(this.outlinePass);
- var n = new s.SMAAPass(t, e);
- n.renderToScreen = !0, this.composer.addPass(n)
- }, x.prototype.setSize = function(t, e) {
- this.renderWidth = t, this.renderHeight = e, this.effects.aspect = t / e, this.renderer.setSize(t, e), this.composer.setSize(t, e);
- for (var i = 0; i < this.resizeListeners.length; i++) this.resizeListeners[i].setSize(t, e);
- G.render = this
- }, x.prototype.render = function(t) {
- this.renderer.setViewport(0, 0, (window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)), 0 < this.effects.currentBlur ? this.composer.render(t) : this.renderer.render(this.scene, this.camera), this.miniCameraControls.render()
- }, x.prototype.boluoVrInit = function() {
- this.isHuawei5X = p.detectHUAWEI5X(), this.oldRenderer = this.renderer, this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera);
- var t = this;
- window._vrEnabled = !1, Object.defineProperty(t, "vrEnabled", {
- get: function() {
- return window._vrEnabled
- },
- set: function(e) {
- (e = !!e) ? (t.renderer = t.newRenderer, window.vrMarkers.forEach((function(t) {
- t.visible = !0
- }))) : (t.renderer = t.oldRenderer, window.vrMarkers.forEach((function(t) {
- t.visible = !1
- }))), t.cursor.visible = e, t.setSize((window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)), window._vrEnabled = e
- }
- }), this.createCursor(.5, !1, 1, 16777215, 0);
- var e = {
- setSize: function(e, i) {
- t.camera.aspect = e / i
- }
- };
- this.resizeListeners.push(e), this.vrLoadingInit()
- }, x.prototype.vrLoadingInit = function() {
- var t = new(t = function(t) {
- var e = this,
- i = new s.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
- n = new s.MeshBasicMaterial({
- color: 4967932,
- side: s.DoubleSide
- }),
- r = new s.Mesh(i, n);
- this.mesh = r, r.position.z = -2, r.scale.set(.08, .08, .08), r.visible = !1, t.add(r), e.enabled = !1, this.update = function(t) {
- 1 == e.enabled && (r.rotation.z += 15 * t)
- }
- })(this.camera);
- window.Loading = t, this.updateListeners.push(t)
- }, x.prototype.createCursor = function(t, e, i, n, r) {
- var o, a = new s.SpriteMaterial({
- opacity: i,
- color: n,
- transparent: e,
- map: this.boluoGetTexture(v.splitUrl("./images/cursor.png")),
- needsUpdate: !0,
- side: s.DoubleSide
- });
- a.map.offset = new s.Vector2(1 / 17 * r, 0), a.map.repeat = new s.Vector2(1 / 17, 1), a.depthTest = !1, a.blending = s.AdditiveBlending, (o = new s.Sprite(a))
- .scale.set(t, t, t), o.position.z = -2, o.visible = !1, o.name = "cursor", this.camera.add(o), this.scene.add(this.camera), this.cursor = o;
- var l = new this.CursorAnimation(this.scene, o, this.camera);
- this.cursor.triggerTargetEvent = l.triggerTargetEvent, this.updateListeners.push(l)
- }, x.prototype.CursorAnimation = function(t, i, n) {
- this.cursor = i, this.raycaster = new s.Raycaster, this.targetEventObj = {}, this.type = 1, this.tweenFlag = !0, this.target = n, this.euler = new s.Euler, this.q0 = new s.Quaternion, this.q1 = new s.Quaternion(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this.zee = new s.Vector3(0, 0, 1), this.alpha = -1e3, this.beta = -1e3, this.gamma = -1e3, this.orient = s.Math.degToRad(window.orientation || 0);
- var r = this;
- window.addEventListener("orientationchange", (function() {
- r.orient = s.Math.degToRad(window.orientation || 0)
- })), window.addEventListener("deviceorientation", (function(t) {
- var i = s.Math.degToRad(t.alpha),
- n = s.Math.degToRad(t.beta),
- o = s.Math.degToRad(t.gamma);
- this.isHuawei5X ? (-1e3 === r.alpha && (r.alpha = i), -1e3 === r.beta && (r.beta = n), -1e3 === r.gamma && (r.gamma = o), Math.abs(i - r.alpha) > .06 && (r.alpha = i), Math.abs(n - r.beta) > .006 && (r.beta = n), Math.abs(o - r.gamma) > .006 && (r.gamma = o)) : (r.alpha = i, r.beta = n, r.gamma = o);
- if (f.vrDebug) {
- e("#info-device-orientation")
- .css("display", "block");
- var a = "";
- a += "alpha=(" + r.alpha + ")<BR/>", a += "beta=(" + r.beta + ")<BR/>", a += "gamma=" + r.gamma + "<BR/>", document.getElementById("info-device-orientation")
- .innerHTML = a
- }
- })), this.setObjectQuaternion = function(t, e, i, o, a) {
- r.euler.set(i, e, -o, "YXZ"), t.setFromEuler(r.euler), t.multiply(r.q1), t.multiply(r.q0.setFromAxisAngle(r.zee, -a)), n.updateMatrixWorld()
- }, parent !== window && window.addEventListener("message", (function(t) {
- if (!t.data.type || "ZqApi.TagModule" !== t.data.type) {
- var e = JSON.parse(t.data),
- i = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
- e && e.alpha && e.beta && e.gamma && function(t) {
- var i = s.Math.degToRad(e.alpha),
- n = s.Math.degToRad(e.beta),
- o = s.Math.degToRad(e.gamma);
- t ? (-1e3 === r.alpha && (r.alpha = i), -1e3 === r.beta && (r.beta = n), -1e3 === r.gamma && (r.gamma = o), Math.abs(i - r.alpha) > .06 && (r.alpha = i), Math.abs(n - r.beta) > .006 && (r.beta = n), Math.abs(o - r.gamma) > .006 && (r.gamma = o)) : (r.alpha = i, r.beta = n, r.gamma = o)
- }(i)
- }
- })), this.update = function(t) {
- a.update(), window._vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient), this.triggerTargetEvent())
- }, this.triggerTargetEvent = function() {
- var t = this.choseObj(),
- e = t ? t.object : void 0;
- this.targetEventObj.currentObj = e, e !== this.targetEventObj.lastObj && (e && this.autoCursorPosition(t), 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(), e && e.enabled && this.startAnimate(function() {
- this.clickCallback(e)
- }.bind(this))) : this.type, this.targetEventObj.lastObj = e)
- }, this.choseObj = function() {
- this.raycaster.setFromCamera({
- x: 0,
- y: 0
- }, n);
- this.raycaster.ray;
- var t = window.vrMarkers,
- e = this.raycaster.intersectObjects(t);
- if (e.length > 0) return e[0]
- }, this.clickCallback = function(t) {
- this.runTHREEAction(t, "onclick")
- }, this.runTHREEAction = function(t, e) {
- switch (e) {
- case "onclick":
- t._listeners && t._listeners.click && t._listeners.click.forEach((function(t) {
- t()
- }));
- break;
- case "onhover":
- t._listeners && t._listeners.hover && t._listeners.hover.forEach((function(t) {
- t()
- }));
- break;
- case "onout":
- t._listeners && t._listeners.out && t._listeners.out.forEach((function(t) {
- t()
- }))
- }
- }, this.startAnimate = function(t) {
- this.tweenFlag && this.initAnimation(t)
- }, this.initAnimation = function(t) {
- var e = this,
- i = this.cursor.material.map.offset;
- e.tweenFlag = !1, this.cursorAnimate = new a.Tween(i)
- .to({
- x: 1
- }, 1e3)
- .onStart((function() {
- e.tweenFlag = !1
- }))
- .onStop((function() {
- e.tweenFlag = !0, this.x = 0, i.x = 0
- }))
- .onUpdate((function() {}))
- .onComplete((function() {
- t(), i.x = 0, setTimeout((function() {
- e.tweenFlag = !0
- }), 1500)
- })), this.cursorAnimate.easing((function(t) {
- return Math.floor(17 * t) / 17
- })), this.cursorAnimate.start()
- }, this.autoCursorPosition = function(t) {
- var e = Math.abs(t.distance - 10);
- this.cursor.position.z = -e, e /= 10, this.cursor.scale.set(e, e, e)
- }
- }, x.prototype.vrRenderer = function(t, e, i) {
- var n = new e.vrCamera(i);
- n.bananaAspect = .8, this.width, this.height;
- e = this;
- this.setSize = function(i, n) {
- t.setSize.call(this, i, n), e.width = i, e.height = n
- }, this.render = function(e, i, r, o) {
- var a, s;
- if (i.__RESS__SKIP__STEREO__) return t.render(e, i, r, o);
- if ("PerspectiveCamera" === i.type) a = n.cameraL, s = n.cameraR, e.updateMatrixWorld(), null === i.parent && i.updateMatrixWorld(), n.vrCameraUpdate(i);
- else {
- if ("OrthographicCamera" !== i.type) return DEBUG && void 0;
- a = s = i
- }
- t.setScissorTest(!0), t.setScissor(0, 0, this.width / 2, this.height), t.setViewport(0, 0, this.width / 2, this.height), t.render.call(this, e, a, r, o), t.setScissor(this.width / 2, 0, this.width / 2, this.height), t.setViewport(this.width / 2, 0, this.width / 2, this.height), t.render.call(this, e, s, r, o), t.setScissorTest(!1)
- }, this.__proto__ = {
- __proto__: t
- }
- }, x.prototype.vrCamera = function(t) {
- this.type = "StereoCamera", this._aspect = 1, this._overlap = .064, this.cameraL = new s.PerspectiveCamera, this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new s.PerspectiveCamera, this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1, this.eyeRight = new s.Matrix4, this.eyeLeft = new s.Matrix4, this.vrCameraNeedsUpdate = !0, Object.defineProperty(this, "bananaAspect", {
- get: function() {
- return this._aspect
- },
- set: function(t) {
- this._aspect !== t && (this.vrCameraNeedsUpdate = !0), this._aspect = t
- }
- }), Object.defineProperty(this, "overlap", {
- get: function() {
- return this._overlap
- },
- set: function(t) {
- this._overlap !== t && (this.vrCameraNeedsUpdate = !0), this._overlap = t
- }
- }), this.vrCameraUpdate = function(t) {
- if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== t.fov || this.bananaReal_aspect !== t.aspect * this.bananaAspect || this.bananaNear !== t.near || this.bananaFar !== t.far, this.vrCameraNeedsUpdate) {
- this.vrCameraNeedsUpdate = !1, this.bananaFocus = t.focus, this.bananaFov = t.fov, this.bananaReal_aspect = t.aspect * this.bananaAspect, this.bananaNear = t.near, this.bananaFar = t.far, this.bananaFocus = 10;
- var e, i, n = t.projectionMatrix.clone(),
- r = this.overlap / 2,
- o = r * this.bananaNear / this.bananaFocus,
- a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
- this.eyeLeft.elements[12] = -r, this.eyeRight.elements[12] = r, e = -a * this.bananaReal_aspect + o, i = a * this.bananaReal_aspect + o, n.elements[0] = 2 * this.bananaNear / (i - e), n.elements[8] = (i + e) / (i - e), this.cameraL.projectionMatrix.copy(n), e = -a * this.bananaReal_aspect - o, i = a * this.bananaReal_aspect - o, n.elements[0] = 2 * this.bananaNear / (i - e), n.elements[8] = (i + e) / (i - e), this.cameraR.projectionMatrix.copy(n)
- }
- this.cameraL.matrixWorld.copy(t.matrixWorld)
- .multiply(this.eyeLeft), this.cameraR.matrixWorld.copy(t.matrixWorld)
- .multiply(this.eyeRight)
- }
- }, x.prototype.boluoGetTexture = function(t) {
- var e = new s.TextureLoader;
- return e.crossOrigin = "anonymous", e.load(t)
- }, x.prototype.updateScreenSize = function() {
- //(window.innerWidth != this.renderWidth || (window.renderHeight || window.innerHeight) != this.renderHeight || this.forceUpdateSize) && (this.setSize(window.innerWidth, (window.renderHeight || window.innerHeight)), this.forceUpdateSize = !1)
- }, x.prototype.updateComponents = function() {
- for (var t = Math.min(1, this.updateClock.getDelta()), e = 0; e < this.updateListeners.length; e++) this.updateListeners[e].update(t)
- }, x.prototype.computeCompassAngle = function() {
- var t = this.camera.getWorldDirection(new s.Vector3),
- e = (new s.Vector2)
- .subVectors(new s.Vector2(t.z, t.x), new s.Vector2(0, -1));
- e.y = e.y - 1;
- var i = e.length(),
- n = Math.acos(e.x / i);
- e.y < 0 && (n *= -1), n = 180 * n / Math.PI + 180, this.emit("compass", n)
- }, x.prototype.getImageData = (r = document.createElement("canvas"), o = r.getContext("2d"), function(t, e, i) {
- return r.width == e && r.height == i || (r.width = e, r.height = i), o.drawImage(t, 0, 0, e, i), o.getImageData(0, 0, e, i)
- }), x.prototype.initSizedTexture2D = function(t, e, i) {
- var n = this.renderer,
- r = n.context,
- o = n.state,
- a = new s.Texture(null);
- a.flipY = !1, !0 !== i && (i = !1), a.generateMipmaps = i;
- var l = n.paramThreeToGL(a.format),
- u = n.paramThreeToGL(a.type),
- h = n.properties.get(a),
- c = r.createTexture();
- o.bindTexture(r.TEXTURE_2D, c), r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY), r.texImage2D(r.TEXTURE_2D, 0, l, t, t, 0, l, u, null), a.wrapS = e, a.wrapT = e;
- var d = n.paramThreeToGL(e);
- return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, d), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, d), i ? (a.magFilter = s.LinearFilter, a.minFilter = s.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 = s.LinearFilter, a.minFilter = s.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), h.__webglTexture = c, a
- }, x.prototype.initSizedCubeMap = function(t, e) {
- var i = this.renderer,
- n = i.context,
- r = i.state,
- o = new s.CubeTexture([null, null, null, null, null, null]);
- o.flipY = !1, o.generateMipmaps = e;
- var a = i.paramThreeToGL(o.format),
- l = i.paramThreeToGL(o.type),
- u = i.properties.get(o),
- h = n.createTexture();
- r.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
- for (var c = 0; c < 6; c++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + c, 0, a, t, t, 0, a, l, null);
- return e ? (o.magFilter = s.LinearFilter, o.minFilter = s.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 = s.LinearFilter, o.minFilter = s.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), u.__image__webglTextureCube = h, o
- }, x.prototype.deallocateCubeTexture = function(t) {
- var e = this.renderer,
- i = e.context,
- n = e.properties.get(t);
- i.deleteTexture(n.__image__webglTextureCube)
- }, x.prototype.uploadTexture2D = function(t, e, i, n, r, o) {
- var a = this.renderer,
- s = a.context,
- l = a.state,
- u = a.properties.get(e);
- l.bindTexture(s.TEXTURE_2D, u.__webglTexture), s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, e.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, e.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, e.unpackAlignment), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(e.wrapS)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(e.wrapT)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(e.magFilter)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(e.minFilter)), s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, t), e.generateMipmaps && s.generateMipmap(s.TEXTURE_2D), l.bindTexture(s.TEXTURE_2D, null)
- }, x.prototype.rebuildMipMaps2D = function(t) {
- var e = this.renderer,
- i = e.context,
- n = e.state;
- e.properties.get(t), i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
- }, x.prototype.rebuildMipMaps3D = function(t) {
- var e = this.renderer,
- i = e.context,
- n = e.state,
- r = e.properties.get(t);
- n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube), i.generateMipmap(i.TEXTURE_CUBE_MAP), n.bindTexture(i.TEXTURE_CUBE_MAP, null)
- }, x.prototype.renderToCubeMap = function() {
- var t = !1,
- e = null,
- i = null,
- n = null,
- r = null,
- o = null;
- return function(a, u, h, c, d, p, f, m, g, v, y, b, w, x, M, T) {
- this.renderer.context, t || ((i = new s.OrthographicCamera(-.5, .5, .5, -.5, -200, 200))
- .position.z = 150, (e = new s.Scene)
- .add(i), n = new s.ShaderMaterial({
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- vertexShader: l.basicTextured.vertexShader,
- fragmentShader: l.basicTextured.fragmentShader,
- depthWrite: !1,
- depthTest: !1,
- side: s.DoubleSide
- }), r = new s.PlaneBufferGeometry(1, 1), (o = new s.Mesh(r, n))
- .position.z = 0, e.add(o), t = !0);
- var S = r.getAttribute("uv");
- S.setDynamic(!0), S.needsUpdate = !0;
- var _ = S.array,
- A = d / h,
- P = p / c,
- C = f / h,
- E = m / c;
- _[0] = A, _[1] = P + E, _[2] = A + C, _[3] = P + E, _[4] = A, _[5] = P, _[6] = A + C, _[7] = P;
- var D = r.getAttribute("position");
- D.setDynamic(!0), D.needsUpdate = !0;
- var L = D.array,
- O = g / u.width - .5,
- I = v / u.height - .5,
- R = y / u.width,
- N = b / u.height;
- L[0] = O, L[1] = I + N, L[3] = O + R, L[4] = I + N, L[6] = O, L[7] = I, L[9] = O + R, L[10] = I, this.renderer.properties.get(a), n.uniforms.tDiffuse.value = a, n.blending = x || s.NoBlending, n.transparent = !!M, null != T || (T = 1), n.uniforms.alpha.value = T, n.needUpdate = !0, u.activeCubeFace = w, u.viewport.set(0, 0, u.width, u.height);
- var k = this.renderer.autoClear;
- this.renderer.autoClear = !1, this.renderer.render(e, i, u, !1), this.renderer.autoClear = k
- }
- }(), x.prototype.copyCubeMap = function() {
- var t = !1,
- e = null,
- i = null,
- n = null,
- r = null,
- o = null,
- a = new s.Euler;
- return new s.Vector3,
- function(u, h, c, d, p, f, m, g, v) {
- if (this.renderer, !t) {
- (i = new s.OrthographicCamera(-1, 1, 1, -1, 0, 200))
- .position.set(0, 0, 0), (e = new s.Scene)
- .add(i), n = new s.ShaderMaterial({
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- vertexShader: l.copyCubeMap.vertexShader,
- fragmentShader: l.copyCubeMap.fragmentShader,
- depthWrite: !1,
- depthTest: !1,
- side: s.DoubleSide
- }), r = new s.BoxGeometry(2, 2, 2), o = new s.Mesh(r, n), e.add(o), t = !0
- }
- for (var y = 0; y < 6; y++) x.getCubeOrientationForCubeFace(y, a), o.rotation.copy(a), o.matrixWorldNeedsUpdate = !0, o.updateMatrixWorld(), n.uniforms.tDiffuse.value = u, n.blending = m || s.NoBlending, n.transparent = !!g, null != v || (v = 1), n.uniforms.alpha.value = v, n.needUpdate = !0, h.activeCubeFace = y, h.viewport.set(0, 0, p, f), this.renderer.render(e, i, h, !1)
- }
- }(), x.getCubeOrientationForCubeFace = function(t, e) {
- switch (t) {
- case h.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- e.set(0, -Math.PI / 2, 0);
- break;
- case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- e.set(0, Math.PI / 2, 0);
- break;
- case h.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- e.set(Math.PI / 2, Math.PI, 0);
- break;
- case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- e.set(-Math.PI / 2, Math.PI, 0);
- break;
- case h.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- e.set(0, -Math.PI, 0);
- break;
- case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- e.set(0, 0, 0)
- }
- }, x.prototype.renderSolidTileToCubeMap = function() {
- var t = !1,
- e = null,
- i = null,
- n = null,
- r = null,
- o = null;
- return function(a, l, u, h, c, d, p, f, m, g) {
- if (this.renderer.context, !t) {
- (i = new s.OrthographicCamera(-.5, .5, .5, -.5, -200, 200))
- .position.z = 150, (e = new s.Scene)
- .add(i);
- var v = ["void main() { ", " vec4 pos = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", " gl_Position = pos; ", "}"].join("\n"),
- y = ["uniform vec4 blockColor;", "uniform float alpha;", "void main() {", " gl_FragColor = vec4(blockColor.rgb, alpha);", "}"].join("\n");
- n = new s.ShaderMaterial({
- uniforms: {
- blockColor: {
- type: "v4",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- vertexShader: v,
- fragmentShader: y,
- depthWrite: !1,
- depthTest: !1,
- side: s.DoubleSide
- }), (r = new s.PlaneBufferGeometry(1, 1))
- .getAttribute("position"), (o = new s.Mesh(r, n))
- .position.z = 0, e.add(o), t = !0
- }
- n.uniforms.blockColor.value = p, null != g || (g = 1), n.uniforms.alpha.value = g, n.blending = f || s.NoBlending, n.transparent = !!m, n.needUpdate = !0, a.activeCubeFace = d, a.viewport.set(l, u, h, c), this.renderer.render(e, i, a, !1)
- }
- }(), x.prototype.showFPS = function() {
- this.stats = new m, document.body.appendChild(this.stats.domElement)
- };
- var M = function(t) {
- if (window.requestAnimationFrame(M), this.updateScreenSize(), this.updateComponents(), this.render(t), this.stats && this.stats.update(), -1 == b && G.model.settings.basic && G.model.settings.basic.user) {
- var e = G.model.settings.basic.user.group;
- b = 15 == e ? 1 : 0
- }
- if (1 == b && !0 === G.startEntryPage && !G.frameRate && G.player && "panorama" === G.player.mode) {
- n || (n = (performance || Date)
- .now());
- var i = function() {
- var t;
- w++;
- var e = (performance || Date)
- .now();
- if (e >= n + 1e3 && (t = 1e3 * w / (e - n), n = e, w = 0), t) return Math.ceil(t)
- }();
- G.frameRate = i
- }
- this.computeCompassAngle(), this.emit(c.AfterRender)
- };
- x.prototype.mesaueLensRender = function(t, e, i, n) {
- this.renderer.render(t, e, i, n)
- }, t.exports = x
- })
- .call(this, i(6))
- }, function(t, e) {
- t.exports = {
- Texture2D: 0,
- TextureCube: 1
- }
- }, function(t, e, i) {
- function n(t) {
- r.call(this, t)
- }
- var r = i(14);
- n.prototype = Object.create(r.prototype), t.exports = n
- }, function(t, e, i) {
- var n;
- t.exports = ((n = function() {
- function t(t) {
- return r.appendChild(t.dom), t
- }
- function e(t) {
- for (var e = 0; e < r.children.length; e++) r.children[e].style.display = e === t ? "block" : "none";
- i = t
- }
- var i = 0,
- r = document.createElement("div");
- r.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", r.addEventListener("click", (function(t) {
- t.preventDefault(), e(++i % r.children.length)
- }), !1);
- var o = (performance || Date)
- .now(),
- a = o,
- s = 0,
- l = t(new n.Panel("FPS", "#0ff", "#002")),
- u = t(new n.Panel("MS", "#0f0", "#020"));
- if (self.performance && self.performance.memory) var h = t(new n.Panel("MB", "#f08", "#201"));
- return e(0), {
- REVISION: 16,
- dom: r,
- addPanel: t,
- showPanel: e,
- begin: function() {
- o = (performance || Date)
- .now()
- },
- end: function() {
- s++;
- var t = (performance || Date)
- .now();
- if (u.update(t - o, 200), t > a + 1e3 && (l.update(1e3 * s / (t - a), 100), a = t, s = 0, h)) {
- var e = performance.memory;
- h.update(e.usedJSHeapSize / 1048576, e.jsHeapSizeLimit / 1048576)
- }
- return t
- },
- update: function() {
- o = this.end()
- },
- domElement: r,
- setMode: e
- }
- })
- .Panel = function(t, e, i) {
- var n = 1 / 0,
- r = 0,
- o = Math.round,
- a = o(window.devicePixelRatio || 1),
- s = 80 * a,
- l = 48 * a,
- u = 3 * a,
- h = 2 * a,
- c = 3 * a,
- d = 15 * a,
- p = 74 * a,
- f = 30 * a,
- m = document.createElement("canvas");
- m.width = s, m.height = l, m.style.cssText = "width:80px;height:48px";
- var g = m.getContext("2d");
- return g.font = "bold " + 9 * a + "px Helvetica,Arial,sans-serif", g.textBaseline = "top", g.fillStyle = i, g.fillRect(0, 0, s, l), g.fillStyle = e, g.fillText(t, u, h), g.fillRect(c, d, p, f), g.fillStyle = i, g.globalAlpha = .9, g.fillRect(c, d, p, f), {
- dom: m,
- update: function(l, v) {
- n = Math.min(n, l), r = Math.max(r, l), g.fillStyle = i, g.globalAlpha = 1, g.fillRect(0, 0, s, d), g.fillStyle = e, g.fillText(o(l) + " " + t + " (" + o(n) + "-" + o(r) + ")", u, h), g.drawImage(m, c + a, d, p - a, f, c, d, p - a, f), g.fillRect(c + p - a, d, a, f), g.fillStyle = i, g.globalAlpha = .9, g.fillRect(c + p - a, d, a, o((1 - l / v) * f))
- }
- }
- }, n)
- }, function(t, e, i) {
- var n = i(0),
- r = i(8),
- o = i(10),
- a = null,
- s = null,
- l = {
- top: -451,
- left: (window.renderWidth || window.innerWidth) - 480 - 260
- },
- u = !0;
- function h(t) {
- a = t, this.player = null, s = this
- }
- h.prototype.init = function() {
- this.player = G.player, a.miniCamera = new n.PerspectiveCamera, a.on("virtual-update-position", (function(t) {
- a.miniCamera = new n.PerspectiveCamera(t.fov, 1, .5, t.distance), a.miniCamera.position.copy(t.positions[0]), a.miniCamera.quaternion.copy(t.quaternion), a.miniCamera.lookAt(t.positions[1]), a.miniCamera.updateProjectionMatrix()
- })), s.player.updateMiniCameraPosition = function(t) {
- r.start(o.property(l, t.direction, t.new), 200), "left" === t.direction && (u = !(t.new > t.old))
- }, s.player.on("choosed-virtual-camera", (function() {
- l.left = (window.renderWidth || window.innerWidth) - 480 - 260, r.start(o.property(l, "top", 0), 200)
- })), s.player.on("hidePutModelInfoPanel", (function() {
- r.start(o.property(l, "top", -415), 200), l.left = (window.renderWidth || window.innerWidth) - 480 - 260
- })), s.player.miniCameraScreenShot = function(t) {
- s.getImage(t)
- }, s.player.saveVirturalCameraScreenshot = function() {
- var t = window.screenshotData,
- e = [];
- return t.forEach((function(t, i) {
- e.push({
- uuid: i,
- name: t.name,
- url: t.url
- })
- })), t = null, JSON.stringify(e)
- }
- }, h.prototype.render = function() {
- a.renderer.clearDepth(), a.renderer.setScissorTest(!0), a.renderer.setScissor(l.left, l.top, 480, 360), a.renderer.setViewport(l.left, l.top, 480, 360), a.renderer.render(a.scene, a.miniCamera), a.renderer.setScissorTest(!1)
- }, h.prototype.getImage = function(t) {
- var e = new Image;
- e.src = a.renderer.domElement.toDataURL("image/png", 1), e.onload = function() {
- var i = document.createElement("canvas"),
- n = i.getContext("2d");
- i.width = 480 * window.devicePixelRatio, i.height = 360 * window.devicePixelRatio, n.drawImage(e, l.left * window.devicePixelRatio, 0, (window.renderWidth || window.innerWidth) * window.devicePixelRatio, (window.renderHeight || window.innerHeight) * window.devicePixelRatio, 0, 0, (window.renderWidth || window.innerWidth) * window.devicePixelRatio, (window.renderHeight || window.innerHeight) * window.devicePixelRatio);
- var r = i.toDataURL("image/png");
- t && t(r)
- }
- }, window.addEventListener("resize", (function() {
- l.left = u ? (window.renderWidth || window.innerWidth) - 480 - 260 : (window.renderWidth || window.innerWidth) - 480 - 5
- })), t.exports = h
- }, function(t, e, i) {
- (function(e) {
- function n(t, e, i, n) {
- this.qualityManager = t, this.scene = e, this.camera = i, this.container = n, this.quickstartCamera = new p, this.endFOV = a.insideFOV, this.quickstartCamera.fov = this.endFOV + g.quickstart.fovChange, this.controls = new f(this.quickstartCamera), this.controls.bindEvents(n), this.controls.enabled = !0, this.controls.locked = !0, this.skybox = null
- }
- var r = i(0),
- o = i(2),
- a = i(26),
- s = i(8),
- l = i(10),
- u = i(15),
- h = i(18),
- c = i(23),
- d = (i(43), i(192)),
- p = i(37),
- f = i(35),
- m = (i(30), i(75), i(193)),
- g = (i(3), i(1)),
- v = i(194),
- y = new o("/js/scene/QuickstartManager.js");
- n.prototype.load = function(t) {
- t.pano.shouldRedrawOnBaseLoaded = !0;
- var i, n = this,
- r = h.FORWARD.clone()
- .applyQuaternion(t.quaternion),
- o = r.clone()
- .negate();
- this.controls.lookAt(r.add(this.quickstartCamera.position));
- var a = this.qualityManager.getPanoSize(c.BASE);
- this.qualityManager.getPanoSize(c.STANDARD);
- if (t.pano.tiled) {
- window.loadingCount = 1, window.firstPanoId = t.pano.id, y.warn("Loading startPano, TILED", t.pano.id), t.pano.update();
- var s = m.getHFOVForCamera(this.quickstartCamera, (window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)),
- l = this.quickstartCamera.fov;
- y.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + s + ", vertical FOV: " + l + "]"), i = t.pano.loadTiledPano(a, o, null, !1, !1, !0)
- } else y.warn("Loading startPano", t.pano.id), i = t.pano.loadCube("high");
- return e.when(i)
- .then(function() {
- n.init(t.pano, t.quaternion), t.pano.tiled ? i.done(function() {
- t.pano.lockUntilRenderingComplete = !1, this.controls.locked = !1
- }.bind(this)) : this.controls.locked = !1
- }.bind(this))
- }, n.prototype.init = function(t, i) {
- y.info("Quickstart done loading, adding scene objects"), t.lockUntilRenderingComplete = !0, this.skybox = new r.Mesh(new r.CubeGeometry(1, 1, 1), new d({
- side: r.BackSide
- })), this.skybox.material.uniforms.map.value = t.skybox, this.skybox.quaternion.copy(t.quaternion), this.scene.add(this.skybox), e(this.container)
- .show()
- }, n.prototype.update = function(t) {
- this.controls.update(t), this.camera.copy(this.quickstartCamera)
- }, n.prototype.setSize = function(t, e) {
- this.quickstartCamera.updateAspect(t / e)
- }, n.prototype.destroy = function() {
- this.scene.remove(this.skybox)
- }, n.prototype.startLanding = function() {
- function t() {
- var t = s.getById("quickAnimation"),
- e = t.length > 0 ? t[0].current : g.quickstart.animation,
- n = e < g.quickstart.animation ? g.quickstart.animation - e : 0;
- setTimeout(r, n), i()
- }
- function i() {
- o.forEach((function(e) {
- document.body.removeEventListener(e, t, !0)
- }))
- }
- var n = e.Deferred(),
- r = n.resolve.bind(n);
- s.start(l.property(this.quickstartCamera, "fov", this.endFOV, function() {
- this.quickstartCamera.updateProjectionMatrix()
- }.bind(this)), g.quickstart.animation, null, 0, u.easeOutQuad, null, "quickAnimation");
- var o = ["touchstart", "mousedown", "keydown"];
- o.forEach((function(e) {
- document.body.addEventListener(e, t, !0)
- }));
- var a = v.isQuickstartHelpEnabled() ? g.quickstart.fadeOutDelay : g.quickstart.animation;
- return setTimeout(r, a), setTimeout(i, a), n.promise()
- }, t.exports = n
- })
- .call(this, i(6))
- }, function(t, e, i) {
- function n(t) {
- t = t || {}, r.RawShaderMaterial.call(this, a.extendObject({
- fragmentShader: o.cube.fragmentShader,
- vertexShader: o.cube.vertexShader,
- uniforms: r.UniformsUtils.clone(o.cube.uniforms),
- name: "CubemapMaterial"
- }, t))
- }
- var r = i(0),
- o = i(12),
- a = i(7);
- n.prototype = Object.create(r.RawShaderMaterial.prototype), n.prototype.constructor = n, t.exports = n
- }, function(t, e, i) {
- var n = i(56),
- r = function(t, e, i) {
- var r = e,
- o = i;
- return 2 * Math.atan(Math.tan(t * n.RADIANS_PER_DEGREE / 2) * (r / o)) * n.DEGREES_PER_RADIAN
- };
- t.exports = {
- getHFOVForCamera: function(t, e, i) {
- return r(t.fov, e, i)
- },
- getHFOVFromVFov: r
- }
- }, function(t, e, i) {
- var n = i(3),
- r = i(2),
- o = i(1),
- a = new r("/js/gui/helpManager.js"),
- s = function() {
- var t;
- try {
- return t = window.localStorage.getItem("visitCount") || "0", t = (parseFloat(t) + 1)
- .toString(), window.localStorage.setItem("visitCount", t), a.debug("visitCount = " + t), t
- } catch (e) {
- t = "1", a.debug("couldn't set local storage")
- }
- }();
- t.exports = {
- isHelpEnabled: function() {
- return ("1" === s || "1" === n.valueFromHash("help", null)) && "0" !== n.valueFromHash("help", null) && o.warp.auto < 0
- },
- isQuickstartHelpEnabled: function() {
- if (o.quickstart.enabled && this.isHelpEnabled()) return !0
- },
- isStandardHelpEnabled: function() {
- if (!o.quickstart.enabled && this.isHelpEnabled()) return !0
- }
- }
- }, function(t, e, i) {
- function n(t, e, i) {
- this.maxNavPanoSize = -1, this.maxZoomPanoSize = -1, this.devicePixelDensity = t, this.deviceScreenSize = e, this.clientBandwidth = i, this.panoSizeClassMap = {}, this.useHighResolutionPanos = !0, this.useUltraHighResolutionPanos = !1, this.modelHasUltraHighPanos = !1
- }
- var r = i(23),
- o = i(1),
- a = i(3),
- s = i(26),
- l = (i(25), i(21));
- n.prototype.init = function(t) {
- 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(), t.on(l.ActiveModelChanged, this.onModelChanged.bind(this))
- }, n.prototype.updateFromModel = function(t) {
- this.updateHighResolutionSettings(t), this.updateUltraHighResolutionSettings(t)
- }, n.prototype.updateHighResolutionSettings = function(t) {
- this.updateMaximums()
- }, n.prototype.updateUltraHighResolutionSettings = function(t) {
- o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1, this.updateMaximums()
- }, n.prototype.enableUltraHighQualityMode = function() {
- this.modelHasUltraHighPanos = !0, this.updateUltraHighResolutionSettings(null)
- }, n.prototype.ultraHighQualityModeEnabled = function() {
- return this.modelHasUltraHighPanos
- }, n.prototype.onModelChanged = function(t) {
- this.updateFromModel(t.model), this.updateMaximums()
- }, n.prototype.updateMaximums = function() {
- this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(), this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(), this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
- }, n.prototype.buildPanoSizeClassMap = function() {
- this.panoSizeClassMap[r.BASE] = 512, this.panoSizeClassMap[r.STANDARD] = 1024, this.panoSizeClassMap[r.HIGH] = 2048, this.panoSizeClassMap[r.ULTRAHIGH] = 4096
- }, n.prototype.getPanoSize = function(t) {
- return this.panoSizeClassMap[t]
- }, n.prototype.getMaxPossiblePanoSize = function() {
- return this.getPanoSize(r.ULTRAHIGH)
- }, n.prototype.getMaxPanoSize = function() {
- return this.maxZoomPanoSize
- }, n.prototype.getMaxNavPanoSize = function() {
- return this.maxNavPanoSize
- }, n.prototype.getMaxZoomPanoSize = function() {
- return this.maxZoomPanoSize
- }, n.prototype.detectMaxNavPanoSizeClass = function() {
- var t = "";
- return t = o.screenshot ? o.panoramaSettings.screenshot_2k ? r.HIGH : r.STANDARD : o.panoramaSettings.loading_2k ? r.HIGH : r.STANDARD, this.useHighResolutionPanos ? (a.isMobile() || ((window.renderHeight || window.innerHeight), this.highQualityThreshold), t) : r.STANDARD
- }, n.prototype.detectMaxNavPanoSize = function() {
- var t = this.detectMaxNavPanoSizeClass();
- return this.getPanoSize(t)
- }, n.prototype.detectMaxZoomPanoSize = function() {
- 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)
- }, t.exports = n
- }, function(t, e, i) {
- (function(e) {
- var n, r, o, a, s, l, u, h, c = i(0),
- d = i(2),
- p = i(7),
- f = i(1),
- m = i(24),
- g = i(31),
- v = i(21),
- y = i(42),
- b = i(20),
- w = i(197),
- x = i(4)
- .EventEmitter,
- M = i(39),
- T = new d("/js/mattertag/MattertagManager.js");
- function S() {
- this.tagState = w.IDLE, this.intersectTag = null, this.hoveredTag = null, this.activeTag = null, this.mattertagDiscs = [], this.raycaster = new c.Raycaster, this.modelManager = null, this.player = null, this.director = null, this.totalMattertags = 0, this.lastAudioTag = null, this.hide360TagForce = ""
- }
- p.extend(S, x), S.prototype.init = function(t, i, n) {
- this.modelManager = t, this.player = i, this.director = n, this.updateModel(), this.bindEvents();
- var r = this;
- e("#iframe-close, .help_back")
- .click((function() {
- e("#iframe-close")
- .addClass("css-sprites"), document.getElementsByClassName("iframe-open")[0].src = "about:blank", r.dismissExaminedTag()
- })), e(".closeTagContainer")
- .on("click", (function() {
- e(".pctagcontainer")
- .fadeOut(300, (function() {
- e(".moreImages")
- .remove()
- })), setTimeout((function() {
- e(".imageCon")
- .attr("src", "")
- .removeClass("longimgCon highimgCon commimgCon"), e(".topimg")
- .removeClass("topimgCss")
- }), 300), r.dismissExaminedTag()
- })), G.settings.building.rooms && (this.hasroom = !0)
- }, S.prototype.update = function(t) {
- this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
- }, S.prototype.updateTags = function(t, e, i, n) {
- for (var r in this.model.mattertags) 12 !== this.model.mattertags[r].type && this.model.mattertags[r].update(t, e, i, n, this.show360TagPanoId)
- }, S.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel(), this.getMattertagsFromModel(), this.totalMattertags = Object.keys(this.model.mattertags)
- .length
- }, S.prototype.getMattertagsFromModel = function() {
- for (var t in this.mattertagDiscs = [], this.model.mattertags) {
- var e = this.model.mattertags[t].disc;
- e && this.mattertagDiscs.push(e)
- }
- }, S.prototype.bindEvents = function() {
- this.modelManager.on(v.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(b.ModeChanging, this.onPlayerModeChanging.bind(this)), this.player.on(b.Move, this.onPlayerMove.bind(this)), this.player.on(b.Ready, this.onPlayerReady.bind(this)), this.player.on(b.FlyingEnded, this.onPlayerFlyingEnded.bind(this)), this.player.on(b.WarpStarted, this.handleWarpStart.bind(this)), this.player.on(b.WarpInterrupted, this.handleWarpInterruption.bind(this))
- }, S.prototype.handleWarpStart = function(t, e, i, n) {
- this.dismissExaminedTag(), e === m.BLACK && (n = n || f.warp.teleportTime, t && (i = g.END), this.hideShowTagsForBlackoutStyle(i, n))
- }, S.prototype.handleWarpInterruption = function(t, e, i) {
- i = i || f.warp.teleportTime, this.hideShowTagsForBlackoutStyle(e, i)
- }, S.prototype.hideShowTagsForBlackoutStyle = function(t, e) {
- var i = 0,
- n = 0,
- r = e / 2;
- switch (null == t && (t = g.MIDDLE), t) {
- case g.END:
- this.hideAllMattertags(r);
- break;
- case g.BEGINNING:
- this.hideAllMattertags()
- .done(this.showAllMattertags.bind(this, r));
- break;
- case g.NONE:
- break;
- case g.MIDDLE:
- i = r, n = r, this.hideAllMattertags(n), setTimeout(function() {
- this.showAllMattertags(i)
- }.bind(this), n);
- break;
- case g.FADEIN:
- setTimeout(function() {
- this.showAllMattertags(r)
- }.bind(this), r)
- }
- }, S.prototype.onPlayerModeChanging = function() {
- this.dismissExaminedTag()
- }, S.prototype.onPlayerMove = function() {
- this.dismissExaminedTag(!0)
- }, S.prototype.onPlayerReady = function(t, e, i) {
- this.startAllMattertags(t, e ? i : null)
- }, S.prototype.onPlayerFlyingEnded = function(t, e) {
- t && this.updateClosestTags(t)
- }, S.prototype.dismissExaminedTag = function(t) {
- t && this.activeTag && this.activeTag.type === M.Audio ? (this.boardState, this.tagState = w.BROWSE) : (this.activeTag && this.tagState === w.EXAMINE && this.dismissActiveTag(), this.hoveredTag && (this.hoveredTag.setFreeState(!0), this.hoveredTag = null))
- }, S.prototype.startAllMattertags = function(t, e) {
- this.model.shouldShowMattertags = f.mattertags.enabled, t || (this.showAllMattertags(f.mattertags.startup.fadeInDuration, f.mattertags.startup.fadeInDelay), e && setTimeout(function() {
- this.activateTag(this.model.getTagByIdx(e))
- }.bind(this), f.mattertags.startup.fadeInDuration / 2))
- }, S.prototype.showAllMattertags = function(t, i) {
- function n() {
- ++o === this.totalMattertags && (this.model.tagsShown = !0, r.resolve())
- }
- var r = e.Deferred(),
- o = 0;
- if (!this.model.shouldShowMattertags) return r.resolve()
- .promise();
- for (var a in this.model.mattertags) {
- var s = this.model.mattertags[a];
- s.type !== M.Title && s.type !== M.RegionalJump && s.show(t, i)
- .done(n.bind(this))
- }
- return this.showtitletags = !0, this.updatetitletags(), r.promise()
- }, S.prototype.updatetitletags = function() {
- if (this.showtitletags && G.titletags && "panorama" === G.player.mode) {
- var t, i, n, r = G.player.camera.clone();
- this.ttagsshow = [], this.ttagshide = [];
- for (var o = 0; o < G.titletags.length; o++)
- if (G.player && G.player.currentPano && 2 === G.player.currentPano.alignmentType) this.ttagsshow.push(G.titletags[o]);
- else if ("dollhouse" !== G.player.mode && "floorplan" !== G.player.mode)
- if (this.hasroom) n = G.titletags[o], G.player.currentPano && G.model.panos.index[n.locationId] && G.player.currentPano.roomid === G.model.panos.index[n.locationId].roomid ? this.ttagsshow.push(G.titletags[o]) : this.ttagshide.push(G.titletags[o]);
- else {
- if ((i = (t = G.titletags[o].position)
- .clone()
- .distanceTo(r.position)) <= f.titletagMaxdistance) {
- var a = new c.Raycaster(r.position, r.position.clone()
- .sub(t)
- .normalize())
- .intersectObjects(G.model.colliders);
- if (a.length, !a.length || a[0].distance - i > -.5) {
- this.ttagsshow.push(G.titletags[o]);
- continue
- }
- }
- this.ttagshide.push(G.titletags[o])
- }
- else this.ttagshide.push(G.titletags[o]);
- this.ttposition()
- } else e(".viewport-tag")
- .css("display", "none")
- }, S.prototype.ttposition = function() {
- if (!this.ttagsshow) return !0;
- for (var t = G.player.camera.clone(), i = t.getWorldDirection(new c.Vector3), n = 0; n < this.ttagsshow.length; n++) {
- var r = this.ttagsshow[n],
- o = r.position;
- if (o.clone()
- .sub(t.position)
- .normalize()
- .angleTo(i) > Math.PI / 2) e("#titletag" + r.i)
- .css("display", "none");
- else {
- var a = o.clone()
- .project(t),
- s = (a.x + 1) / 2 * 100,
- l = (1 - a.y) / 2 * 100;
- e("#titletag" + r.i)
- .css({
- display: "",
- left: s + "%",
- top: l + "%"
- })
- }
- }
- for (n = 0; n < this.ttagshide.length; n++) e("#titletag" + this.ttagshide[n].i)
- .css("display", "none")
- }, S.prototype.updateRegionalJumpTags = function(t) {
- var e = null;
- for (var i in this.model.mattertags) {
- var n = this.model.mattertags[i],
- r = n.data;
- i >= 3e4 && (t.roomid === n.data.roomidx ? (n.isTargetRoomHavePoint = !1, e = new c.Line3(new c.Vector3(r.base.x, 0, r.base.z), new c.Vector3(t.position.x, 0, t.position.z)), this.model.settings.locations.points.forEach((function(t) {
- t.roomidx === n.data.target_room && (n.isTargetRoomHavePoint = !0)
- })), !n.isTargetRoomHavePoint || e.distance() < 1 ? n.hide(0, 0) : n.show(0, 0)) : n.hide(0, 0))
- }
- }, S.prototype.hideAllMattertags = function(t, i) {
- function n() {
- ++o === this.totalMattertags && (this.model.tagsShown = !1, r.resolve())
- }
- var r = e.Deferred(),
- o = 0;
- for (var a in this.model.mattertags) {
- var s = this.model.mattertags[a];
- s.type !== M.RegionalJump && s.type !== M.Title && -1 !== s.tagid && -2 !== s.tagid && (s.hide(t, i)
- .done(n.bind(this)), s === this.activeTag && this.dismissActiveTag()), s.type !== M.RegionalJump && s.type !== M.Title && -1 !== s.tagid && -2 !== s.tagid ? (s.hide(t, i)
- .done(n.bind(this)), s === this.activeTag && this.dismissActiveTag()) : 12 === s.type && -1 !== s.tagid && -2 !== s.tagid && ++o === this.totalMattertags && (this.model.tagsShown = !1, r.resolve())
- }
- return r.promise()
- }, S.prototype.update360Tags = function(t) {
- var i = e.Deferred();
- for (var n in this.hideAllMattertags(f.mattertags.startup.fadeInDuration), this.model.mattertags) {
- var r = this.model.mattertags[n];
- if (r.type == M.Tag360T1 || 1 === r.subtype) {
- var o = this;
- setTimeout((function() {
- o.show360TagPanoId = t
- }), 600)
- }
- }
- return i.promise()
- }, S.prototype.hideAllMattertagsExceptType = function(t, i, n) {
- function r() {
- ++a === this.totalMattertags && (this.model.tagsShown = !1, o.resolve())
- }
- var o = e.Deferred(),
- a = 0;
- for (var s in this.model.mattertags) {
- var l = this.model.mattertags[s];
- l.type !== t && (l.hide(i, n)
- .done(r.bind(this)), l === this.activeTag && this.dismissActiveTag())
- }
- return o.promise()
- }, S.prototype.activateTag = function(t, e) {
- e = e || w.EXAMINE, this.activeTag = t, "panorama" === this.player.mode && (this.activeTag.type === M.IFrame || this.activeTag.type === M.ImageText || this.activeTag.type === M.ImageTextAudio || this.activeTag.type === M.Video || this.activeTag === M.IKEA ? document.getElementsByTagName("html")
- .item(0)
- .style.cursor = "default" : this.activeTag.type === M.Tag360T1 || (document.getElementsByTagName("html")
- .item(0)
- .style.cursor = "default", (this.activeTag.type != M.TextOnly && this.activeTag !== M.TextAudio || null != this.activeTag.label && "" != this.activeTag.label) && (this.activeTag.type == M.TagTo360 || this.activeTag.setHoverState(e === w.EXAMINE)))), this.tagState = e, T.error("=========emitTagEvent=======state", e), this.emit(y.TagActivated, t), this.emitTagEvent(t, e)
- }, S.prototype.activateAudioTag = function(t, e, i) {
- e = e || w.EXAMINE, this.activeTag = t, this.activeTag.setHoverState(e === w.EXAMINE, i), this.tagState = e, this.emit(y.TagActivated, t)
- }, S.prototype.activateOtherModelTag = function(t, e, i) {
- e = e || w.EXAMINE, this.activeTag = t, this.activeTag.setHoverState(e === w.EXAMINE, i), this.tagState = e, this.emit(y.TagActivated, t)
- }, S.prototype.dismissActiveTag = function(t) {
- if (null !== this.activeTag) {
- t ? this.lastAudioTag && this.lastAudioTag.setFreeState(!0, !0) : this.activeTag.setFreeState(!0);
- var e = this.activeTag;
- this.activeTag = null, this.tagState = w.IDLE, this.emit(y.TagDismissed, e)
- }
- }, S.prototype.dismissAudioActiveTag = function() {
- if (null != this.activeTag) {
- var t = this.activeTag;
- this.lastAudioTag.setFreeState(!0, !0), this.activeTag = null, this.tagState = w.IDLE, this.emit(y.TagDismissed, t)
- }
- }, S.prototype.pauseAudioTag = function() {
- null != this.lastAudioTag && this.lastAudioTag.setFreeState(!0, !0)
- }, S.prototype.openTag = function(t, e, i) {
- t && (this.activeTag = t, this.tagState = w.EXAMINE, t.setHoverState(!0, 0), e && e >= 0 && (this.toid = setTimeout(function() {
- this.closeTag(), i && i()
- }.bind(this), e)))
- }, S.prototype.closeTag = function() {
- e(".pctagcontainer")
- .fadeOut(300), e("#iframe-parent")
- .css("display", "none"), e(".help_back")
- .css("display", "none"), this.activeTag && (this.activeTag.stopAudio(), this.activeTag.setClosedState()), this.dismissExaminedTag(), this.activeTag = null, this.tagState = w.IDLE
- }, S.prototype.clickedOnTag = function(t, e, i) {
- var n, r, o, a, s, l, u, h = this;
- if (this.intersectTag.type === M.BuildingType) return i.stopPropagation(), !0;
- if (this.intersectTag.type === M.TagTo360 || this.intersectTag.type === M.Tag360T1) {
- if (i.stopPropagation(), this.director) {
- var d = function(t) {
- var e = -1;
- for (var i in h.player.model.images.list) h.player.model.images.list[i].sceneid == t && (e = i);
- return e
- }(this.intersectTag.tagInfoUrl); - 1 === d && (d = 0), this.director.goToHighlight(d)
- }
- return !0
- }
- if (this.intersectTag.type === M.RegionalJump) {
- i.stopPropagation();
- var p = (n = this.intersectTag.data.target_room, r = this.intersectTag.data.base, o = G.settings.locations.points, a = [], s = null, l = [], u = null, o && (o.forEach((function(t) {
- n === t.roomidx && (s = new c.Line3(new c.Vector3(r.x, 0, r.z), new c.Vector3(t.viewpoint.x, 0, t.viewpoint.y)), t.lineLength = s.distance(), l.push(s.distance()), a.push(t))
- })), l.sort((function(t, e) {
- return t - e
- })), a.forEach((function(t) {
- t.lineLength === l[0] && (u = t.locationid)
- }))), u),
- f = (function(t) {
- var e = G.settings.nestscenes.scenes,
- i = null,
- n = new c.Vector3,
- r = t.target_scene,
- o = new c.Vector3(t.base.x, 0, t.base.z),
- a = new c.Vector3(t.end_position.x, 0, t.end_position.z);
- e && (e.forEach((function(t) {
- r === parseInt(t.sceneid) && (i = t._camera._locationid)
- })), G.settings.locations.points.forEach((function(t) {
- i === t.locationid && n.copy(t.spot)
- .add((new c.Vector3)
- .subVectors(a, o))
- })))
- }(this.intersectTag.data), e);
- h.intersectTag.data.base, h.intersectTag.data.end_position;
- return f.model.panos.list.forEach((function(t) {
- p === t.id && f.flyToPano({
- pano: t
- })
- })), !0
- }
- if (!(this.intersectTag.type != M.TextOnly && this.intersectTag !== M.TextAudio || null != this.intersectTag.label && "" != this.intersectTag.label)) return !0;
- if (this.intersectTag.type == M.Pano) return !0;
- if (!t) return this.tagState !== w.EXAMINE ? (this.intersectTag.type === M.Audio ? (null == this.lastAudioTag && (this.lastAudioTag = this.intersectTag), this.intersectTag.i == this.lastAudioTag.i ? "active" == this.intersectTag.boardState ? this.dismissActiveTag(!0) : this.intersectTag.setHoverState(!0, 0) : (this.dismissActiveTag(!0), this.intersectTag.setHoverState(!0, 0), this.lastAudioTag = this.intersectTag)) : (this.pauseAudioTag(), this.dismissActiveTag(!0), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag.type === M.TextOnly || this.intersectTag.type === M.TextAudio || this.intersectTag === M.IKEA ? this.intersectTag.setHoverState(!0, 0) : this.intersectTag.setHoverState(!0)), this.activeTag = this.intersectTag, (this.intersectTag.type !== M.IFrame && this.intersectTag.type !== M.ImageText && this.intersectTag.type !== M.ImageTextAudio || this.intersectTag !== M.IKEA) && this.activeTag.examineMattertag(this.player, this.activateTag.bind(this)), this.tagState = w.EXAMINE, this.emit(y.TagNavigation, this.activeTag), !0) : (this.dismissActiveTag(!0), !1);
- if (this.tagState === w.IDLE) return this.intersectTag.type === M.Audio ? (null == this.lastAudioTag && (this.lastAudioTag = this.intersectTag), this.intersectTag.i == this.lastAudioTag.i ? this.activateAudioTag(this.intersectTag, w.EXAMINE, 1) : (this.dismissAudioActiveTag(), this.lastAudioTag = this.intersectTag, this.activateAudioTag(this.intersectTag, w.EXAMINE, 0))) : (this.pauseAudioTag(), this.dismissActiveTag(), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag.type === M.Video || this.intersectTag.type === M.TextOnly || this.intersectTag.type === M.TextAudio || this.intersectTag === M.IKEA ? this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0) : this.activateTag(this.intersectTag, w.EXAMINE));
- if (this.tagState === w.EXAMINE) return this.intersectTag !== this.activeTag ? this.intersectTag.type === M.Audio ? (this.pauseAudioTag(), this.dismissActiveTag(), this.lastAudioTag = this.intersectTag, this.activateAudioTag(this.intersectTag, w.EXAMINE, 1)) : (this.pauseAudioTag(), this.dismissActiveTag(), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag === M.IKEA ? this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0) : this.activateTag(this.intersectTag, w.EXAMINE)) : this.intersectTag.type === M.Audio ? (this.pauseAudioTag(), this.dismissActiveTag(), !1) : (this.dismissActiveTag(), this.intersectTag.type !== M.ImageText && this.intersectTag.type !== M.ImageTextAudio && this.intersectTag !== M.IKEA || this.intersectTag.label || this.intersectTag.data.details.description || this.intersectTag.tagInfoUrl || this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0), !1);
- if (this.tagState === w.BROWSE) {
- if (this.intersectTag.type !== M.Audio) return this.pauseAudioTag(), this.dismissActiveTag(), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag === M.IKEA ? this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0) : this.activateTag(this.intersectTag, w.EXAMINE);
- this.intersectTag.i == this.lastAudioTag.i ? (this.pauseAudioTag(), this.dismissActiveTag()) : (this.pauseAudioTag(), this.lastAudioTag = this.intersectTag, this.intersectTag.setHoverState(!0, 0))
- }
- }, S.prototype.disposeCursorFor360 = function(t) {
- t && t.type === M.Tag360T1 ? document.getElementsByTagName("html")
- .item(0)
- .style.cursor = "pointer" : document.getElementsByTagName("html")
- .item(0)
- .style.cursor = "default"
- }, S.prototype.intersectMattertag = (n = new c.Vector3, r = new c.Vector3, o = new c.Vector3, function(t, e, i) {
- var a = null,
- s = this.mattertagDiscs.filter((function(t) {
- return t.parent.visible
- }));
- if (s.length > 0) {
- var l = this.model.floors.reduce((function(t, e) {
- return e.hidden ? t : t.concat(e.collider.children)
- }), s);
- n.set(t.x, t.y, -1)
- .unproject(i), r.set(t.x, t.y, 1)
- .unproject(i), o.copy(r)
- .sub(n)
- .normalize(), this.raycaster.set(n, o);
- var u = this.raycaster.intersectObjects(l);
- u.length > 0 && -1 !== s.indexOf(u[0].object) && u[0].object.tag.type && ((a = u[0].object.tag)
- .i >= 3e4 ? a = G.model.mattertags[a.i] : a.i >= 1e4 && (a = G.model.mattertags[a.i - 1e4]))
- }
- return this.intersectTag = a, this.disposeCursorFor360(a), e && (this.activeTag && a !== this.activeTag && (this.tagState === w.BROWSE || this.tagState === w.EXAMINE && a) && this.dismissActiveTag(), a && a !== this.activeTag && (a.listeners("enter")
- .length < 1 && (a.on("enter", function(t) {
- this.hoveredTag = t
- }.bind(this)), a.on("leave", function(t) {
- this.hoveredTag = null
- }.bind(this))), this.activateTag(a, w.BROWSE))), a
- }), S.prototype.rankedMattertagInDirection = (a = [], s = [], l = new c.Vector3, u = new c.Vector3, h = new c.Vector3, function(t, e, i, n) {
- var r = 0;
- s.length = 0;
- for (var o = 0; o < this.closestMattertags.length; o++) {
- var c = this.closestMattertags[o];
- u.copy(c.position), u.add(c.discPosition), l.copy(e), l.sub(u)
- .negate(), l.normalize();
- var d = l.dot(n);
- if (d >= 0 && (h.copy(u), h.project(i), this.intersectMattertag(h, !1, i))) {
- if (r >= a.length)
- for (var p = 0; p < 64; p++) a.push({
- tag: c,
- dot: d
- });
- var f = a[r];
- f.tag = c, f.dot = d, f.position = math.projectPositionToCanvas(u, i), s.push(f), r++
- }
- }
- return s.sort((function(t, e) {
- return t.dot > e.dot ? -1 : t.dot < e.dot ? 1 : 0
- })), t < s.length ? s[t].tag : null
- }), S.prototype.updateClosestTags = function() {
- var t = new c.Vector3;
- return function(e) {
- this.closestMattertags || (this.closestMattertags = []), this.closestMattertags.length = 0;
- var i = this.model.mattertags;
- if (i)
- for (var n in i)
- if (i.hasOwnProperty(n)) {
- if (n >= 1e4) return;
- var r = i[n],
- o = r.position;
- t.copy(e), t.sub(o)
- .negate();
- var a = t.lengthSq();
- 12 !== r.type && a < 30 && this.closestMattertags.push(r)
- }
- }
- }(), S.prototype.emitTagEvent = function(t, e) {
- if (T.warn("=========emitTagEvent=======tag===mode", t, e), "-1" !== t.tagid) {
- var i = t.data.details,
- n = "";
- for (var r in e === w.EXAMINE ? e = "click" : e === w.BROWSE && (e = "hover"), t.type === M.TextOnly && (i.orientationAndPosition = t.getBillboardOrientationAndPosition(this.player.camera)), M)
- if (i.templatetype === M[r]) {
- n = r, i.type = r;
- break
- } var o = {
- tagId: t.tagid,
- type: n,
- mode: e,
- detail: i
- };
- "click" === e && (this.tagState = w.BROWSE, this.activeTag = t), this.emit("tagActiveEvent", o)
- }
- }, t.exports = S
- })
- .call(this, i(6))
- }, function(t, e) {
- t.exports = {
- IDLE: "idle",
- BROWSE: "browse",
- EXAMINE: "examine"
- }
- }, function(t, e, i) {
- (function(e) {
- function n(t) {
- 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 = t.concurrentDownloads || 1, this.downloadTestResults = {}
- }
- var r, o, a, s, l = i(0),
- u = (i(5), i(1)),
- h = (i(19), i(2)),
- c = (i(18), i(23), i(76)),
- d = i(38),
- p = i(30),
- f = (i(29), i(65)),
- m = i(36),
- g = i(11),
- v = i(4)
- .EventEmitter,
- y = (new h(e), Object.freeze({
- Testing: 1,
- Success: 2,
- Fail: 3
- }));
- n.prototype = Object.create(v.prototype), n.IDLE_REFRESH_DELAY = 500, n.ACTIVE_REFRESH_DELAY = 0, n.DOWNLOAD_RETRIES = 4, n.prototype.init = function(t) {
- this.qualityManager = t
- }, n.prototype.setUrls = function(t) {
- this.urls = t
- }, n.prototype.setPanoData = function(t, e, i) {
- this.panos = t, this.imagePanos = e, this.panoGroupId = i
- }, n.prototype.start = function() {
- this.refreshUpdateInterval(0)
- }, n.prototype.stop = function() {
- window.cancel(this.refreshInterval)
- }, n.prototype.refreshUpdateInterval = function(t) {
- t || (t = 0), this.refreshInterval = window.setTimeout(function() {
- this.update() ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
- }.bind(this), t)
- }, n.prototype.update = function() {
- var t = this.forceQueue.length > 0;
- return this.processQueueForDownloading(this.forceQueue), this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos), this.priorityQueue.length > 0 && (t = !0), this.processQueueForDownloading(this.priorityQueue)), t
- }, n.prototype.forceQueueTilesForPano = (a = [], s = [], function(t, e, i, n, r, o) {
- a.length = 0;
- for (var l = this.getTileDownloadDescriptors(t, e), u = 0; u < l.length; u++) {
- var h = l[u];
- h.status !== f.None && h.status !== f.Queued || a.push(h)
- }
- if (i && a.length > 0) {
- d.sortPanoTiles(a, t, i), s.length = 0, p.matchingTilesInDirection(t, e, i, n, r, s);
- for (var c = 0, m = function(t) {
- return t.face === g.face && t.faceTileIndex === g.faceTileIndex
- }; c < a.length;) {
- var g = a[c];
- s.findIndex(m) < 0 ? a.splice(c, 1) : c++
- }
- }
- for (var v = 0; v < a.length; v++) this.forceQueue.push(a[v]);
- this.setStatusForAllDescriptors(this.forceQueue, f.ForceQueued), this.clearFromQueue(this.priorityQueue, f.ForceQueued, !1), o && this.processQueueForDownloading(this.forceQueue, !0)
- }), n.prototype.clearForceQueue = function() {
- this.clearQueue(this.forceQueue)
- }, n.prototype.queuePrioritizedTilesForPanos = function(t) {
- this.tilePrioritizer && (this.clearQueue(this.priorityQueue), this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, t, this), this.clearFromQueue(this.priorityQueue, f.None, !0), this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, f.Queued))
- }, n.prototype.clearQueue = function(t) {
- this.setStatusForAllDescriptors(t, f.None), t.length = 0
- }, n.prototype.clearFromQueue = function(t, e, i) {
- for (var n = 0; n < t.length; n++) {
- var r = t[n];
- r && (e === r.status && !i || e !== r.status && i) && (t[n] = null)
- }
- }, n.prototype.setStatusForAllDescriptors = function(t, e) {
- for (var i = 0; i < t.length; i++) {
- var n = t[i];
- n && (n.status = e)
- }
- }, n.prototype.setStatusOrRemoveForAllDescriptors = function(t, e) {
- for (var i = 0; i < t.length; i++) {
- var n = t[i];
- n && (n.status !== e ? n.status = e : t[i] = null)
- }
- }, n.prototype.getTileDownloadDescriptors = function(t, e) {
- var i = this.getAllTileDownloadDescriptorsForPano(t),
- n = i[e];
- return n || (n = this.buildDownloadDescriptorArray(e), i[e] = n, this.initTileDownloadDescriptors(n, t, e)), n
- }, n.prototype.getAllTileDownloadDescriptorsForPano = function(t) {
- var e = this.downloadDescriptors[t.id];
- return e || (e = {}, this.downloadDescriptors[t.id] = e), e
- }, n.prototype.processQueueForDownloading = function(t, e) {
- if (this.cleanupActiveDownloads(), this.activeDownloads.length < this.concurrentDownloads || e)
- for (var i = e ? t.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && t.length > 0; r++) {
- var o = t.shift();
- o && (this.startDownload(o), n++)
- }
- }, n.prototype.testDownload = function(t, e, i) {
- var n = this.downloadTestResults[t];
- if (n) n === y.Success ? i(!0) : n === y.Fail && i(!1);
- else {
- this.downloadTestResults[t] = y.Testing;
- var r = this.panos.list[0],
- o = this.getTileUrl(r.id, t, e, 0),
- a = function(e) {
- this.downloadTestResults[t] = y.Success, i(!0)
- }.bind(this),
- s = function() {
- this.downloadTestResults[t] = y.Fail, i(!1)
- }.bind(this);
- this.loadImage(o, 0, a, s)
- }
- }, n.prototype.startDownload = function(t) {
- t.status = f.Downloading;
- var e = this.getTileUrl(t.pano.id, t.panoSize, t.tileSize, t.tileIndex);
- this.activeDownloads.push(t), this.loadImage(e, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, t), this.downloadFailed.bind(this, t))
- }, n.prototype.downloadFailed = function(t, e) {}, n.prototype.downloadComplete = function(t, e) {
- if (t.panoGroupId === this.panoGroupId) {
- var i = this.getPanoLoadCallbacks(t.pano, t.panoSize);
- t.status = f.Downloaded, i && i.onProgress && i.onProgress(t.pano, t.panoSize);
- var n = {
- panoId: t.pano.id,
- image: e,
- tileSize: t.tileSize,
- panoSize: t.panoSize,
- tileIndex: t.tileIndex,
- faceTileIndex: t.faceTileIndex,
- totalTiles: t.totalTiles,
- face: t.face,
- tileX: t.tileX,
- tileY: t.tileY,
- direction: t.direction
- };
- t.image = e, this.emit(c.TileDownloadSuccess, n), this.isPanoDownloaded(t.pano, t.panoSize) && (n = {
- panoId: t.pano.id,
- tileSize: t.tileSize,
- panoSize: t.panoSize
- }, this.emit(c.PanoDownloadComplete, n), i && i.onLoad && i.onLoad(t.pano, t.panoSize))
- }
- }, n.prototype.cleanupActiveDownloads = function() {
- var t = [];
- return function() {
- t.length = 0;
- for (var e = 0; e < this.activeDownloads.length; e++) {
- var i = this.activeDownloads[e];
- i.status !== f.Downloaded && i.status !== f.Failed && t.push(i)
- }
- this.activeDownloads.length = 0, this.activeDownloads.push.apply(this.activeDownloads, t)
- }
- }(), n.prototype.isPanoDownloaded = function(t, e) {
- var i = this.getTileDownloadDescriptors(t, e);
- if (i.length <= 0) return !1;
- for (var n = 0; n < i.length; n++) {
- if (i[n].status !== f.Downloaded) return !1
- }
- return !0
- }, n.prototype.setPanoLoadCallbacks = function(t, e, i, n, r) {
- var o = t.id + ":" + this.qualityManager.getPanoSize(e);
- this.panoLoadCallbacks[o] = {
- onLoad: i,
- onFail: n,
- onProgress: r
- }
- }, n.prototype.getPanoLoadCallbacks = function(t, e) {
- var i = t.id + ":" + e;
- return this.panoLoadCallbacks[i]
- }, n.prototype.buildDownloadDescriptorArray = function(t) {
- for (var e = p.getTileCountForSize(t), i = [], n = 0; n < e; n++) {
- var r = this.buildDownloadDescriptor();
- i.push(r)
- }
- return i
- }, n.prototype.buildDownloadDescriptor = function() {
- return {
- panoGroupId: null,
- pano: null,
- panoSize: -1,
- tileSize: -1,
- tileIndex: -1,
- totalTiles: -1,
- faceTileIndex: -1,
- status: f.None,
- url: null,
- image: null,
- direction: new l.Vector3,
- face: -1,
- cubeFace: -1,
- tileX: -1,
- tileY: -1
- }
- }, n.prototype.initTileDownloadDescriptors = function(t, e, i) {
- for (var n = 0; n < t.length; n++) {
- var r = t[n];
- this.initTileDownloadDescriptor(r, e, i, n)
- }
- }, n.prototype.initTileDownloadDescriptor = function(t, e, i, n) {
- var r = i >= p.TILE_SIZE ? p.TILE_SIZE : i;
- t.face = p.getFaceForTile(i, n), t.cubeFace = m.mapFaceToCubemapFace(t.face), t.panoGroupId = this.panoGroupId, t.pano = e, t.panoSize = i, t.tileSize = r, t.tileIndex = n, t.totalTiles = p.getTileCountForSize(i), t.status = f.None, t.image = null, p.getTileLocation(t.panoSize, t.tileIndex, t), p.getTileVector(t.panoSize, t.tileSize, t.cubeFace, t.tileX, t.tileY, p.LocationOnTile.Center, 0, t.direction)
- }, n.prototype.getTileUrl = (r = {
- 256: "256",
- 512: "512",
- 1024: "1k",
- 2048: "2k",
- 4096: "4k"
- }, o = {
- face: -1,
- faceTileIndex: -1,
- tileX: -1,
- tileY: -1
- }, function(t, e, i, n) {
- p.getTileLocation(e, n, o);
- var a = Math.floor(e / i),
- s = a * a,
- l = Math.floor(n / s),
- h = "";
- return 1 === u.tiling.customCompression && (h = "_" + u.tiling["q" + r[e]]), this.urls.get("multiple/" + t + "/" + r[e] + h + "_face" + l + "_" + o.tileX + "_" + o.tileY + ".jpg")
- }), n.prototype.loadImage = function(t, e, i, n) {
- g.getImage(t, e)
- .then((function(t) {
- i(t)
- }))
- .fail(n)
- }, t.exports = n
- })
- .call(this, "/js/tile/TileDownloader.js")
- }, function(t, e, i) {
- function n(t) {
- var e, i = {
- renderTarget: null,
- inUse: !1,
- size: -1,
- pano: null
- };
- return i.inUse = !0, i.size = t, e = i, E.push(e), i
- }
- function r(t) {
- for (var e = 0; e < E.length; e++) {
- var i = E[e];
- if (i.renderTarget === t) return i.inUse = !1, !0
- }
- return !1
- }
- function o() {
- 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 u.Vector3, this.initTime = -1, this.maxBaseUploadsPerFrame = A, this.maxNonBaseUploadsPerFrame = _
- }
- function a() {
- this.uploadIntervalCancelled || this.overlayTilesLoaded || (this.usingTileOverlay ? this.refreshUploadInterval(this.uploadIntervalDelay) : (M = !0, this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), this.peekNextFromUploadQueue() ? this.refreshUploadInterval(T) : this.uploadInterval = null))
- }
- var s, l, u = i(0),
- h = i(14),
- c = i(1),
- d = i(23),
- p = i(55),
- f = i(48),
- m = i(76),
- g = i(18),
- v = i(200),
- y = i(38),
- b = i(30),
- w = i(36),
- x = i(4)
- .EventEmitter,
- M = !1,
- T = c.tiling.uploadIntervalDelay,
- S = c.tiling.initialIntervalDelay,
- _ = c.tiling.maxNonBaseUploadsPerFrame,
- A = c.tiling.maxBaseUploadsPerFrame,
- P = 0,
- C = 1,
- E = [];
- o.prototype = Object.create(x.prototype), o.prototype.init = function(t, e, i) {
- this.sceneRenderer = t, this.tileDownloader = e, this.qualityManager = i, this.bindEvents(), this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)), this.initTime = performance.now()
- }, o.prototype.getActivePanoTextures = function(t) {
- t = t || [];
- for (var e = 0; e < E.length; e++) {
- var i = E[e];
- i.renderTarget && i.renderTarget.texture && t.push(i.renderTarget.texture)
- }
- }, o.prototype.hasQueuedTiles = function() {
- var t = this.peekNextFromUploadQueue();
- return null != t
- }, o.prototype.getActiveRenderTargetDescriptor = function(t) {
- return this.activeRenderTargetDescriptors[t]
- }, o.prototype.setActiveRenderTargetDescriptor = function(t, e) {
- this.activeRenderTargetDescriptors[t] = e
- }, o.prototype.loadOverlayTiles = function() {
- if (0 !== c.tiling.overlayStyle) {
- var t = 0,
- e = function(e, n, r) {
- e = n ? e[n] = this.sceneRenderer.initSizedTexture2D(b.TILE_SIZE, u.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(b.TILE_SIZE, u.ClampToEdgeWrapping), this.sceneRenderer.uploadTexture2D(r, e, 0, 0, b.TILE_SIZE, b.TILE_SIZE), ++t === i.length && (this.overlayTilesLoaded = !0)
- }.bind(this),
- i = [
- ["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)],
- ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)],
- ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)],
- ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)],
- ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)],
- ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)],
- ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)],
- ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)],
- ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)],
- ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)],
- ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]
- ];
- i.forEach(function(t) {
- this.tileDownloader.loadImage(t[0], 0, t[1])
- }.bind(this)), this.usingTileOverlay = !0
- } else this.usingTileOverlay = !1
- }, o.prototype.bindEvents = function() {
- this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
- }, o.prototype.setupZoomRenderTarget = function() {
- if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
- if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) return;
- var t = this.zoomRenderTarget;
- if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1), t) {
- var e = t.width,
- i = this.zoomRenderTarget.width;
- this.sceneRenderer.copyCubeMap(t.texture, this.zoomRenderTarget, e, e, i, i), t.texture.dispose(), t.texture.loaded = !1, t.texture.version = 0, this.sceneRenderer.deallocateCubeTexture(t.texture), t.texture = null
- }
- this.zoomPanoRenderingDisabled = !1
- } else this.zoomPanoRenderingDisabled = !0
- }, o.prototype.enableUltraHighQualityMode = function(t) {
- if (!this.qualityManager.ultraHighQualityModeEnabled()) {
- var e = this.qualityManager.getPanoSize(d.ULTRAHIGH);
- this.tileDownloader.testDownload(e, b.TILE_SIZE, function(e) {
- e && (this.qualityManager.enableUltraHighQualityMode(), this.setupZoomRenderTarget(), t())
- }.bind(this))
- }
- }, o.prototype.activateTiledPano = function(t, e, i) {
- i && this.clearAllQueuedUploads();
- for (var o = 0; o < b.FACES_PER_PANO; o++) this.initTileTree(t.id, o, this.qualityManager.getMaxPossiblePanoSize());
- this.linkAllTilesAndNodes(t);
- var a = this.getActiveRenderTargetDescriptor(t.id);
- if (e > this.qualityManager.getMaxNavPanoSize() && (e = this.qualityManager.getMaxNavPanoSize()), !a || e !== a.size) {
- if (a && r(a.renderTarget), !(a = function(t) {
- for (var e = 0; e < E.length; e++) {
- var i = E[e];
- if (!i.inUse && i.size === t) return i.inUse = !0, i
- }
- return null
- }(e))) {
- var s = this.initTiledPano(e, !1);
- (a = n(s.width))
- .renderTarget = s
- }
- a.pano = t, this.resetPanoDescriptor(t.id), this.resetPanoLODDescriptors(t.id), this.resetRenderStatus(t.id, !0, !0)
- }
- this.setActiveRenderTargetDescriptor(t.id, a);
- var l = i ? 0 : 1;
- return this.updateActivePanos(t, l), a.renderTarget
- }, o.prototype.deactivateTiledPano = function(t) {
- var e = this.getActiveRenderTargetDescriptor(t.id);
- this.isRenderTargetDescriptorValid(e) && r(e.renderTarget), this.setActiveRenderTargetDescriptor(t.id, null);
- var i = this.getUploadQueueForPano(t.id);
- this.clearUploadQueue(i), this.updateActivePanos()
- }, o.prototype.updateActivePanos = (s = [], function(t, e) {
- s.length = 0;
- for (var i = 0; i < this.activePanos.length; i++) {
- t && s.length === e && s.push(t);
- var n = this.activePanos[i],
- r = this.getActiveRenderTargetDescriptor(n.id);
- t && n.id === t.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
- }
- t && e >= s.length && s.push(t), this.activePanos.length = 0, this.activePanos.push.apply(this.activePanos, s)
- }), o.prototype.getActivePanoCount = function() {
- return this.activePanos.length
- }, o.prototype.resetRenderStatus = function(t, e, i, n) {
- var r = function(t, n, r, o) {
- i && (n.tile.zoomUploaded = !1), e && (n.tile.uploaded = !1)
- },
- o = null;
- n && (o = v.getLevelCountForSize(b.TILE_SIZE, n) + 1);
- for (var a = 0; a < b.FACES_PER_PANO; a++) {
- this.getTileTree(t, a)
- .breadthFirst({
- callback: r.bind(this, a),
- minLevel: o
- })
- }
- }, o.prototype.copyBaseRenderStatusToZoomed = function(t) {
- for (var e = v.getLevelCountForSize(b.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(t, e, i, n) {
- e.tile.zoomUploaded = e.tile.uploaded, e.zoomCovered = e.covered
- }, n = 0; n < b.FACES_PER_PANO; n++) {
- this.getTileTree(t, n)
- .breadthFirst({
- callback: i.bind(this, n),
- maxLevel: e
- })
- }
- }, o.prototype.renderPanoTiles = (l = [], function(t, e, i, n) {
- this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(), e = e || this.direction || g.FORWARD;
- var r = this.getActiveRenderTargetDescriptor(t);
- if (!this.isRenderTargetDescriptorValid(r)) throw new h("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
- for (var o = 0; o < b.FACES_PER_PANO; o++) {
- var a = this.getTileTree(t, o);
- l.length = 0, a.breadthFirst({
- saveVisited: l
- });
- for (var s = 0; s < l.length; s++) {
- var u = l[s];
- this.queueTileUpload(u.tile, !1, n || 0 === s && i)
- }
- }
- this.updateDirection(e)
- }), o.prototype.isRenderTargetDescriptorValid = function(t) {
- return t && t.renderTarget
- }, o.prototype.isPanoActive = function(t) {
- var e = this.getActiveRenderTargetDescriptor(t);
- return this.isRenderTargetDescriptorValid(e)
- }, o.prototype.isPanoZoomed = function(t) {
- return this.zoomingActive && this.zoomPanoId === t
- }, o.prototype.initTileTree = function(t, e, i) {
- var n = this.tileTrees[t];
- n || (n = [], this.tileTrees[t] = n);
- var r = n[e];
- if (!r) {
- var o = v.getLevelCountForSize(b.TILE_SIZE, i);
- r = new v(b.TILE_SIZE, o), n[e] = r
- }
- }, o.prototype.getTileTree = function(t, e) {
- var i = this.tileTrees[t];
- if (!i) throw new h("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
- var n = i[e];
- if (!n) throw new h("PanoRenderer.getTileTree() -> Tree not yet initialized!");
- return n
- }, o.prototype.initTiledPano = function(t, e) {
- var i = this.sceneRenderer.renderer,
- n = (i.context, new u.WebGLRenderTargetCube(t, t, {
- stencilBuffer: !1
- })),
- r = new u.CubeTexture([]);
- n.texture = r, r.image = [null, null, null, null, null, null], r.flipY = !0, e ? (r.generateMipmaps = !0, r.magFilter = u.LinearFilter, r.minFilter = u.LinearMipMapLinearFilter) : (r.generateMipmaps = !1, r.magFilter = u.LinearFilter, r.minFilter = u.LinearFilter), r.format = u.RGBAFormat, i.setRenderTarget(n), i.setRenderTarget(null);
- var o = i.properties.get(r);
- return o.__image__webglTextureCube = o.__webglTexture, n
- }, o.prototype.getUploadQueueForPano = function(t) {
- var e = this.uploadQueues[t];
- return e || (e = [], this.uploadQueues[t] = e), e
- }, o.prototype.isTileUploaded = function(t) {
- return this.isPanoZoomed(t.panoId) ? t.zoomUploaded : t.uploaded
- }, o.prototype.setUploaded = function(t, e) {
- this.isPanoZoomed(t.panoId) ? t.zoomUploaded = e : t.uploaded = e
- }, o.prototype.queueTileUpload = function(t, e, i) {
- var n = this.getActiveRenderTargetDescriptor(t.panoId);
- if (this.isRenderTargetDescriptorValid(n) && t.downloaded && !this.isTileUploaded(t) && (!t.uploadQueued || i) && (!(t.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
- var r = this.getUploadQueueForPano(t.panoId);
- i ? this.uploadTile(t, !1) : (this.shoulPushToFrontOfQueue(t) ? this.forceQueue.push(t) : e && this.direction ? y.insertSortedPanoTile(r, t, n.pano, this.direction) : r.push(t), t.uploadQueued = !0, this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
- }
- }, o.prototype.shoulPushToFrontOfQueue = function(t) {
- return 0 === v.getLevelCountForSize(b.TILE_SIZE, t.panoSize)
- }, o.prototype.getTopUploadQueue = function() {
- for (var t = null, e = null, i = P; i <= C; i++)
- for (var n = 0; n < this.activePanos.length; n++)
- if (t = this.activePanos[n], (e = this.getUploadQueueForPano(t.id))
- .length > 0) switch (i) {
- case P:
- if (0 === e[0].level) return e;
- break;
- case C:
- return e
- }
- return null
- }, o.prototype.getNextFromUploadQueue = function() {
- var t = function(t) {
- var e = t.shift();
- return e.uploadQueued = !1, e
- };
- return function() {
- if (this.forceQueue.length > 0) return t(this.forceQueue);
- var e = this.getTopUploadQueue();
- return e && e.length > 0 ? t(e) : null
- }
- }(), o.prototype.peekNextFromUploadQueue = function() {
- if (this.forceQueue.length > 0) return this.forceQueue[0];
- var t = this.getTopUploadQueue();
- return t && t.length > 0 ? t[0] : null
- }, o.prototype.clearAllQueuedUploads = function() {
- this.clearAllUploadQueues(null, 0)
- }, o.prototype.clearAllQueuedUploadsForPano = function(t) {
- this.clearAllUploadQueues(t, 0)
- }, o.prototype.clearAllUploadQueues = function(t, e) {
- if (t) this.clearUploadQueue(this.getUploadQueueForPano(t), e), this.clearUploadQueue(this.forceQueue, e, t);
- else {
- for (var i = 0; i < this.activePanos.length; i++) {
- var n = this.activePanos[i];
- this.clearUploadQueue(this.getUploadQueueForPano(n.id), e)
- }
- this.clearUploadQueue(this.forceQueue, e)
- }
- }, o.prototype.clearUploadQueue = function(t, e, i) {
- null != e || (e = 0);
- for (var n = 0; n < t.length;) {
- var r = t[n];
- (!i || i && i === r.tile.panoId) && r.level >= e ? (r.uploadQueued = !1, t.splice(n, 1)) : n++
- }
- }, o.prototype.refreshUploadInterval = function() {
- var t = null;
- return function(e) {
- this.uploadIntervalCancelled || (t || (t = a.bind(this)), null != e || (e = T), M || (e = S), this.uploadInterval = window.setTimeout(t, e), this.uploadIntervalDelay = e)
- }
- }(), o.prototype.update = function() {
- var t = performance.now(),
- e = 0;
- return function() {
- this.uploadIntervalCancelled = !0, window.clearTimeout(this.uploadInterval), this.uploadInterval = null, !(performance.now() - t > T || 0 === e) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), t = performance.now()), e++
- }
- }(), o.prototype.updateUploadQueue = function(t, e) {
- t || (t = 1);
- for (var i = 0, n = 0; !(n >= e || i >= t);) {
- var r = this.getNextFromUploadQueue();
- if (!r) break;
- if (0 !== r.level ? i++ : n++, !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
- var o = this.getActiveRenderTargetDescriptor(r.panoId);
- this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
- }
- }
- }, o.prototype.updateDirection = function(t) {
- if (t = t || this.direction) {
- this.direction = t;
- for (var e = 0; e < this.activePanos.length; e++) {
- var i = this.activePanos[e],
- n = this.getUploadQueueForPano(i.id);
- y.sortPanoTiles(n, i, this.direction)
- }
- }
- }, o.prototype.uploadTile = function() {
- var t = {},
- e = (new u.Vector4, c.tiling.overlayStyle);
- return function(i, n) {
- var r = i.panoId,
- o = i.image,
- a = i.tileSize,
- s = i.panoSize,
- l = i.tileIndex,
- h = (i.faceTileIndex, i.totalTiles),
- c = (i.face, i.tileX),
- d = i.tileY,
- f = !0,
- m = !1,
- g = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
- v = this.getActiveRenderTargetDescriptor(r),
- y = v.renderTarget,
- b = v.size;
- if (this.isPanoZoomed(r) && (y = this.zoomRenderTarget, b = this.qualityManager.getMaxZoomPanoSize()), this.isRenderTargetDescriptorValid(v) || (f = !1, m = !1), n || (this.anyUploaded(i.node) && (f = !1, m = !0), this.isTileUploaded(i) && (f = !1, m = !1)), f) {
- var w = a / s * b,
- x = c * a / s * b,
- M = d * a / s * b;
- t[a] || (t[a] = this.sceneRenderer.initSizedTexture2D(a, u.ClampToEdgeWrapping));
- var T = t[a];
- if (this.sceneRenderer.uploadTexture2D(o, T, 0, 0, a, a), 1 === e || 2 === e) {
- var S = 1 === e ? this.overlayTilesBasic : this.overlayTilesEnhanced;
- this.sceneRenderer.renderToCubeMap(T, y, a, a, 0, 0, a, a, x, M, w, w, i.cubeFace), this.sceneRenderer.renderToCubeMap(S[s], y, a, a, 0, 0, a, a, x, M, w, w, i.cubeFace, u.NormalBlending, !0, .5)
- } else this.sceneRenderer.renderToCubeMap(T, y, a, a, 0, 0, a, a, x, M, w, w, i.cubeFace);
- g.uploadCount++, this.emit(p.TileRenderSuccess, r, s, l, h), g.uploadCount === h && this.emit(p.PanoRenderComplete, r, s, h), this.setUploaded(i, !0), this.addCoverageForNode(i.node)
- } else this.setUploaded(i, !1);
- return i.uploadAttempted || (g.uploadAttempts++, this.emit(p.TileUploadAttempted, r, s, l, h)), i.uploadAttempted = !0, g.uploadAttempts === h && this.emit(p.UploadAttemptedForAllTiles, r, s, h), m
- }
- }(), o.prototype.linkTileAndNode = function(t, e) {
- e.tile = t, t.node = e
- }, o.prototype.linkAllTilesAndNodes = function(t) {
- for (var e = function(e, i, n, r, o) {
- var a = this.getTileDirectoryEntry(t.id, i, r, o);
- this.linkTileAndNode(a, n)
- }, i = 0; i < b.FACES_PER_PANO; i++) {
- var n = this.getTileTree(t.id, i);
- n.breadthFirst({
- callback: e.bind(this, n, i)
- })
- }
- }, o.prototype.anyUploaded = function(t) {
- if (!t) return !1;
- if (t.tile && this.isTileUploaded(t.tile)) return !0;
- if (t.children)
- for (var e = 0; e < t.children.length; e++) {
- var i = t.children[e];
- if (this.anyUploaded(i)) return !0
- }
- return !1
- }, o.prototype.setNodeCovered = function(t, e) {
- this.isPanoZoomed(t.tile.panoId) ? t.zoomCovered = e : t.covered = e
- }, o.prototype.isNodeCovered = function(t) {
- return !!t && (this.isPanoZoomed(t.tile.panoId) ? t.zoomCovered : t.covered)
- }, o.prototype.addCoverageForNode = function(t) {
- if (this.setNodeCovered(t, !0), t.parent && t.covered) {
- var e = t.parent;
- this.nodeSubcovered(e) && this.addCoverageForNode(e, !0)
- }
- }, o.prototype.calcFullCoverage = function(t) {
- var e = !1;
- if (t.children)
- for (var i = 0; i < t.children.length; i++) {
- var n = t.children[i];
- e = e || this.calcFullCoverage(n)
- }
- t.covered = t.tile.uploaded || e
- }, o.prototype.nodeSubcovered = function(t) {
- if (!t.children) return !1;
- for (var e = 0; e < t.children.length; e++)
- if (!t.children[e] || !this.isNodeCovered(t.children[e])) return !1;
- return !0
- }, o.prototype.resetPanoDescriptor = function(t) {
- this.getPanoDescriptor(t)
- }, o.prototype.getPanoDescriptor = function(t) {
- var e = this.panoDescriptors[t];
- return e || (e = {}, this.panoDescriptors[t] = e), e
- }, o.prototype.resetPanoLODDescriptors = function(t) {
- var e = this.getPanoLODDescriptors(t);
- for (var i in e)
- if (e.hasOwnProperty(i)) {
- var n = e[i];
- n.uploadCount = 0, n.uploadAttempts = 0
- }
- }, o.prototype.getPanoLODDescriptor = function(t, e) {
- var i = this.getPanoLODDescriptors(t),
- n = i[e];
- return n || (n = {
- uploadCount: 0,
- uploadAttempts: 0
- }, i[e] = n), n
- }, o.prototype.getPanoLODDescriptors = function(t) {
- var e = this.panoLODDescriptors[t];
- return e || (e = {}, this.panoLODDescriptors[t] = e), e
- }, o.prototype.onTileDownloaded = function(t) {
- var e = v.getLevelCountForSize(b.TILE_SIZE, t.panoSize),
- i = this.getTileDirectoryEntry(t.panoId, t.face, e, t.faceTileIndex);
- if (i.downloaded = !0, i.image = t.image, i.panoSize = t.panoSize, i.tileX = t.tileX, i.tileY = t.tileY, i.totalTiles = t.totalTiles, i.tileIndex = t.tileIndex, i.faceTileIndex = t.faceTileIndex, i.face = t.face, i.cubeFace = w.mapFaceToCubemapFace(t.face), i.panoId = t.panoId, i.tileSize = t.tileSize, i.direction = (new u.Vector3)
- .copy(t.direction), i.node = null, i.level = v.getLevelCountForSize(b.TILE_SIZE, i.panoSize), this.isPanoActive(i.panoId)) {
- var n = this.getTileTree(i.panoId, i.face)
- .getSubNode(i.panoSize, i.tileX, i.tileY);
- this.linkTileAndNode(i, n), this.queueTileUpload(i, !0)
- }
- }, o.prototype.getTileDirectoryEntry = function(t, e, i, n) {
- var r = this.tileDirectory[t];
- r || (r = {}, this.tileDirectory[t] = r);
- var o = 16384 * e + 1024 * i + n,
- a = r[o];
- return a || (a = {
- downloaded: !1,
- uploaded: !1,
- zoomUploaded: !1
- }, r[o] = a), a._key = t + ":" + e + ":" + i + ":" + n, a._tileKey = o, a
- }, o.prototype.setZoomingActive = function(t, e, i) {
- this.zoomPanoRenderingDisabled || t === this.zoomingActive && this.zoomPanoId === e.id || (this.zoomingActive = t, this.zoomPanoId = e.id, this.zoomingActive && (this.zoomPanoId !== e.id || i) && this.updateZoomedPanoFromBase(e))
- }, o.prototype.updateZoomedPanoFromBase = function(t) {
- if (!this.zoomPanoRenderingDisabled) {
- var e = this.getActiveRenderTargetDescriptor(t.id);
- if (e && e.renderTarget) {
- var i = this.qualityManager.getMaxZoomPanoSize(),
- n = e.renderTarget,
- r = e.size;
- this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i), this.copyBaseRenderStatusToZoomed(t.id)
- }
- }
- }, t.exports = o
- }, function(t, e) {
- function i(t) {
- t.root = function t(e, i, r) {
- if (r > e.levels) return null;
- var o = new n(e, i);
- e.allNodes.push(o);
- for (var s = 0; s < a; s++) o.children[s] = t(e, o, r + 1);
- return o
- }(t, null, 0)
- }
- function n(t, e) {
- this.tree = t, this.parent = e, this.children = [], this.id = ++r
- }
- var r = 0,
- o = 2,
- a = o * o;
- function s(t, e) {
- this.levels = e, this.tileSize = t, this.root = null, this.allNodes = [], i(this)
- }
- s.TraversalType = Object.freeze({
- PreOrder: 0,
- PostOrder: 1
- }), s.getLevelCountForSize = function(t, e) {
- var i = 0;
- for (e < t && (e = t); !((e /= o) < t);) i++;
- return i
- }, s.getSizeForLevel = function(t, e) {
- return Math.pow(o, e) * t
- }, s.prototype.getSubNode = function(t, e, i) {
- (!e || t < this.tileSize) && (e = 0), (!i || t < this.tileSize) && (i = 0), t < this.tileSize && (t = this.tileSize);
- var n = s.getLevelCountForSize(this.tileSize, t);
- return function t(e, i, n, r, a) {
- if (!e) return null;
- if (0 === n) return e;
- if (!e.children || 0 === e.children.length) return null;
- var s = Math.pow(o, n) / o,
- l = r % s,
- u = a % s,
- h = Math.floor(a / s),
- c = Math.floor(r / s),
- d = h * o + c;
- return t(e.children[d], i + 1, n - 1, l, u)
- }(this.root, 0, n, e, i)
- }, s.prototype.breadthFirst = function(t) {
- var e = !!(t = t || {})
- .nullLevelEnd,
- i = t.maxLevel,
- n = t.minLevel,
- r = t.callback,
- o = t.saveVisited,
- a = [],
- s = {},
- l = 0;
- for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i);) {
- var u = a.shift();
- if (u === s)(!n || l >= n) && (r && e && r(null), o && e && o.push(null)), a.length > 0 && a.push(s), l++, 0;
- else {
- if (u.children)
- for (var h = 0; h < u.children.length; h++) {
- u.children[h] && a.push(u.children[h])
- }
- var c = this.getFaceIndexFromNode(u);
- (!n || l >= n) && (r && r(u, l, c), o && o.push(u))
- }
- }
- }, s.prototype.getFaceIndexFromNode = function(t) {
- if (!t) return -1;
- for (var e = 1, i = t, n = 0, r = 0;;) {
- var a = i.parent;
- if (!a) break;
- for (var s = -1, l = 0; l < a.children.length; l++) a.children[l] === i && (s = l);
- n = s % o * e + n, r = Math.floor(s / o) * e + r, e *= o, i = a
- }
- return r * e + n
- }, s.prototype.depthFirst = function(t, e, i) {
- ! function t(e, i, n, r, a, l, u, h) {
- if (e) {
- u = u || s.TraversalType.PreOrder;
- var c = r * o + n;
- if (u === s.TraversalType.PreOrder && (a && a(e, i, c, n, r), l && l.push(e)), e.children && 0 !== e.children.length) {
- for (var d = r * o, p = n * o, f = 0; f < o; f++)
- for (var m = 0; m < o; m++) t(e.children[m * o + f], i + 1, p + f, d + m, a, l, u, h);
- u === s.TraversalType.PostOrder && (a && a(e, i, c, n, r), l && l.push(e))
- }
- }
- }(this.root, 0, 0, 0, t, e, i, this.tileSize)
- }, t.exports = s
- }, function(t, e, i) {
- (function(e) {
- var n = i(0),
- r = i(5),
- o = i(4)
- .EventEmitter;
- function a() {
- this.enable = !1
- }
- a.prototype = Object.create(o.prototype), a.prototype.init = function(t) {
- this.lineLeft = this.buildPanoDom("left"), this.lineRight = this.buildPanoDom("right"), this.lineHeight = this.buildPanoDom("height"), this.frames = 0, this.checkedPoint = null, this.areaName = t ? t.areaName : null, this.raycaster = new n.Raycaster
- }, a.prototype.buildPanoDom = function(t) {
- var i = document.createElement("div");
- i.className = "pano-size-line", e("#pano-size")[0].appendChild(i);
- var n = document.createElement("em");
- i.appendChild(n);
- var r = document.createElement("div");
- r.className = "pano-size-label";
- var o = document.createElement("div");
- o.className = "pano-size-label-point";
- var a = document.createElement("div");
- return t && (a.className = "pano-size-label-name " + t), i.appendChild(r), r.appendChild(o), r.appendChild(a), i
- }, a.prototype.setEnable = function(t) {
- this.enable = t;
- var e = document.getElementById("pano-size");
- e.style.display = t ? "block" : "none"
- }, a.prototype.update = function(t) {
- if (this.enable) {
- var i, o, a = t.mode,
- s = t.camera,
- l = t.currentPano,
- u = l.floorIndex || 0,
- h = this.getFloorCeilingHeight(t);
- if (this.frames += 1, a !== r.PANORAMA || null === l || !l.areasPoints) return this.lineLeft.style.display = this.lineRight.style.display = this.lineHeight.style.display = "none", !1;
- for (var c, d = l.areasPoints, p = 0, f = [], m = [], g = this.checkedPoint, v = this.areaName, y = s.getWorldDirection(new n.Vector3), b = 0; b < d.length; b++) {
- var w = new n.Vector3(y.x, y.y, y.z),
- x = new n.Vector3(d[b].x - s.position.x, d[b].y - s.position.y, d[b].z - s.position.z);
- this.raycaster.set(s.position, x), m.push(w.angleTo(x)), f[p] = d[b], p++
- }
- for (var M = m.slice()
- .sort((function(t, e) {
- return t - e
- }))[0], T = 0; T < m.length; T++)
- if (M === m[T]) {
- var S = T;
- this.checkedPoint = T, this.areaName = l.areaName
- } if (v !== this.areaName && (g = null), g !== this.checkedPoint && g) return this.lineLeft.style.display = this.lineRight.style.display = this.lineHeight.style.display = "none", !1;
- this.lineLeft.style.display = this.lineRight.style.display = this.lineHeight.style.display = "block", c = {
- x: f[S].x,
- y: h[u],
- z: f[S].z
- }, i = 0 === S ? f[f.length - 1] : f[S - 1], o = S === f.length - 1 ? f[0] : f[S + 1], 0 === Math.round(f[S].y) && (f[S].y = 0 === S ? f[S + 1].y : f[0].y);
- var _ = this.getAngleAndDistance(f[S], c, s),
- A = this.getAngleAndDistance(f[S], i, s),
- P = this.getAngleAndDistance(f[S], o, s);
- this.emit("updatePanoSize", this.lineHeight, "height", _), this.emit("updatePanoSize", this.lineLeft, "left", A), this.emit("updatePanoSize", this.lineRight, "right", P), e(this.lineLeft)
- .addClass("reverse"), e(this.lineHeight)
- .removeClass("rock")
- .addClass("around"), -90 < A.angle < 90 && e(this.lineLeft)
- .addClass(""), 90 < P.angle < 270 && e(this.lineLeft)
- .addClass("")
- }
- }, a.prototype.getFloorCeilingHeight = function(t) {
- var e = [],
- i = t.model.floorsHeight,
- n = i.totalfloor,
- r = i.height;
- return n > 1 ? r.forEach((function(i, o) {
- e[o] = o === n - 1 ? t.model.boundingBox.max.y : r[o + 1]
- })) : e.push(t.model.boundingBox.max.y), e
- }, a.prototype.getAngleAndDistance = function(t, e, i) {
- function r(t) {
- var e, r, o = t.project(i);
- return o.y *= -1, e = Math.round((o.x + 1) * (window.renderWidth || window.innerWidth) / 2), r = Math.round((o.y + 1) * (window.renderHeight || window.innerHeight) / 2), new n.Vector2(e, r)
- }
- var o = new n.Matrix4,
- a = new n.Line3(new n.Vector3(t.x, t.y, t.z), new n.Vector3(e.x, e.y, e.z)),
- s = a.distance();
- o.multiplyMatrices(i.projectionMatrix, o.getInverse(i.matrixWorld));
- var l = o.elements,
- u = new n.Vector3(l[3] + l[2], l[7] + l[6], l[11] + l[10]),
- h = new n.Plane(u, l[15] + l[14]),
- c = (new n.Vector3)
- .copy(a.start)
- .dot(h.normal) + h.constant,
- d = (new n.Vector3)
- .copy(a.end)
- .dot(h.normal) + h.constant;
- if (c < 0 && d < 0) return null;
- var p = h.intersectLine(a);
- void 0 !== p && (c < 0 ? a.start.copy(p) : a.end.copy(p));
- var f = r(a.start),
- m = r(a.end),
- g = this.getAngle(f, m);
- return g.point = f, g.length = s, g
- }, a.prototype.updateUI = function(t, i, n) {
- null !== n ? (t.style.display = "block", setTimeout((function() {
- t.style.top = n.point.y + "px", t.style.left = n.point.x + "px", t.style.width = n.dis + "px", t.style.webkitTransform = "rotate(" + n.angle + "deg)", t.style.transform = "rotate(" + n.angle + "deg)", e(".pano-size-label-name")
- .hasClass(i)
- }), 0)) : t.style.display = "none"
- }, a.prototype.getAngle = function(t, e) {
- var i = (new n.Vector2)
- .subVectors(e, t),
- r = i.length(),
- o = Math.acos(i.x / r);
- return i.y < 0 && (o *= -1), {
- angle: 180 * o / Math.PI,
- dis: r
- }
- }, t.exports = a
- })
- .call(this, i(6))
- }, function(t, e, n) {
- (function(e) {
- var r = n(4)
- .EventEmitter,
- o = n(73)(),
- a = n(5),
- s = n(0),
- l = n(1),
- u = function() {
- this.debug = !1, this.arr = [], this.parr = [], this.arrSet = [], this.cur = 0, this.len = 0, this.lon = 0, this.playing = !1, this.pidx = 0, this.pcur = 0, this.enable = !0, this.longplaying = !1, this.adiv = null, this.loadAudio = this.loadAudio.bind(this)
- };
- (u.prototype = Object.create(r.prototype))
- .constructor = u, u.prototype.init = function(t) {
- if (t && o.audioContext) {
- t && t.enable && t.dataset.length && (this.arrSet = t.dataset, this.arrSet.forEach((function(t, e) {
- var i = t.audiourl;
- o && o.load(i)
- }))), this.len = t.dataset.length
- } else this.enable = !1
- }, u.prototype.startRecord = function(t) {
- this.recording ? this.emit("recording") : (this.emit("readyToRecord"), this.recordstart = !0, this.rtime = 0, this.loadAudio(t), this.ridx = t)
- }, u.prototype.endRecord = function() {
- this.recording = !1, this.elapsedtime = this.time.getElapsedTime(), this.time.stop(), this.elapsedtime > this.adiv.duration && (this.elapsedtime = this.adiv.duration), this.send({
- data: this.arr,
- totalTime: parseFloat(this.elapsedtime.toFixed(5))
- }), G.player.controls[a.PANORAMA].rtime = 0, this.adiv.currentTime = 0, this.adiv.pause(), this.emit("stopRecord"), this.pidx = 0
- }, u.prototype.save = function(t) {
- return t.time = parseFloat(this.time.getElapsedTime()
- .toFixed(5)), this.arr.push(t), t.time
- }, u.prototype.save2 = function(t) {
- this.arr.push(t)
- }, u.prototype.checkserver = function() {
- return window.parent && window.parent.NestP
- }, u.prototype.send = function(t) {
- this.arrSet[this.recordidx] = {
- name: this.arrSet[this.recordidx].name,
- audiourl: this.arrSet[this.recordidx].audiourl,
- totalTime: t.totalTime,
- record: t.data.concat()
- }, this.checkserver() && window.parent.NestP.record(t)
- }, u.prototype.reset = function() {
- this.arr = [], this.time = new s.Clock(!1)
- }, u.prototype.trytopause = function(t, e) {
- t !== this.pidx && (this.playing = !1, this.stop(), e && (this.want = t, setTimeout(e, 500)))
- }, u.prototype.perviewPlay = function(t) {
- G.d.currentScript = 1, this.inputidx = t, this.load(function() {
- this.cplay()
- }.bind(this))
- }, u.prototype.pplay = function(t) {
- if (this.enable) {
- if (!this.checkEnable()) return this.emit("emity"), !1;
- if (void 0 === t && (t = this.pidx), t === this.pidx) this.checkstate() ? this.ppause() : this.loadAudio(t);
- else if (this.stopAction(), this.stopAudio(), this.clearview(this.pidx), this.checkstate()) {
- var e = this.pidx;
- this.pidx = t, this.rstop(e, this.loadAudio, t)
- } else this.pidx = t, this.loadAudio(t);
- this.setCurrentView(this.pidx)
- }
- }, u.prototype.checkEnable = function() {
- return 0 !== this.arrSet.length
- }, u.prototype.presume = function(t, e) {
- this.checkstate() || (void 0 === t ? t = this.pidx : this.pidx = t, this.pplay(t))
- }, u.prototype.preset = function() {}, u.prototype.ppause = function(t) {
- this.checkstate() && (void 0 === t && (t = this.pidx), this.rpause(t), this.paused = !0)
- }, u.prototype.loadAudio = function(t) {
- function i() {
- if (n.floading = !1, n.adiv.oncanplay = function() {}, n.fgotoh = !0, n.inputidx = t, G.player.flying || G.player.isWarping()) var e = setInterval((function() {
- G.player.flying || G.player.isWarping() || (clearInterval(e), G.d.goToHighlight(t))
- }), 100);
- else G.d.goToHighlight(t)
- }
- var n = this;
- this.pidx = t;
- var r = this.arrSet[t].audiourl;
- if (o.audioContext && (this.adiv = o.getCell(r)), null !== this.adiv && (this.floading = !0, 4 === this.adiv.readyState ? i() : (this.emit("loadingAudio"), this.adiv.oncanplay = function() {
- i(), this.emit("loadAudioDone")
- }), this.debug && !this.debugstart)) {
- this.debugstart = !0;
- var a = "audioBuffer:",
- s = this.adiv.audioBuffer;
- s ? (a += "duration:" + s.duration + ",", a += "length:" + s.length + ",", a += "numberOfChannels:" + s.numberOfChannels + ",", a += "sampleRate:" + s.sampleRate + ",") : a += "undefined", setInterval((function() {
- e(".debuginfo")
- .html(a), e(".debugpanel")
- .show()
- }), 1e3)
- }
- }, u.prototype.rstop = function(t, e, i) {
- this.rpause(t), this.clearview(t), G.d.tourIsPlaying ? setTimeout(function() {
- this.rstop(t, e, i)
- }.bind(this), 500) : (this.stopAction(), this.stopAudio(), e(i))
- }, u.prototype.stopAction = function() {
- this.playing = !1, this.exetime && this.exetime.stop(), this.exetime = new s.Clock(!1), this.parr = [], this.w = void 0, this.st = 0, this.arrSet[this.pidx].inited = !1
- }, u.prototype.stopAudio = function() {
- this.adiv.currentTime = 0, this.adiv.pause()
- }, u.prototype.rpause = function(t) {
- this.floading && (this.adiv.oncanplay = function() {}, this.floading = !1), this.fgotoh && (this.fgotoh = !1), this.acpause(), this.aupause()
- }, u.prototype.acpause = function() {
- this.playing = !1, this.exetime && this.exetime.stop()
- }, u.prototype.acresume = function() {
- this.arrSet[this.pidx].inited ? (this.playing = !0, this.exetime.start()) : this.acstart(this.pidx)
- }, u.prototype.aupause = function() {
- this.adiv.pause()
- }, u.prototype.auresume = function() {
- this.adiv.play()
- }, u.prototype._emitCountDown = function(t) {
- this.emit("countdown", t)
- }, u.prototype.pafter = function() {
- var t = this;
- if (this.fgotoh)
- if (this.fgotoh = !1, this.recordstart) {
- this._emitCountDown(3);
- var e = 3,
- i = setInterval(function() {
- --e > 0 ? t._emitCountDown(e) : t.emit("startRecord"), 0 == e && (clearInterval(i), this.recordstart = !1, this.arr = [], this.recordidx = this.ridx, this.time = new s.Clock(!1), this.time.start(), this.rtime = void 0, this.recording = !0, this.austart(this.inputidx))
- }.bind(this), 1e3)
- } else this.paused ? (this.paused = !1, this.acresume(), this.auresume()) : (this.acstart(this.pidx), this.austart(this.pidx))
- }, u.prototype.acstart = function(t) {
- this.parr = [], this.parr = this.arrSet[t].record.concat(), this.totalTime = this.arrSet[t].totalTime, this.totalTime || (this.totalTime = this.adiv.duration), this.exetime = new s.Clock(!1), this.exetime.start(), this.playing = !0, this.arrSet[t].inited = !0
- }, u.prototype.austart = function() {
- this.adiv.currentTime = 0, this.adiv.play()
- }, u.prototype.load = function(t) {
- e(".aloading_back")
- .css("display", "block");
- var i = this,
- n = 0,
- r = setInterval((function() {
- ++n > 100 && (clearInterval(r), e(".aloading_back")
- .css("display", "none")), 4 === i.adiv.readyState && (e(".aloading_back")
- .css("display", "none"), clearInterval(r), t && t())
- }), 100)
- }, u.prototype.pause = function() {
- this.trytopause()
- }, u.prototype.next = function() {
- return this.pidx++, this.pidx === this.len ? (this.pidx = 0, this.stop(), -1) : this.pidx
- }, u.prototype.cplay = function() {
- G.d.goToHighlight(this.pidx)
- }, u.prototype.cstop = function() {
- G.d.stopTour(), G.playing = !1
- }, u.prototype.stop = function() {
- this.playing = !1, this.exetime.stop(), this.exetime = new s.Clock(!1), this.adiv.currentTime = 0, this.adiv.pause(), this.emit("stop")
- }, u.prototype.update = function(t) {
- if (this.recording) {
- var e = this.adiv.duration - this.time.getElapsedTime();
- this.recordnotice(e)
- } else this.playing && (this.cur = this.exetime.getElapsedTime(), this.excute(), this.changeview(), G.player.mattertagManager.showtitletags && G.player.mattertagManager.ttposition())
- }, u.prototype.recordnotice = function(t) {
- t <= 0 ? (G.toast("录制结束"), this.autoend()) : this.emit("stopRecordCountDown", t)
- }, u.prototype.autoend = function() {
- this.endRecord()
- }, u.prototype.excute = function() {
- var t;
- if (void 0 === this.w) this.parr && this.parr.length ? (this.w = this.parr[0], this.outdated() ? (this.last = {
- lon: this.parr[0].lon,
- tap: this.parr[0].tap,
- action: this.parr[0].action
- }, this.parse(), this.w = void 0, this.parr.shift()) : (t = this.smoothable()) && ("dollhouse" === t || "floorplan" === t ? this.cal2(t) : "panorama" === t && this.cal2())) : this.playing && this.cur >= this.totalTime && this.rstop(this.pidx, function() {
- var t = this.next();
- t >= 0 && this.pplay(t)
- }.bind(this));
- else if (this.outdated()) this.last = {
- lon: this.parr[0].lon,
- tap: this.parr[0].tap,
- action: this.parr[0].action
- }, this.parse(), this.w = void 0, this.parr.shift();
- else {
- if (!(t = this.smoothable())) return;
- "dollhouse" === t || "floorplan" === t ? this.get2(t) : "panorama" === t && this.get2(), this.uu(t)
- }
- }, u.prototype.clearnext = function() {
- var t = this.w,
- e = 1.5,
- i = this.actiontype(t);
- 2 === i ? e += 1 : 3 === i && (e += l.transition.flyTime);
- t.time;
- this.w = void 0, this.actiontype(this.parr[0]) || this.parr[0].time > e || this.parr.shift()
- }, u.prototype.smoothable = function() {
- var t = this.w;
- return "dollhouse" === t.tap && G.player.mode === a.DOLLHOUSE ? "dollhouse" : "floorplan" === t.tap && G.player.mode === a.FLOORPLAN ? "floorplan" : !("panorama" !== t.tap || "rotate" !== t.action || G.player.mode !== a.PANORAMA || !G.player.currentPano || G.player.currentPano.id !== t.panoid) && "panorama"
- }, u.prototype.outdated = function() {
- return this.cur >= this.w.time
- }, u.prototype.cal3 = function(t) {
- var e = this.w.time - this.cur;
- this.st = this.cur, this.iv3 = {
- target: this.calv3((new s.Vector3)
- .copy(this.w.target), G.player.controls[t].target, e),
- offset: this.calv3((new s.Vector3)
- .copy(this.w.offset), G.player.controls[t].offset, e),
- camera: this.calv3((new s.Vector3)
- .copy(this.w.camera), G.player.controls[t].camera.position, e)
- }, this.initv3 = {
- target: G.player.controls[t].target.clone(),
- offset: G.player.controls[t].offset.clone(),
- camera: G.player.controls[t].camera.position.clone()
- }
- }, u.prototype.cal2 = function(t) {
- t || (t = a.PANORAMA);
- var e = this.w.time - this.cur;
- this.st = this.cur, this.iv2 = {
- lon: (this.w.lon - G.player.controls[t].lon) / e,
- lat: (this.w.lat - G.player.controls[t].lat) / e
- }, this.initv2 = {
- lon: G.player.controls[t].lon,
- lat: G.player.controls[t].lat
- }
- }, u.prototype.calv3 = function(t, e, i) {
- return t.clone()
- .sub(e)
- .multiplyScalar(1 / i)
- }, u.prototype.get3 = function(t) {
- for (i in this.step = {}, this.iv3) this.step[i] = this.iv3[i].clone()
- .multiply(this.cur - this.st)
- .add(this.initv3[i])
- }, u.prototype.get2 = function() {
- this.step = {}, this.step.lon = this.iv2.lon * (this.cur - this.st) + this.initv2.lon, this.step.lat = this.iv2.lat * (this.cur - this.st) + this.initv2.lat
- }, u.prototype.uu = function(t) {
- t !== a.FLOORPLAN && G.player.controls[t].play(this.step)
- }, u.prototype.changeview = function() {
- if (this.playing) {
- var t = this.cur / this.totalTime * 100;
- if (t > 100) return;
- this.emit("updateView", this.pidx, t)
- }
- }, u.prototype.setCurrentView = function(t) {
- this.emit("updateView", t, 0)
- }, u.prototype.clearview = function(t) {
- this.emit("updateView", t, 0)
- }, u.prototype.checkstate = function() {
- return !!(G.d && G.d.tourIsPlaying || this.playing || this.floading || this.fgotoh)
- }, u.prototype.parse = function() {
- var t = this.w;
- if (t.tap) switch (t.tap) {
- case "housedetail":
- this.housedetail(null, t.open);
- break;
- case "dollhouse":
- if (t.action)
- if (G.player.mode !== a.DOLLHOUSE && G.player.mode !== a.TRANSITIONING) G.d.changeMode(a.DOLLHOUSE, "gui");
- else switch (t.action) {
- case "rotate":
- G.player.controls[a.DOLLHOUSE].play(t)
- } else G.d.changeMode(a.DOLLHOUSE, "gui");
- break;
- case "floorplan":
- t.action ? G.player.mode !== a.FLOORPLAN && G.player.mode !== a.TRANSITIONING ? G.d.changeMode(a.FLOORPLAN, "gui") : t.action : G.d.changeMode(a.FLOORPLAN, "gui");
- break;
- case "panorama":
- t.action ? G.player.mode !== a.PANORAMA && G.player.mode !== a.TRANSITIONING ? t.panoid ? G.player.flyToNewMode({
- mode: a.PANORAMA,
- pano: G.model.panos.index[t.panoid]
- }) : G.d.changeMode(a.PANORAMA, "gui") : "move" === t.action ? G.player.flyToPano({
- pano: G.model.panos.index[t.destid]
- }) : G.player.currentPano && G.player.currentPano.id !== t.panoid ? G.player.flyToPano({
- pano: G.model.panos.index[t.panoid]
- }) : "rotate" === t.action && (this.panoid = t.panoid, G.player.controls[a.PANORAMA].play(t)) : G.d.changeMode(a.PANORAMA, "gui");
- break;
- case "outermap":
- break;
- case "floor":
- "all" === t.action ? G.d.allFloors() : G.d.gotoFloor(parseInt(t.action));
- break;
- case "zoom":
- if (t.type === a.PANORAMA && G.player.mode === a.PANORAMA) {
- var e = G.player.controls[a.PANORAMA].camera;
- G.player.zoomLevel = t.level, e.fov = G.player.baseFov * (1 / G.player.zoomLevel), e.updateProjectionMatrix(), G.player.zoomFov = e.fov
- } else t.type === a.DOLLHOUSE && G.player.mode === a.DOLLHOUSE && G.player.controls[a.DOLLHOUSE].dollyOut(parseFloat(t.level))
- }
- }, u.prototype.actiontype = function(t) {
- switch (t.tap) {
- case "housedetail":
- case "outermap":
- return 1;
- case "dollhouse":
- case "floorplan":
- case "panorama":
- return "rotate" === t.action ? 0 : "move" === t.action ? 3 : 2;
- case "floor":
- return 2;
- case "zoom":
- return 1
- }
- return 0
- }, u.prototype.housedetail = function(t, e) {
- this.emit("housedetail", e)
- }, t.exports = u
- })
- .call(this, n(6))
- }])
- }));
- //# sourceMappingURL=HOUSEPLAY.js.map
|