@dcl-regenesislabs/bevy-explorer-web 0.1.0-34587643134.commit-48233ea → 0.1.0-34588802179.commit-3926f33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/Showcase-BgKqxSg0.js +1 -0
- package/assets/{design-C3MV3Rzu.js → design-BDhpdwuN.js} +1 -1
- package/assets/{index-BzmM9aCc.css → index-BGHmZMCW.css} +1 -1
- package/assets/index-CDbflo3B.js +8 -0
- package/assets/menus-D6WfTyFl.js +7 -0
- package/assets/{vendor-DIfqQOai.js → vendor-Cpdw0P4O.js} +1 -1
- package/assets/{vendor-B3vbuu6u.css → vendor-U-32Xe0e.css} +1 -1
- package/bridge-scene/static/BevyExplorerUI/about +1 -1
- package/bridge-scene/static/{bafkreidfqx6yanxny7awdqakrrpi2jimdg47ohtlms2kggsdtgct4gxpuu → bafkreiflweqlg7ohax5xmgs4n2x4d6otmobgvbwya7z57jii6ib2hfd6va} +1 -1
- package/bridge-scene/static/{bafybeidq5nwye5qw7qlypsmzvotrjh2yygqowfdvzv6xaghijcxyjz7v4q → bafybeihzv3omgq33yzl4fmc5a5ua5gpvdyhfyo6qmcx45helxdaofgqgce} +20 -1
- package/engine/pkg/manifest.json +1 -1
- package/engine/pkg/sandbox_worker.bundle.js +12 -0
- package/engine/pkg/webgpu_build.d.ts +6 -0
- package/engine/pkg/webgpu_build.js +49 -28
- package/engine/pkg/webgpu_build_bg.wasm +0 -0
- package/engine/pkg/webgpu_build_bg.wasm.d.ts +2 -0
- package/index.html +17 -17
- package/package.json +3 -3
- package/assets/Showcase-BB2yxhRv.js +0 -1
- package/assets/index-BjlxMXvy.js +0 -8
- package/assets/menus-CBrYEJUg.js +0 -7
package/assets/index-BjlxMXvy.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Showcase-BB2yxhRv.js","assets/design-C3MV3Rzu.js","assets/rolldown-runtime-D9-fqq9M.js","assets/design-Cst4UaAD.css","assets/menus-CBrYEJUg.js","assets/menus-5qt_f1rg.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$ as e,C as t,D as n,G as r,H as i,J as a,K as o,L as s,Q as c,R as l,T as u,W as d,Z as f,a as p,b as m,g as h,h as ee,i as te,l as ne,n as g,o as re,p as _,q as v,r as y,s as ie,y as b,z as ae}from"./design-C3MV3Rzu.js";import{n as x,t as S}from"./vendor-DIfqQOai.js";import{A as oe,B as C,C as w,D as T,E as se,F as ce,G as le,H as ue,I as de,K as fe,L as pe,M as me,N as E,O as D,P as O,R as he,S as ge,T as _e,U as ve,V as ye,W as be,_ as xe,a as Se,b as Ce,c as we,d as Te,f as Ee,g as De,h as Oe,i as ke,j as Ae,k as je,l as Me,m as Ne,n as Pe,o as Fe,p as Ie,q as Le,r as Re,s as ze,t as Be,u as Ve,v as He,w as Ue,x as We,y as Ge,z as Ke}from"./menus-CBrYEJUg.js";import{a as qe,i as Je,n as Ye,o as Xe,r as Ze,t as Qe}from"./emoji-DrfHOLaz.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var k=e(),$e=S(),et=250,tt=3e4,nt=class{onMessage;onUnavailable;ch;ready=!1;queue=[];helloTimer=null;timeoutTimer=null;expected=!1;constructor(e,t,n){this.onMessage=t,this.onUnavailable=n,this.ch=new BroadcastChannel(e),this.ch.onmessage=e=>{let t=e.data;t?.to===`page`&&(t.msg.kind===`bridgeReady`&&this.markReady(),this.onMessage(t.msg))},this.hello(),this.helloTimer=setInterval(()=>this.hello(),et)}expectReady(){this.ready||this.expected||(this.expected=!0,this.timeoutTimer=setTimeout(()=>{this.timeoutTimer=null,this.ready||this.onUnavailable?.()},tt))}send(e){if(!this.ready){this.queue.push(e);return}this.post(e)}sendNow(e){this.post(e)}isReady(){return this.ready}close(){this.stopHello(),this.timeoutTimer!=null&&clearTimeout(this.timeoutTimer),this.timeoutTimer=null,this.ch.close()}markReady(){if(!this.ready){this.ready=!0,this.stopHello(),this.timeoutTimer!=null&&clearTimeout(this.timeoutTimer),this.timeoutTimer=null;for(let e of this.queue.splice(0))this.post(e)}}hello(){this.post({kind:`hello`})}post(e){this.ch.postMessage({to:`scene`,msg:e})}stopHello(){this.helloTimer!=null&&clearInterval(this.helloTimer),this.helloTimer=null}},rt=`bevy-ui-bridge`;function it(){let e=globalThis;return e.__bridgeSession??=e.crypto?.randomUUID?.().slice(0,8)??Math.random().toString(36).slice(2,10),`${rt}#${e.__bridgeSession}`}var at=class{ch;pending=new Map;listeners=new Set;constructor(e=it()){this.ch=new nt(e,e=>this.handle(e),()=>this.handle({kind:`bridgeUnavailable`}))}getPreviousLogin(){return this.rpc(`getPreviousLogin`)}loginPrevious(){return this.rpc(`loginPrevious`)}loginGuest(){return this.rpc(`loginGuest`)}loginCancel(){return this.rpc(`loginCancel`)}logout(){return this.rpc(`logout`)}loginWithIdentity(e){return this.rpc(`loginIdentity`)}async jumpIn(){let e=await this.rpc(`loginPrevious`);if(e&&e.success===!1)throw Error(e.error||`Could not reuse your login`)}async loginNew(){let e=await this.rpc(`loginNew`);if(e&&e.success===!1)throw Error(e.error||`Sign-in failed`)}send(e){this.ch.send(e)}expectBridge(){this.ch.expectReady()}on(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.ch.close(),this.pending.clear(),this.listeners.clear()}rpc(e){let t=crypto.randomUUID();return new Promise((n,r)=>{this.pending.set(t,{resolve:n,reject:r}),this.ch.sendNow({kind:`rpc:req`,id:t,method:e})})}handle(e){if(e.kind===`rpc:res`){let t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),e.ok?t.resolve(e.value):t.reject(Error(e.error??`bridge rpc failed`));return}this.listeners.forEach(t=>t(e))}};function ot(e){return btoa(JSON.stringify(e))}var st=class{rpc;ch;listeners=new Set;playerReadyFired=!1;readyFallbackTimer=null;constructor(e){this.rpc=e,this.ch=new nt(it(),e=>{e.kind===`event`&&e.name===`playerReady`&&(this.playerReadyFired=!0),this.emit(e)},()=>this.emit({kind:`bridgeUnavailable`}))}async getPreviousLogin(){let e=fe();return{userId:e?Le(e.identity):null}}async loginPrevious(e){let t=e===!0?` --default-on-error`:``,n=await this.rpc.command(`/login_previous${t}`);return this.scheduleReadyFallback(),n}async loginGuest(){await this.rpc.command(`/login_guest`),this.scheduleReadyFallback()}async loginCancel(){}async logout(){await this.rpc.command(`/logout`)}async loginWithIdentity(e,t){let n=t===!0?` --default-on-error`:``;await this.rpc.command(`/login_identity ${ot(e)}${n}`),this.scheduleReadyFallback()}async jumpIn(e){let t=fe();t?await this.loginWithIdentity(t.identity,e):await this.loginPrevious(e)}send(e){this.ch.send(e)}expectBridge(){this.ch.expectReady()}on(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.readyFallbackTimer!=null&&clearTimeout(this.readyFallbackTimer),this.ch.close(),this.listeners.clear()}renderBusy(){return this.rpc.renderBusy()}engineReady(){return this.rpc.readyToLaunch()}loadProgress(){return this.rpc.loadProgress()}loadStep(){return this.rpc.loadStep()}enginePanic(){return this.rpc.enginePanic()}clearEnginePanic(){this.rpc.clearEnginePanic()}rearmCrashWatchdog(){this.rpc.rearmCrashWatchdog()}launch(e,t){this.rpc.launch(e,t)}homeScene(){return this.rpc.homeScene()}emit(e){this.listeners.forEach(t=>t(e))}scheduleReadyFallback(){this.readyFallbackTimer!=null&&clearTimeout(this.readyFallbackTimer),this.readyFallbackTimer=setTimeout(()=>{this.readyFallbackTimer=null,this.playerReadyFired||(this.playerReadyFired=!0,this.emit({kind:`event`,name:`playerReady`}))},6e3)}},ct=class{win=null;setWindow(e){this.win=e}readyToLaunch(){return this.win?.__bevyReadyToLaunch===!0}loadProgress(){return this.win?.__bevyLoadProgress??0}loadStep(){return this.win?.__bevyLoadStep??null}enginePanic(){return this.win?.__bevyPanic??null}clearEnginePanic(){this.win&&(this.win.__bevyPanic=void 0)}rearmCrashWatchdog(){this.win?.__rearmCrashWatchdog?.()}launch(e,t){this.win?.__bevyLaunch?.(e,t)}homeScene(){return this.win?.__bevyHomeScene?.()??null}ready(){return typeof this.win?.engine_console_command==`function`}async waitReady(e=9e4){let t=performance.now();for(;!this.ready();){if(performance.now()-t>e)throw Error(`engine RPC did not become ready in time`);await new Promise(e=>setTimeout(e,150))}}async command(e){return await this.waitReady(),this.win.engine_console_command(e)}renderBusy(){try{let e=this.win,t=e?.document.getElementById(`shader-compiling`);return t!=null&&e.getComputedStyle(t).display!==`none`}catch{return!1}}},lt=[{name:`realm`,kind:`string`,delivery:`destination`,doc:`Realm to boot into; absent = the persisted home realm or default realm`},{name:`position`,kind:`string`,delivery:`destination`,doc:"Spawn parcel as `x,y`; absent = the home parcel, or the realm's spawn point"},{name:`preview`,kind:`flag`,delivery:`launch`,doc:`Scene preview mode: hot-reloading, no failed-asset backoff, plain-http fetches allowed, realm fixed`},{name:`baseDomain`,kind:`string`,delivery:`resolved`,doc:`The base domain for all services (comms, profiles, etc); absent = the hosting origin (on web), or decentraland.org`},{name:`realmProvider`,kind:`string`,delivery:`resolved`,doc:"Realm provider (the realm list, and `/main` is the default realm); absent = `https://realm-provider-ea.<base>`"},{name:`catalyst`,kind:`string`,delivery:`resolved`,doc:"Catalyst peer (`/content`, `/lambdas`); absent = `https://peer.<base>`"},{name:`worldsServer`,kind:`string`,delivery:`resolved`,doc:"Worlds content server; absent = `https://worlds-content-server.<base>`"},{name:`places`,kind:`string`,delivery:`resolved`,doc:"Places api; absent = `https://places.<base>`"},{name:`commsGatekeeper`,kind:`string`,delivery:`resolved`,doc:"Comms gatekeeper; absent = `https://comms-gatekeeper.<base>`"},{name:`previewGatekeeper`,kind:`string`,delivery:`resolved`,doc:"Local-preview comms gatekeeper; absent = `https://comms-gatekeeper-local.<base>`"},{name:`assetBundleRegistry`,kind:`string`,delivery:`resolved`,doc:"Asset-bundle registry; absent = `https://asset-bundle-registry.<base>` (custom domains only: org and zone profiles use the registry of the profile's own environment)"},{name:`storage`,kind:`string`,delivery:`resolved`,doc:"World storage; absent = `https://storage.<base>`. https only: an http instance is never signed for (the delegation claim must not go out in cleartext)"},{name:`ethereumRpc`,kind:`string`,delivery:`resolved`,doc:"Ethereum json-rpc websocket; absent = `wss://rpc.<base>`"},{name:`socialRpc`,kind:`string`,delivery:`resolved`,doc:"Social service websocket; absent = `wss://rpc-social-service-ea.<base>`"},{name:`opensea`,kind:`string`,delivery:`resolved`,doc:"OpenSea api; absent = `https://opensea.<base>`"},{name:`reels`,kind:`string`,delivery:`resolved`,doc:"Reels (camera reel) api, used by the HUD; absent = `https://reels.<base>`"},{name:`mapApi`,kind:`string`,delivery:`resolved`,doc:"Map tile api, used by the HUD; absent = `https://api.<base>`"},{name:`pulseServer`,kind:`string`,delivery:`resolved`,doc:"Pulse comms server, `host` or `host:port` (no port = the platform's: 7777 ENet on native, 7743 WebTransport on web); absent = `pulse-server.<base>`"},{name:`imposterSource`,kind:`string`,delivery:`launch`,doc:`Base url of the imposter store; absent = the default store. The realm-keyed path under it is the same as the default store's`},{name:`logFps`,kind:`bool`,delivery:`launch`,doc:`Log the frame rate to the console`},{name:`contentServer`,kind:`string`,delivery:`launch`,doc:`Override the content server only (normally a function of the realm)`},{name:`systemScene`,kind:`string`,delivery:`launch`,doc:"Super-user ui scene source, or `none` for no ui scene. The engine trusts it completely. Absent = the default bridge scene for the react HUD; any explicit value opts out of the HUD"},{name:`portables`,kind:`string`,delivery:`launch`,doc:"`;`-separated portable/startup scene sources; absent = `basiccontroller.dcl.eth` (DEFAULT_PORTABLES)"},{name:`gpuBytesPerFrame`,kind:`number`,delivery:`launch`,doc:`Cap per-frame gpu uploads`},{name:`editor`,kind:`flag`,delivery:`host`,doc:`Embedded in a scene editor (creator hub). Set by editor front-ends`}],ut=new URL(location.pathname.replace(/\/?$/,`/`),location.href).href,dt=new URL(`https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-34587643134.commit-48233ea/`,ut).href,ft=e=>new URL(e,dt).href,pt=new URL(`bridge-scene/static/BevyExplorerUI`,new URL(`https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-34587643134.commit-48233ea/`,ut)).href,mt=[`tortilla.dcl.eth`,`sceneviewer.dcl.eth`],ht=`${be(`worldsServer`)}/world/`,gt=new Set([`localhost`,`127.0.0.1`,`[::1]`]);function _t(e){return e.trim().replace(/\/+$/,``)}function vt(e){let t=_t(e);if(t===``||t.toLowerCase()===`none`||t===_t(pt))return!0;let n=t.toLowerCase();if(mt.includes(n))return!0;if(n.startsWith(ht))return mt.includes(n.slice(ht.length));try{if(gt.has(new URL(t).hostname.toLowerCase()))return!0}catch{}return!1}function yt(e){let t=lt.find(t=>t.name===e);if(t==null)throw Error(`webParam: '${e}' is not in the engine's web param table`);return t}function bt(e,t){switch(e.kind){case`bool`:return t===`true`||t===`1`;case`number`:{let e=Number(t);return t.trim()!==``&&Number.isFinite(e)?e:t}default:return t}}function xt(e){let t={};for(let n of lt){if(n.delivery!==`launch`)continue;if(n.kind===`flag`){t[n.name]=e.has(n.name);continue}let r=e.get(n.name);t[n.name]=r==null?void 0:bt(n,r)}return t}var A=c(),St=[`https://cdn.jsdelivr.net/npm/livekit-client/dist/livekit-client.umd.min.js`,`https://cdn.jsdelivr.net/npm/hls.js@1`],Ct=!1;function wt(){if(it(),Ct||window.__bevyBootConfig!=null)return;Ct=!0;let e=new URLSearchParams(location.search);window.PUBLIC_URL=new URL(`engine`,new URL(`https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-34587643134.commit-48233ea/`,ut)).href,window.__bevyBootConfig={...xt(e),...C,baseDomain:Ke,systemScene:he().systemScene??pt};for(let e of St){let t=document.createElement(`script`);t.src=e,t.crossOrigin=`anonymous`,document.head.appendChild(t)}let t=document.createElement(`script`);t.type=`module`,t.src=new URL(`engine/boot.js`,ut).href,document.head.appendChild(t)}function Tt({rpc:e}){return(0,k.useEffect)(()=>(wt(),e.setWindow(window),()=>e.setWindow(null)),[e]),(0,A.jsxs)(`div`,{id:`canvas-parent`,style:{position:`fixed`,inset:0,width:`100%`,height:`100%`,zIndex:0},children:[(0,A.jsx)(`canvas`,{id:`mygame-canvas`,style:{width:`100%`,height:`100%`,display:`block`}}),(0,A.jsx)(`div`,{id:`shader-compiling`,style:{display:`none`}})]})}function Et(e,t,n){return{address:e,name:t,picture:`https://profile-images.decentraland.org/entities/bafkreid5btlh76opew65hxu6dtkdo6ybqhymdof6vrrmjy2p5a74oy4huq/face.png`,bodyImage:`https://picsum.photos/seed/${encodeURIComponent(e)}/360/760`,hasClaimedName:!t.includes(`#`),isGuest:n,description:`Exploring Decentraland one plaza at a time. 🌅 DCL citizen since 2022.`,links:[{title:`Twitter`,url:`https://twitter.com`},{title:`Discord`,url:`https://discord.com`}],mutuals:30,badges:Array.from({length:8},(e,t)=>({id:`b${t}`,name:`Badge ${t+1}`,tier:[`bronze`,`silver`,`gold`][t%3],image:`https://picsum.photos/seed/badge${t}/96/96`})),photos:Array.from({length:6},(e,t)=>`https://picsum.photos/seed/photo${t}/300/300`),equippedWearables:Pt(),equippedEmotes:It(),info:{gender:`Male`,birthdate:`1991-11-26`,pronouns:`He / Him`,relationship:`Single`,sexualOrientation:`Heterosexual`,language:`Persian`,country:`Argentina`,profession:`IT`,employment:`Chilling`,hobby:`games.movie.party`,realName:`mohammad`}}}var Dt=[{address:`0x5854cce95d5e25817b41f4c41f06b695a83bc495`,name:`Mojito`,picture:`https://profile-images.decentraland.org/entities/bafkreid5btlh76opew65hxu6dtkdo6ybqhymdof6vrrmjy2p5a74oy4huq/face.png`},{address:`0x6723dcb07f3ca735223cd1c0acfa62dd994a1bb4`,name:`Sharknado`,picture:`https://profile-images.decentraland.org/entities/bafkreie5bpho47gnh3jrfxoezwc4pxffup4cmmhmdxsmpf3oslopxb4enm/face.png`},{address:`0x1e105bb213754519903788022b962fe2b9c4b263`,name:`Pravus`,picture:`https://profile-images.decentraland.org/entities/bafkreig4xay5oxgbf75hwkjefx5hgdcdvm6a4tnpiisltslxf4jtajkbyq/face.png`},{address:`0x9f8c2a1b4d6e7f0a3b5c8d9e1f2a4b6c8d0e1f23`,name:`Johnny`},{address:`0x3a1b2c4d5e6f7081920a3b4c5d6e7f8091a2b3c4`,name:`Clara`},{address:`0x77a0b1c2d3e4f5061728394a5b6c7d8e9f001122`,name:`SpottyGoat`},{address:`0xc0ffee254729296a45a3885639ac7e10f9d54979`,name:``}],j=[{id:`c1`,name:`Decentraland Foundation`,description:`The official Decentraland Foundation community. Stay up to date with events, releases and everything happening across the metaverse.`,thumbnail:`https://picsum.photos/seed/dcl/540/360`,membersCount:1242,role:`member`,ownerName:`DCLOfficial`,privacy:`public`},{id:`c2`,name:`Chiri Storytelling`,description:`This space brings to life Chiri's adventures. Gathering cozy Social Gamers, Creators, Digi Fashion lovers, Virtual Citizens & more!`,thumbnail:``,membersCount:374,role:`none`,ownerName:`Chiri`,privacy:`private`},{id:`c3`,name:`VTATV`,description:`Virtual television and live shows broadcast from inside Decentraland.`,thumbnail:``,membersCount:186,role:`none`,ownerName:`VTATV`},{id:`c4`,name:`ABC Decentraland`,description:`Adventures and education for newcomers to the metaverse.`,thumbnail:``,membersCount:436,role:`none`,ownerName:`BillyTeacoin`},{id:`c5`,name:`Toxic Events`,description:`The wildest parties and events in DCL.`,thumbnail:``,membersCount:601,role:`member`,ownerName:`ToxicWaifu`},{id:`c6`,name:`Last Slice Creators`,description:`A community of pizza-loving 3D creators.`,thumbnail:``,membersCount:164,role:`none`,ownerName:`Lastraum`},{id:`c7`,name:`SheFi`,description:`Empowering women in web3 and DeFi.`,thumbnail:``,membersCount:310,role:`none`,ownerName:`msjoedor`},{id:`c8`,name:`Community Building DCL`,description:`Helping communities grow in Decentraland.`,thumbnail:``,membersCount:639,role:`owner`,ownerName:`TheCryptKeeper`}],Ot=[`base`,`common`,`uncommon`,`rare`,`epic`,`legendary`,`mythic`,`unique`,`exotic`],kt=e=>`https://peer.decentraland.org/lambdas/collections/contents/${e}/thumbnail`,M=[{name:`casual_hair_01`,category:`hair`,label:`Casual Hair`},{name:`cornrows`,category:`hair`,label:`Cornrows`},{name:`hair_anime_01`,category:`hair`,label:`Anime Hair`},{name:`eyebrows_00`,category:`eyebrows`,label:`Eyebrows`},{name:`mouth_00`,category:`mouth`,label:`Mouth`},{name:`beard`,category:`facial_hair`,label:`Beard`},{name:`granpa_beard`,category:`facial_hair`,label:`Grandpa Beard`},{name:`f_sweater`,category:`upper_body`,label:`Sweater`},{name:`m_greenhoodie`,category:`upper_body`,label:`Green Hoodie`},{name:`blue_tshirt`,category:`upper_body`,label:`Blue T-Shirt`},{name:`sport_jacket`,category:`upper_body`,label:`Sport Jacket`},{name:`f_jeans`,category:`lower_body`,label:`Jeans`},{name:`f_brown_trousers`,category:`lower_body`,label:`Brown Trousers`},{name:`basketball_shorts`,category:`lower_body`,label:`Basketball Shorts`},{name:`sneakers`,category:`feet`,label:`Sneakers`},{name:`bun_shoes`,category:`feet`,label:`Bun Shoes`},{name:`m_greenflipflops`,category:`feet`,label:`Flip Flops`},{name:`hat`,category:`hat`,label:`Hat`},{name:`bandana`,category:`hat`,label:`Bandana`},{name:`black_sun_glasses`,category:`eyewear`,label:`Sunglasses`},{name:`piratepatch`,category:`eyewear`,label:`Pirate Patch`},{name:`blue_bandana`,category:`mask`,label:`Blue Bandana`},{name:`pink_gem_earring`,category:`earring`,label:`Pink Gem Earring`},{name:`Thunder_earring`,category:`earring`,label:`Thunder Earring`}].map((e,t)=>{let n=`urn:decentraland:off-chain:base-avatars:${e.name}`;return{urn:n,name:e.label,rarity:Ot[t%Ot.length],category:e.category,thumbnail:kt(n),equipped:t%6==0}}),At=`urn:decentraland:off-chain:base-avatars:BaseMale`,jt=e=>({bodyShape:At,eyes:{color:{r:.37,g:.22,b:.19}},hair:{color:{r:.6,g:.36,b:.2}},skin:{color:{r:.8,g:.6,b:.47}},wearables:e,forceRender:[]}),Mt=[{urn:`urn:decentraland:off-chain:base-avatars:thug_life`,name:`Off-catalog Eyewear`,rarity:`epic`,category:`eyewear`,thumbnail:kt(`urn:decentraland:off-chain:base-avatars:black_sun_glasses`),equipped:!0}],Nt=[{urn:`urn:decentraland:matic:collections-v2:0xa42e166edac870aa5351b098ae6458d39ca0fca6:0`,name:`Neon Tiara`,rarity:`legendary`,category:`tiara`,thumbnail:kt(`urn:decentraland:off-chain:base-avatars:hat`),equipped:!0,shopUrl:`https://decentraland.org/shop/item/0xa42e166edac870aa5351b098ae6458d39ca0fca6/0`},{urn:`urn:decentraland:ethereum:collections-v1:mf_sammichgamer:mf_animehair`,name:`Anime warrior hair`,rarity:`legendary`,category:`hair`,thumbnail:kt(`urn:decentraland:off-chain:base-avatars:hair_anime_01`),equipped:!0,shopUrl:`https://decentraland.org/shop/item/0x30d3387ff3de2a21bef7032f82d00ff7739e403c/3`}],Pt=()=>[...M.filter(e=>e.equipped),...Mt,...Nt],Ft=[`Hands Air`,`Wave`,`Fist Pump`,`Dance`,`Raise Hand`,`Clap`,`Money`,`Kiss`,`Head Explode`,`Shrug`],It=()=>Ft.map((e,t)=>({slot:t,urn:`urn:decentraland:off-chain:base-emotes:${e.toLowerCase().replace(/ /g,``)}`,name:e,rarity:`base`})),N=e=>({name:e,description:``}),Lt=[{name:`fullscreen`,category:`general`,description:`Run in fullscreen mode.`,minValue:0,maxValue:1,namedVariants:[N(`Off`),N(`On`)],value:1,default:1,stepSize:1},{name:`resolution`,category:`general`,description:``,minValue:0,maxValue:2,namedVariants:[N(`1280 × 720`),N(`1920 × 1080`),N(`2560 × 1440`)],value:1,default:1,stepSize:1},{name:`graphics_quality`,category:`graphics`,description:`Overall visual quality.`,minValue:0,maxValue:3,namedVariants:[N(`Low`),N(`Medium`),N(`High`),N(`Ultra`)],value:2,default:1,stepSize:1},{name:`fps_limit`,category:`graphics`,description:`Cap the frame rate.`,minValue:30,maxValue:144,namedVariants:[],value:60,default:60,stepSize:1},{name:`master_volume`,category:`audio`,description:``,minValue:0,maxValue:100,namedVariants:[],value:80,default:100,stepSize:1},{name:`voice_chat`,category:`audio`,description:`Enable voice chat.`,minValue:0,maxValue:1,namedVariants:[N(`Off`),N(`On`)],value:1,default:1,stepSize:1}],Rt=()=>[[{Scene:`IaPointer`},[`Mouse Left`,`Gamepad LeftTrigger2`]],[{Scene:`IaPrimary`},[`KeyE`,`Gamepad South`]],[{Scene:`IaSecondary`},[`KeyF`,`Gamepad East`]],[{Scene:`IaForward`},[`KeyW`,`GamepadLeft Up`]],[{Scene:`IaBackward`},[`KeyS`,`GamepadLeft Down`]],[{Scene:`IaRight`},[`KeyD`,`GamepadLeft Right`]],[{Scene:`IaLeft`},[`KeyA`,`GamepadLeft Left`]],[{Scene:`IaJump`},[`Space`,`Gamepad North`]],[{Scene:`IaWalk`},[`ControlLeft`]],[{Scene:`IaModifier`},[`ShiftLeft`]],[{Scene:`IaAction3`},[`Digit1`,`Gamepad DPadUp`]],[{Scene:`IaAction4`},[`Digit2`,`Gamepad DPadRight`]],[{Scene:`IaAction5`},[`Digit3`,`Gamepad DPadDown`]],[{Scene:`IaAction6`},[`Digit4`,`Gamepad DPadLeft`]],[{System:`CameraLock`},[`Mouse Right`,`Gamepad RightTrigger2`]],[{System:`Emote`},[`KeyB`,`Gamepad West`]],[{System:`Cancel`},[`Escape`,`Gamepad Select`]],[{System:`HideUi`},[`KeyU`]],[{System:`ShowDebugUi`},[`PageUp`]],[{System:`HideNames`},[`KeyN`]],[{System:`RollLeft`},[]],[{System:`RollRight`},[]],[{System:`PointAt`},[`Mouse Middle`,`KeyQ`]],[{System:`Microphone`},[`KeyV`]],[{System:`Map`},[`KeyM`,`Tab`]],[{System:`Chat`},[`Enter`,`NumpadEnter`]],[{System:`CameraUp`},[`ArrowUp`]],[{System:`CameraDown`},[`ArrowDown`]],[{System:`CameraLeft`},[`ArrowLeft`]],[{System:`CameraRight`},[`ArrowRight`]],[{System:`CameraZoomIn`},[`MouseWheel Up`,`Gamepad LeftTrigger`]],[{System:`CameraZoomOut`},[`MouseWheel Down`,`Gamepad RightTrigger`]],[{System:`ScrollUp`},[`MouseWheel Up`,`GamepadLeft Up`]],[{System:`ScrollDown`},[`MouseWheel Down`,`GamepadLeft Down`]],[{System:`ScrollLeft`},[`MouseWheel Left`,`GamepadLeft Left`]],[{System:`ScrollRight`},[`MouseWheel Right`,`GamepadLeft Right`]],[{System:`PointerUp`},[`GamepadRight Up`]],[{System:`PointerDown`},[`GamepadRight Down`]],[{System:`PointerLeft`},[`GamepadRight Left`]],[{System:`PointerRight`},[`GamepadRight Right`]],...Array.from({length:10},(e,t)=>[{System:`QuickEmote${t}`},[`Numpad${t}`]]),[{System:`Places`},[`KeyZ`]],[{System:`Communities`},[`KeyO`]],[{System:`Backpack`},[`KeyI`]],[{System:`Gallery`},[`KeyG`]],[{System:`Settings`},[`KeyP`]],[{System:`Friends`},[`KeyL`]],[{System:`ChatPanel`},[`KeyT`]]],zt=[],Bt=e=>e.hasPreviousLogin?[`Mojito`,`MojitoDCL`]:[],Vt=e=>zt.reduce((t,n)=>pe(t,n,Bt(e)),Et(e.userId,e.hasPreviousLogin?`Mojito`:`Guest#beef`,!e.hasPreviousLogin)),Ht={hasPreviousLogin:new URLSearchParams(location.search).get(`previousLogin`)===`1`,userId:`0xmock00000000000000000000000000000000beef`,latency:600};function Ut(e){let t=`single-sign-on-${e.userId}`;e.hasPreviousLogin?localStorage.getItem(t)||localStorage.setItem(t,JSON.stringify({ephemeralIdentity:{address:`0xeeee000000000000000000000000000000000001`,publicKey:`0x04`,privateKey:`0x`+`11`.repeat(32)},expiration:new Date(Date.now()+2592e6).toISOString(),authChain:[{type:`SIGNER`,payload:e.userId,signature:``},{type:`ECDSA_EPHEMERAL`,payload:`Decentraland Login
|
|
3
|
-
Ephemeral address: 0xeeee
|
|
4
|
-
Expiration: `,signature:`0xabc`}]})):localStorage.removeItem(t)}function Wt(e={}){let t={...Ht,...e};Ut(t);let n=17e11,r=[{id:`n1`,type:`social_service_friendship_accepted`,read:!1,timestamp:new Date(n).toISOString(),metadata:{sender:{address:`0x5854cce95d5e25817b41f4c41f06b695a83bc495`,name:`Mojito`,profileImageUrl:`https://profile-images.decentraland.org/entities/bafkreid5btlh76opew65hxu6dtkdo6ybqhymdof6vrrmjy2p5a74oy4huq/face.png`}}},{id:`n2`,type:`social_service_friendship_request`,read:!1,timestamp:new Date(16999982e5).toISOString(),metadata:{sender:{address:`0x6723dcb07f3ca735223cd1c0acfa62dd994a1bb4`,name:`Sharknado`,profileImageUrl:`https://profile-images.decentraland.org/entities/bafkreie5bpho47gnh3jrfxoezwc4pxffup4cmmhmdxsmpf3oslopxb4enm/face.png`}}},{id:`n3`,type:`item_sold`,read:!1,timestamp:new Date(16999964e5).toISOString(),metadata:{title:`Item sold`,description:`Your “Sunset Hoodie” sold for 120 MANA.`,image:`https://profile-images.decentraland.org/entities/bafkreie5bpho47gnh3jrfxoezwc4pxffup4cmmhmdxsmpf3oslopxb4enm/face.png`}},{id:`n4`,type:`event_started`,read:!0,timestamp:new Date(16999136e5).toISOString(),metadata:{title:`Event live`,description:`Music Festival is happening now in Genesis Plaza.`}},{id:`n5`,type:`community_post_added`,read:!1,timestamp:new Date(16999976e5).toISOString(),metadata:{communityName:`Toxic Events`,communityId:`c5`,thumbnailUrl:`https://picsum.photos/seed/dcl/80/80`}},{id:`n6`,type:`credits_reminder_claim_credits`,read:!1,timestamp:new Date(16999946e5).toISOString(),metadata:{}}],i=Array.from({length:14},(e,t)=>({id:`g${t}`,url:`https://picsum.photos/seed/reel${t}/1200/800`,thumbnailUrl:`https://picsum.photos/seed/reel${t}/400/300`,isPublic:t%2==0,dateTime:String(Math.floor((n-t*3*864e5)/1e3))})),a={outfits:[{slot:0,outfit:jt(M.slice(0,5).map(e=>e.urn))},{slot:2,outfit:jt(M.slice(5,10).map(e=>e.urn))}],namesForExtraSlots:[]},o=new BroadcastChannel(it()),s=e=>new Promise(t=>setTimeout(t,e)),c=e=>{o.postMessage({to:`page`,msg:e})},l=null,u=null,d=Rt(),f=null,p=!1,m=e=>{let t=d.find(([t,n])=>`System`in t&&n.includes(e));return t!=null&&`System`in t[0]?t[0].System:null},h=(e,t)=>{if(e.repeat)return;if(f!=null){if(!t)return;c({kind:`inputCaptured`,id:f,input:e.code}),f=null;return}if(p)return;let n=m(e.code);n!=null&&(c({kind:`systemAction`,action:n,pressed:t}),n===`Chat`&&t&&c({kind:`focusChat`}))},ee=e=>h(e,!0),te=e=>h(e,!1),ne=[`Mouse Left`,`Mouse Middle`,`Mouse Right`,`Mouse Back`,`Mouse Forward`],g=e=>{f!=null&&(c({kind:`inputCaptured`,id:f,input:ne[e.button]??`Mouse Left`}),f=null)};window.addEventListener(`keydown`,ee),window.addEventListener(`keyup`,te),window.addEventListener(`pointerdown`,g,!0);let re=!1,_=()=>{setTimeout(()=>{re=!0,c({kind:`event`,name:`playerReady`}),c({kind:`chatVisibility`,open:!0});let e=[564,60,0],t=n=>{let r=e[n];c({kind:`sceneLoading`,state:{visible:r>0,realmConnected:!0,title:`Genesis Plaza`,pendingAssets:r>0?r:null}}),r>0&&setTimeout(()=>t(n+1),250)};t(0)},500),c({kind:`realmInfo`,realm:`https://realm-provider.decentraland.org/main`,isWorld:!1}),c({kind:`sceneInfo`,title:`Genesis Plaza`});let e=0;u=setInterval(()=>{e+=.05;let t=e*.08,n=Math.cos(t)*40,r=Math.sin(t)*40,i=Math.atan2(-Math.sin(t),Math.cos(t))*180/Math.PI;c({kind:`playerPose`,x:n,z:r,yaw:i,camYaw:i})},50),setTimeout(()=>c({kind:`members`,members:Dt}),1400);let t=Number(new URLSearchParams(location.search).get(`simhover`)??0);if(t>0){let e=[{button:0,text:`Show Profile`,enabled:!0},{button:1,text:`Open`,enabled:!0},{button:2,text:`Inspect`,enabled:!0},{button:8,text:`Jump`,enabled:!0},{button:4,text:`Grab`,enabled:!1,tooFarReason:`camera`},{button:10,text:`Use`,enabled:!0},{button:11,text:`Activate`,enabled:!0}].slice(0,Math.min(t,7));setTimeout(()=>c({kind:`hover`,actions:e}),1500)}setTimeout(()=>c({kind:`friends`,available:!0,friends:[{address:`0x5854cce95d5e25817b41f4c41f06b695a83bc495`,name:`Mojito`,status:`online`,picture:`https://profile-images.decentraland.org/entities/bafkreid5btlh76opew65hxu6dtkdo6ybqhymdof6vrrmjy2p5a74oy4huq/face.png`},{address:`0x6723dcb07f3ca735223cd1c0acfa62dd994a1bb4`,name:`Sharknado`,status:`online`},{address:`0x1e105bb213754519903788022b962fe2b9c4b263`,name:`Pravus`,status:`away`},{address:`0x3a1b2c4d5e6f7081920a3b4c5d6e7f8091a2b3c4`,name:`Clara#1l0u`,status:`offline`}],received:[{id:`r1`,address:`0x77a0b1c2d3e4f5061728394a5b6c7d8e9f001122`,name:`SpottyGoat`,message:`Met you at the plaza!`}],sent:[{id:`s1`,address:`0x9f8c2a1b4d6e7f0a3b5c8d9e1f2a4b6c8d0e1f23`,name:`Johnny`}],blocked:[]}),1600),setTimeout(()=>c({kind:`settings`,settings:Lt}),1700),[[`0x5854cce95d5e25817b41f4c41f06b695a83bc495`,`gm everyone 👋`],[`0x6723dcb07f3ca735223cd1c0acfa62dd994a1bb4`,`anyone going to the event?`],[`0x1e105bb213754519903788022b962fe2b9c4b263`,`this plaza looks great`]].forEach(([e,t],n)=>setTimeout(()=>c({kind:`chat`,chat:{sender:e,message:t,channel:`Nearby`}}),2500+n*2200)),new URLSearchParams(location.search).get(`perm`)===`1`&&setTimeout(()=>c({kind:`permissionRequest`,id:1,ty:`ChangeRealm`,sceneName:`Genesis Plaza`,scene:`bafkreigenesisplazahash`,realm:`https://realm-provider.decentraland.org/main`,additional:`Jump to DCL Kickoff Challenge?`}),3e3)};return o.onmessage=async e=>{let n=e.data;if(n?.to!==`scene`)return;let o=n.msg;if(o.kind===`hello`){c({kind:`bridgeReady`}),re&&c({kind:`event`,name:`playerReady`});return}if(await s(t.latency),o.kind===`sendChat`){c({kind:`chat`,chat:{sender:`You`,message:o.message,channel:o.channel}});return}if(o.kind!==`navAction`&&o.kind!==`friendAction`){if(o.kind===`getSettings`){c({kind:`settings`,settings:Lt});return}if(o.kind===`setSetting`){let e=Lt.find(e=>e.name===o.name);e&&(e.value=o.value),c({kind:`settings`,settings:Lt});return}if(o.kind===`getBindings`){c({kind:`bindings`,bindings:d});return}if(o.kind===`setBindings`){d=o.bindings,c({kind:`bindings`,bindings:d});return}if(o.kind===`resetBindings`){d=Rt(),c({kind:`bindings`,bindings:d});return}if(o.kind===`captureInput`){f=o.id;return}if(o.kind===`uiFocus`){p=o.text;return}if(o.kind===`getEmotes`){c({kind:`emotes`,emotes:It()});return}if(o.kind!==`triggerEmote`&&o.kind!==`equipEmote`){if(o.kind===`getWearables`){c({kind:`wearables`,equipped:Pt()});return}if(o.kind===`catalogQuery`){if(o.catalog!==`wearables`){c({kind:`catalogPage`,catalog:o.catalog,items:[],total:0,requestId:o.requestId});return}let e=M.slice();o.category!=null&&o.category!==`all`&&(e=e.filter(e=>e.category===o.category)),o.search!=null&&o.search!==``&&(e=e.filter(e=>(e.name??``).toLowerCase().includes(o.search.toLowerCase()))),o.collectiblesOnly===!0&&(e=e.filter(e=>(e.rarity??`base`)!==`base`));let t=o.direction===`asc`?1:-1;o.orderBy===`name`?e.sort((e,n)=>t*(e.name??``).localeCompare(n.name??``)):o.orderBy===`rarity`&&e.sort((e,n)=>t*(Ot.indexOf(e.rarity)-Ot.indexOf(n.rarity)));let n=e.length,r=o.page*o.pageSize;c({kind:`catalogPage`,catalog:`wearables`,items:e.slice(r,r+o.pageSize),total:n,requestId:o.requestId});return}if(o.kind===`equip`){let e=new Set(o.urns);for(let t of M)t.equipped=e.has(t.urn);c({kind:`wearables`,equipped:Pt()});return}if(o.kind===`getOutfits`){c({kind:`outfits`,metadata:a});return}if(o.kind===`saveOutfit`){a.outfits=a.outfits.filter(e=>e.slot!==o.slot),a.outfits.push({slot:o.slot,outfit:jt(Pt().map(e=>e.urn))}),a.outfits.sort((e,t)=>e.slot-t.slot),c({kind:`outfits`,metadata:a});return}if(o.kind===`deleteOutfit`){a.outfits=a.outfits.filter(e=>e.slot!==o.slot),c({kind:`outfits`,metadata:a});return}if(o.kind===`equipOutfit`){let e=a.outfits.find(e=>e.slot===o.slot);if(e){let t=new Set(e.outfit.wearables);for(let e of M)e.equipped=t.has(e.urn);c({kind:`wearables`,equipped:Pt()})}return}if(o.kind===`setMic`){c({kind:`mic`,enabled:o.enabled,available:!0});return}if(o.kind===`getMap`){c({kind:`mapState`,x:0,y:0});return}if(o.kind!==`engineViewport`&&o.kind!==`minimapConfig`&&o.kind!==`previewAvatar`){if(o.kind===`teleport`){c({kind:`mapState`,x:o.x,y:o.y});return}if(o.kind!==`changeRealm`&&o.kind!==`permissionResolve`){if(o.kind===`getCommunities`){c({kind:`communities`,communities:j});return}if(o.kind===`createCommunity`){j.unshift({id:`new-${j.length}`,name:o.name,description:o.description,thumbnail:``,membersCount:1,role:`owner`,ownerName:`You`,privacy:o.privacy}),c({kind:`communities`,communities:j});return}if(o.kind===`joinCommunity`){let e=j.find(e=>e.id===o.id);e&&(e.role=`member`,e.membersCount+=1),c({kind:`communities`,communities:j});return}if(o.kind===`leaveCommunity`){let e=j.find(e=>e.id===o.id);e&&(e.role=`none`,e.membersCount=Math.max(0,e.membersCount-1)),c({kind:`communities`,communities:j});return}if(o.kind===`getCommunityDetail`){let e=[`DCLOfficial`,`KazeNoKai`,`METAWOLF`,`laurenmae`,`Eax`,`Thund`,`aixa`,`Kimbo`,`BayBackner`,`Rochyou`,`Soultasium`,`franfranfran`,`olavra`,`Meshroom`],t=e=>`0x${(e+1).toString(16).padStart(40,`0`)}`,n=864e5;c({kind:`communityDetail`,id:o.id,members:e.map((e,n)=>({address:t(n),name:e,role:n===0?`owner`:n<3?`moderator`:`member`,picture:`https://i.pravatar.cc/80?u=${e}`,hasClaimedName:!0,isFriend:n%5==0})),posts:[{id:`p1`,author:`Kimbo`,authorAddress:t(7),authorPicture:`https://i.pravatar.cc/80?u=Kimbo`,text:`It was TIME for an update. See you all in the new Plaza. Enjoy!`,timestamp:Date.now()-2*n,likes:10},{id:`p2`,author:`Kimbo`,authorAddress:t(7),authorPicture:`https://i.pravatar.cc/80?u=Kimbo`,text:`EPIC Launch Party happening now in the theatre!`,timestamp:Date.now()-16*n,likes:4},{id:`p3`,author:`Kimbo`,authorAddress:t(7),authorPicture:`https://i.pravatar.cc/80?u=Kimbo`,text:`Hey everyone! Happy Epic and Mobile Launch Day!!! Please help us spread the word and get ready to celebrate together on April 2nd! It will be EPIC.`,timestamp:Date.now()-18*n,likes:1}],places:[{id:`pl1`,title:`Music Festival Main Stage`,thumbnail:`https://picsum.photos/seed/mfest/420/260`,positions:`-66,56`,likeRate:1}],photos:Array.from({length:9},(e,t)=>({id:`ph${t}`,url:`https://picsum.photos/seed/dclph${t}/600/600`,thumbnail:`https://picsum.photos/seed/dclph${t}/300/300`})),events:[{id:`e1`,name:`Watch scary movies with Cult Horror Club`,thumbnail:`https://picsum.photos/seed/horror1/200/120`,startsAt:Date.now()+1*n},{id:`e2`,name:`Pride Sound Set with Artist X`,thumbnail:`https://picsum.photos/seed/pride/200/120`,startsAt:Date.now()+1*n+216e5},{id:`e3`,name:`Join DEEJAY FAMILY at Takeover Tuesdays`,thumbnail:`https://picsum.photos/seed/takeover/200/120`,startsAt:Date.now()+4*n},{id:`e4`,name:`PRIDE: Join Watch Party Wednesdays`,thumbnail:`https://picsum.photos/seed/watch/200/120`,startsAt:Date.now()+5*n}]});return}if(o.kind===`getNotifications`){c({kind:`notifications`,notifications:r});return}if(o.kind===`markNotificationsRead`){for(let e of r)o.ids.includes(e.id)&&(e.read=!0);return}if(o.kind===`getGallery`){c({kind:`gallery`,photos:i,current:i.length,max:500});return}if(o.kind===`getGalleryPhoto`){c({kind:`galleryPhoto`,id:o.id,meta:{userName:t.hasPreviousLogin?`Mojito`:`Guest`,userAddress:t.userId,sceneName:`Genesis Plaza`,x:-9,y:14,realm:`main`,people:Dt.slice(0,3).map(e=>({address:e.address,name:e.name||`Guest`,isGuest:!1}))}});return}if(o.kind===`deleteGalleryPhoto`){let e=i.findIndex(e=>e.id===o.id);e>=0&&i.splice(e,1),c({kind:`gallery`,photos:i,current:i.length,max:500});return}if(o.kind===`getProfile`){c({kind:`profile`,profile:Vt(t)});return}if(o.kind===`getOwnedNames`){c({kind:`ownedNames`,names:Bt(t)});return}if(o.kind===`saveProfile`){let{kind:e,...n}=o;if(n.name===`robtfmfail`){c({kind:`profileSaved`,ok:!1,error:`failed to deploy to server.`});return}zt.push(n),c({kind:`profileSaved`,ok:!0}),c({kind:`profile`,profile:Vt(t)});return}if(o.kind===`getUserProfile`){if(o.address.toLowerCase()===t.userId.toLowerCase()){c({kind:`userProfile`,address:o.address,profile:Vt(t)});return}let e=Dt.find(e=>e.address.toLowerCase()===o.address.toLowerCase())?.name||`${o.address.slice(0,6)}…${o.address.slice(-4)}`;c({kind:`userProfile`,address:o.address,profile:Et(o.address,e,!1)});return}if(o.kind===`reloadScene`){c({kind:`chat`,chat:{sender:``,message:`Reloading the current scene…`,channel:`Nearby`}});return}if(o.kind===`consoleCommand`){let e=o.args??[],t=o.command===`help`&&e.length===0?`Available commands:
|
|
5
|
-
/help - List available commands
|
|
6
|
-
/teleport - set location
|
|
7
|
-
/crdt_snapshot - (hidden by the HUD)`:`(mock) ran /${o.command} ${e.join(` `)}`.trim();c({kind:`consoleReply`,command:o.command,args:e,ok:!0,output:t});return}switch(o.method){case`getPreviousLogin`:c({kind:`rpc:res`,id:o.id,ok:!0,value:{userId:t.hasPreviousLogin?t.userId:null}});return;case`loginPrevious`:c({kind:`rpc:res`,id:o.id,ok:!0,value:{success:!0,error:``}}),_();return;case`loginGuest`:c({kind:`rpc:res`,id:o.id,ok:!0}),_();return;case`loginIdentity`:c({kind:`rpc:res`,id:o.id,ok:!0}),_();return;case`loginNew`:c({kind:`loginCode`,code:`42`}),l={id:o.id,timer:setTimeout(()=>{l=null,c({kind:`rpc:res`,id:o.id,ok:!0,value:{success:!0,error:``}}),_()},2500)};return;case`loginCancel`:case`logout`:l!=null&&(clearTimeout(l.timer),c({kind:`rpc:res`,id:l.id,ok:!0,value:{success:!1,error:`cancelled`}}),l=null),c({kind:`rpc:res`,id:o.id,ok:!0});return}}}}}},()=>{window.removeEventListener(`keydown`,ee),window.removeEventListener(`keyup`,te),window.removeEventListener(`pointerdown`,g,!0),u!=null&&clearInterval(u),o.close()}}var P={root:`_root_byo9o_2`,tabs:`_tabs_byo9o_14`,tab:`_tab_byo9o_14`,tabActive:`_tabActive_byo9o_43`,close:`_close_byo9o_47`,searchRow:`_searchRow_byo9o_63`,searchIcon:`_searchIcon_byo9o_70`,search:`_search_byo9o_63`,body:`_body_byo9o_97`,sectionHeader:`_sectionHeader_byo9o_111`,grid:`_grid_byo9o_123`,emoji:`_emoji_byo9o_128`,noResults:`_noResults_byo9o_145`};function Gt({emojis:e,onPick:t}){return(0,A.jsx)(`div`,{className:P.grid,children:e.map(e=>(0,A.jsx)(`button`,{type:`button`,className:P.emoji,title:e.expression,onClick:()=>t(e),children:e.emoji},e.code))})}function Kt({onPick:e,onClose:t}){let[n,r]=(0,k.useState)(0),[i,a]=(0,k.useState)(``),[o,s]=(0,k.useState)(()=>Je()),c=t=>{e(t.emoji),s(qe(t.code))},l=i.trim(),u=(0,k.useMemo)(()=>l?Xe(l,80):[],[l]),d=(0,k.useMemo)(()=>o.map(e=>Qe.get(e)).filter(e=>e!=null),[o]),f=Ye[n];return(0,A.jsxs)(`div`,{className:P.root,role:`dialog`,"aria-label":`Emoji picker`,children:[(0,A.jsxs)(`div`,{className:P.tabs,children:[Ye.map((e,t)=>(0,A.jsx)(`button`,{type:`button`,className:`${P.tab} ${t===n&&!l?P.tabActive:``}`.trim(),title:e.name,onClick:()=>{r(t),a(``)},children:e.icon},e.name)),(0,A.jsx)(`button`,{type:`button`,className:P.close,title:`Close`,onClick:t,children:`×`})]}),(0,A.jsxs)(`div`,{className:P.searchRow,children:[(0,A.jsx)(`span`,{className:P.searchIcon,"aria-hidden":`true`,children:`🔍`}),(0,A.jsx)(`input`,{className:P.search,value:i,onChange:e=>a(e.target.value),placeholder:`Search emoji`,onKeyDown:e=>e.stopPropagation()})]}),(0,A.jsx)(`div`,{className:P.body,children:l?u.length>0?(0,A.jsx)(Gt,{emojis:u,onPick:c}):(0,A.jsx)(`div`,{className:P.noResults,children:`No results`}):(0,A.jsxs)(A.Fragment,{children:[d.length>0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:P.sectionHeader,children:`Frequently used`}),(0,A.jsx)(Gt,{emojis:d,onPick:c})]}),(0,A.jsx)(`div`,{className:P.sectionHeader,children:f.name}),(0,A.jsx)(Gt,{emojis:f.emojis,onPick:c})]})})]})}var qt=/(?<url>https?:\/\/[^\s<>"']+)|(?<world>[a-z0-9][\w-]*\.(?:dcl\.)?eth\b)|(?<loc>-?\d{1,3}\s*,\s*-?\d{1,3})|(?<mention>@[\w-]+(?:#[\w]+)?)/gi;function Jt(e){let t=[],n=0;for(let r of e.matchAll(qt)){let i=r.index??0;i>n&&t.push({type:`text`,value:e.slice(n,i)});let a=r.groups??{};if(a.url)t.push({type:`url`,value:a.url});else if(a.world)t.push({type:`world`,value:a.world});else if(a.loc){let[e,n]=a.loc.split(`,`).map(e=>parseInt(e.trim(),10));t.push({type:`location`,value:a.loc,x:e,y:n})}else if(a.mention){let[e,n]=a.mention.slice(1).split(`#`);t.push({type:`mention`,value:a.mention,name:e,tag:n})}n=i+r[0].length}return n<e.length&&t.push({type:`text`,value:e.slice(n)}),t}function Yt(e){let t=new Map;for(let n of e)n.name.trim()&&(t.set(n.name.toLowerCase(),n.address),t.set(n.name.split(`#`)[0].toLowerCase(),n.address));return t}function Xt(e,t){return t.get(`${e.name}#${e.tag}`.toLowerCase())??t.get(e.name.toLowerCase())}function Zt(e,t,n){if(!t)return!1;let r=t.name?.split(`#`)[0].toLowerCase();return Jt(e).some(e=>{if(e.type!==`mention`)return!1;let i=Xt(e,n);return i&&t.address&&i.toLowerCase()===t.address.toLowerCase()||!!r&&e.name.toLowerCase()===r})}function Qt({text:e,members:t,styles:n,onMention:r,onLocation:i,onWorld:a}){let o=Yt(t);return(0,A.jsx)(A.Fragment,{children:Jt(e).map((e,t)=>{if(e.type===`url`)return(0,A.jsx)(`a`,{className:n.url,href:e.value,target:`_blank`,rel:`noreferrer noopener`,children:e.value},t);if(e.type===`world`)return a?(0,A.jsx)(`button`,{type:`button`,className:n.world,onClick:()=>a(e.value),children:e.value},t):(0,A.jsx)(`span`,{children:e.value},t);if(e.type===`location`)return(0,A.jsx)(`button`,{type:`button`,className:n.location,onClick:()=>i(e.x,e.y),children:e.value},t);if(e.type===`mention`){let i=Xt(e,o);return i?(0,A.jsxs)(`button`,{type:`button`,className:n.mention,onClick:t=>r(i,e.name,t),onContextMenu:t=>r(i,e.name,t),children:[`@`,e.name]},t):(0,A.jsx)(`span`,{children:e.value},t)}return(0,A.jsx)(`span`,{children:e.value},t)})})}var F={root:`_root_1mxu6_4`,open:`_open_1mxu6_24`,active:`_active_1mxu6_31`,messages:`_messages_1mxu6_40`,nav:`_nav_1mxu6_45`,navLeft:`_navLeft_1mxu6_57`,channelIcon:`_channelIcon_1mxu6_64`,navTitle:`_navTitle_1mxu6_69`,navRight:`_navRight_1mxu6_76`,glyph:`_glyph_1mxu6_83`,glyphLg:`_glyphLg_1mxu6_86`,empty:`_empty_1mxu6_114`,dayRow:`_dayRow_1mxu6_121`,dayPill:`_dayPill_1mxu6_126`,entry:`_entry_1mxu6_137`,bubble:`_bubble_1mxu6_142`,name:`_name_1mxu6_152`,tag:`_tag_1mxu6_157`,text:`_text_1mxu6_161`,time:`_time_1mxu6_172`,pickerWrap:`_pickerWrap_1mxu6_179`,suggest:`_suggest_1mxu6_180`,suggestList:`_suggestList_1mxu6_194`,suggestItem:`_suggestItem_1mxu6_202`,suggestActive:`_suggestActive_1mxu6_218`,suggestGlyph:`_suggestGlyph_1mxu6_222`,suggestName:`_suggestName_1mxu6_226`,noResults:`_noResults_1mxu6_229`,inputRow:`_inputRow_1mxu6_238`,input:`_input_1mxu6_238`,inputBare:`_inputBare_1mxu6_267`,ring:`_ring_1mxu6_271`,emojiBtn:`_emojiBtn_1mxu6_280`,membersPanel:`_membersPanel_1mxu6_288`,membersHeader:`_membersHeader_1mxu6_296`,back:`_back_1mxu6_305`,membersTitle:`_membersTitle_1mxu6_322`,membersCount:`_membersCount_1mxu6_327`,personIcon:`_personIcon_1mxu6_336`,membersList:`_membersList_1mxu6_340`,memberRow:`_memberRow_1mxu6_353`,memberInfo:`_memberInfo_1mxu6_363`,memberName:`_memberName_1mxu6_369`,memberStatus:`_memberStatus_1mxu6_378`,avatarBtn:`_avatarBtn_1mxu6_398`,url:`_url_1mxu6_409`,location:`_location_1mxu6_417`,mention:`_mention_1mxu6_418`,world:`_world_1mxu6_419`,mentionMe:`_mentionMe_1mxu6_435`},$t=500,en=/^0x[0-9a-fA-F]{6,}$/,tn=[`#73d3d3`,`#acf8f8`,`#ff8362`,`#ff4bed`,`#caff73`,`#a14bf3`,`#e8b9ff`,`#fea217`,`#81e1ff`,`#ff7439`,`#ffa25a`,`#ffc95b`,`#a0abff`,`#c640cd`],nn=`#61d04f`;function rn(e){return!e||e.toLowerCase()===`system`}function an(e){return en.test(e)?`${e.slice(0,6)}…${e.slice(-4)}`:e}function on(e){return rn(e)?`DCL System`:an(e)}function sn(e){return e.name.trim()?e.name:an(e.address)}function cn(e){let t=e.indexOf(`#`);return t>=0?{base:e.slice(0,t),tag:e.slice(t)}:{base:e,tag:``}}function ln(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return t}function un(e){return rn(e)?nn:tn[ln(e)%tn.length]}function dn(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function fn(e){let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function pn(e){return fn(e)===fn(Date.now())?`Today`:new Date(e).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`})}function mn(){return(0,A.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsx)(`circle`,{cx:`8`,cy:`5`,r:`2.6`,stroke:`currentColor`,strokeWidth:`1.4`}),(0,A.jsx)(`path`,{d:`M3.2 13c0-2.4 2.1-3.8 4.8-3.8s4.8 1.4 4.8 3.8`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`})]})}function hn(){return(0,A.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 22 22`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsx)(`circle`,{cx:`11`,cy:`11`,r:`10`,stroke:`currentColor`,strokeWidth:`2`}),(0,A.jsx)(`circle`,{cx:`7.6`,cy:`9`,r:`1.15`,fill:`currentColor`}),(0,A.jsx)(`circle`,{cx:`14.4`,cy:`9`,r:`1.15`,fill:`currentColor`}),(0,A.jsx)(`path`,{d:`M7 13.4c1 1.6 2.5 2.4 4 2.4s3-.8 4-2.4`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`})]})}function gn({len:e}){let t=Math.min(1,e/$t),n=2*Math.PI*8,r=t>=.9?`var(--brand)`:t>=.7?`var(--gold)`:`var(--green)`;return(0,A.jsxs)(`svg`,{className:F.ring,width:`20`,height:`20`,viewBox:`0 0 20 20`,"aria-hidden":`true`,children:[(0,A.jsx)(`circle`,{cx:`10`,cy:`10`,r:8,fill:`none`,stroke:`rgba(255,255,255,0.25)`,strokeWidth:`2`}),(0,A.jsx)(`circle`,{cx:`10`,cy:`10`,r:8,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:n,strokeDashoffset:n*(1-t),transform:`rotate(-90 10 10)`})]})}function _n({ts:e}){return(0,A.jsx)(`div`,{className:F.dayRow,children:(0,A.jsx)(`span`,{className:F.dayPill,children:pn(e)})})}var vn={url:F.url,mention:F.mention,location:F.location,world:F.world};function yn({line:e,name:t,picture:n,members:r=[],me:a,onOpenProfile:o,onLocation:s,onVisitWorld:c}){let l=un(e.sender),{base:u,tag:d}=cn(t),f={address:e.sender,name:t,picture:n},p=Zt(e.message,a??null,Yt(r)),m=e=>{e.type===`contextmenu`&&e.preventDefault(),o?.(f,e)};return(0,A.jsxs)(`div`,{className:`${F.entry} ${p?F.mentionMe:``}`.trim(),children:[(0,A.jsx)(`button`,{type:`button`,className:F.avatarBtn,"aria-label":`View ${u}`,onClick:m,onContextMenu:m,children:(0,A.jsx)(i,{src:n,name:t,color:l,size:28})}),(0,A.jsxs)(`div`,{className:F.bubble,children:[(0,A.jsxs)(`button`,{type:`button`,className:F.name,style:{color:l},onClick:m,onContextMenu:m,children:[u,d&&(0,A.jsx)(`span`,{className:F.tag,children:d})]}),(0,A.jsx)(`span`,{className:F.text,children:(0,A.jsx)(Qt,{text:e.message,members:r,styles:vn,onMention:(e,t,n)=>{n.type===`contextmenu`&&n.preventDefault();let i=r.find(t=>t.address.toLowerCase()===e.toLowerCase());o?.({address:e,name:i?.name??`@${t}`,picture:i?.picture},n)},onLocation:(e,t)=>s?.(e,t),onWorld:c})}),(0,A.jsx)(`span`,{className:F.time,children:dn(e.ts)})]})]})}function bn({member:e}){let{base:t,tag:n}=cn(sn(e)),r=un(e.address);return(0,A.jsxs)(`div`,{className:F.memberRow,children:[(0,A.jsx)(i,{src:e.picture,name:t,color:r,size:40,status:`online`}),(0,A.jsxs)(`div`,{className:F.memberInfo,children:[(0,A.jsxs)(`span`,{className:F.memberName,style:{color:r},children:[t,n&&(0,A.jsx)(`span`,{className:F.tag,children:n})]}),(0,A.jsx)(`span`,{className:F.memberStatus,children:`Online`})]})]})}function xn({members:e,onBack:t,onClose:n}){return(0,A.jsxs)(`div`,{className:F.membersPanel,children:[(0,A.jsxs)(`header`,{className:F.membersHeader,children:[(0,A.jsx)(v,{variant:`ghost`,className:F.glyphLg,"aria-label":`Back`,onClick:t,children:`‹`}),(0,A.jsx)(`span`,{className:F.membersTitle,children:`Nearby`}),(0,A.jsxs)(`span`,{className:F.membersCount,children:[(0,A.jsx)(`span`,{className:F.personIcon,"aria-hidden":`true`,children:`●`}),e.length,` Online`]}),(0,A.jsx)(v,{variant:`solid`,className:F.glyph,"aria-label":`Close chat`,onClick:n,children:`×`})]}),(0,A.jsx)(`div`,{className:F.membersList,children:e.length===0?(0,A.jsx)(`div`,{className:F.empty,children:`No one nearby`}):e.map(e=>(0,A.jsx)(bn,{member:e},e.address))})]})}function Sn({chat:e,hidden:t=!1,me:n,onTeleport:r,onVisitWorld:a}){let[o,s]=(0,k.useState)(``),[c,l]=(0,k.useState)(!1),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)([]),[m,h]=(0,k.useState)(null),[ee,te]=(0,k.useState)(!1),[ne,g]=(0,k.useState)(!1),[re,_]=(0,k.useState)(null),[y,ie]=(0,k.useState)([]),b=(0,k.useRef)(null),x=(0,k.useRef)(null),S=e.open,C=S&&(ee||ne||c),w=!C,T=(0,k.useMemo)(()=>{let t=new Map;for(let n of e.members)n.name.trim()&&t.set(n.address.toLowerCase(),n.name);return t},[e.members]),se=(0,k.useMemo)(()=>{let t=new Map;for(let n of e.members)n.picture&&t.set(n.address.toLowerCase(),n.picture);return t},[e.members]),ce=e=>T.get(e.toLowerCase())??on(e),le=(0,k.useMemo)(()=>{let t=[],n=``;for(let r of e.messages){let e=fn(r.ts);e!==n&&(t.push({kind:`day`,ts:r.ts,id:`day-${e}`}),n=e),t.push({kind:`msg`,line:r})}return t},[e.messages]);(0,k.useEffect)(()=>{if(!S)return;let e=b.current;e&&(e.scrollTop=e.scrollHeight)},[S,C]);let ue=(0,k.useRef)(!0);(0,k.useEffect)(()=>{let e=b.current;if(!e)return;let t=()=>{ue.current=e.scrollHeight-e.scrollTop-e.clientHeight<80};return e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)},[S]),(0,k.useEffect)(()=>{if(!S)return;let e=b.current;e&&ue.current&&(e.scrollTop=e.scrollHeight)},[e.messages,S]),(0,k.useEffect)(()=>{S&&x.current?.focus()},[S,e.focusTick]),(0,k.useEffect)(()=>{C||d(!1)},[C]);let de=()=>{e.open||e.toggle()},fe=(e,t)=>{oe(e.address,t.clientX,t.clientY)},pe=e=>{s(t=>`${t.replace(/\s*$/,``)} @${e} `.trimStart()),de(),x.current?.focus()};(0,k.useEffect)(()=>{e.pendingMention&&(pe(e.pendingMention),e.consumeMention())},[e.pendingMention]);let me=/@([\w-]*)$/,E=t=>{s(t);let n=t.match(Ze);h(n?n[1]:null),p(n?Xe(n[1]):[]);let r=t.match(me);_(r?r[1]:null);let i=(r?.[1]??``).toLowerCase();ie(r?e.members.filter(e=>(e.name||e.address).toLowerCase().includes(i)).slice(0,6):[])},D=e=>{let t=e.name.trim()?e.name.split(`#`)[0]:e.address;s(e=>e.replace(me,`@${t} `)),ie([]),_(null),x.current?.focus()},O=e=>{s(t=>{let n=t.match(Ze);return(n?t.slice(0,n.index):t)+e}),p([]),h(null),x.current?.focus()},he=()=>{o.trim()&&(e.send(o),s(``),p([]),h(null),ie([]),_(null))};return t?null:(0,A.jsxs)(`div`,{className:`${F.root} ${S?F.open:``} ${C?F.active:``}`.trim(),onMouseEnter:()=>te(!0),onMouseLeave:()=>te(!1),children:[S&&C&&(0,A.jsxs)(`header`,{className:F.nav,children:[(0,A.jsxs)(`div`,{className:F.navLeft,children:[(0,A.jsx)(ae,{size:26,className:F.channelIcon}),(0,A.jsx)(`span`,{className:F.navTitle,children:`Nearby`})]}),(0,A.jsxs)(`div`,{className:F.navRight,children:[e.members.length>0&&(0,A.jsxs)(v,{variant:`ghost`,shape:`pill`,active:u,"aria-label":`${e.members.length} nearby`,onClick:()=>d(e=>!e),children:[(0,A.jsx)(mn,{}),e.members.length]}),(0,A.jsx)(v,{variant:`solid`,className:F.glyph,"aria-label":`Close chat`,onClick:e.toggle,children:`×`})]})]}),S&&(0,A.jsx)(`div`,{ref:b,className:F.messages,children:le.length===0?(0,A.jsx)(`div`,{className:F.empty,children:`No messages yet`}):le.map(t=>t.kind===`day`?(0,A.jsx)(_n,{ts:t.ts},t.id):(0,A.jsx)(yn,{line:t.line,name:ce(t.line.sender),picture:se.get(t.line.sender.toLowerCase()),members:e.members,me:n,onOpenProfile:fe,onLocation:(e,t)=>r?.(e,t),onVisitWorld:a},t.line.id))}),C&&c&&(0,A.jsx)(`div`,{className:F.pickerWrap,children:(0,A.jsx)(Kt,{onPick:O,onClose:()=>l(!1)})}),C&&re!=null&&y.length>0&&(0,A.jsx)(`div`,{className:F.suggest,children:(0,A.jsx)(`ul`,{className:F.suggestList,children:y.map((e,t)=>(0,A.jsx)(`li`,{children:(0,A.jsxs)(`button`,{type:`button`,className:`${F.suggestItem} ${t===0?F.suggestActive:``}`.trim(),onClick:()=>D(e),children:[(0,A.jsx)(i,{src:e.picture,name:e.name,color:un(e.address),size:20}),(0,A.jsx)(`span`,{className:F.suggestName,children:e.name||an(e.address)})]})},e.address))})}),C&&m!=null&&(0,A.jsx)(`div`,{className:F.suggest,children:f.length===0?(0,A.jsx)(`div`,{className:F.noResults,children:`No results`}):(0,A.jsx)(`ul`,{className:F.suggestList,children:f.map((e,t)=>(0,A.jsx)(`li`,{children:(0,A.jsxs)(`button`,{type:`button`,className:`${F.suggestItem} ${t===0?F.suggestActive:``}`.trim(),onClick:()=>O(e.emoji),children:[(0,A.jsx)(`span`,{className:F.suggestGlyph,children:e.emoji}),(0,A.jsx)(`span`,{className:F.suggestName,children:e.expression})]})},e.code))})}),(0,A.jsxs)(`form`,{className:F.inputRow,onSubmit:e=>{e.preventDefault(),he()},children:[(0,A.jsx)(`input`,{ref:x,className:`${F.input} ${w?F.inputBare:``}`.trim(),value:o,onChange:e=>E(e.target.value),onFocus:()=>{g(!0),de()},onBlur:()=>g(!1),placeholder:ne?`Message Nearby`:`Press Enter to chat`,maxLength:$t,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(e.preventDefault(),y.length>0?D(y[0]):f.length>0?O(f[0].emoji):he()):_e(e)&&(re==null?m==null?c?l(!1):x.current?.blur():(h(null),p([])):(_(null),ie([])))}}),!w&&o.length>0&&(0,A.jsx)(gn,{len:o.length}),!w&&(0,A.jsx)(v,{variant:`ghost`,size:`sm`,active:c,className:F.emojiBtn,"aria-label":`Emoji`,onClick:()=>{de(),l(e=>!e)},children:(0,A.jsx)(hn,{})})]}),S&&C&&u&&(0,A.jsx)(xn,{members:e.members,onBack:()=>d(!1),onClose:()=>{d(!1),e.toggle()}})]})}var I={root:`_root_1qkin_5`,head:`_head_1qkin_25`,tabs:`_tabs_1qkin_34`,closeGlyph:`_closeGlyph_1qkin_39`,body:`_body_1qkin_44`,sectionHead:`_sectionHead_1qkin_59`,chev:`_chev_1qkin_75`,chevOpen:`_chevOpen_1qkin_80`,row:`_row_1qkin_84`,info:`_info_1qkin_94`,name:`_name_1qkin_101`,verified:`_verified_1qkin_113`,tag:`_tag_1qkin_118`,status:`_status_1qkin_122`,online:`_online_1qkin_127`,sub:`_sub_1qkin_130`,date:`_date_1qkin_140`,actions:`_actions_1qkin_145`,empty:`_empty_1qkin_157`,placeholder:`_placeholder_1qkin_164`,phIcon:`_phIcon_1qkin_172`,phTitle:`_phTitle_1qkin_183`,phText:`_phText_1qkin_188`,rowBtn:`_rowBtn_1qkin_196`};function Cn(e,t){return e.trim()?e:O(t)}function wn(e){return e.trim().length>0&&!e.includes(`#`)&&!/^0x[0-9a-f]+$/i.test(e)}function Tn(){return(0,A.jsxs)(`svg`,{className:I.verified,viewBox:`0 0 16 16`,"aria-label":`verified`,children:[(0,A.jsx)(`defs`,{children:(0,A.jsxs)(`linearGradient`,{id:`vrf`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,A.jsx)(`stop`,{offset:`0`,stopColor:`#ff2d55`}),(0,A.jsx)(`stop`,{offset:`1`,stopColor:`#c640cd`})]})}),(0,A.jsx)(`path`,{d:`M8 1l1.7 1.2 2.1-.2 1 1.8 1.9.9-.5 2 .9 1.9-1.6 1.4.1 2.1-2 .6-1.1 1.8-2-.7-2 .7-1.1-1.8-2-.6.1-2.1L1.6 8.6l.9-1.9-.5-2 1.9-.9 1-1.8 2.1.2z`,fill:`url(#vrf)`}),(0,A.jsx)(`path`,{d:`M5.5 8l1.7 1.7L10.8 6`,stroke:`#fff`,strokeWidth:`1.4`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function En({name:e,address:t}){let{base:n,tag:r}=ce(Cn(e,t));return(0,A.jsxs)(`span`,{className:I.name,style:{color:E(t)},children:[n,wn(e)&&(0,A.jsx)(Tn,{}),r&&(0,A.jsx)(`span`,{className:I.tag,children:r})]})}function Dn({open:e}){return(0,A.jsx)(`svg`,{className:`${I.chev} ${e?I.chevOpen:``}`.trim(),viewBox:`0 0 12 12`,"aria-hidden":`true`,children:(0,A.jsx)(`path`,{d:`M2.5 7.5L6 4l3.5 3.5`,stroke:`currentColor`,strokeWidth:`1.6`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function On({title:e,count:t,children:n}){let[r,i]=(0,k.useState)(!0);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,className:I.sectionHead,onClick:()=>i(e=>!e),children:[(0,A.jsx)(Dn,{open:r}),e,` (`,t,`)`]}),r&&n]})}var kn={online:`Online`,away:`Away`,offline:`Offline`};function An({friend:e,onOpen:t}){let n={address:e.address,name:e.name,picture:e.picture},r=e=>{e.type===`contextmenu`&&e.preventDefault(),t?.(n,e)};return(0,A.jsxs)(`button`,{type:`button`,className:`${I.row} ${I.rowBtn}`,onClick:r,onContextMenu:r,children:[(0,A.jsx)(i,{src:e.picture,name:Cn(e.name,e.address),color:E(e.address),size:40,status:e.status}),(0,A.jsxs)(`div`,{className:I.info,children:[(0,A.jsx)(En,{name:e.name,address:e.address}),(0,A.jsx)(`span`,{className:`${I.status} ${I[e.status]}`,children:kn[e.status]})]})]})}function jn(e){return e?new Date(e).toLocaleDateString([],{month:`short`,day:`numeric`}).toUpperCase():``}function Mn({req:e,onAccept:t,onReject:n}){return(0,A.jsxs)(`div`,{className:I.row,children:[(0,A.jsx)(i,{src:e.picture,name:Cn(e.name,e.address),color:E(e.address),size:40}),(0,A.jsxs)(`div`,{className:I.info,children:[(0,A.jsx)(En,{name:e.name,address:e.address}),e.message&&(0,A.jsx)(`span`,{className:I.sub,children:e.message})]}),(0,A.jsx)(`span`,{className:I.date,children:jn(e.createdAt)}),(0,A.jsxs)(`div`,{className:I.actions,children:[(0,A.jsx)(f,{variant:`secondary`,size:`sm`,onClick:n,children:`Delete`}),(0,A.jsx)(f,{variant:`primary`,size:`sm`,onClick:t,children:`Accept`})]})]})}function Nn({req:e,onCancel:t}){return(0,A.jsxs)(`div`,{className:I.row,children:[(0,A.jsx)(i,{src:e.picture,name:Cn(e.name,e.address),color:E(e.address),size:40}),(0,A.jsxs)(`div`,{className:I.info,children:[(0,A.jsx)(En,{name:e.name,address:e.address}),(0,A.jsx)(`span`,{className:I.sub,children:`Request sent`})]}),(0,A.jsx)(`span`,{className:I.date,children:jn(e.createdAt)}),(0,A.jsx)(`div`,{className:I.actions,children:(0,A.jsx)(f,{variant:`secondary`,size:`sm`,onClick:t,children:`Cancel`})})]})}function Pn({friends:e}){let[t,r]=(0,k.useState)(`friends`),a=(e,t)=>oe(e.address,t.clientX,t.clientY),{online:o,offline:s}=(0,k.useMemo)(()=>{let t=[],n=[];for(let r of[...e.list].sort((e,t)=>e.name.localeCompare(t.name)))(r.status===`offline`?n:t).push(r);return{online:t,offline:n}},[e.list]);if(!e.open)return null;let c=[{id:`friends`,label:`Friends`},{id:`requests`,label:`Requests`,badge:e.received.length},{id:`blocked`,label:`Blocked`}];return(0,A.jsxs)(`div`,{className:I.root,children:[(0,A.jsxs)(`header`,{className:I.head,children:[(0,A.jsx)(n,{variant:`underline`,className:I.tabs,items:c,value:t,onChange:r,"aria-label":`Friends sections`}),(0,A.jsx)(v,{variant:`solid`,className:I.closeGlyph,"aria-label":`Close friends`,onClick:e.toggle,children:`×`})]}),(0,A.jsx)(`div`,{className:I.body,children:e.available?t===`friends`?e.list.length===0?(0,A.jsx)(`div`,{className:I.empty,children:`No friends yet.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(On,{title:`Online`,count:o.length,children:o.map(e=>(0,A.jsx)(An,{friend:e,onOpen:a},e.address))}),(0,A.jsx)(On,{title:`Offline`,count:s.length,children:s.map(e=>(0,A.jsx)(An,{friend:e,onOpen:a},e.address))})]}):t===`requests`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(On,{title:`Received`,count:e.received.length,children:e.received.length===0?(0,A.jsx)(`div`,{className:I.empty,children:`No Requests`}):e.received.map(t=>(0,A.jsx)(Mn,{req:t,onAccept:()=>e.act(`accept`,t.address),onReject:()=>e.act(`reject`,t.address)},t.id))}),(0,A.jsx)(On,{title:`Sent`,count:e.sent.length,children:e.sent.length===0?(0,A.jsx)(`div`,{className:I.empty,children:`No Requests`}):e.sent.map(t=>(0,A.jsx)(Nn,{req:t,onCancel:()=>e.act(`cancel`,t.address)},t.id))})]}):e.blocked.length===0?(0,A.jsxs)(`div`,{className:I.placeholder,children:[(0,A.jsx)(`div`,{className:I.phIcon,"aria-hidden":`true`,children:`⊘`}),(0,A.jsx)(`div`,{className:I.phTitle,children:`No Blocked Accounts`}),(0,A.jsx)(`div`,{className:I.phText,children:`If you block someone, you won’t see each other in-world or exchange messages, and their name and messages are hidden in public chats.`})]}):e.blocked.map(t=>(0,A.jsxs)(`div`,{className:I.row,children:[(0,A.jsx)(i,{name:O(t),color:E(t),size:40}),(0,A.jsx)(`div`,{className:I.info,children:(0,A.jsx)(`span`,{className:I.name,children:O(t)})}),(0,A.jsx)(`div`,{className:I.actions,children:(0,A.jsx)(f,{variant:`secondary`,size:`sm`,onClick:()=>e.act(`unblock`,t),children:`Unblock`})})]},t)):(0,A.jsxs)(`div`,{className:I.placeholder,children:[(0,A.jsx)(`div`,{className:I.phTitle,children:`Friends aren’t available`}),(0,A.jsx)(`div`,{className:I.phText,children:`Sign in with a wallet to add and manage friends.`})]})})]})}var Fn=`__hudForwardedToCanvas`;function In(e){return e[Fn]=!0,e}function Ln(e){return e[Fn]===!0}var L={root:`_root_1s3k0_4`,groupTitle:`_groupTitle_1s3k0_14`,rows:`_rows_1s3k0_20`,pairBox:`_pairBox_1s3k0_28`,row:`_row_1s3k0_20`,quadBox:`_quadBox_1s3k0_43`,rowLabel:`_rowLabel_1s3k0_57`,chips:`_chips_1s3k0_62`,chipWrap:`_chipWrap_1s3k0_69`,chip:`_chip_1s3k0_62`,chipFixed:`_chipFixed_1s3k0_94`,chipConflict:`_chipConflict_1s3k0_101`,chipRemove:`_chipRemove_1s3k0_104`,chipAdd:`_chipAdd_1s3k0_124`,capturePrompt:`_capturePrompt_1s3k0_142`,captureHint:`_captureHint_1s3k0_148`},Rn=[[{Scene:`IaForward`},`Move Forward`],[{Scene:`IaBackward`},`Move Backward`],[{Scene:`IaLeft`},`Move Left`],[{Scene:`IaRight`},`Move Right`],[{Scene:`IaJump`},`Jump`],[{Scene:`IaWalk`},`Walk`],[{Scene:`IaModifier`},`Sprint / Modifier`],[{Scene:`IaPointer`},`Pointer / Interact`],[{Scene:`IaPrimary`},`Primary Action`],[{Scene:`IaSecondary`},`Secondary Action`],[{Scene:`IaAction3`},`Action 3`],[{Scene:`IaAction4`},`Action 4`],[{Scene:`IaAction5`},`Action 5`],[{Scene:`IaAction6`},`Action 6`],[{System:`PointAt`},`Point At`],[{System:`Microphone`},`Microphone`]],zn=[[{System:`Map`},`Map`],[{System:`Places`},`Places`],[{System:`Communities`},`Communities`],[{System:`Backpack`},`Backpack`],[{System:`Gallery`},`Gallery`],[{System:`Settings`},`Settings`],[{System:`Friends`},`Friends`],[{System:`ChatPanel`},`Chat Panel`],[{System:`Chat`},`Focus Chat`],[{System:`HideUi`},`Hide UI`],[{System:`HideNames`},`Hide Nametags`],[{System:`Cancel`},`Cancel`]],Bn=[[{System:`Emote`},`Emote Wheel`],...Array.from({length:10},(e,t)=>[{System:`QuickEmote${t}`},`Quick Emote ${t}`])],Vn=[[`Gameplay`,Rn],[`Interface`,zn],[`Emotes`,Bn],[`Camera`,[[{System:`CameraLock`},`Camera Look`],[{System:`CameraUp`},`Camera Up`],[{System:`CameraDown`},`Camera Down`],[{System:`CameraLeft`},`Camera Left`],[{System:`CameraRight`},`Camera Right`],[{System:`CameraZoomIn`},`Camera Zoom In`],[{System:`CameraZoomOut`},`Camera Zoom Out`],[{System:`RollLeft`},`Camera Roll Left`],[{System:`RollRight`},`Camera Roll Right`]]],[`Pointer & Scroll`,[[{System:`PointerUp`},`Pointer Up`],[{System:`PointerDown`},`Pointer Down`],[{System:`PointerLeft`},`Pointer Left`],[{System:`PointerRight`},`Pointer Right`],[{System:`ScrollUp`},`Scroll Up`],[{System:`ScrollDown`},`Scroll Down`],[{System:`ScrollLeft`},`Scroll Left`],[{System:`ScrollRight`},`Scroll Right`]]]],Hn=Vn.flatMap(([,e])=>e),Un=[[{Scene:`IaForward`},{Scene:`IaBackward`}],[{Scene:`IaLeft`},{Scene:`IaRight`}],[{System:`CameraUp`},{System:`CameraDown`}],[{System:`CameraLeft`},{System:`CameraRight`}],[{System:`PointerUp`},{System:`PointerDown`}],[{System:`PointerLeft`},{System:`PointerRight`}],[{System:`ScrollUp`},{System:`ScrollDown`}],[{System:`ScrollLeft`},{System:`ScrollRight`}],[{System:`CameraZoomIn`},{System:`CameraZoomOut`}],[{System:`RollLeft`},{System:`RollRight`}]],Wn={Up:`Down`,Down:`Up`,Left:`Right`,Right:`Left`},Gn=(e,t)=>Un.some(n=>D(n[0],e)&&D(n[1],t)||D(n[1],e)&&D(n[0],t)),Kn=[`CameraUp`,`CameraDown`,`CameraLeft`,`CameraRight`],qn=(e,t)=>Kn.every((n,r)=>{let i=e[t+r]?.[0];return i!=null&&`System`in i&&i.System===n});function Jn(e){let t=[];for(let n=0;n<e.length;n++)qn(e,n)?(t.push(e.slice(n,n+4)),n+=3):n+1<e.length&&Gn(e[n][0],e[n+1][0])?(t.push([e[n],e[n+1]]),n++):t.push([e[n]]);return t}var Yn=/^(MouseMove|MouseWheel|GamepadLeft|GamepadRight|GamepadLeftTrigger|GamepadRightTrigger) (Up|Down|Left|Right)$/;function Xn(e,t,n){return e.some(([e])=>D(e,t))?e.map(([e,r])=>D(e,t)?[e,n]:[e,r]):[...e,[t,n]]}var Zn=(e,t)=>e.find(([e])=>D(e,t))?.[1]??[];function Qn(e,t,n,r){if(er(t,r))return e;let i=Yn.exec(r),a=i==null?void 0:Un.find(e=>e.some(e=>D(e,t)));if(i==null||a==null){let i=[...Zn(e,t)];return i[n]=r,Xn(e,t,[...new Set(i)])}let[o,s]=[i[1],i[2]],c=D(a[0],t)?a[1]:a[0],l=(e,t,n)=>Xn(e,t,[...Zn(e,t).filter(e=>!e.startsWith(`${o} `)),`${o} ${n}`]);return l(l(e,t,s),c,Wn[s])}var $n=e=>`System`in e&&e.System.startsWith(`Scroll`),er=(e,t)=>$n(e)&&t.startsWith(`MouseWheel `);function tr(e,t,n){return $n(t)?[]:Hn.filter(([r])=>!$n(r)&&!D(r,t)&&(e.find(([e])=>D(r,e))?.[1]??[]).includes(n)).map(([,e])=>e)}function nr({action:e,label:t,onRebind:n,onRemove:r}){let i=je(),a=w(i,e);return(0,A.jsxs)(`div`,{className:L.row,children:[(0,A.jsx)(`span`,{className:L.rowLabel,children:t}),(0,A.jsxs)(`span`,{className:L.chips,children:[a.map((a,o)=>{if(er(e,a))return(0,A.jsx)(`span`,{className:L.chipWrap,children:(0,A.jsx)(`span`,{className:`${L.chip} ${L.chipFixed}`,title:`The wheel always scrolls`,children:T(i,a)})},`${a}${o}`);let s=tr(i.bindings,e,a);return(0,A.jsxs)(`span`,{className:L.chipWrap,children:[(0,A.jsx)(`button`,{type:`button`,className:`${L.chip} ${s.length>0?L.chipConflict:``}`.trim(),title:s.length>0?`Also bound to ${s.join(`, `)} — click to rebind`:`Click to rebind`,onClick:()=>n(e,t,o),children:T(i,a)}),(0,A.jsx)(`button`,{type:`button`,className:L.chipRemove,"aria-label":`Remove ${T(i,a)} from ${t}`,onClick:()=>r(e,o),children:`×`})]},`${a}${o}`)}),(0,A.jsx)(`button`,{type:`button`,className:L.chipAdd,"aria-label":`Add a binding for ${t}`,onClick:()=>n(e,t,a.length),children:`+`})]})]})}var rr=[`Mouse Left`,`Mouse Middle`,`Mouse Right`,`Mouse Back`,`Mouse Forward`];function ir({cancelHint:e,label:t,onMouse:n}){return(0,k.useEffect)(()=>{let e=document.getElementById(`mygame-canvas`),t=e=>{e.preventDefault(),e.stopPropagation()},r=null,i=i=>{Ln(i)||(t(i),e?.dispatchEvent(In(new PointerEvent(i.type,i))),i.type===`pointerdown`?r=i.button:r===i.button&&n(rr[i.button]??`Mouse Left`))},a=r=>{Ln(r)||(t(r),e?.dispatchEvent(In(new WheelEvent(`wheel`,r))),n(Math.abs(r.deltaY)>=Math.abs(r.deltaX)?r.deltaY<0?`MouseWheel Up`:`MouseWheel Down`:r.deltaX<0?`MouseWheel Left`:`MouseWheel Right`))};return window.addEventListener(`pointerdown`,i,!0),window.addEventListener(`pointerup`,i,!0),window.addEventListener(`wheel`,a,{capture:!0,passive:!1}),window.addEventListener(`click`,t,!0),window.addEventListener(`auxclick`,t,!0),window.addEventListener(`contextmenu`,t,!0),()=>{window.removeEventListener(`pointerdown`,i,!0),window.removeEventListener(`pointerup`,i,!0),window.removeEventListener(`wheel`,a,{capture:!0}),window.removeEventListener(`click`,t,!0),window.removeEventListener(`auxclick`,t,!0),window.removeEventListener(`contextmenu`,t,!0)}},[n]),(0,A.jsxs)(l,{title:`Rebind ${t}`,width:400,closeButton:!1,ariaLabel:`Rebind ${t}`,children:[(0,A.jsx)(`div`,{className:L.capturePrompt,children:`Press a key, mouse or gamepad button…`}),e!=null&&(0,A.jsxs)(`div`,{className:L.captureHint,children:[e,` to cancel`]})]})}function ar(e){if(D(e,{System:`Cancel`}))return[];let t=w(Ue(),{System:`Cancel`});return t.length>0?t:[`Escape`]}function or({bindings:e}){let t=(t,n,r)=>{let{input:i,cancel:a}=e.capture(),o=ar(t),s=!1,c=n=>{s||(s=!0,a(),l(),!o.includes(n)&&e.set(Qn(Ue().bindings,t,r,n)))},l=b(()=>(0,A.jsx)(ir,{label:n,cancelHint:o.length>0?T(Ue(),o[0]):void 0,onMouse:c}),{onClose:()=>{s||(s=!0,a())}});i.then(c)},n=(t,n)=>{let r=Ue().bindings,i=Zn(r,t).filter((e,t)=>t!==n);e.set(Xn(r,t,i))};return(0,A.jsx)(`div`,{className:L.root,children:Vn.map(([e,r])=>(0,A.jsxs)(`section`,{children:[(0,A.jsx)(`h2`,{className:L.groupTitle,children:e}),(0,A.jsx)(`div`,{className:L.rows,children:Jn(r).map(e=>e.length>1?(0,A.jsx)(`div`,{className:e.length===4?`${L.pairBox} ${L.quadBox}`:L.pairBox,children:e.map(([e,r])=>(0,A.jsx)(nr,{action:e,label:r,onRebind:t,onRemove:n},r))},e[0][1]):(0,A.jsx)(nr,{action:e[0][0],label:e[0][1],onRebind:t,onRemove:n},e[0][1]))})]},e))})}var R={head:`_head_ans8i_2`,title:`_title_ans8i_8`,reset:`_reset_ans8i_14`,card:`_card_ans8i_34`,grid:`_grid_ans8i_41`,field:`_field_ans8i_48`,fieldHead:`_fieldHead_ans8i_53`,label:`_label_ans8i_59`,value:`_value_ans8i_64`,empty:`_empty_ans8i_70`},sr=`Key Bindings`;function cr(e){return e.replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function lr(e){return e.namedVariants.length===2||e.namedVariants.length===0&&e.maxValue-e.minValue<=1&&e.stepSize>=1}function ur(e){return!lr(e)&&e.namedVariants.length<=2}function dr({s:e,onSet:t}){return lr(e)?(0,A.jsx)(o,{checked:e.value>=1,onChange:n=>t(e.name,+!!n),"aria-label":e.name}):e.namedVariants.length>2?(0,A.jsx)(d,{variant:`light`,value:String(e.value),options:e.namedVariants.map((e,t)=>({value:String(t),label:e.name})),onChange:n=>t(e.name,Number(n)),"aria-label":e.name}):(0,A.jsx)(r,{arrows:!0,value:e.value,min:e.minValue,max:e.maxValue,step:e.stepSize||1,onChange:n=>t(e.name,n),"aria-label":e.name})}var fr=(0,k.memo)(function({s:e,onSet:t}){return(0,A.jsxs)(`div`,{className:R.field,children:[(0,A.jsxs)(`div`,{className:R.fieldHead,children:[(0,A.jsx)(`span`,{className:R.label,children:cr(e.name)}),ur(e)&&(0,A.jsx)(`span`,{className:R.value,children:e.value})]}),(0,A.jsx)(dr,{s:e,onSet:t})]})},(e,t)=>e.s.name===t.s.name&&e.s.value===t.s.value&&e.onSet===t.onSet);function pr({settings:e,bindings:t,profile:r,onNavigate:i}){let a=(0,k.useMemo)(()=>[...new Set(e.list.map(e=>e.category)),sr],[e.list]),[o,s]=(0,k.useState)(null);if(!e.open)return null;let c=o&&a.includes(o)?o:a[0],l=e.list.filter(e=>e.category===c),u=()=>{if(c===sr){m({title:`Reset key bindings?`,body:`All bindings return to their defaults. This cannot be undone.`,confirmLabel:`Reset`}).then(e=>e&&t.reset());return}l.forEach(t=>e.set(t.name,t.default))},d=r.data;return(0,A.jsxs)(ge,{active:`settings`,profileName:d?.name,profilePicture:d?.picture,profileAddress:d?.address,profileClaimed:d?.hasClaimedName,onNavigate:i,onClose:e.toggle,children:[(0,A.jsxs)(`div`,{className:R.head,children:[(0,A.jsx)(`h1`,{className:R.title,children:`Settings`}),(0,A.jsx)(n,{items:a.map(e=>({id:e,label:cr(e)})),value:c,onChange:s,"aria-label":`Settings categories`}),(0,A.jsx)(`button`,{type:`button`,className:R.reset,onClick:u,children:`↺ Reset all defaults`})]}),(0,A.jsx)(`div`,{className:R.card,children:c===sr?(0,A.jsx)(or,{bindings:t}):l.length===0?(0,A.jsx)(`div`,{className:R.empty,children:`No settings available.`}):(0,A.jsx)(`div`,{className:R.grid,children:l.map(t=>(0,A.jsx)(fr,{s:t,onSet:e.set},t.name))})})]})}var z={root:`_root_fhnuh_2`,head:`_head_fhnuh_21`,title:`_title_fhnuh_30`,closeGlyph:`_closeGlyph_fhnuh_35`,body:`_body_fhnuh_39`,name:`_name_fhnuh_48`,tag:`_tag_fhnuh_58`,addr:`_addr_fhnuh_62`,guest:`_guest_fhnuh_67`,desc:`_desc_fhnuh_75`,links:`_links_fhnuh_81`,link:`_link_fhnuh_81`,empty:`_empty_fhnuh_101`};function mr({profile:e}){if(!e.open)return null;let t=e.data,n=t?t.name.trim()?t.name:O(t.address):``,{base:r,tag:a}=ce(n),o=t?E(t.address):`var(--fill-4)`;return(0,A.jsxs)(`div`,{className:z.root,children:[(0,A.jsxs)(`header`,{className:z.head,children:[(0,A.jsx)(`span`,{className:z.title,children:`Profile`}),(0,A.jsx)(v,{variant:`solid`,className:z.closeGlyph,"aria-label":`Close profile`,onClick:e.toggle,children:`×`})]}),t?(0,A.jsxs)(`div`,{className:z.body,children:[(0,A.jsx)(i,{src:t.picture,name:r,color:o,size:88,status:`online`}),(0,A.jsxs)(`div`,{className:z.name,style:{color:o},children:[r,a&&(0,A.jsx)(`span`,{className:z.tag,children:a})]}),(0,A.jsx)(`div`,{className:z.addr,children:O(t.address)}),t.isGuest&&(0,A.jsx)(`span`,{className:z.guest,children:`Guest`}),t.description&&(0,A.jsx)(`p`,{className:z.desc,children:t.description}),t.links&&t.links.length>0&&(0,A.jsx)(`div`,{className:z.links,children:t.links.map(e=>(0,A.jsx)(`a`,{className:z.link,href:e.url,target:`_blank`,rel:`noreferrer`,children:e.title},e.url))})]}):(0,A.jsx)(`div`,{className:z.empty,children:`Profile unavailable.`})]})}var B={root:`_root_8hwrw_2`,head:`_head_8hwrw_21`,heading:`_heading_8hwrw_30`,markRead:`_markRead_8hwrw_36`,closeGlyph:`_closeGlyph_8hwrw_48`,body:`_body_8hwrw_52`,row:`_row_8hwrw_66`,unread:`_unread_8hwrw_77`,thumb:`_thumb_8hwrw_81`,img:`_img_8hwrw_92`,dot:`_dot_8hwrw_97`,info:`_info_8hwrw_104`,title:`_title_8hwrw_111`,bodyText:`_bodyText_8hwrw_120`,time:`_time_8hwrw_130`,unreadDot:`_unreadDot_8hwrw_136`,empty:`_empty_8hwrw_146`};function hr(e){return e.replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function V(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t)return t}}function gr(e,t,...n){let r=e[t];if(r&&typeof r==`object`)return V(r,...n)}function _r(e){let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Math.floor((Date.now()-t)/6e4);if(n<1)return`now`;if(n<60)return`${n}m`;let r=Math.floor(n/60);if(r<24)return`${r}h`;let i=Math.floor(r/24);return i<7?`${i}d`:new Date(t).toLocaleDateString([],{month:`short`,day:`numeric`})}function vr(e){return V(e,`image`,`thumbnail`,`thumbnailUrl`,`tokenImage`,`profileImageUrl`)??gr(e,`sender`,`profileImageUrl`,`image`)}var yr={social_service_friendship_request:`wants to be your friend!`,social_service_friendship_accepted:`accepted your friend request.`},H=e=>V(e,`communityName`)??`a community`,br={community_post_added:e=>({title:`New Community Announcement`,body:`A new announcement was posted in ${H(e)}.`}),community_invite_received:e=>({title:`Community Invite Received`,body:`You've been invited to join ${H(e)}.`}),community_voice_chat_started:e=>({title:`Community Voice Stream Started`,body:`${H(e)} is streaming — click to join.`}),community_renamed:e=>({title:`Community Renamed`,body:`${V(e,`oldName`)??`A community`} was renamed to ${V(e,`newName`)??H(e)}.`}),community_request_to_join_received:e=>({title:`Membership Request Received`,body:`${V(e,`userName`,`memberName`)??`Someone`} wants to join ${H(e)}.`}),community_request_to_join_accepted:e=>({title:`Membership Request Accepted`,body:`You're now a member of ${H(e)}.`}),community_deleted:e=>({title:`Community Deleted`,body:`${H(e)} has been deleted.`}),community_deleted_content_violation:e=>({title:`Community Deleted`,body:`${H(e)} was deleted for a content violation.`}),community_member_banned:e=>({title:`Banned from Community`,body:`You've been banned from ${H(e)}.`}),community_member_removed:e=>({title:`Removed from Community`,body:`You've been removed from ${H(e)}.`}),community_ownership_transferred:e=>({title:`Community Ownership Transferred`,body:`You're now the owner of ${H(e)}.`}),credits_reminder_claim_credits:()=>({title:`Marketplace Credits`,body:`You have Credits waiting to be claimed.`}),credits_reminder_complete_goals:()=>({title:`Marketplace Credits`,body:`Complete your goals to earn Credits.`}),credits_reminder_usage:()=>({title:`Marketplace Credits`,body:`Don't forget to use your Credits.`}),credits_reminder_usage_24_hours:()=>({title:`Marketplace Credits`,body:`Your Credits expire soon — use them now.`}),credits_reminder_do_not_miss_out:()=>({title:`Marketplace Credits`,body:`Don't miss out on your Credits.`}),credits_new_season_reminder:()=>({title:`New Credits Season`,body:`A new Marketplace Credits season has started.`})};function xr(e){let t=e.metadata,n=vr(t);if(yr[e.type])return{title:gr(t,`sender`,`name`)??V(t,`title`)??`Someone`,body:yr[e.type],image:n};let r=V(t,`title`);if(r!=null)return{title:r,body:V(t,`description`,`message`),image:n};let i=br[e.type];return i?{...i(t),image:n}:{title:hr(e.type),body:V(t,`description`,`message`,`name`),image:n}}function Sr({n:e}){let{title:t,body:n,image:r}=xr(e);return(0,A.jsxs)(`div`,{className:`${B.row} ${e.read?``:B.unread}`.trim(),children:[(0,A.jsx)(`div`,{className:B.thumb,children:r?(0,A.jsx)(`img`,{className:B.img,src:r,alt:``}):(0,A.jsx)(`span`,{className:B.dot})}),(0,A.jsxs)(`div`,{className:B.info,children:[(0,A.jsx)(`span`,{className:B.title,children:t}),n&&(0,A.jsx)(`span`,{className:B.bodyText,children:n})]}),(0,A.jsx)(`span`,{className:B.time,children:_r(e.timestamp)}),!e.read&&(0,A.jsx)(`span`,{className:B.unreadDot,"aria-label":`unread`})]})}function Cr({notifications:e}){return e.open?(0,A.jsxs)(`div`,{className:B.root,children:[(0,A.jsxs)(`header`,{className:B.head,children:[(0,A.jsx)(`span`,{className:B.heading,children:`Notifications`}),e.unread>0&&(0,A.jsx)(`button`,{type:`button`,className:B.markRead,onClick:e.markAllRead,children:`Mark all read`}),(0,A.jsx)(v,{variant:`solid`,className:B.closeGlyph,"aria-label":`Close notifications`,onClick:e.toggle,children:`×`})]}),(0,A.jsx)(`div`,{className:B.body,children:e.list.length===0?(0,A.jsx)(`div`,{className:B.empty,children:`You’re all caught up.`}):e.list.map(e=>(0,A.jsx)(Sr,{n:e},e.id))})]}):null}var wr={slot:`_slot_10ky5_2`,bg:`_bg_10ky5_6`,num:`_num_10ky5_15`},Tr=182,Er=168,Dr=92,Or=74,kr={base:{flap:`#A09BA8`,glows:[{c:`#CFCDD4`,cx:156.62,cy:134.02,r:123.28,b:53.79},{c:`#FCFCFC`,cx:33.93,cy:.93,r:121.93,b:53.79,o:.8}]},common:{flap:`#73D3D3`,glows:[{c:`#73D3D3`,cx:137,cy:115,r:119,b:89.96},{c:`#B5FFF6`,cx:44,cy:32,r:68,b:50}]},uncommon:{flap:`#FF8362`,glows:[{c:`#FF8362`,cx:137,cy:115,r:119,b:81.65},{c:`#FFE0B2`,cx:29.47,cy:18.47,r:77.47,b:50}]},rare:{flap:`#34CE76`,glows:[{c:`#34CE76`,cx:137,cy:115,r:106,b:53.79},{c:`#73FFAF`,cx:32.48,cy:19.06,r:77.47,b:50}]},epic:{flap:`#438FFF`,glows:[{c:`#5C9EFF`,cx:136,cy:102,r:102,b:53.79},{c:`#4DEAFF`,cx:12.47,cy:21.47,r:77.47,b:50}]},legendary:{flap:`#A14BF3`,glows:[{c:`#B66CFF`,cx:121,cy:112,r:83,b:41.72},{c:`#E579FB`,cx:12.47,cy:21.47,r:77.47,b:50}]},mythic:{flap:`#FF4BED`,glows:[{c:`#FF4BED`,cx:121,cy:112,r:83,b:53.79},{c:`#FFA6C1`,cx:12.47,cy:21.47,r:77.47,b:53.79}]},exotic:{flap:`#9CD71E`,glows:[{c:`#CAFF73`,cx:121,cy:112,r:116,b:74.89},{c:`#CAFF73`,cx:12.47,cy:21.47,r:77.47,b:58.66}]},unique:{flap:`#FEA217`,glows:[{c:`#FFDD2C`,cx:70,cy:157,r:91,b:53.79},{c:`#FFAB2C`,cx:132.9,cy:39.9,r:53.9,b:53.79}]}},Ar=`M14.8164 12.709C64.4508 -0.703243 116.612 -1.5304 166.64 10.3027C176.559 12.6489 182.063 22.9775 179.27 32.6738L145.125 151.212C142.308 160.99 132.238 166.37 122.526 164.608C103.049 161.075 83.0735 161.392 63.7158 165.54C54.0636 167.609 43.8302 162.551 40.71 152.865L2.89062 35.4668C-0.202676 25.8636 4.97707 15.368 14.8164 12.709Z`,jr=`M4.79456 34.854C2.02502 26.2568 6.68143 16.9787 15.3385 14.6393C64.652 1.31383 116.475 0.492713 166.179 12.2493C174.905 14.3132 179.848 23.4393 177.348 32.12L143.203 150.658C140.703 159.339 131.704 164.24 122.883 162.64C103.149 159.061 82.9097 159.381 63.2967 163.584C54.53 165.463 45.3831 160.849 42.6136 152.252L4.79456 34.854Z`,Mr=`M47.9447 7.70117C43.9328 8.34457 40.4114 10.7359 38.638 14.3936L17.1322 58.75C15.343 62.4402 15.0466 66.6786 16.304 70.582L4.79428 34.8545C2.02478 26.2574 6.68134 16.9791 15.3382 14.6396C26.1034 11.7307 36.9885 9.41758 47.9447 7.70117Z`,Nr=`M17.1325 58.7501C15.3433 62.4403 15.047 66.6787 16.3044 70.5822L13.1836 60.8956L33.8238 24.3209L17.1325 58.7501Z`,Pr=`M11.0036 21.9181C10.6762 22.1695 10.615 22.639 10.867 22.9659L15.3604 26.5831L17.129 28.6697L15.533 31.4881L15.1114 35.3803C15.162 35.8414 15.6155 36.1457 16.0614 36.0179C16.4192 35.9153 16.6472 35.5652 16.5963 35.1964L17.0108 31.9443L19.1989 28.861L20.0563 33.9719C20.1331 34.4298 20.5915 34.7189 21.0379 34.5909C21.4127 34.4834 21.65 34.1151 21.5929 33.7294L20.6933 27.6476L19.6397 25.3561L21.2475 20.6279C21.4369 20.0711 20.9223 19.5309 20.357 19.6931C20.1239 19.7599 19.9394 19.9382 19.8647 20.1689L19.0229 22.5681C18.7079 23.4659 17.9771 24.1553 17.0625 24.4176C16.1661 24.6746 15.2008 24.4903 14.4621 23.921L12.0623 22.0715C11.8154 21.7316 11.3368 21.6622 11.0036 21.9181Z`;function Fr({thumbnail:e,rarity:t=`base`,number:n,width:r=174,rotate:i=0}){let a=(0,k.useId)().replace(/:/g,``),o=e,s=kr[t]??kr.base,c=i?`rotate(${-i} ${Dr} ${Or})`:void 0,l={fontSize:Math.round(r*.19),transform:`translateX(-50%)${i?` rotate(${-i}deg)`:``}`};return(0,A.jsxs)(`div`,{className:wr.slot,style:{width:r,height:r*Er/Tr,transform:i?`rotate(${i}deg)`:void 0},children:[(0,A.jsxs)(`svg`,{className:wr.bg,viewBox:`0 0 ${Tr} ${Er}`,preserveAspectRatio:`none`,children:[(0,A.jsxs)(`defs`,{children:[s.glows.map((e,t)=>(0,A.jsx)(`filter`,{id:`blur-${a}-${t}`,x:`-120`,y:`-120`,width:`420`,height:`420`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:(0,A.jsx)(`feGaussianBlur`,{stdDeviation:e.b})},t)),(0,A.jsx)(`clipPath`,{id:`clip-${a}`,children:(0,A.jsx)(`path`,{d:jr})})]}),(0,A.jsx)(`path`,{d:jr,fill:`#691FA9`}),(0,A.jsxs)(`g`,{clipPath:`url(#clip-${a})`,children:[s.glows.map((e,t)=>(0,A.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,fill:e.c,opacity:e.o??1,filter:`url(#blur-${a}-${t})`},t)),o&&(0,A.jsx)(`g`,{transform:c,children:(0,A.jsx)(`image`,{href:o,x:`37.9961`,y:`20`,width:`108`,height:`108`,preserveAspectRatio:`none`})}),(0,A.jsx)(`path`,{d:Mr,fill:s.flap}),(0,A.jsx)(`path`,{d:Nr,fill:`black`,fillOpacity:`0.1`}),(0,A.jsx)(`path`,{d:Pr,fill:`#FCFCFC`}),(0,A.jsx)(`circle`,{cx:`16.2543`,cy:`21.5305`,r:`1.87704`,transform:`rotate(-16 16.2543 21.5305)`,fill:`#FCFCFC`})]}),(0,A.jsx)(`path`,{d:Ar,fill:`none`,stroke:`#f1eff5`,strokeWidth:`4`})]}),n!=null&&(0,A.jsx)(`span`,{className:wr.num,style:l,children:n})]})}var U={backdrop:`_backdrop_okd42_2`,wheel:`_wheel_okd42_12`,slotPos:`_slotPos_okd42_21`,slotHover:`_slotHover_okd42_27`,slotEmpty:`_slotEmpty_okd42_32`,center:`_center_okd42_38`,hoverName:`_hoverName_okd42_49`,title:`_title_okd42_55`,customise:`_customise_okd42_60`,hint:`_hint_okd42_77`,close:`_close_okd42_83`},Ir=215,Lr=152,Rr=112;function zr({emotes:e,onCustomise:t}){let[n,r]=(0,k.useState)(null);if(We(e=>{(e.key===`e`||e.key===`E`)&&(e.preventDefault(),t?.())},{capture:!1,enabled:e.open&&t!=null}),!e.open)return null;let i=Array.from({length:10},(t,n)=>{let r=(n+1)%10;return{k:n,num:r,deg:-90+n*36,emote:e.list.find(e=>e.slot===r)??null}}),a=n==null?null:e.list.find(e=>e.slot===n);return(0,A.jsx)(`div`,{className:U.backdrop,onClick:e.toggle,children:(0,A.jsxs)(`div`,{className:U.wheel,onClick:e=>e.stopPropagation(),children:[(0,A.jsx)(`button`,{type:`button`,className:U.close,"aria-label":`Close emotes`,onClick:e.toggle,children:`×`}),i.map(({num:t,deg:i,emote:a})=>{let o=i*Math.PI/180,s=Ir+Lr*Math.cos(o),c=Ir+Lr*Math.sin(o);return(0,A.jsx)(`div`,{role:`button`,"aria-label":`Emote slot ${t}${a?`: ${a.name}`:``}`,className:`${U.slotPos} ${n===t?U.slotHover:``} ${a?``:U.slotEmpty}`.trim(),style:{left:`${s}px`,top:`${c}px`},onMouseEnter:()=>a&&r(t),onMouseLeave:()=>r(e=>e===t?null:e),onClick:()=>a&&e.play(a.urn),children:(0,A.jsx)(Fr,{thumbnail:a?me(a.urn):void 0,rarity:a?.rarity??`base`,number:t,rotate:i+90,width:Rr})},t)}),(0,A.jsxs)(`div`,{className:U.center,children:[(0,A.jsx)(`div`,{className:U.hoverName,children:a?.name??` `}),(0,A.jsx)(`div`,{className:U.title,children:`EMOTES`}),(0,A.jsx)(`button`,{type:`button`,className:U.customise,onClick:t,children:`Customise [E]`}),(0,A.jsx)(`div`,{className:U.hint,children:`Press [B+num] to run an emote`})]})]})})}var Br={root:`_root_2zlqk_5`,group:`_group_2zlqk_27`,divider:`_divider_2zlqk_35`},Vr=[{kind:`profile`,icon:`profile`,label:`Profile`},{kind:`notifications`,icon:`notifications`,label:`Notifications`},{kind:`map`,icon:`map`,label:`Map`,hotkey:`Map`},{kind:`places`,icon:`places`,label:`Places`,hotkey:`Places`},{kind:`communities`,icon:`communities`,label:`Communities`,hotkey:`Communities`},{kind:`backpack`,icon:`backpack`,label:`Backpack`,hotkey:`Backpack`},{kind:`gallery`,icon:`gallery`,label:`Gallery`,hotkey:`Gallery`},{kind:`settings`,icon:`settings`,label:`Settings`,hotkey:`Settings`},{kind:`divider`},{kind:`help`,icon:`help`,label:`Help & Support`}],Hr=[{kind:`mic`,icon:`mic`,label:`Voice chat`},{kind:`emotes`,icon:`emotes`,label:`Emotes`,hotkey:`Emote`},{kind:`divider`},{kind:`friends`,icon:`friends`,label:`Friends`,hotkey:`Friends`},{kind:`chat`,icon:`chat`,label:`Chat`,hotkey:`ChatPanel`}];function Ur(e,t,n,r,i){if(e.kind===`divider`)return(0,A.jsx)(`div`,{className:Br.divider},`d${t}`);let o=`hotkey`in e&&e.hotkey!=null?se(r,e.hotkey):void 0;return e.kind===`chat`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,badge:n.chat.unread,active:n.chat.open,onClick:n.chat.toggle},`chat`):e.kind===`friends`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,badge:n.friends.received.length,active:n.friends.open,onClick:n.friends.toggle},`friends`):e.kind===`settings`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,active:n.settings.open,onClick:n.settings.toggle},`settings`):e.kind===`profile`?(0,A.jsx)(a,{icon:e.icon,label:e.label,active:n.profile.open,onClick:i??n.profile.toggle},`profile`):e.kind===`backpack`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,active:n.backpack.open,onClick:n.backpack.toggle},`backpack`):e.kind===`communities`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,active:n.communities.open,onClick:n.communities.toggle},`communities`):e.kind===`map`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,active:n.map.open,onClick:n.map.toggle},`map`):e.kind===`places`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,active:n.places.open,onClick:n.places.toggle},`places`):e.kind===`gallery`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,active:n.gallery.open,onClick:n.gallery.toggle},`gallery`):e.kind===`notifications`?(0,A.jsx)(a,{icon:e.icon,label:e.label,badge:n.notifications.unread,active:n.notifications.open,onClick:n.notifications.toggle},`notifications`):e.kind===`emotes`?(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,active:n.emotes.open,onClick:n.emotes.toggle},`emotes`):e.kind===`mic`?(0,A.jsx)(a,{icon:e.icon,label:e.label,active:n.mic.enabled,onClick:n.mic.toggle},`mic`):e.kind===`help`?(0,A.jsx)(a,{icon:e.icon,label:e.label,onClick:()=>window.open(`https://decentraland.org/help/`,`_blank`,`noopener`)},`help`):(0,A.jsx)(a,{icon:e.icon,label:e.label,shortcut:o,onClick:()=>n.nav(e.action)},e.action)}function Wr({session:e,onViewProfile:t}){let n=je();return(0,A.jsxs)(`nav`,{className:Br.root,"aria-label":`Main navigation`,children:[(0,A.jsx)(`div`,{className:Br.group,children:Vr.map((r,i)=>Ur(r,i,e,n,t))}),(0,A.jsx)(`div`,{className:Br.group,children:Hr.map((r,i)=>Ur(r,i,e,n,t))})]})}var W={root:`_root_iexx0_8`,header:`_header_iexx0_26`,title:`_title_iexx0_38`,coords:`_coords_iexx0_47`,collapse:`_collapse_iexx0_54`,surface:`_surface_iexx0_75`,circle:`_circle_iexx0_87`,cutout:`_cutout_iexx0_101`,cutoutFill:`_cutoutFill_iexx0_105`,rotor:`_rotor_iexx0_110`,layer:`_layer_iexx0_120`,tile:`_tile_iexx0_130`,poi:`_poi_iexx0_135`,poiPin:`_poiPin_iexx0_144`,poiLabel:`_poiLabel_iexx0_153`,north:`_north_iexx0_173`,northLabel:`_northLabel_iexx0_186`,arrow:`_arrow_iexx0_196`,zoom:`_zoom_iexx0_208`,settings:`_settings_iexx0_217`,roundButton:`_roundButton_iexx0_223`};function Gr({chunks:e}){let t=1280;return(0,A.jsx)(A.Fragment,{children:e.map(({col:e,row:n})=>(0,A.jsx)(`img`,{className:W.tile,src:Oe(e,n),alt:``,draggable:!1,width:t,height:t,style:{left:e*t,top:n*t}},`${e},${n}`))})}function Kr({tile:e}){let t=e.meters/2,n=Ee(e.centerX-t,e.centerZ+t,32),r=e.meters/16*32;return(0,A.jsx)(`img`,{className:W.tile,src:e.url,alt:``,draggable:!1,width:r,height:r,style:{left:n.x,top:n.y}})}var qr=`dcl-minimap-places`,Jr=2592e5,Yr=100,Xr=500;function Zr(e){let[t,n]=e.split(`,`).map(Number);return Number.isFinite(t)&&Number.isFinite(n)?{x:t,y:n}:null}function Qr(e){let t=(e.positions??[]).map(Zr).filter(e=>e!=null);if(t.length===0)return e.base_position==null?null:Zr(e.base_position);let n=t.reduce((e,t)=>({x:e.x+t.x,y:e.y+t.y}),{x:0,y:0});return{x:Math.round(n.x/t.length),y:Math.round(n.y/t.length)}}function $r(e){let t=[];for(let n of e){if(n.world===!0)continue;let e=Qr(n);e!=null&&t.push({id:n.id,title:n.title,categories:n.categories??[],x:e.x,y:e.y})}return t}function ei(){try{let e=localStorage.getItem(qr);if(e==null)return null;let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let{at:n,places:r}=t;return typeof n!=`number`||Date.now()-n>Jr||!Array.isArray(r)?null:r}catch{return null}}function ti(e){try{localStorage.setItem(qr,JSON.stringify({at:Date.now(),places:e}))}catch{}}var ni=null;function ri(){let e=ei();return e==null?ni??(ni=(async()=>{let e=[];for(let t=0;t<Xr;t+=Yr){let n=await we({limit:Yr,offset:t,order_by:`like_score_best`,order:`desc`});if(e.push(...$r(n.data)),n.data.length<Yr)break}return ti(e),e})(),ni.catch(()=>{ni=null}),ni):Promise.resolve(e)}function ii(e,t,n,r){return e.map(e=>({p:e,d:Math.hypot(e.x-t,e.y-n)})).filter(e=>e.d<=r).sort((e,t)=>e.d-t.d).map(e=>e.p)}var ai=`dcl-minimap-style`,oi=`dcl-minimap-rotation`,si=`dcl-minimap-zoom`,ci=`dcl-minimap-markers`,li=[`parcel`,`satellite`,`imposters`],ui=[`camera`,`north`],di=[`poi`,`featured`,`game`,`casino`,`social`,`music`,`art`,`fashion`,`crypto`,`education`,`shop`,`sports`,`business`,`parkour`];function fi(e){try{return localStorage.getItem(e)}catch{return null}}function pi(e,t){try{localStorage.setItem(e,t)}catch{}}function mi(){let e=fi(ai);return li.includes(e)?e:`satellite`}function hi(e){pi(ai,e)}function gi(){let e=fi(oi);return ui.includes(e)?e:`north`}function _i(e){pi(oi,e)}function vi(){let e=Number(fi(si));return!Number.isFinite(e)||e<=0?256:Math.min(768,Math.max(64,e))}function yi(e){pi(si,String(e))}function bi(){try{let e=JSON.parse(fi(ci)??`null`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[...di]}catch{return[...di]}}function xi(e){pi(ci,JSON.stringify(e))}var Si={menu:`_menu_o6pdy_3`,section:`_section_o6pdy_16`,option:`_option_o6pdy_26`,check:`_check_o6pdy_44`},Ci=[{value:`camera`,label:`Rotate with camera`},{value:`north`,label:`Fixed north`}],wi=[{value:`parcel`,label:`Parcel atlas`},{value:`satellite`,label:`Satellite`},{value:`imposters`,label:`Camera`}];function Ti(e){return e.length===0?`none`:e.length===1&&e[0]===`poi`?`poi`:e.length===di.length?`all`:null}var Ei=[{value:`all`,label:`All`,categories:di},{value:`poi`,label:`Only POI`,categories:[`poi`]},{value:`none`,label:`None`,categories:[]}];function Di({rotation:e,onRotation:t,style:n,onStyle:r,hideStyle:i,markers:a,onMarkers:o}){let s=Ti(a);return(0,A.jsxs)(`div`,{className:Si.menu,role:`menu`,"aria-label":`Minimap settings`,children:[(0,A.jsx)(`p`,{className:Si.section,children:`Rotation mode`}),Ci.map(n=>(0,A.jsx)(Oi,{label:n.label,selected:e===n.value,onSelect:()=>t(n.value)},n.value)),!i&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:Si.section,children:`Visualization style`}),wi.map(e=>(0,A.jsx)(Oi,{label:e.label,selected:n===e.value,onSelect:()=>r(e.value)},e.value))]}),(0,A.jsx)(`p`,{className:Si.section,children:`Markers`}),Ei.map(e=>(0,A.jsx)(Oi,{label:e.label,selected:s===e.value,onSelect:()=>o([...e.categories])},e.value))]})}function Oi({label:e,selected:t,onSelect:n}){return(0,A.jsxs)(`button`,{type:`button`,className:Si.option,role:`menuitemradio`,"aria-checked":t,onClick:n,children:[(0,A.jsx)(`span`,{className:Si.check,children:t&&(0,A.jsx)(y,{size:13})}),e]})}var ki=220,Ai=.2,ji=10;function Mi({minimap:e,map:t,sceneTitle:n,setEngineViewport:r}){let[i,a]=(0,k.useState)(!0),[o,s]=(0,k.useState)(!1),[c,l]=(0,k.useState)(mi),[u,d]=(0,k.useState)(gi),[f,m]=(0,k.useState)(vi),[h,ee]=(0,k.useState)(bi),[g,re]=(0,k.useState)([]),[v,y]=(0,k.useState)([]),[b,ae]=(0,k.useState)(()=>Ne(0,0)),[x,S]=(0,k.useState)({x:0,y:0}),oe=(0,k.useRef)(null),C=(0,k.useRef)(null),w=(0,k.useRef)(f),T=e.isWorld?`imposters`:c,{pose:se,setConfig:ce}=e;(0,k.useEffect)(()=>{ce({style:T,rotation:u,visibleMeters:f})},[ce,T,u,f]),(0,k.useEffect)(()=>{if(e.isWorld||h.length===0)return;let t=!0;return ri().then(e=>{t&&re(e)}).catch(e=>{console.warn(`[minimap] could not load place markers`,e)}),()=>{t=!1}},[e.isWorld,h.length]);let le=(0,k.useMemo)(()=>e.isWorld?[]:ii(g,x.x,x.y,ji).filter(e=>e.categories.some(e=>h.includes(e))),[e.isWorld,g,x.x,x.y,h]);(0,k.useEffect)(()=>{let e=oe.current;if(e==null||!i)return;let t=0,n=``,r=``,a=``,o=()=>{t=requestAnimationFrame(o);let i=se.current,s=ki/w.current*16/32,c=Ee(i.x,i.z,32),l=u===`north`?0:-i.camYaw;e.style.setProperty(`--map-scale`,String(s)),e.style.setProperty(`--map-tx`,String(-c.x)),e.style.setProperty(`--map-ty`,String(-c.y)),e.style.setProperty(`--map-yaw`,String(l)),e.style.setProperty(`--map-arrow`,String(i.yaw+l));let d=Math.floor(i.x/16),f=Math.floor(i.z/16),p=`${d},${f}`;if(p!==a&&(a=p,S({x:d,y:f})),T===`satellite`){let e=ki/2/s*Math.SQRT2,t=Ie(c.x-e,c.y-e,c.x+e,c.y+e,1280),r=t.map(e=>`${e.col},${e.row}`).join(`|`);r!==n&&(n=r,y(t))}else if(T===`parcel`){let e=Ne(i.x,i.z);e.url!==r&&(r=e.url,ae(e))}};return t=requestAnimationFrame(o),()=>cancelAnimationFrame(t)},[se,u,T,i]);let ue=(0,k.useCallback)(e=>{let t=w.current,n=Math.min(768,Math.max(64,t*e));if(n===t)return;let r=Math.log(t),i=Math.log(n),a=performance.now(),o=e=>{let t=Math.min(1,(e-a)/(Ai*1e3));if(w.current=Math.exp(r+(i-r)*t),t<1){requestAnimationFrame(o);return}w.current=n,m(n),yi(n)};requestAnimationFrame(o)},[]),de=f>64,fe=f<768;(0,k.useEffect)(()=>{if(!o)return;let e=e=>{C.current?.contains(e.target)||s(!1)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[o]);let pe=(0,k.useCallback)(e=>{l(e),hi(e)},[]),me=(0,k.useCallback)(e=>{d(e),_i(e)},[]),E=(0,k.useCallback)(e=>{ee(e),xi(e)},[]),D=(0,k.useCallback)(e=>e.stopPropagation(),[]),O=(0,k.useMemo)(()=>T===`satellite`?(0,A.jsx)(Gr,{chunks:v}):T===`parcel`?(0,A.jsx)(Kr,{tile:b}):null,[T,v,b]);return(0,A.jsxs)(`div`,{className:W.root,children:[(0,A.jsxs)(`div`,{className:W.header,children:[(0,A.jsx)(`span`,{className:W.title,children:n||`Empty parcel`}),(0,A.jsxs)(`span`,{className:W.coords,children:[x.x,`,`,x.y]}),(0,A.jsx)(`button`,{type:`button`,className:W.collapse,onClick:()=>a(e=>!e),"aria-label":i?`Collapse minimap`:`Expand minimap`,"aria-expanded":i,children:i?(0,A.jsx)(p,{size:16}):(0,A.jsx)(te,{size:16})})]}),i&&(0,A.jsxs)(`div`,{className:W.surface,ref:oe,children:[(0,A.jsxs)(`button`,{type:`button`,className:T===`imposters`?`${W.circle} ${W.cutout}`:W.circle,onClick:t.toggle,"aria-label":`Open map`,children:[(0,A.jsxs)(`div`,{className:W.rotor,children:[(0,A.jsxs)(`div`,{className:W.layer,children:[O,le.map(e=>{let t=Ee(e.x*16+8,e.y*16+8,32);return(0,A.jsxs)(`span`,{className:W.poi,style:{left:t.x,top:t.y},children:[(0,A.jsx)(`img`,{className:W.poiPin,src:De(e.categories),alt:``,draggable:!1}),e.categories.includes(`poi`)&&(0,A.jsx)(`span`,{className:W.poiLabel,children:e.title})]},e.id)})]}),(0,A.jsx)(`span`,{className:W.north,"aria-hidden":`true`,children:(0,A.jsx)(`span`,{className:W.northLabel,children:`N`})})]}),T===`imposters`&&(0,A.jsx)(`span`,{className:W.cutoutFill,children:(0,A.jsx)(Ge,{region:`map`,report:r})}),(0,A.jsx)(`svg`,{className:W.arrow,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,A.jsx)(`path`,{d:`M12 2 21 22 12 17.4 3 22Z`,fill:`var(--brand)`,stroke:`var(--text)`,strokeWidth:`1.6`,strokeLinejoin:`round`})})]}),(0,A.jsxs)(`div`,{className:W.zoom,onClick:D,role:`group`,"aria-label":`Minimap zoom`,children:[(0,A.jsx)(`button`,{type:`button`,className:W.roundButton,onClick:()=>ue(1/1.5),disabled:!de,"aria-label":`Zoom in`,children:(0,A.jsx)(_,{size:14})}),(0,A.jsx)(`button`,{type:`button`,className:W.roundButton,onClick:()=>ue(1.5),disabled:!fe,"aria-label":`Zoom out`,children:(0,A.jsx)(ne,{size:14})})]}),(0,A.jsxs)(`div`,{className:W.settings,onClick:D,ref:C,children:[(0,A.jsx)(`button`,{type:`button`,className:W.roundButton,onClick:()=>s(e=>!e),"aria-label":`Minimap settings`,"aria-expanded":o,children:(0,A.jsx)(ie,{size:14})}),o&&(0,A.jsx)(Di,{rotation:u,onRotation:me,style:c,onStyle:pe,hideStyle:e.isWorld,markers:h,onMarkers:E})]})]})]})}var G={root:`_root_1pc98_1`,reticle:`_reticle_1pc98_13`,reticleActive:`_reticleActive_1pc98_38`,hints:`_hints_1pc98_45`,hintsRadial:`_hintsRadial_1pc98_60`,hint:`_hint_1pc98_45`,hintReverse:`_hintReverse_1pc98_79`,hintDisabled:`_hintDisabled_1pc98_83`,hintText:`_hintText_1pc98_86`,mouse:`_mouse_1pc98_89`,cap:`_cap_1pc98_93`,proxTip:`_proxTip_1pc98_109`},Ni=0,Pi={0:`IaPointer`,1:`IaPrimary`,2:`IaSecondary`,3:`IaAny`,4:`IaForward`,5:`IaBackward`,6:`IaRight`,7:`IaLeft`,8:`IaJump`,9:`IaWalk`,10:`IaAction3`,11:`IaAction4`,12:`IaAction5`,13:`IaAction6`,14:`IaModifier`},Fi={1:`E`,2:`F`,4:`W`,5:`S`,6:`D`,7:`A`,8:`Space`,10:`1`,11:`2`,12:`3`,13:`4`};function Ii(){return(0,A.jsxs)(`svg`,{className:G.mouse,width:`22`,height:`22`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.6746 11.8961V2.99524C11.6746 2.99524 4.33789 2.98667 4.33789 11.8961H11.6746Z`,fill:`#FF7439`}),(0,A.jsx)(`rect`,{x:`4.50781`,y:`2.99524`,width:`15`,height:`20`,rx:`7.5`,stroke:`#ECEBED`,strokeWidth:`2`}),(0,A.jsx)(`path`,{d:`M4.33789 11.9952H18.9999`,stroke:`#ECEBED`}),(0,A.jsx)(`path`,{d:`M7.20715 0.590018C4.26466 1.54992 2.11196 4.23323 1.19016 6.9471`,stroke:`#ECEBED`,strokeLinecap:`round`})]})}function Li({button:e}){let t=je(),n=Pi[e],r=n==null?void 0:w(t,{Scene:n})[0];return r===`Mouse Left`||r==null&&e===Ni?(0,A.jsx)(Ii,{}):(0,A.jsx)(`span`,{className:G.cap,children:r==null?Fi[e]??`?`:T(t,r)})}var Ri=14,zi=34,Bi=[{x:Ri,y:0,side:`r`},{x:-14,y:0,side:`l`},{x:0,y:-68,side:`t`},{x:Ri,y:zi,side:`r`},{x:-14,y:zi,side:`l`},{x:Ri,y:-34,side:`r`},{x:-14,y:-34,side:`l`}];function Vi(e){return e.side===`t`?{position:`absolute`,left:e.x,top:e.y,transform:`translate(-50%, -50%)`}:e.side===`l`?{position:`absolute`,left:e.x,top:e.y,transform:`translate(-100%, -50%)`}:{position:`absolute`,left:e.x,top:e.y,transform:`translateY(-50%)`}}var Hi={camera:{Icon:g,text:`Get camera closer`},player:{Icon:ee,text:`Get player closer`}};function Ui({action:e,slot:t}){let n=t?.side===`l`,r=e.enabled?null:Hi[e.tooFarReason??`camera`];return(0,A.jsxs)(`div`,{className:`${G.hint}${n?` ${G.hintReverse}`:``}${e.enabled?``:` ${G.hintDisabled}`}`,style:t?Vi(t):void 0,children:[r?(0,A.jsx)(`span`,{className:G.mouse,"data-testid":`too-far-icon-${e.tooFarReason??`camera`}`,children:(0,A.jsx)(r.Icon,{size:22})}):(0,A.jsx)(Li,{button:e.button}),(0,A.jsx)(`span`,{className:G.hintText,children:e.enabled?e.text:r?.text})]})}function Wi({hover:e,locked:t,proximity:n}){let r=(0,k.useSyncExternalStore)(Se,Re),[i,a]=(0,k.useState)(!1);(0,k.useEffect)(()=>{let e=()=>a(document.pointerLockElement!=null);return e(),document.addEventListener(`pointerlockchange`,e),()=>document.removeEventListener(`pointerlockchange`,e)},[]);let o=t||i,s=e.length>0;return(0,k.useEffect)(()=>(ke(s&&!o),()=>ke(!1)),[s,o]),!o&&!s&&n.length===0?null:(0,A.jsxs)(`div`,{className:G.root,"aria-hidden":`true`,children:[o&&(0,A.jsx)(`div`,{"data-testid":`reticle`,className:`${G.reticle}${s?` ${G.reticleActive}`:``}`}),s&&(o?(0,A.jsx)(`div`,{className:G.hints,children:e.map((e,t)=>(0,A.jsx)(Ui,{action:e},t))}):(0,A.jsx)(`div`,{className:G.hintsRadial,style:{left:r.x,top:r.y},children:e.slice(0,Bi.length).map((e,t)=>(0,A.jsx)(Ui,{action:e,slot:Bi[t]},t))})),n.map(e=>(0,A.jsx)(`div`,{"data-testid":`proxtip-${e.id}`,className:G.proxTip,style:{left:`${e.x}px`,top:`${e.y}px`},children:e.actions.map((e,t)=>(0,A.jsxs)(`div`,{className:G.hint,children:[(0,A.jsx)(Li,{button:e.button}),(0,A.jsx)(`span`,{className:G.hintText,children:e.text})]},t))},e.id))]})}var K={modal:`_modal_h601v_4`,icon:`_icon_h601v_17`,prompt:`_prompt_h601v_27`,scene:`_scene_h601v_33`,additional:`_additional_h601v_36`,options:`_options_h601v_41`,option:`_option_h601v_41`,radio:`_radio_h601v_63`,radioOn:`_radioOn_h601v_76`,radioDot:`_radioDot_h601v_79`,input:`_input_h601v_86`,actions:`_actions_h601v_92`,deny:`_deny_h601v_98`},Gi={MovePlayer:`move your avatar within the scene bounds`,ForceCamera:`temporarily change the camera view`,PlayEmote:`make your avatar perform an emote`,SetLocomotion:`temporarily modify your avatar's locomotion settings`,HideAvatarsNametags:`temporarily hide player avatars and/or nametags, and/or disables passports`,DisableVoice:`temporarily disable voice chat`,Teleport:`teleport you to a new location`,ChangeRealm:`move you to a new realm`,SpawnPortable:`spawn a portable experience`,KillPortables:`manage your active portable experiences`,Web3:`initiate a web3 transaction with your wallet`,CopyToClipboard:`copy text into the clipboard`,Fetch:`fetch data from a remote server`,Websocket:`open a web socket to communicate with a remote server`,OpenUrl:`open a url in your browser`,OpenExplorerUi:`open an explorer menu panel (map, backpack, settings, ...)`},Ki=[{value:`once`,label:`Once`},{value:`scene`,label:`Always for Scene`},{value:`realm`,label:`Always for Realm`},{value:`global`,label:`Always for Global`}];function qi(){return(0,A.jsxs)(`svg`,{width:`26`,height:`26`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,children:[(0,A.jsx)(`rect`,{x:`4`,y:`10`,width:`16`,height:`11`,rx:`2`,fill:`currentColor`}),(0,A.jsx)(`path`,{d:`M8 10V7a4 4 0 0 1 8 0v3`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function Ji({request:e,onResolve:t}){let[n,r]=(0,k.useState)(`once`),i=Gi[e.ty]??`perform a restricted action`;return(0,A.jsxs)(`div`,{className:K.modal,role:`alertdialog`,"aria-modal":`true`,"aria-label":`Scene permission request`,onClick:e=>e.stopPropagation(),children:[(0,A.jsx)(`span`,{className:K.icon,children:(0,A.jsx)(qi,{})}),(0,A.jsxs)(`div`,{className:K.prompt,children:[`The scene `,(0,A.jsx)(`span`,{className:K.scene,children:e.sceneName||`A scene`}),` wants permission to `,i]}),e.additional?(0,A.jsx)(`div`,{className:K.additional,children:e.additional}):null,(0,A.jsx)(`div`,{className:K.options,role:`radiogroup`,"aria-label":`Apply this decision`,children:Ki.map(e=>(0,A.jsxs)(`label`,{className:K.option,children:[(0,A.jsx)(`input`,{className:K.input,type:`radio`,name:`permission-level`,checked:n===e.value,onChange:()=>r(e.value)}),(0,A.jsx)(`span`,{className:`${K.radio} ${n===e.value?K.radioOn:``}`.trim(),children:n===e.value?(0,A.jsx)(`span`,{className:K.radioDot}):null}),e.label]},e.value))}),(0,A.jsxs)(`div`,{className:K.actions,children:[(0,A.jsx)(f,{variant:`primary`,onClick:()=>t(!0,n),children:`Allow`}),(0,A.jsx)(f,{variant:`ghost`,className:K.deny,onClick:()=>t(!1,n),children:`Deny`})]})]})}function Yi(e,t){let n=!1,r=(r,i)=>{n||(n=!0,t(e.id,r,i))};return b(t=>(0,A.jsx)(Ji,{request:e,onResolve:(e,n)=>{r(e,n),t()}}),{onClose:()=>r(!1,`once`)})}function Xi(e){let[t,n]=(0,k.useState)({page:0,engine:null,ms:0});return(0,k.useEffect)(()=>{if(!e)return;let t=0,r=0,i=0,a=null,o,s=performance.now(),c=s,l=0,u=()=>{let e=window;e!==a&&typeof e.__engineHeartbeat==`function`&&(o=e.__engineHeartbeat,e.__engineHeartbeat=function(...e){return i++,o?.apply(this,e)},a=e)},d=e=>{if(r++,l+=e-c,c=e,u(),e-s>=500){let t=(e-s)/1e3;n({page:Math.round(r/t),engine:typeof window.__nativeEngineFps==`number`?Math.round(window.__nativeEngineFps):a?Math.round(i/t):null,ms:Number((l/r).toFixed(1))}),r=0,i=0,l=0,s=e}t=requestAnimationFrame(d)};return t=requestAnimationFrame(d),()=>{cancelAnimationFrame(t),a&&o&&(a.__engineHeartbeat=o)}},[e]),t}var q={meter:`_meter_77eb9_1`,fps:`_fps_77eb9_21`,unit:`_unit_77eb9_25`,dim:`_dim_77eb9_31`,engine:`_engine_77eb9_34`,good:`_good_77eb9_39`,warn:`_warn_77eb9_42`,bad:`_bad_77eb9_45`};function Zi(){let{page:e,engine:t,ms:n}=Xi(!0),r=e>=55?q.good:e>=30?q.warn:q.bad;return(0,A.jsxs)(`div`,{className:q.meter,"aria-hidden":`true`,children:[(0,A.jsxs)(`span`,{className:`${q.fps} ${r}`,children:[e,(0,A.jsx)(`span`,{className:q.unit,children:`fps`})]}),(0,A.jsxs)(`span`,{className:q.dim,children:[n,`ms`]}),t!=null&&(0,A.jsxs)(`span`,{className:q.dim,children:[`engine `,(0,A.jsx)(`b`,{className:q.engine,children:t})]})]})}var J={root:`_root_1m58s_1`,"fade-in":`_fade-in_1m58s_1`,leaving:`_leaving_1m58s_13`,"fade-out":`_fade-out_1m58s_1`,watermark:`_watermark_1m58s_18`,loading:`_loading_1m58s_38`,spinnerLogo:`_spinnerLogo_1m58s_44`,pulse:`_pulse_1m58s_1`,panel:`_panel_1m58s_52`,logo:`_logo_1m58s_60`,title:`_title_1m58s_66`,subtitle:`_subtitle_1m58s_75`,account:`_account_1m58s_83`,error:`_error_1m58s_90`,buttons:`_buttons_1m58s_96`,cta:`_cta_1m58s_105`,ctaSecondary:`_ctaSecondary_1m58s_106`,authHint:`_authHint_1m58s_135`,authCode:`_authCode_1m58s_142`,resetBox:`_resetBox_1m58s_151`,resetText:`_resetText_1m58s_160`,ctaDanger:`_ctaDanger_1m58s_167`,label:`_label_1m58s_173`,arrow:`_arrow_1m58s_181`,bootBar:`_bootBar_1m58s_188`,bootLabel:`_bootLabel_1m58s_198`,bootTrack:`_bootTrack_1m58s_205`,bootFill:`_bootFill_1m58s_212`,avatarWrap:`_avatarWrap_1m58s_220`,disc:`_disc_1m58s_233`,glow:`_glow_1m58s_249`,"glow-pulse":`_glow-pulse_1m58s_1`,avatar:`_avatar_1m58s_220`,"avatar-in":`_avatar-in_1m58s_1`,"avatar-float":`_avatar-float_1m58s_1`},Qi={download:`Downloading engine`,compile:`Compiling`,init:`Initializing`,workers:`Starting workers`,gpu:`Preparing graphics`};function $i({flow:e}){if(e.engineReady)return null;let t=(e.loadStep==null?void 0:Qi[e.loadStep])??`Starting…`,n=Math.round(e.loadProgress);return(0,A.jsxs)(`div`,{className:J.bootBar,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":t,children:[(0,A.jsxs)(`div`,{className:J.bootLabel,children:[t,` · `,n,`%`]}),(0,A.jsx)(`div`,{className:J.bootTrack,children:(0,A.jsx)(`div`,{className:J.bootFill,style:{width:`${n}%`}})})]})}function ea(e){return e.loadStep===`download`?`DOWNLOADING… ${Math.round(e.loadProgress)}%`:`STARTING…`}function ta(){return(0,A.jsx)(`span`,{className:J.arrow,"aria-hidden":`true`,children:(0,A.jsxs)(`svg`,{viewBox:`0 0 28 28`,width:`22`,height:`22`,children:[(0,A.jsx)(`circle`,{cx:`14`,cy:`14`,r:`14`,fill:`#fff`}),(0,A.jsx)(`path`,{d:`M12.5 9l5 5-5 5M9 14h8`,stroke:`var(--brand)`,strokeWidth:`2.4`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]})})}function na(e){let[t,n]=(0,k.useState)({});return(0,k.useEffect)(()=>{if(e==null||e===``){n({});return}let t=!1;return fetch(`${be(`catalyst`)}/lambdas/profiles/${e}`).then(e=>e.json()).then(e=>{let r=e.avatars?.[0];t||n({name:r?.name,body:r?.avatar?.snapshots?.body})}).catch(()=>void 0),()=>{t=!0}},[e]),t}function ra({body:e}){let[t,n]=(0,k.useState)(!1);return t?null:(0,A.jsxs)(`div`,{className:J.avatarWrap,children:[(0,A.jsx)(`div`,{className:J.disc}),(0,A.jsx)(`div`,{className:J.glow}),(0,A.jsx)(`img`,{className:J.avatar,src:e,alt:``,draggable:!1,onError:()=>n(!0)})]})}var ia={"sign-in-or-guest":{title:`Discover a virtual social world`,subtitle:`shaped by its community of
|
|
8
|
-
creators & explorers.`},"reuse-login-or-new":{title:`Welcome back!`,subtitle:`Ready to explore?`}};function aa({flow:e}){(0,k.useEffect)(()=>{Me()},[]);let t=e.status===`reuse-login-or-new`,n=na(t&&e.account!=null?e.account:void 0);return(0,A.jsx)(`div`,{className:J.root,children:e.status===`loading`?(0,A.jsx)(`div`,{className:J.loading,children:(0,A.jsx)(`div`,{className:J.spinnerLogo})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:J.watermark}),(0,A.jsx)(oa,{flow:e,name:n.name}),t&&n.body!=null&&(0,A.jsx)(ra,{body:n.body}),(0,A.jsx)($i,{flow:e})]})})}function oa({flow:e,name:t}){let n=e.status,r=ia[n],i=n===`reuse-login-or-new`&&t!=null&&t!==``?`Welcome back ${t}`:r.title,a=!e.engineReady;return(0,A.jsxs)(`div`,{className:J.panel,children:[(0,A.jsx)(`div`,{className:J.logo}),(0,A.jsx)(`h1`,{className:J.title,children:i}),r.subtitle&&(0,A.jsx)(`p`,{className:J.subtitle,children:r.subtitle}),e.error&&(0,A.jsx)(`p`,{className:J.error,children:e.error}),(0,A.jsxs)(`div`,{className:J.buttons,children:[e.authPending&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:J.authHint,children:e.authCode==null?`Opening the sign-in page in your browser…`:`Verify this code matches the one in the browser window we just opened:`}),e.authCode!=null&&(0,A.jsx)(`div`,{className:J.authCode,children:e.authCode}),(0,A.jsx)(f,{variant:`secondary`,size:`lg`,className:J.ctaSecondary,onClick:e.cancelLogin,children:(0,A.jsx)(`span`,{className:J.label,children:`CANCEL`})})]}),n===`sign-in-or-guest`&&!e.authPending&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(f,{variant:`primary`,size:`lg`,className:J.cta,onClick:e.startWithAccount,disabled:e.busy,children:[(0,A.jsx)(`span`,{className:J.label,children:`START WITH ACCOUNT`}),(0,A.jsx)(ta,{})]}),(0,A.jsx)(f,{variant:`secondary`,size:`lg`,className:J.ctaSecondary,onClick:e.exploreAsGuest,disabled:e.busy||a,children:(0,A.jsx)(`span`,{className:J.label,children:a?ea(e):`EXPLORE AS GUEST`})})]}),n===`reuse-login-or-new`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(f,{variant:`primary`,size:`lg`,className:J.cta,onClick:e.jumpIn,disabled:e.busy||a,children:[(0,A.jsx)(`span`,{className:J.label,children:a?ea(e):e.profileFetchFailed?`TRY AGAIN`:`JUMP INTO DECENTRALAND`}),!a&&(0,A.jsx)(ta,{})]}),(0,A.jsx)(f,{variant:`secondary`,size:`lg`,className:J.ctaSecondary,onClick:e.useDifferentAccount,disabled:e.busy,children:(0,A.jsx)(`span`,{className:J.label,children:`USE A DIFFERENT ACCOUNT`})}),e.profileFetchFailed&&(0,A.jsxs)(`div`,{className:J.resetBox,children:[(0,A.jsx)(`p`,{className:J.resetText,children:`If the problem persists you can continue with a fresh default profile. This permanently replaces your account's current avatar and profile.`}),(0,A.jsx)(f,{variant:`secondary`,size:`lg`,className:`${J.ctaSecondary} ${J.ctaDanger}`,onClick:e.resetProfileAndJumpIn,disabled:e.busy||a,children:(0,A.jsx)(`span`,{className:J.label,children:`RESET PROFILE & JUMP IN`})})]})]})]})]})}var Y={root:`_root_1vhw7_1`,"fade-in":`_fade-in_1vhw7_1`,logo:`_logo_1vhw7_24`,title:`_title_1vhw7_30`,subtitle:`_subtitle_1vhw7_36`,track:`_track_1vhw7_44`,fill:`_fill_1vhw7_52`,indeterminate:`_indeterminate_1vhw7_59`,slide:`_slide_1vhw7_1`};function sa({scene:e}){let t=(0,k.useRef)(0),n=e?.pendingAssets??null;n!=null&&n>t.current&&(t.current=n);let r=e!=null&&!e.realmConnected,i=n!=null&&t.current>0,a=i?1-n/t.current:0,o=r?`Reconnecting…`:e?.title?e.title:`Entering Decentraland`,s=r?`Reconnecting to the realm`:n!=null&&n>0?`Loading scene assets · ${n} remaining`:`Preparing your surroundings`;return(0,A.jsxs)(`div`,{className:Y.root,children:[(0,A.jsx)(`div`,{className:Y.logo}),(0,A.jsx)(`h2`,{className:Y.title,children:o}),(0,A.jsx)(`p`,{className:Y.subtitle,children:s}),(0,A.jsx)(`div`,{className:Y.track,children:(0,A.jsx)(`div`,{className:`${Y.fill}${i?``:` `+Y.indeterminate}`,style:i?{width:`${Math.round(a*100)}%`}:void 0})})]})}function ca({onStay:e,onLeave:t}){return(0,A.jsx)(l,{title:`Leave Decentraland?`,closeButton:!1,width:420,actions:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(f,{variant:`ghost`,onClick:e,children:`Stay`}),(0,A.jsx)(f,{variant:`primary`,onClick:t,children:`Leave`})]}),actionsEqual:!0,children:`You're about to exit the world and go back. You'll have to reconnect to return.`})}function la(e,t){let n=!1,r=e=>{n||(n=!0,e())};return b(e=>(0,A.jsx)(ca,{onStay:e,onLeave:()=>{r(t),e()}}),{onClose:()=>r(e)})}function ua(e){let[t,n]=(0,k.useState)(!1),r=(0,k.useRef)(!1);return(0,k.useEffect)(()=>{if(!e)return;r.current=!1;let t=e=>{r.current||(e.preventDefault(),e.returnValue=``)},i=()=>{r.current||(window.history.pushState(null,``,window.location.href),n(!0))};return window.history.pushState(null,``,window.location.href),window.addEventListener(`beforeunload`,t),window.addEventListener(`popstate`,i),()=>{window.removeEventListener(`beforeunload`,t),window.removeEventListener(`popstate`,i)}},[e]),{confirming:t,stay:(0,k.useCallback)(()=>n(!1),[]),leave:(0,k.useCallback)(()=>{n(!1),r.current=!0,window.history.go(-2)},[])}}var da=/Android|iPhone|iPad|iPod|webOS|BlackBerry|Opera Mini|IEMobile|Windows Phone/i;function fa(){return/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1}function pa(){return typeof navigator>`u`?!1:da.test(navigator.userAgent)||fa()}function ma(){return typeof navigator>`u`||/Chrome\//.test(navigator.userAgent)}function ha(){return typeof document>`u`?!1:document.cookie.split(`;`).some(e=>e.trim().startsWith(`bypass_browser_check=`))}function ga(){let e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)||fa()?`ios`:/Android/i.test(e)?`android`:`other`}var _a=5e3;async function va(){let e=navigator.gpu;if(e==null)return!1;let t;try{let n=await Promise.race([e.requestAdapter(),new Promise(e=>{t=setTimeout(()=>e(`timeout`),_a)})]);return n===`timeout`||n!=null}catch{return!1}finally{t!=null&&clearTimeout(t)}}var X={root:`_root_3vjgt_1`,card:`_card_3vjgt_13`,logo:`_logo_3vjgt_21`,title:`_title_3vjgt_26`,subtitle:`_subtitle_3vjgt_32`,buttons:`_buttons_3vjgt_38`,store:`_store_3vjgt_45`,steps:`_steps_3vjgt_66`,stepHint:`_stepHint_3vjgt_76`,flag:`_flag_3vjgt_82`,flagText:`_flagText_3vjgt_91`,copy:`_copy_3vjgt_102`,tryAnyway:`_tryAnyway_3vjgt_121`},ya=`https://testflight.apple.com/join/KF4r3jlU`,ba=`https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer`,xa=`https://www.google.com/chrome/`;function Sa(){return(0,A.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,A.jsx)(`path`,{d:`M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z`})})}function Ca(){return(0,A.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,A.jsx)(`path`,{d:`M3,20.5V3.5C3,2.91 3.34,2.39 3.84,2.15L13.69,12L3.84,21.85C3.34,21.6 3,21.09 3,20.5M16.81,15.12L6.05,21.34L14.54,12.85L16.81,15.12M20.16,10.81C20.5,11.08 20.75,11.5 20.75,12C20.75,12.5 20.53,12.9 20.18,13.18L17.89,14.5L15.39,12L17.89,9.5L20.16,10.81M6.05,2.66L16.81,8.88L14.54,11.15L6.05,2.66Z`})})}function wa(){return(0,A.jsxs)(`svg`,{viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsxs)(`defs`,{children:[(0,A.jsxs)(`linearGradient`,{id:`cg-a`,x1:`3.2173`,y1:`15`,x2:`44.7812`,y2:`15`,gradientUnits:`userSpaceOnUse`,children:[(0,A.jsx)(`stop`,{offset:`0`,stopColor:`#d93025`}),(0,A.jsx)(`stop`,{offset:`1`,stopColor:`#ea4335`})]}),(0,A.jsxs)(`linearGradient`,{id:`cg-b`,x1:`20.7219`,y1:`47.6791`,x2:`41.5039`,y2:`11.6837`,gradientUnits:`userSpaceOnUse`,children:[(0,A.jsx)(`stop`,{offset:`0`,stopColor:`#fcc934`}),(0,A.jsx)(`stop`,{offset:`1`,stopColor:`#fbbc04`})]}),(0,A.jsxs)(`linearGradient`,{id:`cg-c`,x1:`26.5981`,y1:`46.5015`,x2:`5.8161`,y2:`10.506`,gradientUnits:`userSpaceOnUse`,children:[(0,A.jsx)(`stop`,{offset:`0`,stopColor:`#1e8e3e`}),(0,A.jsx)(`stop`,{offset:`1`,stopColor:`#34a853`})]})]}),(0,A.jsx)(`circle`,{cx:`24`,cy:`23.9947`,r:`12`,fill:`#fff`}),(0,A.jsx)(`path`,{d:`M24,12H44.7812a23.9939,23.9939,0,0,0-41.5639.0029L13.6079,30l.0093-.0024A11.9852,11.9852,0,0,1,24,12Z`,fill:`url(#cg-a)`}),(0,A.jsx)(`circle`,{cx:`24`,cy:`24`,r:`9.5`,fill:`#1a73e8`}),(0,A.jsx)(`path`,{d:`M34.3913,30.0029,24.0007,48A23.994,23.994,0,0,0,44.78,12.0031H23.9989l-.0025.0093A11.985,11.985,0,0,1,34.3913,30.0029Z`,fill:`url(#cg-b)`}),(0,A.jsx)(`path`,{d:`M13.6086,30.0031,3.218,12.006A23.994,23.994,0,0,0,24.0025,48L34.3931,30.0029l-.0067-.0068a11.9852,11.9852,0,0,1-20.7778.007Z`,fill:`url(#cg-c)`})]})}function Ta(){document.cookie=`bypass_browser_check=1;path=/;max-age=2592000`,location.reload()}function Ea({hint:e,target:t}){let[n,r]=(0,k.useState)(!1);return(0,k.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1200);return()=>clearTimeout(e)},[n]),(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{className:X.stepHint,children:e}),(0,A.jsxs)(`div`,{className:X.flag,children:[(0,A.jsx)(`code`,{className:X.flagText,children:t}),(0,A.jsx)(`button`,{type:`button`,className:X.copy,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>r(!0),()=>{})},title:`Copy`,"aria-label":`Copy`,children:n?(0,A.jsx)(y,{size:15}):(0,A.jsx)(re,{size:15})})]})]})}function Da(){return(0,A.jsx)(`div`,{className:X.root,children:(0,A.jsx)(s,{})})}function Oa({reason:e=`mobile`}){if(e===`gpu`)return(0,A.jsx)(`div`,{className:X.root,children:(0,A.jsxs)(`div`,{className:X.card,children:[(0,A.jsx)(`img`,{className:X.logo,src:ft(`assets/logo.png`),alt:``,draggable:!1}),(0,A.jsx)(`h1`,{className:X.title,children:`Enable GPU acceleration`}),(0,A.jsxs)(`p`,{className:X.subtitle,children:[`Decentraland Web renders in 3D with `,(0,A.jsx)(`strong`,{children:`WebGPU`}),`, which needs a working GPU. Your browser has it turned off or can’t reach a supported GPU. In Chrome, paste each of these into a new tab (they can’t be opened by clicking), switch it on, then relaunch:`]}),(0,A.jsxs)(`ol`,{className:X.steps,children:[(0,A.jsx)(Ea,{hint:`Turn on “Use graphics acceleration when available”`,target:`chrome://settings/system`}),(0,A.jsx)(Ea,{hint:`Set “Unsafe WebGPU Support” to Enabled`,target:`chrome://flags/#enable-unsafe-webgpu`})]}),(0,A.jsx)(`button`,{type:`button`,className:X.tryAnyway,onClick:Ta,children:`try anyway…`})]})});if(e===`browser`)return(0,A.jsx)(`div`,{className:X.root,children:(0,A.jsxs)(`div`,{className:X.card,children:[(0,A.jsx)(`img`,{className:X.logo,src:ft(`assets/logo.png`),alt:``,draggable:!1}),(0,A.jsx)(`h1`,{className:X.title,children:`Browser Not Supported`}),(0,A.jsxs)(`p`,{className:X.subtitle,children:[`Decentraland Web requires `,(0,A.jsx)(`strong`,{children:`Google Chrome`}),` on desktop to run.`]}),(0,A.jsx)(`div`,{className:X.buttons,children:(0,A.jsxs)(f,{variant:`secondary`,href:xa,target:`_blank`,rel:`noopener`,className:X.store,children:[(0,A.jsx)(wa,{}),(0,A.jsx)(`span`,{children:`Download Chrome`})]})}),(0,A.jsx)(`button`,{type:`button`,className:X.tryAnyway,onClick:Ta,children:`try anyway…`})]})});let t=ga(),n=t===`ios`||t===`other`,r=t===`android`||t===`other`;return(0,A.jsx)(`div`,{className:X.root,children:(0,A.jsxs)(`div`,{className:X.card,children:[(0,A.jsx)(`img`,{className:X.logo,src:ft(`assets/logo.png`),alt:``,draggable:!1}),(0,A.jsx)(`h1`,{className:X.title,children:`Decentraland`}),(0,A.jsx)(`p`,{className:X.subtitle,children:`This experience isn’t available on mobile browsers. Download the app to explore:`}),(0,A.jsxs)(`div`,{className:X.buttons,children:[n&&(0,A.jsxs)(f,{variant:`secondary`,href:ya,target:`_blank`,rel:`noopener`,className:X.store,children:[(0,A.jsx)(Sa,{}),(0,A.jsx)(`span`,{children:`Install from App Store`})]}),r&&(0,A.jsxs)(f,{variant:`secondary`,href:ba,target:`_blank`,rel:`noopener`,className:X.store,children:[(0,A.jsx)(Ca,{}),(0,A.jsx)(`span`,{children:`Install from Google Play`})]})]})]})})}var Z={layer:`_layer_1orcz_7`,head:`_head_1orcz_18`,title:`_title_1orcz_25`,lead:`_lead_1orcz_33`,params:`_params_1orcz_39`,paramValue:`_paramValue_1orcz_46`,paramDesc:`_paramDesc_1orcz_51`,advanced:`_advanced_1orcz_58`,advancedNote:`_advancedNote_1orcz_67`,exit:`_exit_1orcz_73`,proceed:`_proceed_1orcz_87`};function ka(){window.close(),window.location.replace(`https://decentraland.org`)}var Aa=`This Launch Link Is Not Trusted`;function ja({params:e,onProceed:t}){let[n,r]=(0,k.useState)(!1);return(0,A.jsx)(`div`,{className:Z.layer,children:(0,A.jsxs)(l,{role:`alertdialog`,ariaLabel:Aa,width:560,closeButton:!1,header:(0,A.jsxs)(`div`,{className:Z.head,children:[(0,A.jsx)(ae,{size:72}),(0,A.jsx)(`h2`,{className:Z.title,children:Aa})]}),actionsDirection:`column`,actions:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(f,{autoFocus:!0,variant:`primary`,className:Z.exit,onClick:ka,children:`Exit Application`}),n?(0,A.jsxs)(`div`,{className:Z.advanced,children:[(0,A.jsx)(`p`,{className:Z.advancedNote,children:`Continuing hands this address full control of your session for as long as this tab is open. Only do this if you recognise it as your own.`}),(0,A.jsx)(f,{variant:`ghost`,className:Z.proceed,onClick:t,children:`Continue anyway`})]}):(0,A.jsx)(f,{variant:`secondary`,onClick:()=>r(!0),children:`Advanced`})]}),children:[(0,A.jsx)(`p`,{className:Z.lead,children:`Someone may be trying to change how your Explorer behaves.`}),(0,A.jsxs)(`p`,{className:Z.lead,children:[`This link carries `,e.length>1?`parameters`:`a parameter`,` the Explorer does not accept from links:`]}),(0,A.jsx)(`dl`,{className:Z.params,children:e.map(e=>(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`dt`,{children:[e.name,` = `,(0,A.jsx)(`span`,{className:Z.paramValue,children:e.value})]}),(0,A.jsx)(`dd`,{className:Z.paramDesc,children:e.warning})]},e.name))}),(0,A.jsx)(`p`,{className:Z.lead,children:`Unless you built this link yourself, the safe choice is to exit.`})]})})}var Ma={systemScene:{warning:`Replaces the Explorer's interface with a scene loaded from this address. It can move your avatar, change your profile, and answer permission prompts on your behalf.`,read:()=>he().systemScene,isTrusted:vt},baseDomain:{warning:`Points every backend service — sign-in, content, comms — at servers under this domain. Whoever runs them would see your session and control what you play.`,read:e=>e?null:Ke,isTrusted:ue},contentServer:{warning:`Fetches every scene and asset from this server instead of the realm’s own. Whoever runs it decides what you see and what runs.`,read:()=>new URLSearchParams(location.search).get(`contentServer`),isTrusted:Na}};function Na(e){try{return ye(new URL(e).hostname)!=null}catch{return!1}}function Pa(e,t){try{let n=new URL(e.value===`authority`?`dummy://${t}`:t);return ye(n.hostname)!=null}catch{return!1}}for(let e of le)Ma[e.name]={warning:`Points the Explorer's "${e.name}" backend service at this server, with everything else looking normal. Whoever runs it would see the requests and choose the answers.`,read:t=>t?null:ve(e,new URLSearchParams(location.search).get(e.name)),isTrusted:t=>Pa(e,t)};for(let e of Object.keys(Ma))yt(e);function Fa({native:e}){let t=[];for(let[n,r]of Object.entries(Ma)){let i=r.read(e);i==null||i===``||r.isTrusted(i)||t.push({name:n,value:i,warning:r.warning})}return t}var Ia=x(),Q={scrim:`_scrim_1hq83_5`,fadeIn:`_fadeIn_1hq83_1`,pop:`_pop_1hq83_27`,popIn:`_popIn_1hq83_1`,head:`_head_1hq83_53`,title:`_title_1hq83_57`,subtitle:`_subtitle_1hq83_63`,btn:`_btn_1hq83_70`,detail:`_detail_1hq83_75`},La={launch:{title:`Something went wrong`,subtitle:`The 3D engine couldn't start. Reloading often fixes it.`},runtime:{title:`The world crashed`,subtitle:`The 3D engine stopped unexpectedly.`},react:{title:`Something went wrong`,subtitle:`The app hit an unexpected error.`}};function Ra({error:e,onReload:n,onDismiss:r}){let{title:i,subtitle:a}=La[e.source],o=(0,k.useRef)(null);return(0,k.useEffect)(u,[]),t(o,!0),(0,Ia.createPortal)((0,A.jsx)(`div`,{ref:o,className:Q.scrim,tabIndex:-1,onClick:r??void 0,children:(0,A.jsx)(`div`,{className:Q.pop,children:(0,A.jsx)(l,{header:(0,A.jsxs)(`div`,{className:Q.head,children:[(0,A.jsx)(`h2`,{className:Q.title,children:i}),(0,A.jsx)(`p`,{className:Q.subtitle,children:a})]}),role:`alertdialog`,ariaLabel:i,closeButton:!1,actionsAlign:`center`,actions:(0,A.jsxs)(A.Fragment,{children:[r&&(0,A.jsx)(f,{variant:`ghost`,className:Q.btn,onClick:r,children:`Dismiss`}),(0,A.jsx)(f,{variant:`primary`,className:Q.btn,onClick:n,children:`Reload`})]}),children:(0,A.jsx)(`pre`,{className:Q.detail,children:e.message})})})}),document.body)}var za=class extends k.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){console.error(`[react error boundary]`,e)}render(){let{error:e}=this.state;return e?(0,A.jsx)(Ra,{error:{message:e.stack??e.message,source:`react`},onReload:()=>location.reload()}):this.props.children}},Ba={head:`_head_qzuz3_4`,title:`_title_qzuz3_8`,subtitle:`_subtitle_qzuz3_14`,btn:`_btn_qzuz3_21`};function Va(e){let t=!1,n=b(t=>(0,A.jsx)(l,{header:(0,A.jsxs)(`div`,{className:Ba.head,children:[(0,A.jsx)(`h2`,{className:Ba.title,children:e.title}),(0,A.jsx)(`p`,{className:Ba.subtitle,children:e.message})]}),role:`alertdialog`,ariaLabel:e.title,closeButton:!1,actionsAlign:`center`,actions:(0,A.jsx)(f,{variant:`primary`,className:Ba.btn,onClick:t,children:`OK`}),children:null}),{onClose:()=>{t||(t=!0,e.onDismiss())}});return()=>{t=!0,n()}}var Ha={realm:`World not found`,bridge:`HUD not connected`};function Ua(e){return e in Ha}var Wa={guest:"`1` skips the sign-in screen with a guest login.",fps:"`1` shows the frame-rate overlay (Ctrl/Cmd+Shift+F toggles it)."},Ga=[`native`,`hud`,`mock`,`showcase`,`gate`,`nogate`,`bundled`,`simerror`,`simhover`,`previousLogin`,`perm`];function Ka(){let e=lt.filter(e=>e.delivery!==`host`).map(e=>({name:e.name,doc:e.doc,reader:`engine`})),t=Object.entries(Wa).map(([e,t])=>({name:e,doc:t,reader:`page`}));return[...e,...t]}function qa(e){let t=new Set([...Ka().map(e=>e.name),...Ga]);return[...new Set(e.keys())].filter(e=>!t.has(e))}var Ja={lead:`_lead_vayr0_2`,ignored:`_ignored_vayr0_7`,name:`_name_vayr0_17`,accepted:`_accepted_vayr0_24`};function Ya(e){return b(t=>(0,A.jsxs)(l,{title:`Unrecognised link parameters`,role:`alertdialog`,ariaLabel:`Unrecognised link parameters`,width:560,onClose:t,actionsAlign:`center`,actions:(0,A.jsx)(f,{variant:`primary`,onClick:t,children:`OK`}),children:[(0,A.jsxs)(`p`,{className:Ja.lead,children:[`This link carries `,e.length>1?`parameters`:`a parameter`,` the Explorer does not recognise, so `,e.length>1?`they were`:`it was`,` ignored:`]}),(0,A.jsx)(`ul`,{className:Ja.ignored,children:e.map(e=>(0,A.jsx)(`li`,{children:e},e))}),(0,A.jsx)(`p`,{className:Ja.lead,children:`The parameters a link can carry:`}),(0,A.jsx)(`dl`,{className:Ja.accepted,children:Ka().map(e=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:(0,A.jsx)(`span`,{className:Ja.name,children:e.name})}),(0,A.jsx)(`dd`,{children:e.doc})]},e.name))})]}))}var Xa=`modulepreload`,Za=function(e){return`https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-34587643134.commit-48233ea/`+e},Qa={},$a=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Za(t,n),t=s(t),t in Qa)return;Qa[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Xa,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},eo=(0,k.lazy)(()=>$a(()=>import(`./Showcase-BB2yxhRv.js`).then(e=>({default:e.Showcase})),__vite__mapDeps([0,1,2,3,4,5]))),$=new URLSearchParams(location.search),to=$.get(`mock`)===`1`?`mock`:`engine`,no=$.get(`showcase`)===`1`,ro=he().hideHud;function io(){return to===`native`||$.get(`nogate`)===`1`?null:pa()||$.get(`gate`)===`1`?`mobile`:$.get(`gate`)===`browser`?`browser`:$.get(`gate`)===`gpu`?`gpu`:!ma()&&!ha()?`browser`:null}var ao=io(),oo=Fa({native:to===`native`}),so=qa($);function co(){let e=lo(),t=uo(ao!=null||to===`mock`||to===`native`||no),[n,r]=(0,k.useState)(!1);return oo.length>0&&!n?(0,A.jsx)(ja,{params:oo,onProceed:()=>r(!0)}):ao?(0,A.jsx)(Oa,{reason:ao}):t===`checking`?(0,A.jsx)(Da,{}):t===`blocked`?(0,A.jsx)(Oa,{reason:`gpu`}):(0,A.jsxs)(za,{children:[no?(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(eo,{})}):(0,A.jsx)(fo,{}),e&&(0,A.jsx)(Zi,{})]})}function lo(){let[e,t]=(0,k.useState)($.get(`fps`)===`1`);return We(e=>{(e.ctrlKey||e.metaKey)&&e.shiftKey&&(e.key===`F`||e.key===`f`)&&(e.preventDefault(),t(e=>!e))}),e}function uo(e){let[t,n]=(0,k.useState)(e?`ok`:`checking`);return(0,k.useEffect)(()=>{if(e)return;if($.get(`nogate`)===`1`||ha()){n(`ok`);return}let t=!1;return va().then(e=>{t||n(e?`ok`:`blocked`)}),()=>{t=!0}},[e]),t}function fo(){let{rpc:e,createDriver:t}=(0,k.useMemo)(()=>{if(to===`mock`)return Wt(),{rpc:null,createDriver:()=>new at};if(to===`native`)return{rpc:null,createDriver:()=>new at};let e=new ct;return{rpc:e,createDriver:()=>new st(e)}},[]),n=Pe(t),r=ua(n.phase===`entering`||n.phase===`world`);(0,k.useEffect)(()=>{if(r.confirming)return la(r.stay,r.leave)},[r.confirming,r.stay,r.leave]),(0,k.useEffect)(()=>{if(so.length!==0)return Ya(so)},[]);let i=n.fatalError!=null&&Ua(n.fatalError.source)?{title:Ha[n.fatalError.source],message:n.fatalError.message}:null;(0,k.useEffect)(()=>{if(i!=null)return Va({...i,onDismiss:n.dismissFatal})},[i?.message]);let a=n.fatalError!=null&&!Ua(n.fatalError.source)?{message:n.fatalError.message,source:n.fatalError.source}:null,o=n.phase===`world`?n.permissions.pending[0]?.id:void 0;(0,k.useEffect)(()=>{let e=n.permissions.pending[0];if(!(o==null||!e))return Yi(e,n.permissions.resolve)},[o]);let[s,c]=(0,k.useState)(`wearables`);(0,k.useEffect)(()=>{n.backpack.open||c(`wearables`)},[n.backpack.open]);let l=()=>{let e=n.profile.data;e&&Ae(e.address)},u=e=>{e===`settings`?n.settings.toggle():e===`backpack`?n.backpack.toggle():e===`communities`?n.communities.toggle():e===`map`?n.map.toggle():e===`places`?n.places.toggle():e===`gallery`?n.gallery.toggle():e===`profile`?l():e===`signout`&&n.logout()},d=n.settings.open||n.backpack.open||n.communities.open||n.map.open||n.places.open||n.gallery.open;return ro?(0,A.jsxs)(de,{value:n,children:[e&&(0,A.jsx)(Tt,{rpc:e}),(0,A.jsx)(h,{}),a&&(0,A.jsx)(Ra,{error:a,onReload:n.reload,onDismiss:a.source===`runtime`?n.dismissFatal:void 0})]}):(0,A.jsxs)(de,{value:n,children:[e&&(0,A.jsx)(Tt,{rpc:e}),n.phase===`login`&&(0,A.jsx)(aa,{flow:n.login}),n.phase===`picking`&&(0,A.jsx)(Fe,{onPick:n.pickDestination}),n.phase===`entering`&&(0,A.jsx)(sa,{scene:n.sceneLoading}),n.phase===`world`&&!n.menuOpen&&(0,A.jsxs)(A.Fragment,{children:[!d&&(0,A.jsx)(Wr,{session:n,onViewProfile:l}),!d&&(0,A.jsx)(Mi,{minimap:n.minimap,map:n.map,sceneTitle:n.minimap.sceneTitle,setEngineViewport:n.setEngineViewport}),!d&&(0,A.jsx)(Wi,{hover:n.hover,locked:n.cursorLocked,proximity:n.proximity}),(0,A.jsx)(Sn,{chat:n.chat,hidden:n.friends.open||d,me:n.profile.data,onTeleport:(e,t)=>n.map.teleport(e,t),onVisitWorld:e=>Te({worldName:e,onConfirm:()=>n.map.changeRealm(e)})}),(0,A.jsx)(Pn,{friends:n.friends}),(0,A.jsx)(pr,{settings:n.settings,bindings:n.bindings,profile:n.profile,onNavigate:u}),(0,A.jsx)(mr,{profile:n.profile}),(0,A.jsx)(Cr,{notifications:n.notifications}),(0,A.jsx)(zr,{emotes:n.emotes,onCustomise:()=>{c(`emotes`),n.backpack.toggle()}}),(0,A.jsx)(He,{backpack:n.backpack,emotes:n.emotes,profile:n.profile,onNavigate:u,setEngineViewport:n.setEngineViewport,initialTab:s}),(0,A.jsx)(xe,{communities:n.communities,profile:n.profile,onNavigate:u}),(0,A.jsx)(Ve,{map:n.map,profile:n.profile,onNavigate:u}),(0,A.jsx)(ze,{places:n.places,profile:n.profile,onNavigate:u,onTeleport:(e,t)=>n.map.teleportToPlace(e,t),onVisitWorld:e=>n.map.changeRealm(e)}),(0,A.jsx)(Be,{gallery:n.gallery,profile:n.profile,onNavigate:u,onTeleport:(e,t)=>n.map.teleport(e,t),onViewProfile:e=>Ae(e.address)})]}),(0,A.jsx)(h,{}),a&&(0,A.jsx)(Ra,{error:a,onReload:n.reload,onDismiss:a.source===`runtime`?n.dismissFatal:void 0})]})}var po=`coi_sw_reloaded`;function mo(){`serviceWorker`in navigator&&(location.pathname.endsWith(`/`)||history.replaceState(history.state,``,`${location.pathname}/${location.search}${location.hash}`),navigator.serviceWorker.register(new URL(`service_worker.js`,ut)).then(e=>{if(navigator.serviceWorker.controller){sessionStorage.removeItem(po);return}let t=()=>{sessionStorage.getItem(po)?(sessionStorage.removeItem(po),console.error(`[coi] service worker failed to take control after reload`)):(sessionStorage.setItem(po,`true`),window.location.reload())};if(e.active){t();return}let n=e.installing??e.waiting;n?.addEventListener(`statechange`,()=>{n.state===`activated`&&t()})}).catch(e=>console.log(`[coi] service worker registration failed:`,e)))}var ho=/^(localhost|127(\.\d{1,3}){3}|\[::1\])$/i,go=/^(10|192\.168|172\.(1[6-9]|2\d|3[01])|169\.254)(\.\d{1,3}){1,3}$/;function _o(e){let t;try{t=new URL(e,location.href).hostname}catch{return null}return ho.test(t)?`loopback`:go.test(t)||t.toLowerCase().endsWith(`.local`)?`local`:null}function vo(){let e=window.fetch.bind(window);window.fetch=function(t,n){let r=_o(t instanceof Request?t.url:String(t));if(r==null||n!=null&&`targetAddressSpace`in n)return e(t,n);let i={...n,targetAddressSpace:r};return e(t,i)}}vo(),Ce(),mo(),(0,$e.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(k.StrictMode,{children:(0,A.jsx)(co,{})}));export{bn as i,yn as n,_n as r,Fr as t};
|