forked from Garde-Studios/minecraft-docker-server
60 lines
199 KiB
JavaScript
60 lines
199 KiB
JavaScript
|
var $o=Object.defineProperty,Uo=Object.defineProperties;var Po=Object.getOwnPropertyDescriptors;var Ht=Object.getOwnPropertySymbols;var No=Object.prototype.hasOwnProperty,Ro=Object.prototype.propertyIsEnumerable;var Wt=(e,t,o)=>t in e?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Vt=(e,t)=>{for(var o in t||(t={}))No.call(t,o)&&Wt(e,o,t[o]);if(Ht)for(var o of Ht(t))Ro.call(t,o)&&Wt(e,o,t[o]);return e},Zt=(e,t)=>Uo(e,Po(t));import{n as ne,l as u,c as d,w as M,a as te,b as Oo,d as T,o as F,r as E,e as V,f as b,g as Q,F as O,h as w,i as m,j as A,t as Do,k as x,m as C,p as f,q as ie,s as W,v as ft,u as ce,x as J,y as Bo,z as Qt,A as nt,B as Z,C as Xe,D as re,E as j,G as Ho,H as Wo,I as Vo,J as Zo,K as jo,L as jt,M as Fo,N as Go,V as Yo}from"./vendor.d0ab50b1.js";const Ko=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function o(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerpolicy&&(i.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?i.credentials="include":r.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(r){if(r.ep)return;r.ep=!0;const i=o(r);fetch(r.href,i)}};Ko();const Jt=["chatNoMessages","chatTitle","chatLogin","chatSend","chatPlaceholder","chatErrorDisabled","chatErrorUnknown","serversHeading","markersHeading","markersSkeleton","markersSetSkeleton","markersUnnamed","markersSearchPlaceholder","markersSearchSkeleton","worldsSkeleton","playersSkeleton","playersTitle","playersTitleHidden","playersTitleOtherWorld","playersSearchPlaceholder","playersSearchSkeleton","followingHeading","followingUnfollow","followingTitleUnfollow","followingHidden","linkTitle","loadingTitle","locationRegion","locationChunk","contextMenuCopyLink","contextMenuCenterHere","toggleTitle","mapTitle","layersTitle","copyToClipboardSuccess","copyToClipboardError","loginTitle","loginHeading","loginUsernameLabel","loginPasswordLabel","loginSubmit","loginErrorUnknown","loginErrorDisabled","loginErrorIncorrect","loginSuccess","registerHeading","registerDescription","registerConfirmPasswordLabel","registerCodeLabel","registerSubmit","registerErrorUnknown","registerErrorDisabled","registerErrorVerifyFailed","registerErrorIncorrect","logoutTitle","logoutErrorUnknown","logoutSuccess","closeTitle","showMore"],qo=["chatPlayerJoin","chatPlayerQuit","chatAnonymousJoin","chatAnonymousQuit","chatErrorNotAllowed","chatErrorRequiresLogin","chatErrorCooldown","worldsHeading","playersHeading"],Qo=document.createRange(),Jo=/<br \/>/g,Xt=/§[0-9a-f]/ig,Xo=/[_\s]?nether([\s_]|$)/i,ea=/(^|[_\s])end([\s_]|$)/i,Et=e=>{const t=e>=0&&e<13700;return{serverTime:e,days:Math.floor((e+8e3)/24e3),hours:(Math.floor(e/1e3)+6)%24,minutes:Math.floor(e/1e3%1*60),seconds:Math.floor(e/1e3%1*60%1*60),day:t,night:!t}},ta=e=>{const t=new URLSearchParams(e.search),o=e.hash.replace("#","");return o?oa(o):aa(t)},oa=e=>{let t,o,a,r;if(e=e.replace("#",""),e[0]==="/"&&e.split("/").length===7){const i=e.split("/");r=void 0,t=i[5],o=i[6],a=[i[1],i[2],i[3]].map(n=>parseFloat(n)).filter(n=>!isNaN(n)&&isFinite(n))}else{const i=e.split(";");t=i[0]||void 0,o=i[1]||void 0,a=(i[2]||"").split(",").map(n=>parseFloat(n)).filter(n=>!isNaN(n)&&isFinite(n)),r=typeof i[3]!="undefined"?parseInt(i[3]):void 0}return eo({world:t?decodeURIComponent(t):void 0,map:o?decodeURIComponent(o):void 0,location:a.length===3?{x:a[0],y:a[1],z:a[2]}:void 0,zoom:r,legacy:!1})},aa=e=>{let t=e.get("worldname")||e.get("world")||void 0,o=e.has("worldname")&&e.get("mapname")||void 0;const a=[e.get("x")||"",e.get("y")||"64",e.get("z")||""].map(i=>parseFloat(i)).filter(i=>!isNaN(i)&&isFinite(i)),r=e.has("zoom")?parseInt(e.get("zoom")):void 0;return t=t?decodeURIComponent(t):void 0,o=o?decodeURIComponent(o):void 0,eo({w
|
||
|
if(!e.data?.key) {
|
||
|
console.warn('Ignoring postmessage without key');
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
e.source.postMessage({
|
||
|
key: e.data.key,
|
||
|
success: true,
|
||
|
result: Function('', "'use strict';" + e.data.code)(),
|
||
|
}, e.origin);
|
||
|
} catch(ex) {
|
||
|
e.source.postMessage({
|
||
|
key: e.data.key,
|
||
|
success: false,
|
||
|
error: ex
|
||
|
}, e.origin);
|
||
|
}
|
||
|
})<\/script>`,window.addEventListener("message",t=>{var o;if(t.origin!=="null"||t.source!==e.contentWindow){console.warn("Ignoring postmessage with invalid source");return}if(!((o=t.data)!=null&&o.key)){console.warn("Ignoring postmessage without key");return}if(!Ct.has(t.data.key)){console.warn("Ignoring postmessage with invalid key");return}t.data.success?Ct.get(t.data.key).call(globalThis,t.data.result):no.get(t.data.key).call(globalThis,t.data.error)}),new Promise(t=>{document.body.appendChild(e),e.onload=()=>{t(e.contentWindow)}})};let kt=null;const Ct=new Map,no=new Map,at=async e=>(kt||(kt=await la()),new Promise((t,o)=>{const a=Math.random();Ct.set(a,t),no.set(a,o),kt.postMessage({key:a,code:e},"*")})),io=e=>{let t="overworld";return Xo.test(e)||e=="DIM-1"?t="nether":(ea.test(e)||e=="DIM1")&&(t="end"),t},da={playerMarkersEnabled(e){return e.components.players.markers!==void 0},markerUIEnabled(e){return!e.ui.disableMarkerUI},coordinatesControlEnabled(e){return e.components.coordinatesControl!==void 0},clockControlEnabled(e){return e.components.clockControl!==void 0},loginEnabled(e){return e.components.login||e.loginRequired},night(e){return Et(e.currentWorldState.timeOfDay).night},mapBackground(e){return e.currentMap?e.currentMap.nightAndDay?Et(e.currentWorldState.timeOfDay).night?e.currentMap.backgroundNight||e.currentMap.background||"transparent":e.currentMap.backgroundDay||e.currentMap.background||"transparent":e.currentMap.background||"transparent":"transparent"},url(e){return!e.currentWorld||!e.currentMap?"":to(e.currentMap,e.currentLocation,e.currentZoom)},pageTitle(e){var t,o;return e.configuration.title.replace(/{world}/gi,((t=e.currentWorld)==null?void 0:t.displayName)||"No world").replace(/{map}/gi,((o=e.currentMap)==null?void 0:o.displayName)||"No map")},playersHeading(e){return e.messages.playersHeading.replace("{cur}",e.players.size.toString()).replace("{max}",e.maxPlayers.toString())}};var c=(e=>(e.INIT="init",e.SET_SERVER_CONFIGURATION="setServerConfiguration",e.SET_SERVER_CONFIGURATION_HASH="setServerConfigurationHash",e.SET_SERVER_MESSAGES="setServerMessages",e.SET_WORLDS="setWorlds",e.SET_COMPONENTS="setComponents",e.SET_MARKER_SETS="setMarkerSets",e.SET_MARKERS="setMarkers",e.SET_WORLD_STATE="setWorldState",e.ADD_MARKER_SET_UPDATES="addMarkerSetUpdates",e.ADD_MARKER_UPDATES="addMarkerUpdates",e.ADD_TILE_UPDATES="addTileUpdates",e.ADD_CHAT="addChat",e.POP_MARKER_UPDATES="popMarkerUpdates",e.POP_TILE_UPDATES="popTileUpdates",e.SET_MAX_PLAYERS="setMaxPlayers",e.SET_PLAYERS_ASYNC="setPlayersAsync",e.SYNC_PLAYERS="syncPlayers",e.SET_LOADED="setLoaded",e.SET_CURRENT_SERVER="setCurrentServer",e.SET_CURRENT_MAP="setCurrentMap",e.SET_CURRENT_LOCATION="setCurrentLocation",e.SET_CURRENT_ZOOM="setCurrentZoom",e.SET_PARSED_URL="setParsedUrl",e.CLEAR_PARSED_URL="clearParsedUrl",e.SET_FOLLOW_TARGET="setFollowTarget",e.SET_VIEW_TARGET="setViewTarget",e.CLEAR_FOLLOW_TARGET="clearFollow",e.CLEAR_VIEW_TARGET="clearViewTarget",e.SET_SCREEN_SIZE="setScreenSize",e.TOGGLE_UI_ELEMENT_VISIBILITY="toggleUIElementVisibility",e.SET_UI_ELEMENT_VISIBILITY="setUIElementVisibility",e.SHOW_UI_MODAL="showUIModal",e.HIDE_UI_MODAL="hideUIModal",e.TOGGLE_SIDEBAR_SECTION_COLLAPSED_STATE="toggleSidebarSectionCollapsedState",e.SET_LOGGED_IN="setLoggedIn",e.SET_LOGIN_REQUIRED="setLoginRequired",e.RESET="reset",e))(c||{}),dt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEUrHQ1DIAxsQi29jXOqfWYnGwr///9SPYm7iXK0hG20e2ScaUyQXkCKTD2CVDpAKhMzJBEvHw7GloC3gnKtgG22iWy+iGycclysdlqiakecY0aWX0CAUzR6TjMkGAjN/gIgAAAAbElEQVQY02XKRw7AIAxEUTuYGkJI79z/mDESO39pNk8D0wQ8rUvRGjgBrZxHDqCihG1Tap4Vd545SyDynmhdj8O5npPgvTHWhuCctcYQSbjvEJal4/b9ut5XQozPgzhwiDGmJKGesZXS9wn4AR4zCfm0oDjBAAAAAElFTkSuQmCC";const it=new Map,rt=new Map,ct=new Set,Tt=[],so=e=>{switch(e){case"large":case"body":return 32;case"small":default:return 16}},lo=(e,t)=>{const o=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e.uuid,r=`${o}-${t}`;if(it.has(r))return Promise.resolve(it.get(r));if(rt.has(r))return rt.get(r);const i=new Promise((n,s)=>{const l=new
|
||
|
Check your server configuration in index.html is correct.`,o=new Map;if(!Object.keys(e).length)throw new K(`No servers defined. ${t}`);for(const a in e){if(!Object.hasOwnProperty.call(e,a))continue;const r=e[a];let i=!1;for(const n of It)if(r&&Object.hasOwnProperty.call(r,n[0])){try{Nt.set(a,new n[1](r[n[0]]))}catch(s){throw s.message=`Server "${a}": ${s.message}. ${t}`,s}o.set(a,r),i=!0}if(!i)throw new K(`Server "${a}": No configuration found for any supported map type. ${t}`);r.id=a}return o},Za=e=>{const t=`
|
||
|
Check your standalone/config.js file exists and is being loaded correctly.`,o=new Map;o.set("dynmap",{id:"dynmap",label:"dynmap",dynmap:e});try{Nt.set("dynmap",new Ke(e))}catch(a){throw a.message=`${a.message}. ${t}`,a}return o},ja=e=>{var t;if(!e)throw new K(`No configuration found.
|
||
|
Check for any syntax errors in your configuration in index.html. Your browser console may contain additional information.`);if(e.version!==Ha)throw new K(`Configuration version mismatch.
|
||
|
Use a fresh copy of index.html from your current LiveAtlas version (${_().state.version}) and reapply any customisations.`);return typeof e.servers!="undefined"?Va(e.servers):Za(((t=window.config)==null?void 0:t.url)||null)},Fa={[c.INIT](e,t){const o=(t==null?void 0:t.messages)||{},a=(t==null?void 0:t.ui)||{};try{const r=JSON.parse(localStorage.getItem("uiSettings")||"{}");if(r&&r.sidebar)for(const i in r.sidebar){const n=r.sidebar[i];!n||typeof e.ui.sidebar[i]!="undefined"&&(e.ui.sidebar[i].collapsed=!!n.collapsed)}}catch(r){console.warn("Failed to load saved UI settings",r)}e.messages=Object.assign(e.messages,sa(o)),typeof a.playersAboveMarkers=="boolean"&&(e.ui.playersAboveMarkers=a.playersAboveMarkers),typeof a.compactPlayerMarkers=="boolean"&&(e.ui.compactPlayerMarkers=a.compactPlayerMarkers),typeof a.disableContextMenu=="boolean"&&(e.ui.disableContextMenu=a.disableContextMenu),typeof a.disableMarkerUI=="boolean"&&(e.ui.disableMarkerUI=a.disableMarkerUI),typeof a.playersSearch=="boolean"&&(e.ui.playersSearch=a.playersSearch),typeof a.customLoginUrl=="string"&&(e.ui.customLoginUrl=a.customLoginUrl),e.servers=t.servers,e.currentServer&&!e.servers.has(e.currentServer.id)&&(e.currentServer=void 0)},[c.SET_SERVER_CONFIGURATION](e,t){e.configuration=Object.assign(e.configuration,t)},[c.SET_SERVER_CONFIGURATION_HASH](e,t){e.configurationHash=t},[c.SET_SERVER_MESSAGES](e,t){e.messages=Object.assign(e.messages,t)},[c.SET_WORLDS](e,t){e.worlds.clear(),e.maps.clear(),e.followTarget=void 0,e.viewTarget=void 0,e.currentWorldState.timeOfDay=0,e.currentWorldState.raining=!1,e.currentWorldState.thundering=!1,t.forEach(o=>{e.worlds.set(o.name,o),o.maps.forEach(a=>e.maps.set(`${a.world.name}_${a.name}`,a))}),e.currentWorld&&e.worlds.has(e.currentWorld.name)?e.currentWorld=e.worlds.get(e.currentWorld.name):e.currentWorld=void 0,e.currentWorld&&e.currentMap&&e.maps.has(`${e.currentWorld.name}_${e.currentMap.name}`)?e.currentMap=e.maps.get(`${e.currentWorld.name}_${e.currentMap.name}`):e.currentMap=void 0},[c.SET_COMPONENTS](e,t){e.components=Object.assign(e.components,t)},[c.SET_MARKER_SETS](e,t){e.markerSets.clear(),e.pendingMarkerUpdates.splice(0),Y.markers.clear();for(const o of t)e.markerSets.set(o[0],o[1]),Y.markers.set(o[0],new Map)},[c.SET_MARKERS](e,t){Y.markers.clear();for(const o of t)Y.markers.set(o[0],o[1])},[c.SET_WORLD_STATE](e,t){e.currentWorldState=Object.assign(e.currentWorldState,t)},[c.ADD_MARKER_SET_UPDATES](e,t){for(const o of t){if(o.removed){e.markerSets.delete(o.id),Y.markers.delete(o.id);continue}if(o.payload)if(e.markerSets.has(o.id)){const a=e.markerSets.get(o.id);a.showLabels=o.payload.showLabels,a.minZoom=o.payload.minZoom,a.maxZoom=o.payload.maxZoom,a.priority=o.payload.priority,a.label=o.payload.label,a.hidden=o.payload.hidden}else e.markerSets.set(o.id,{id:o.id,showLabels:o.payload.showLabels,minZoom:o.payload.minZoom,maxZoom:o.payload.maxZoom,priority:o.payload.priority,label:o.payload.label,hidden:o.payload.hidden}),Y.markers.set(o.id,new Map)}},[c.ADD_MARKER_UPDATES](e,t){let o;for(const a of t)!Y.markers.has(a.set)||(o=Y.markers.get(a.set),a.removed?o.delete(a.id):o.set(a.id,a.payload));e.pendingMarkerUpdates=e.pendingMarkerUpdates.concat(t)},[c.ADD_TILE_UPDATES](e,t){e.pendingTileUpdates=e.pendingTileUpdates.concat(t)},[c.ADD_CHAT](e,t){e.chat.messages.unshift(...t)},[c.POP_MARKER_UPDATES](e,t){e.pendingMarkerUpdates.splice(0,t)},[c.POP_TILE_UPDATES](e,t){e.pendingTileUpdates.splice(0,t)},[c.SET_MAX_PLAYERS](e,t){e.maxPlayers=t},[c.SET_PLAYERS_ASYNC](e,t){let o=0;for(const a of t){if(e.players.has(a.name)){const r=e.players.get(a.name);r.health=a.health,r.uuid=a.uuid,r.armor=a.armor,r.location=Object.assign(r.location,a.location),r.yaw=a.yaw,r.hidden=a.hidden,r.displayName=a.displayName,r.sort=a.sort,(r.displayName!==a.displayName||r.sort!==a.sort)&&(e.sortedPlayers.dirty=!0)}else e.sortedPlayers.dirty=!0,e.players.set(a.name,{name:a.name,uuid:a.uuid,health:a.health,armor:a.armor,location:a.location,yaw:a.yaw,displayName:a.displayName,sort:a.sort,hidden:a.hidden});if(t.delete(a),++o>=10)break}retur
|
||
|
<svg class="svg-icon" aria-hidden="true">
|
||
|
<use xlink:href="#icon--clock_sun" />
|
||
|
</svg>`,this._moon.innerHTML=`
|
||
|
<svg class="svg-icon" aria-hidden="true">
|
||
|
<use xlink:href="#icon--clock_moon" />
|
||
|
</svg>`,this.options.showDigitalClock&&(this._clock=u.exports.DomUtil.create("div","clock__time",this._container)),this._unwatchHandler=M(o,a=>{this._update(a)},{deep:!0}),this._container}onRemove(){this._unwatchHandler&&this._unwatchHandler()}_update(t){const o=t.timeOfDay;let a;if(o>23100||o<12900){let n=o+900;n=n>=24e3?n-24e3:n,a=n/27600*2*Math.PI}else{const n=o-12900;a=Math.PI+n/20400*2*Math.PI}const r=a+Math.PI;o>=0?(this._sun.style.transform="translate("+Math.round(-50*Math.cos(a))+"px, "+Math.round(-50*Math.sin(a))+"px)",this._moon.style.transform="translate("+Math.round(-50*Math.cos(r))+"px, "+Math.round(-50*Math.sin(r))+"px)"):(this._sun.style.transform="translate(-150px, -150px)",this._moon.style.transform="translate(-150px, -150px)");const i=Et(o);this.options.showDigitalClock&&(o>=0?(this._clock.classList.remove(i.night?"day":"night"),this._clock.classList.add(i.day?"day":"night"),this._clock.textContent=[i.hours.toString().padStart(2,"0"),i.minutes.toString().padStart(2,"0")].join(":")):(this._clock.classList.remove(i.night?"day":"night"),this._clock.textContent="")),this.options.showWeather&&(t.thundering?(this._setSunIcon("clock_sun_storm"),this._setMoonIcon("clock_moon_storm")):t.raining?(this._setSunIcon("clock_sun_rain"),this._setMoonIcon("clock_moon_rain")):(this._setSunIcon("clock_sun"),this._setMoonIcon("clock_moon")))}_setSunIcon(t){this._sun&&this._currentSunIcon!==t&&(this._sun.innerHTML=`
|
||
|
<svg class="svg-icon" aria-hidden="true">
|
||
|
<use xlink:href="#icon--${t}" />
|
||
|
</svg>`,this._currentSunIcon=t)}_setMoonIcon(t){this._moon&&this._currentMoonIcon!==t&&(this._moon.innerHTML=`
|
||
|
<svg class="svg-icon" aria-hidden="true">
|
||
|
<use xlink:href="#icon--${t}" />
|
||
|
</svg>`,this._currentMoonIcon=t)}}const pr=T({props:{leaflet:{type:Object,required:!0}},setup(e){const t=_(),o=d(()=>t.state.components.clockControl);let a=new qt(o.value);M(o,r=>{e.leaflet.removeControl(a),r&&(a=new qt(r),e.leaflet.addControl(a))},{deep:!0}),V(()=>e.leaflet.addControl(a)),F(()=>e.leaflet.removeControl(a))},render(){return null}});let ur=document.getElementById("icon--link"),we=document.getElementById("svg-sprite-component-wrap");we||(we=document.createElementNS("http://www.w3.org/2000/svg","svg"),we.id="svg-sprite-component-wrap",we.style.setProperty("display","none"),document.body.appendChild(we));if(!ur){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");we.appendChild(e),e.setAttribute("viewBox","0 0 269.4 271.84"),e.setAttribute("id","icon--link"),e.innerHTML='<path d="M110.774 86.501c-13.432 0-26.865 5.12-37.01 15.357l-58.551 59.088c-20.29 20.476-20.29 53.87 0 74.346l21.008 21.201c20.29 20.476 53.704 20.448 74.006.012l38.221-38.473a13.5 13.5 0 0 0-.064-19.092 13.5 13.5 0 0 0-19.092.062l-38.22 38.473c-10.117 10.185-25.582 10.195-35.673.012l-21.006-21.199c-10.091-10.183-10.091-26.155 0-36.338l58.55-59.086c10.092-10.183 25.57-10.183 35.66 0l10.995 11.094a13.5 13.5 0 0 0 19.092.086 13.5 13.5 0 0 0 .086-19.092l-10.992-11.094C137.639 91.62 124.206 86.5 110.774 86.5z"></path><path d="M196.174 0c-13.428.002-26.857 5.117-37.008 15.336l-38.219 38.473a13.5 13.5 0 0 0 .063 19.092 13.5 13.5 0 0 0 19.091-.063l38.22-38.473c10.117-10.185 25.582-10.195 35.673-.012l21.008 21.2c10.091 10.182 10.091 26.154 0 36.337l-58.55 59.088c-10.091 10.183-25.571 10.183-35.662 0l-10.992-11.094a13.5 13.5 0 0 0-19.092-.088 13.5 13.5 0 0 0-.088 19.092l10.994 11.094c20.29 20.476 53.727 20.476 74.018 0l58.55-59.088c20.29-20.476 20.29-53.87 0-74.346l-21.007-21.2c-10.145-10.24-23.57-15.351-36.998-15.35z"></path>'}class hr extends u.exports.Control{constructor(t){super(t)}onAdd(){const t=_(),o=u.exports.DomUtil.create("button","leaflet-control-button leaflet-control-link"),a=d(()=>t.state.messages.copyToClipboardSuccess),r=d(()=>t.state.messages.copyToClipboardError);return o.type="button",o.title=t.state.messages.linkTitle,o.innerHTML=`
|
||
|
<svg class="svg-icon" aria-hidden="true">
|
||
|
<use xlink:href="#icon--link" />
|
||
|
</svg>`,o.addEventListener("click",i=>{i.preventDefault(),Do(window.location.href.split("#")[0]+t.getters.url).then(()=>{ne(a.value)}).catch(n=>{ne({type:"error",text:r.value}),console.error("Error copying to clipboard",n)})}),o}}const gr=T({props:{leaflet:{type:Object,required:!0}},setup(e){const t=new hr({position:"bottomleft"});V(()=>e.leaflet.addControl(t)),F(()=>e.leaflet.removeControl(t))},render(){return null}});let fr=document.getElementById("icon--chat"),_e=document.getElementById("svg-sprite-component-wrap");_e||(_e=document.createElementNS("http://www.w3.org/2000/svg","svg"),_e.id="svg-sprite-component-wrap",_e.style.setProperty("display","none"),document.body.appendChild(_e));if(!fr){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");_e.appendChild(e),e.setAttribute("viewBox","0 0 255.35 204.89"),e.setAttribute("id","icon--chat"),e.innerHTML='<path d="M61.254 0C27.32 0 0 27.318 0 61.252v42.163c0 33.934 27.319 61.252 61.254 61.252h15.259l-21.095 38.319c-.46 1.82.236 2.723 3.955.918 13.531-6.566 53.741-27.223 77.092-39.237h57.636c33.934 0 61.254-27.318 61.254-61.252V61.252C255.355 27.317 228.036 0 194.101 0zm.053 80.558a17.531 17.531 0 0 1 .095 0 17.531 17.531 0 0 1 17.53 17.531 17.531 17.531 0 0 1-17.53 17.531A17.531 17.531 0 0 1 43.87 98.089a17.531 17.531 0 0 1 17.436-17.531zm67.688 0a17.531 17.531 0 0 1 .095 0 17.531 17.531 0 0 1 17.53 17.531 17.531 17.531 0 0 1-17.53 17.531 17.531 17.531 0 0 1-17.531-17.531 17.531 17.531 0 0 1 17.436-17.531zm67.733 0a17.531 17.531 0 0 1 .095 0 17.531 17.531 0 0 1 17.53 17.531 17.531 17.531 0 0 1-17.53 17.531 17.531 17.531 0 0 1-17.531-17.531 17.531 17.531 0 0 1 17.436-17.531z"></path>'}class yr extends u.exports.Control{constructor(t){super(t)}onAdd(){const t=_(),o=u.exports.DomUtil.create("button","leaflet-control-bottom leaflet-control-button leaflet-control-chat");return o.type="button",o.title=t.state.messages.chatTitle,o.innerHTML=`
|
||
|
<svg class="svg-icon">
|
||
|
<use xlink:href="#icon--chat" />
|
||
|
</svg>`,o.addEventListener("click",a=>{t.commit(c.TOGGLE_UI_ELEMENT_VISIBILITY,"chat"),a.stopPropagation(),a.preventDefault()}),u.exports.DomEvent.on(o,"keydown",a=>{a.key==="ArrowRight"&&t.commit(c.SET_UI_ELEMENT_VISIBILITY,{element:"chat",state:!0})}),M(t.state.ui.visibleElements,a=>{o.setAttribute("aria-expanded",a.has("chat").toString())}),o}}const br=T({props:{leaflet:{type:Object,required:!0}},setup(e){const t=new yr({position:"topleft"});V(()=>e.leaflet.addControl(t)),F(()=>e.leaflet.removeControl(t))},render(){return null}});class vr extends u.exports.Control{constructor(t){super(t)}onAdd(){const t=u.exports.DomUtil.create("div","leaflet-control-logo");let o;if(this.options.url&&(o=u.exports.DomUtil.create("a","",t),o.href=this.options.url,o.setAttribute("aria-label",this.options.text)),this.options.image){const a=u.exports.DomUtil.create("img","",o);a.src=this.options.image,a.alt=this.options.text}else t.textContent=this.options.text;return t}}const wr=T({props:{options:{type:Object,required:!0},leaflet:{type:Object,required:!0}},setup(e){return{control:new vr(e.options)}},mounted(){this.leaflet.addControl(this.control)},unmounted(){this.leaflet.removeControl(this.control)},render(){return null}});let _r=document.getElementById("icon--layers"),ke=document.getElementById("svg-sprite-component-wrap");ke||(ke=document.createElementNS("http://www.w3.org/2000/svg","svg"),ke.id="svg-sprite-component-wrap",ke.style.setProperty("display","none"),document.body.appendChild(ke));if(!_r){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");ke.appendChild(e),e.setAttribute("viewBox","0 0 234.46 247.78"),e.setAttribute("id","icon--layers"),e.innerHTML='<path d="m130.947 2.453 100.256 70.392c4.44 3.118 4.327 7.968-.254 10.876l-111.155 70.56c-4.58 2.908-11.842 2.739-16.282-.379L3.257 83.51c-4.44-3.117-4.327-7.968.253-10.875l111.155-70.56c4.58-2.908 11.842-2.74 16.282.378z"></path><path d="M217.846 154.897 119.79 217.14c-4.58 2.907-11.843 2.738-16.283-.38l-86.895-61.013-13.104 8.317c-4.58 2.908-4.693 7.757-.253 10.875l100.252 70.393c4.44 3.117 11.703 3.285 16.284.378l111.157-70.559c4.58-2.907 4.694-7.759.254-10.876z"></path><path d="m217.846 109.185-98.048 62.24c-4.58 2.908-11.843 2.739-16.283-.378L16.62 110.033 3.517 118.35c-4.58 2.908-4.694 7.759-.254 10.877l100.253 70.39c4.44 3.118 11.703 3.288 16.283.38l111.158-70.56c4.58-2.907 4.693-7.757.253-10.875z"></path>'}let kr=document.getElementById("icon--checkbox"),Se=document.getElementById("svg-sprite-component-wrap");Se||(Se=document.createElementNS("http://www.w3.org/2000/svg","svg"),Se.id="svg-sprite-component-wrap",Se.style.setProperty("display","none"),document.body.appendChild(Se));if(!kr){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");Se.appendChild(e),e.setAttribute("viewBox","0 0 105.15 95.879"),e.setAttribute("id","icon--checkbox"),e.innerHTML='<path d="M97.014 14.81 48.221 63.603 26.547 41.929l-9.191 9.193L48.22 81.987l57.984-57.986z" stroke="#222" stroke-width="6"></path>'}const Sr=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),wt=(e,t)=>{if(!!e.target){if(Sr.has(e.key)){const o=t.indexOf(e.target);if(o<0)return;let a=o;switch(e.key){case"ArrowUp":case"ArrowLeft":a=o-1;break;case"ArrowDown":case"ArrowRight":a=o+1;break;case"Home":a=0;break;case"End":a=t.length-1;break}a<0?a=t.length-1:a>=t.length&&(a=0),t[a].focus(),e.preventDefault()}else if(e.key==="Enter"&&e.target){const o=new MouseEvent("click",{ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,altKey:e.altKey,bubbles:!0});e.target.dispatchEvent(o),e.preventDefault()}}};u.exports.Control.LayersObject;u.exports.Control.LayersOptions;const oe=_();class Lr extends u.exports.Control.Layers{constructor(t,o,a){super(t,o,Object.assign(a||{},{sortLayers:!0,sortFunction:(r,i,n,s)=>{const l=this._layerPositions.get(r)||0,p=this._layerPositions.get(i)||0;return l!==p?l-p:n<s?-1:n>s?1:0}})),this.visible=!1,this._layerPositions=new Map}hasLayer(t){return!!super._getLayer(u.exports.Util.stamp(t))}expand(){this._layersButton.setAttribute("aria-expanded","
|
||
|
<svg class="svg-icon" aria-hidden="true">
|
||
|
<use xlink:href="#icon--layers" />
|
||
|
</svg>`,M(oe.state.ui.visibleElements,i=>{i.has("layers")&&!this.visible?this.expand():this.visible&&!i.has("layers")&&this.collapse(),this.visible=oe.state.ui.visibleElements.has("layers")}),M(oe.state.messages,i=>r.title=i.layersTitle),this.visible=oe.state.ui.visibleElements.has("layers"),this.visible&&this.expand(),this._baseLayersList=u.exports.DomUtil.create("div",t+"-base",a),this._separator=u.exports.DomUtil.create("div",t+"-separator",a),this._overlaysList=u.exports.DomUtil.create("div",t+"-overlays",a),o.appendChild(a),window.addEventListener("resize",()=>this.handleResize()),this.handleResize()}handleResize(){const t=this._layersButton.getBoundingClientRect().y;this._section.style.maxHeight=`calc(100vh - ${t+30+10+55}px)`}addOverlayAtPosition(t,o,a){return this._layerPositions.set(t,a),super.addOverlay(t,o)}addOverlay(t,o){return this._layerPositions.set(t,0),super.addOverlay(t,o)}removeLayer(t){return this._layerPositions.delete(t),super.removeLayer(t)}_addItem(t){const o=t.overlay?this._overlaysList:this._baseLayersList,a=document.createElement("label"),r=document.createElement("span"),i=this._map.hasLayer(t.layer);let n;return a.className="layer checkbox",t.overlay?(n=document.createElement("input"),n.type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=super._createRadioElement("leaflet-base-layers_"+u.exports.Util.stamp(this),i),n.layerId=u.exports.Util.stamp(t.layer),this._layerControlInputs.push(n),r.textContent=t.name,u.exports.DomEvent.on(n,"click",s=>super._onInputClick(s),this),a.appendChild(n),a.insertAdjacentHTML("beforeend",`
|
||
|
<svg class="svg-icon" aria-hidden="true">
|
||
|
<use xlink:href="#icon--checkbox" />
|
||
|
</svg>`),a.appendChild(r),o.appendChild(a),super._checkDisabledLayers(),r}onRemove(t){this._layerControlInputs=[],super.onRemove(t)}}class Er{constructor(t){const o=d(()=>_().state.components.layerControl);this.map=t,this.layerControl=new Lr({},{},{position:"topleft"}),o.value&&this.map.addControl(this.layerControl),M(o,a=>{a?this.map.addControl(this.layerControl):this.map.removeControl(this.layerControl)})}addLayer(t,o,a,r){this.map.addLayer(t),o&&(this.layerControl.hasLayer(t)&&this.layerControl.removeLayer(t),typeof r!="undefined"?this.layerControl.addOverlayAtPosition(t,a,r):this.layerControl.addOverlay(t,a))}addHiddenLayer(t,o,a){this.layerControl.hasLayer(t)&&this.layerControl.removeLayer(t),typeof a!="undefined"?this.layerControl.addOverlayAtPosition(t,o,a):this.layerControl.addOverlay(t,o)}removeLayer(t){this.map.removeLayer(t),this.layerControl.removeLayer(t)}}class Ar extends u.exports.Map{constructor(t,o){super(t,o),this._layerManager=Object.seal(new Er(this))}getLayerManager(){return this._layerManager}_initControlPos(){const t=this._controlCorners={},o="leaflet-",a=this._controlContainer=u.exports.DomUtil.create("div",o+"control-container",this._container);function r(i,n){const s=o+i+" "+o+n;t[`${i}${n}`]=u.exports.DomUtil.create("div",s,a)}r("top","left"),r("top","right"),r("top","center"),r("bottom","center"),r("bottom","left"),r("bottom","right")}}let xr=document.getElementById("icon--loading"),Le=document.getElementById("svg-sprite-component-wrap");Le||(Le=document.createElementNS("http://www.w3.org/2000/svg","svg"),Le.id="svg-sprite-component-wrap",Le.style.setProperty("display","none"),document.body.appendChild(Le));if(!xr){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");Le.appendChild(e),e.setAttribute("stroke","#fff"),e.setAttribute("id","icon--loading"),e.setAttribute("viewBox","0 0 38 38"),e.innerHTML='<g transform="translate(1 1)" stroke-width="2" fill="none"><circle stroke-opacity=".5" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18"><animatetransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"></animatetransform></path></g>'}class Cr extends u.exports.Control{constructor(t){super(t),this._dataLoaders=new Set,this._delayIndicatorTimeout=null,this._loadingIndicator=u.exports.DomUtil.create("div","leaflet-control-button leaflet-control-loading")}onAdd(t){return this._loadingIndicator.title=_().state.messages.loadingTitle,this._loadingIndicator.hidden=!0,this._loadingIndicator.innerHTML=`
|
||
|
<svg class="svg-icon">
|
||
|
<use xlink:href="#icon--loading" />
|
||
|
</svg>`,this._addLayerListeners(t),this._addMapListeners(t),this._loadingIndicator}onRemove(t){this._removeLayerListeners(t),this._removeMapListeners(t)}addLoader(t){this._dataLoaders.add(t),this.options.delayIndicator&&!this._delayIndicatorTimeout?this._delayIndicatorTimeout=setTimeout(()=>{this.updateIndicator(),this._delayIndicatorTimeout=null},this.options.delayIndicator):this.updateIndicator()}removeLoader(t){this._dataLoaders.delete(t),this.updateIndicator(),this.options.delayIndicator&&this._delayIndicatorTimeout&&!this.isLoading()&&(clearTimeout(this._delayIndicatorTimeout),this._delayIndicatorTimeout=null)}updateIndicator(){this.isLoading()?this._showIndicator():this._hideIndicator()}isLoading(){return this._countLoaders()>0}_countLoaders(){return this._dataLoaders.size}_showIndicator(){this._loadingIndicator.hidden=!1}_hideIndicator(){this._loadingIndicator.hidden=!0}_handleLoading(t){this.addLoader(this.getEventId(t))}_handleBaseLayerChange(t){t.layer&&t.layer.eachLayer&&typeof t.layer.eachLayer=="function"&&t.layer.eachLayer(o=>{this._handleBaseLayerChange({layer:o})})}_handleLoad(t){this.removeLoader(this.getEventId(t))}getEventId(t){return t.id?t.id:t.layer?t.layer._leaflet_id:t.target._leaflet_id}_layerAdd(t){if(t.layer instanceof u.exports.TileLayer)try{t.layer.isLoading()&&this.addLoader(t.layer._leaflet_id),t.layer.on("loading",this._handleLoading,this),t.layer.on("load",this._handleLoad,this)}catch(o){console.warn("L.Control.Loading: Tried and failed to add event handlers to layer",t.layer),console.warn("L.Control.Loading: Full details",o)}}_layerRemove(t){if(t.layer instanceof u.exports.TileLayer)try{t.layer.off("loading",this._handleLoading,this),t.layer.off("load",this._handleLoad,this)}catch(o){console.warn("L.Control.Loading: Tried and failed to remove event handlers from layer",t.layer),console.warn("L.Control.Loading: Full details",o)}}_addLayerListeners(t){t.eachLayer(o=>{o instanceof u.exports.TileLayer&&(o.isLoading()&&this.addLoader(o._leaflet_id),o.on("loading",this._handleLoading,this),o.on("load",this._handleLoad,this))}),t.on("layeradd",this._layerAdd,this),t.on("layerremove",this._layerRemove,this)}_removeLayerListeners(t){t.eachLayer(o=>{o instanceof u.exports.TileLayer&&(this.removeLoader(o._leaflet_id),o.off("loading",this._handleLoading,this),o.off("load",this._handleLoad,this))}),t.off("layeradd",this._layerAdd,this),t.off("layerremove",this._layerRemove,this)}_addMapListeners(t){t.on("baselayerchange",this._handleBaseLayerChange,this),t.on("dataloading",this._handleLoading,this),t.on("dataload",this._handleLoad,this),t.on("layerremove",this._handleLoad,this)}_removeMapListeners(t){t.off("baselayerchange",this._handleBaseLayerChange,this),t.off("dataloading",this._handleLoading,this),t.off("dataload",this._handleLoad,this),t.off("layerremove",this._handleLoad,this)}}const Tr={name:"svg-icon",props:{name:{type:String,required:!0},title:{type:String,default:null}},setup(e){const t=d(()=>`#icon--${e.name}`),o=d(()=>`svg-icon svg-icon--${e.name}`);return{iconPath:t,className:o}}},Mr={key:0},Ir=["xlink:href"];function zr(e,t,o,a,r,i){return m(),b("svg",{class:ie(a.className),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[o.title?(m(),b("title",Mr,x(o.title),1)):C("",!0),f("use",{"xlink:href":a.iconPath},null,8,Ir)],2)}var pe=P(Tr,[["render",zr]]);let $r=document.getElementById("icon--block_world_surface"),Ee=document.getElementById("svg-sprite-component-wrap");Ee||(Ee=document.createElementNS("http://www.w3.org/2000/svg","svg"),Ee.id="svg-sprite-component-wrap",Ee.style.setProperty("display","none"),document.body.appendChild(Ee));if(!$r){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");Ee.appendChild(e),e.setAttribute("viewBox","0 0 194.86 225"),e.setAttribute("id","icon--block_world_surface"),e.innerHTML='<g transform="translate(-56.845 -44.525)"><path d="m154.27 44.525-97.428 56.25 19.486 11.25 77.942-45 77.942 45 19.486-11.25z" fill="#66a443"></path><path d="m154.27 157.02-77.942-45 77.942-45 77.942 45z" fill="#77b551"></path><path d="m56.845 213.2
|
||
|
<svg class="svg-icon">
|
||
|
<use xlink:href="#icon--${this.loggedIn.value?"logout":"login"}" />
|
||
|
</svg>`}async handleClick(){const t=d(()=>this.store.state.messages.logoutSuccess),o=d(()=>this.store.state.messages.logoutErrorUnknown);if(this.loggedIn.value)try{await this.store.dispatch(R.LOGOUT,void 0),ne(t.value)}catch{ne(o.value)}else await this.store.dispatch(R.LOGIN,null)}}const mn=T({props:{leaflet:{type:Object,required:!0}},setup(e){const t=new cn({position:"topleft"});V(()=>e.leaflet.addControl(t)),F(()=>e.leaflet.removeControl(t))},render(){return null}}),pn=T({props:{options:{type:Object,required:!0},leaflet:{type:Object,required:!0}},setup(e){let o=_().state.currentMapProvider.createTileLayer(Object.freeze(JSON.parse(JSON.stringify(e.options.tileLayerOptions))));e.leaflet.getLayerManager().addHiddenLayer(o,e.options.label,e.options.priority),F(()=>{e.leaflet.getLayerManager().removeLayer(o),o.remove()})},render(){return null}});const un=T({components:{TileLayerOverlay:pn,MapContextMenu:sn,TileLayer:Ya,PlayersLayer:er,MarkerSetLayer:rr,CoordinatesControl:nr,ClockControl:pr,LinkControl:gr,ChatControl:br,LogoControl:wr,LoginControl:mn},setup(){const e=_(),t=void 0,o=d(()=>e.state.maps),a=d(()=>{var H;return(H=e.state.currentMap)==null?void 0:H.overlays}),r=d(()=>e.state.markerSets),i=d(()=>e.state.configuration),n=d(()=>e.getters.playerMarkersEnabled),s=d(()=>e.getters.coordinatesControlEnabled),l=d(()=>e.getters.clockControlEnabled),p=d(()=>e.state.components.linkControl),h=d(()=>e.state.components.chatBox),g=d(()=>e.state.components.login),y=d(()=>!e.state.ui.disableContextMenu),L=d(()=>e.state.components.logoControls),I=d(()=>e.state.currentWorld),U=d(()=>e.state.currentMap),z=d(()=>e.getters.mapBackground),S=d(()=>e.state.followTarget),$=d(()=>e.state.viewTarget),k=d(()=>e.state.parsedUrl),N=E(null),v=d(()=>e.state.messages.mapTitle);return{leaflet:t,maps:o,overlays:a,markerSets:r,configuration:i,playerMarkersEnabled:n,coordinatesControlEnabled:s,clockControlEnabled:l,linkControlEnabled:p,chatBoxEnabled:h,loginEnabled:g,contextMenuEnabled:y,logoControls:L,followTarget:S,viewTarget:$,parsedUrl:k,mapBackground:z,currentWorld:I,currentMap:U,scheduledView:N,mapTitle:v}},watch:{followTarget:{handler(e,t){e&&this.updateFollow(e,!t||e.name!==t.name)},deep:!0},viewTarget:{handler(e){e&&(this.currentWorld&&e.location.world===this.currentWorld.name&&_().commit(c.CLEAR_VIEW_TARGET,void 0),this.setView(e))},deep:!0},currentMap(e,t){const o=_();if(e&&(o.state.currentMapProvider.populateMap(e),this.leaflet)){let a=this.scheduledView;!a&&t?a={location:t.latLngToLocation(this.leaflet.getCenter(),64)}:a||(a={location:{x:0,y:0,z:0}}),a.options={animate:!1,noMoveStart:!1},this.setView(a),this.scheduledView=null}},currentWorld(e,t){var a,r,i,n,s,l,p,h;const o=_();if(e){o.state.currentMapProvider.populateWorld(e);let g=this.scheduledView||{};if(o.state.followTarget&&o.state.followTarget.location.world===e.name)return;if(o.state.viewTarget&&o.state.viewTarget.location.world===e.name){o.commit(c.CLEAR_VIEW_TARGET,void 0);return}else(a=o.state.parsedUrl)!=null&&a.location?(g.location=o.state.parsedUrl.location,t||(typeof((r=o.state.parsedUrl)==null?void 0:r.zoom)!="undefined"?g.zoom=(i=o.state.parsedUrl)==null?void 0:i.zoom:typeof((n=o.state.currentMap)==null?void 0:n.defaultZoom)!="undefined"?g.zoom=(s=o.state.currentMap)==null?void 0:s.defaultZoom:g.zoom=o.state.configuration.defaultZoom),o.commit(c.CLEAR_PARSED_URL,void 0)):g.location=((l=o.state.currentMap)==null?void 0:l.center)||e.center;g.zoom==null&&(typeof((p=o.state.currentMap)==null?void 0:p.defaultZoom)!="undefined"?g.zoom=(h=o.state.currentMap)==null?void 0:h.defaultZoom:g.zoom=o.state.configuration.defaultZoom),this.scheduledView=g}},parsedUrl:{handler(e){!e||!this.currentMap||!this.leaflet||this.setView({location:Zt(Vt({},e.location),{world:e.world}),map:e.map,zoom:e.zoom,options:{animate:!1,noMoveStart:!0}})},deep:!0}},mounted(){this.leaflet=new Ar(this.$el.nextElementSibling,Object.freeze({zoom:this.configuration.defaultZoom,center:new u.exports.LatLng(0,0),fadeAnimation:!1,zoomAnimation:!0,zoomControl:!0,preferCanvas:!0,attributionControl:!1,crs:u.exports.C
|
||
|
<path transform="translate(-59.399373,-0.17905527)" d="m 202.21483,0.17905527 c -49.2926,0 -89.25212,39.95956873 -89.25212,89.25210973 0,49.292555 82.37686,197.611115 89.25212,197.611115 7.99783,0 89.25211,-148.31856 89.25211,-197.611115 0,-49.292541 -39.95957,-89.25210973 -89.25211,-89.25210973 z m 0,51.39320173 c 20.91016,-0.0011 37.86223,16.948751 37.86389,37.858908 0.001,20.912125 -16.95177,37.865025 -37.86389,37.863935 -20.91214,0.001 -37.86506,-16.9518 -37.86394,-37.863935 0.002,-20.910176 16.95376,-37.86003 37.86394,-37.858908 z"></path>
|
||
|
`}let bi=document.getElementById("icon--marker_line"),He=document.getElementById("svg-sprite-component-wrap");He||(He=document.createElementNS("http://www.w3.org/2000/svg","svg"),He.id="svg-sprite-component-wrap",He.style.setProperty("display","none"),document.body.appendChild(He));if(!bi){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");He.appendChild(e),e.setAttribute("viewBox","0 0 286.89 286.89"),e.setAttribute("id","icon--marker_line"),e.innerHTML='<path d="m138.25 1.7383a8.5 8.5 0 0 0-6.125 2.1953l-115.74 105.05a8.5008 8.5008 0 0 0 2.084 13.98l222.54 105.04-84.184 41.338a8.5 8.5 0 0 0-3.8848 11.377 8.5 8.5 0 0 0 11.377 3.8828l100.03-49.119a8.5008 8.5008 0 0 0-0.11718-15.316l-227-107.15 106.32-96.5a8.5 8.5 0 0 0 0.58204-12.006 8.5 8.5 0 0 0-5.8828-2.7773z"></path>'}let vi=document.getElementById("icon--marker_area"),We=document.getElementById("svg-sprite-component-wrap");We||(We=document.createElementNS("http://www.w3.org/2000/svg","svg"),We.id="svg-sprite-component-wrap",We.style.setProperty("display","none"),document.body.appendChild(We));if(!vi){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");We.appendChild(e),e.setAttribute("viewBox","0 0 286.89 286.89"),e.setAttribute("id","icon--marker_area"),e.innerHTML='<path d="m80.789 0.381-78.122 110.68s84.697 175.47 87.791 173.92c3.094-1.5426 194.15-35.093 194.15-35.093l-23.978-169.3z"></path>'}let wi=document.getElementById("icon--marker_circle"),Ve=document.getElementById("svg-sprite-component-wrap");Ve||(Ve=document.createElementNS("http://www.w3.org/2000/svg","svg"),Ve.id="svg-sprite-component-wrap",Ve.style.setProperty("display","none"),document.body.appendChild(Ve));if(!wi){let e=document.createElementNS("http://www.w3.org/2000/svg","symbol");Ve.appendChild(e),e.setAttribute("viewBox","0 0 286.89 286.89"),e.setAttribute("id","icon--marker_circle"),e.innerHTML='<circle cx="142.68" cy="143.06" r="137.35"></circle>'}const _i=T({name:"MarkerListItem",components:{SvgIcon:pe},props:{id:{type:String,required:!0},marker:{type:Object,required:!0}},setup(e){const t=Ho(),o=d(()=>t.state.messages.markersUnnamed),a=d(()=>({x:Math.round(e.marker.location.x),z:Math.round(e.marker.location.z)})),r=d(()=>{if("iconUrl"in e.marker)return e.marker.iconUrl}),i=d(()=>{switch(e.marker.type){case D.POINT:return"marker_point";case D.AREA:return"marker_area";case D.LINE:return"marker_line";case D.CIRCLE:return"marker_circle"}});return{icon:r,defaultIcon:i,messageUnnamed:o,pan:()=>{e.marker.type===D.POINT?t.commit(c.SET_VIEW_TARGET,{location:e.marker.location}):t.commit(c.SET_VIEW_TARGET,{location:e.marker.bounds,options:{padding:[10,10]}})},location:a}}}),ki=["id","value"],Si=["for","title"],Li=["src"],Ei={class:"marker__label"},Ai={class:"marker__location"};function xi(e,t,o,a,r,i){const n=w("SvgIcon");return m(),b(O,null,[f("input",{id:`marker-${e.id}`,type:"radio",name:"marker",value:e.id,onClick:t[0]||(t[0]=J((...s)=>e.pan&&e.pan(...s),["prevent"]))},null,8,ki),f("label",{for:`marker-${e.id}`,class:"marker",title:e.marker.tooltip,onClick:t[1]||(t[1]=J((...s)=>e.pan&&e.pan(...s),["prevent"]))},[e.icon?(m(),b("img",{key:0,width:"16",height:"16",class:"marker__icon",src:e.icon,alt:""},null,8,Li)):(m(),A(n,{key:1,name:e.defaultIcon,class:"marker__icon"},null,8,["name"])),f("span",Ei,x(e.marker.tooltip||e.messageUnnamed),1),f("span",Ai,"X: "+x(e.location.x)+", Z: "+x(e.location.z),1)],8,Si)],64)}var Ci=P(_i,[["render",xi],["__scopeId","data-v-3a029710"]]);const Ti=T({name:"MarkerList",components:{MarkerListItem:Ci,RadioList:ot},props:{markerSet:{type:Object,required:!0},search:{type:Boolean,default:!0}},setup(e){let t=0;const o=_(),a=d(()=>o.state.messages.showMore),r=d(()=>o.state.messages.markersSearchPlaceholder),i=d(()=>o.state.messages.markersSearchSkeleton),n=d(()=>o.state.messages.markersSetSkeleton),s=Y.markers.get(e.markerSet.id),l=E(""),p=E(new Map),h=E(null),g=E(0),y=E(0),L=E(50),I=E(null),U=v=>{v.key==="f"&&v.ctrlKey&&(v.preventDefault(),I.value.focus())},z=()=>{if(p.value.clear(),!s)return;y.value=s.size;let v=0;s.forEach((H,B)=>{l.val
|
||
|
${k}`,!1,++I.value),clearTimeout(Number(e)),e=setTimeout(()=>U(),1e3)}}finally{L.value=!1}},z=()=>{const k=new URL(window.location.href),N=ta(k);N&&(N.legacy&&(k.searchParams.delete("worldname"),k.searchParams.delete("world"),k.searchParams.delete("mapname"),k.searchParams.delete("x"),k.searchParams.delete("y"),k.searchParams.delete("z"),k.searchParams.delete("zoom"),history.replaceState({},"",k.toString())),t.commit(c.SET_PARSED_URL,N))},S=()=>{t.commit(c.SET_SCREEN_SIZE,{width:window.innerWidth,height:window.innerHeight})},$=k=>{if(!k.ctrlKey||!k.shiftKey)return;let N;if(!(t.state.ui.visibleModal&&(!h.value||k.key!=="M"))){switch(k.key){case"M":N="maps";break;case"I":N="markers";break;case"C":N="chat";break;case"P":N="players";break;case"L":N="layers";break;default:return}k.preventDefault(),t.commit(c.TOGGLE_UI_ELEMENT_VISIBILITY,N)}};return M(o,k=>document.title=k),M(a,k=>window.history.replaceState({},"",k)),M(r,k=>{!k||(Gt(),I.value=0,window.history.replaceState({},"",k.id),U())},{deep:!0}),M(i,async(k,N)=>{k&&N&&await U()}),M(p,async()=>{L.value||(console.log("Login state changed. Reloading configuration"),await U())}),M(h,k=>{k?(t.commit(c.SET_UI_ELEMENT_VISIBILITY,{element:"maps",state:!1}),t.dispatch(R.LOGIN,null),ne("Login required"),gt("Login required",!0,1)):t.commit(c.HIDE_UI_MODAL,"login")}),M(l,()=>{Gt()}),z(),S(),V(()=>{window.addEventListener("resize",S),window.addEventListener("keydown",$),window.addEventListener("hashchange",z),U()}),jo(()=>{t.dispatch(R.STOP_UPDATES,void 0),clearTimeout(Number(e)),window.removeEventListener("resize",S),window.removeEventListener("keydown",$),window.removeEventListener("hashchange",z)}),{chatBoxEnabled:n,chatVisible:s,loginEnabled:g,loginRequired:h,loginModalVisible:y}}});function Xs(e,t,o,a,r,i){const n=w("Map"),s=w("ChatBox"),l=w("LoginModal"),p=w("Sidebar"),h=w("notifications");return m(),b(O,null,[Z(n),e.chatBoxEnabled?W((m(),A(s,{key:0},null,512)),[[jt,e.chatBoxEnabled&&e.chatVisible]]):C("",!0),e.loginEnabled?W((m(),A(l,{key:1,required:e.loginRequired},null,8,["required"])),[[jt,e.loginModalVisible]]):C("",!0),Z(p),Z(h,{position:"bottom center",speed:250,max:3,ignoreDuplicates:!0,classes:"notification"})],64)}var el=P(Js,[["render",Xs]]);class tl extends bt{constructor(t){super(t),this._url=`${t.baseUrl}{z}/{x}_{y}.png`,u.exports.Util.setOptions(this,{zoomReverse:!1})}}class G extends me{constructor(t){if(super(t),this.configurationAbort=void 0,this.markersAbort=void 0,this.playersAbort=void 0,this.updatesEnabled=!1,this.playerUpdateTimeout=null,this.playerUpdateTimestamp=new Date,this.playerUpdateInterval=3e3,this.markerUpdateTimeout=null,this.markerUpdateInterval=3e3,this.worldPlayerUpdateIntervals=new Map,this.worldMarkerUpdateIntervals=new Map,this.worldComponents=new Map,this.markerSets=new Map,this.markers=new Map,!this.config)throw new K("URL missing");this.config.slice(-1)!=="/"&&(this.config=`${t}/`)}static buildServerConfig(t){var o,a,r;return{title:(((o=t.ui)==null?void 0:o.title)||"Pl3xmap").replace(Xt,""),expandUI:((r=(a=t.ui)==null?void 0:a.sidebar)==null?void 0:r.pinned)==="pinned",defaultZoom:1,defaultMap:void 0,defaultWorld:void 0,followMap:void 0,followZoom:void 0}}static buildMessagesConfig(t){var o,a,r,i;return{worldsHeading:((a=(o=t.ui)==null?void 0:o.sidebar)==null?void 0:a.world_list_label)||"",playersHeading:((i=(r=t.ui)==null?void 0:r.sidebar)==null?void 0:i.player_list_label)||"",chatPlayerJoin:"",chatPlayerQuit:"",chatAnonymousJoin:"",chatAnonymousQuit:"",chatErrorNotAllowed:"",chatErrorRequiresLogin:"",chatErrorCooldown:""}}buildWorlds(t,o){const a=[];return this.worldComponents.clear(),this.worldMarkerUpdateIntervals.clear(),this.worldPlayerUpdateIntervals.clear(),(t.worlds||[]).filter(i=>i&&!!i.name).sort((i,n)=>i.order-n.order).forEach((i,n)=>{var y,L,I,U,z,S,$,k,N,v,H,B;const s=o[n],l={components:{players:{markers:void 0,imageUrl:tt,grayHiddenPlayers:!0,showImages:!0}}};if(this.worldMarkerUpdateIntervals.set(i.name,s.marker_update_interval||3e3),(y=s.player_tracker)!=null&&y.enabled){const q=!!((I=(L=s.player_tracker)==null?void 0
|
||
|
`+e,!0)):(console.error("LiveAtlas failed to load:",e),gt(`LiveAtlas failed to load:
|
||
|
`+e,!0))}
|