LasTres/public/js/bundle.js

470 lines
1.2 MiB
JavaScript
Raw Permalink Normal View History

2023-06-01 08:45:43 +02:00
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/react-dom/cjs/react-dom.development.js":
/*!*************************************************************!*\
!*** ./node_modules/react-dom/cjs/react-dom.development.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
eval("/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Scheduler = __webpack_require__(/*! scheduler */ \"./node_modules/scheduler/index.js\");\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nvar suppressWarning = false;\nfunction setSuppressWarning(newSuppressWarning) {\n {\n suppressWarning = newSuppressWarning;\n }\n} // In DEV, calls to console.warn and console.error get replaced\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n if (!suppressWarning) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n if (!suppressWarning) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar ScopeComponent = 21;\nvar OffscreenComponent = 22;\nvar LegacyHiddenComponent = 23;\nvar CacheComponent = 24;\nvar TracingMarkerComponent = 25;\n\n// -----------------------------------------------------------------------------\n\nvar enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing\n// the react-reconciler package.\n\nvar enableNewReconciler = false; // Support legacy Primer support on internal FB www\n\nvar enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics.\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFall
/***/ }),
/***/ "./node_modules/react-dom/client.js":
/*!******************************************!*\
!*** ./node_modules/react-dom/client.js ***!
\******************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
eval("\n\nvar m = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\nif (false) {} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n\n\n//# sourceURL=webpack://LasTres/./node_modules/react-dom/client.js?");
/***/ }),
/***/ "./node_modules/react-dom/index.js":
/*!*****************************************!*\
!*** ./node_modules/react-dom/index.js ***!
\*****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
eval("\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (true) {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ \"./node_modules/react-dom/cjs/react-dom.development.js\");\n}\n\n\n//# sourceURL=webpack://LasTres/./node_modules/react-dom/index.js?");
/***/ }),
/***/ "./node_modules/react/cjs/react.development.js":
/*!*****************************************************!*\
!*** ./node_modules/react/cjs/react.development.js ***!
\*****************************************************/
/***/ ((module, exports, __webpack_require__) => {
eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.2.0';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback featur
/***/ }),
/***/ "./node_modules/react/index.js":
/*!*************************************!*\
!*** ./node_modules/react/index.js ***!
\*************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react.development.js */ \"./node_modules/react/cjs/react.development.js\");\n}\n\n\n//# sourceURL=webpack://LasTres/./node_modules/react/index.js?");
/***/ }),
/***/ "./node_modules/scheduler/cjs/scheduler.development.js":
/*!*************************************************************!*\
!*** ./node_modules/scheduler/cjs/scheduler.development.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, exports) => {
eval("/**\n * @license React\n * scheduler.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var enableSchedulerDebugging = false;\nvar enableProfiling = false;\nvar frameYieldMs = 5;\n\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n siftUp(heap, node, index);\n}\nfunction peek(heap) {\n return heap.length === 0 ? null : heap[0];\n}\nfunction pop(heap) {\n if (heap.length === 0) {\n return null;\n }\n\n var first = heap[0];\n var last = heap.pop();\n\n if (last !== first) {\n heap[0] = last;\n siftDown(heap, last, 0);\n }\n\n return first;\n}\n\nfunction siftUp(heap, node, i) {\n var index = i;\n\n while (index > 0) {\n var parentIndex = index - 1 >>> 1;\n var parent = heap[parentIndex];\n\n if (compare(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node;\n heap[index] = parent;\n index = parentIndex;\n } else {\n // The parent is smaller. Exit.\n return;\n }\n }\n}\n\nfunction siftDown(heap, node, i) {\n var index = i;\n var length = heap.length;\n var halfLength = length >>> 1;\n\n while (index < halfLength) {\n var leftIndex = (index + 1) * 2 - 1;\n var left = heap[leftIndex];\n var rightIndex = leftIndex + 1;\n var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n\n if (compare(left, node) < 0) {\n if (rightIndex < length && compare(right, left) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n heap[index] = left;\n heap[leftIndex] = node;\n index = leftIndex;\n }\n } else if (rightIndex < length && compare(right, node) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n // Neither child is smaller. Exit.\n return;\n }\n }\n}\n\nfunction compare(a, b) {\n // Compare sort index first, then task id.\n var diff = a.sortIndex - b.sortIndex;\n return diff !== 0 ? diff : a.id - b.id;\n}\n\n// TODO: Use symbols?\nvar ImmediatePriority = 1;\nvar UserBlockingPriority = 2;\nvar NormalPriority = 3;\nvar LowPriority = 4;\nvar IdlePriority = 5;\n\nfunction markTaskErrored(task, ms) {\n}\n\n/* eslint-disable no-var */\n\nvar hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';\n\nif (hasPerformanceNow) {\n var localPerformance = performance;\n\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date;\n var initialTime = localDate.now();\n\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n} // Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\n\n\nvar maxSigned31BitInt = 1073741823; // Times out immediately\n\nvar IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\n\nvar USER_BLOCKING_PRIORITY_TIMEOUT = 250;\nvar NORMAL_PRIORITY_TIMEOUT = 5000;\nvar LOW_PRIORITY_TIMEOUT = 10000; // Never times out\n\nvar IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap\n\nvar taskQueue = [];\nvar timerQueue = []; // Incrementing id counter. Used to maintain insertion order.\n\nvar taskIdCounter = 1; // Pausing the scheduler is useful for debugging.\nvar currentTask = null;\nvar currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.\n\nvar isPerformingWork = false;\nvar
/***/ }),
/***/ "./node_modules/scheduler/index.js":
/*!*****************************************!*\
!*** ./node_modules/scheduler/index.js ***!
\*****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/scheduler.development.js */ \"./node_modules/scheduler/cjs/scheduler.development.js\");\n}\n\n\n//# sourceURL=webpack://LasTres/./node_modules/scheduler/index.js?");
/***/ }),
/***/ "./js-src/components/bottom-panel.tsx":
/*!********************************************!*\
!*** ./js-src/components/bottom-panel.tsx ***!
\********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BottomPanel)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_output_packet_execute_action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/output-packet/execute_action */ \"./js-src/output-packet/execute_action.ts\");\n/* harmony import */ var _lastres_components_presentation_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/components/presentation-item */ \"./js-src/components/presentation-item.tsx\");\n/* harmony import */ var _lastres_components_presentation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lastres/components/presentation */ \"./js-src/components/presentation.tsx\");\n/* harmony import */ var _lastres_components_talk_npcs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lastres/components/talk-npcs */ \"./js-src/components/talk-npcs.tsx\");\n\n\n\n\n\nfunction BottomPanel(props) {\n const actionHash = props.actionHash;\n function printListActions() {\n if (actionHash === null) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n const listOfActionKeys = Object.keys(actionHash).sort((a, b) => {\n const isDisabledComparisionValue = +actionHash[a].is_disabled - +actionHash[b].is_disabled;\n if (isDisabledComparisionValue !== 0) {\n return isDisabledComparisionValue;\n }\n if (actionHash[a].name < actionHash[b].name) {\n return -1;\n }\n if (actionHash[a].name > actionHash[b].name) {\n return 1;\n }\n return 0;\n });\n function printDisabledReason(action) {\n if (!action.is_disabled || action.disabled_reason === null) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", { className: \"disabled-reason\", style: { color: 'red' } }, action.disabled_reason));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"Acciones disponibles.\"),\n listOfActionKeys.map((key) => {\n const style = {};\n const action = actionHash[key];\n if (action.is_disabled) {\n style.background = 'lightgray';\n }\n function onClick() {\n if (action.is_disabled) {\n return;\n }\n if (props.websocket !== null) {\n new _lastres_output_packet_execute_action__WEBPACK_IMPORTED_MODULE_1__[\"default\"](action.identifier)\n .send(props.websocket);\n }\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { onClick: onClick, className: \"action\", style: style, key: action.identifier },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, action.name),\n printDisabledReason(action));\n }));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_presentation__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_presentation_item__WEBPACK_IMPORTED_MODULE_2__[\"default\"], null, printListActions()),\n react__WEBPACK
2023-06-01 08:45:43 +02:00
/***/ }),
/***/ "./js-src/components/game.tsx":
/*!************************************!*\
!*** ./js-src/components/game.tsx ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ StateGame: () => (/* binding */ StateGame),\n/* harmony export */ \"default\": () => (/* binding */ Game)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_upper_panel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/upper-panel */ \"./js-src/components/upper-panel.tsx\");\n/* harmony import */ var _lastres_components_bottom_panel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/components/bottom-panel */ \"./js-src/components/bottom-panel.tsx\");\n/* harmony import */ var _lastres_components_pj_selection_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lastres/components/pj-selection-menu */ \"./js-src/components/pj-selection-menu.tsx\");\n/* harmony import */ var _lastres_components_word_selector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lastres/components/word-selector */ \"./js-src/components/word-selector.tsx\");\n/* harmony import */ var _lastres_output_packet_init__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lastres/output-packet/init */ \"./js-src/output-packet/init.ts\");\n/* harmony import */ var _lastres_output_packet_ping__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lastres/output-packet/ping */ \"./js-src/output-packet/ping.ts\");\n/* harmony import */ var _lastres_input_packets__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @lastres/input-packets */ \"./js-src/input-packets.ts\");\n\n\n\n\n\n\n\n\nvar StateGame;\n(function (StateGame) {\n StateGame[StateGame[\"MainScreen\"] = 0] = \"MainScreen\";\n StateGame[StateGame[\"SelectingWord\"] = 1] = \"SelectingWord\";\n})(StateGame || (StateGame = {}));\nfunction Game(props) {\n const selectedPJ = props.selectedPJ;\n if (selectedPJ === null) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_pj_selection_menu__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { setSelectedPJ: props.setSelectedPJ, userWantsToCreatePJ: props.userWantsToCreatePJ, setUserWantsToCreatePJ: props.setUserWantsToCreatePJ, error: props.error, setError: props.setError })));\n }\n const [teamPJs, setTeamPJs] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [enemyTeamPJs, setEnemyTeamPJs] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [isBattling, setIsBattling] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [currentLocation, setCurrentLocation] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [connectedLocations, setConnectedLocations] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [logLines, setLogLines] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [error, setError] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [scrollLog, setScrollLog] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [movingTo, setMovingTo] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [remainingFrames, setRemainingFrames] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [actionHash, setActionHash] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [talkNPCs, setTalkNPCs] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [stateGame, setStateGame] = react__WEBPACK_IMPORTED_MODULE_0__.useState(StateGame.MainScreen);\n const [NPCToSayWord, setNPCToSayWord] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [words, setWords] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const logPresentationRef = react__WEBPACK_IMPORTED_MODUL
/***/ }),
/***/ "./js-src/components/log-panel.tsx":
/*!*****************************************!*\
!*** ./js-src/components/log-panel.tsx ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LogPanel)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction LogPanel(props) {\n const logLines = props.logLines;\n function generateLog() {\n if (logLines === null || logLines.length < 1) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, \"No log\"));\n }\n return logLines.sort(function (a, b) {\n const aDate = Date.parse(a.date);\n const bDate = Date.parse(b.date);\n return aDate - bDate;\n }).map((item, i) => {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { key: i },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"b\", null, item.date),\n \" \",\n item.content.map((item, i) => {\n const style = {};\n if (item.color !== undefined) {\n style.color = item.color;\n }\n if (item.background !== undefined) {\n style.background = item.background;\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { key: i, style: style }, item.text);\n }),\n \" \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"br\", null));\n });\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"code\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"pre\", null, generateLog())));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/log-panel.tsx?");
2023-06-01 08:45:43 +02:00
/***/ }),
/***/ "./js-src/components/login-page.tsx":
/*!******************************************!*\
!*** ./js-src/components/login-page.tsx ***!
\******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LoginPage)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction LoginPage(props) {\n const userInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const passwordInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const onUserAsksForRegistration = () => {\n props.setIsAskingForRegistration(true);\n };\n const login = () => {\n if (userInputRef.current === null) {\n return;\n }\n if (passwordInputRef.current == null) {\n return;\n }\n fetch('/player/login', {\n method: 'POST',\n mode: 'same-origin',\n cache: 'no-cache',\n body: JSON.stringify({\n username: userInputRef.current.value,\n password: passwordInputRef.current.value\n })\n }).then(async (response) => {\n const statusCode = response.status;\n const data = await response.json();\n if (statusCode !== 200) {\n props.setError(data.error);\n return;\n }\n props.setError(null);\n props.setIsLoggedIn(true);\n }).catch((error) => {\n console.log(error);\n });\n };\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-container\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-contained\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h1\", null, \"Inicia sesi\\u00F3n en L3TDE online\"),\n (props.error !== null\n ? (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", { style: { background: 'red' } }, props.error))\n : (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-form\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"input\", { ref: userInputRef, type: \"text\", placeholder: \"Nombre de usuario\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"input\", { ref: passwordInputRef, type: \"password\", placeholder: \"Password\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"width-max-content align-self-end\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { onClick: login }, \"Login\"))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null,\n \"\\u00BFTodav\\u00EDa no tienes cuenta? \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { href: \"#\", onClick: onUserAsksForRegistration }, \"Registrate\"))))));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/login-page.tsx?");
/***/ }),
/***/ "./js-src/components/page.tsx":
/*!************************************!*\
!*** ./js-src/components/page.tsx ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Page)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_login_page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/login-page */ \"./js-src/components/login-page.tsx\");\n/* harmony import */ var _lastres_components_game__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/components/game */ \"./js-src/components/game.tsx\");\n/* harmony import */ var _lastres_login__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lastres/login */ \"./js-src/login.ts\");\n/* harmony import */ var _lastres_components_registration_page__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lastres/components/registration-page */ \"./js-src/components/registration-page.tsx\");\n\n\n\n\n\n// import Game from '@lastres/components/game'\nfunction Page() {\n const [isLoggedIn, setIsLoggedIn] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);\n const [userWantsToCreatePJ, setUserWantsToCreatePJ] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);\n const [isAskingForRegistration, setIsAskingForRegistration] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);\n const [error, setError] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [selectedPJ, setSelectedPJ] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const [websocket, setWebsocket] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n (0,_lastres_login__WEBPACK_IMPORTED_MODULE_3__.checkLogin)(setError, setIsLoggedIn);\n if (!isLoggedIn) {\n return notLoggedRender(setIsLoggedIn, isAskingForRegistration, setIsAskingForRegistration, error, setError);\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_game__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { selectedPJ: selectedPJ, setSelectedPJ: setSelectedPJ, userWantsToCreatePJ: userWantsToCreatePJ, setUserWantsToCreatePJ: setUserWantsToCreatePJ, error: error, setError: setError, setWebsocket: setWebsocket, websocket: websocket }));\n}\nfunction notLoggedRender(setIsLoggedIn, isAskingForRegistration, setIsAskingForRegistration, error, setError) {\n if (isAskingForRegistration) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_registration_page__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { setIsLoggedIn: setIsLoggedIn, setIsAskingForRegistration: setIsAskingForRegistration, error: error, setError: setError })));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_login_page__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { setIsLoggedIn: setIsLoggedIn, error: error, setError: setError, setIsAskingForRegistration: setIsAskingForRegistration })));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/page.tsx?");
2023-06-01 08:45:43 +02:00
/***/ }),
/***/ "./js-src/components/pj-creation-menu.tsx":
/*!************************************************!*\
!*** ./js-src/components/pj-creation-menu.tsx ***!
\************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PJCreationMenu)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_pj__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/pj */ \"./js-src/pj.ts\");\n\n\nfunction PJCreationMenu(props) {\n const longNameInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const shortNameInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const nickInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const raceSelectRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const [playableRaces, setPlayableRaces] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n if (playableRaces === null) {\n fetch('/races/playable', {\n method: 'GET',\n mode: 'same-origin',\n cache: 'no-cache'\n }).then(async (response) => {\n const statusCode = response.status;\n const data = await response.json();\n if (statusCode !== 200) {\n props.setError(data.error);\n return;\n }\n setPlayableRaces(data);\n props.setError(null);\n }).catch((error) => {\n console.log(error);\n props.setError('Imposible conectar al servidor para recibir las razas.');\n });\n }\n function createPJ() {\n if (longNameInputRef.current === null) {\n return;\n }\n if (shortNameInputRef.current === null) {\n return;\n }\n if (nickInputRef.current === null) {\n return;\n }\n if (raceSelectRef.current === null || raceSelectRef.current.selectedOptions.length < 1) {\n return;\n }\n fetch('/pj/create', {\n method: 'POST',\n mode: 'same-origin',\n cache: 'no-cache',\n body: JSON.stringify({\n full_name: longNameInputRef.current.value,\n short_name: shortNameInputRef.current.value,\n nick: nickInputRef.current.value,\n race: raceSelectRef.current.selectedOptions[0].value\n })\n }).then(async (response) => {\n const statusCode = response.status;\n const data = await response.json();\n if (statusCode !== 200) {\n props.setError(data.error);\n return;\n }\n props.setError(null);\n props.setUserWantsToCreatePJ(false);\n const pjs = await (0,_lastres_pj__WEBPACK_IMPORTED_MODULE_1__.fetchMyPjs)(props.setError);\n props.setPJs(pjs);\n }).catch((error) => {\n console.log(error);\n props.setError('Imposible crear pj, no se pudo conectar al servidor.');\n });\n }\n function renderRaces() {\n if (playableRaces !== null) {\n return Object.keys(playableRaces)\n .map((item, i) => {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { key: i, value: playableRaces[item].identifier }, `${playableRaces[item].name_selection} (${playableRaces[item].description})`);\n });\n }\n return ([]);\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-container\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-contained\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { href: \"#\", className: \"close-button\", onClick: () => {\n
2023-06-01 08:45:43 +02:00
/***/ }),
2023-06-08 09:02:32 +02:00
/***/ "./js-src/components/pj-health-like-bar.tsx":
/*!**************************************************!*\
!*** ./js-src/components/pj-health-like-bar.tsx ***!
\**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PJHealthLikeBar)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction PJHealthLikeBar(props) {\n const percentage = ((props.value / props.max) * 100) + '%';\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bar\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"filled\", style: { width: percentage } })));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/pj-health-like-bar.tsx?");
/***/ }),
/***/ "./js-src/components/pj-list-item.tsx":
/*!********************************************!*\
!*** ./js-src/components/pj-list-item.tsx ***!
\********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PJListItem)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_pj_health_like_bar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/pj-health-like-bar */ \"./js-src/components/pj-health-like-bar.tsx\");\n\n\nfunction PJListItem(props) {\n const pj = props.pj;\n function avatar() {\n if (pj.image === undefined) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n const image = pj.health > 0 ? pj.image : '/img/skull.png';\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"img\", { src: image }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"shadow\" }));\n }\n function printExperience() {\n if (pj.experience_to_next_level_current === undefined || pj.experience_to_next_level_complete === undefined) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null,\n \"Exp \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: { color: 'red' } }, pj.experience_to_next_level_current),\n \"/\",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: { color: 'green' } }, pj.experience_to_next_level_complete)));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"pj-list-item\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"avatar\" }, avatar()),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"data\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null,\n pj.nick,\n \" Nvl \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: { color: 'red' } },\n pj.level,\n \".\")),\n printExperience(),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bar-container\" },\n \"S \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_pj_health_like_bar__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { value: pj.health, max: pj.max_health })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bar-container\" },\n \"M \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_pj_health_like_bar__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { value: pj.mana, max: pj.max_mana })))));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/pj-list-item.tsx?");
/***/ }),
2023-06-08 09:02:32 +02:00
/***/ "./js-src/components/pj-list-selection.tsx":
/*!*************************************************!*\
!*** ./js-src/components/pj-list-selection.tsx ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2023-06-22 21:54:28 +02:00
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PJListSelection)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_pj_health_like_bar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/pj-health-like-bar */ \"./js-src/components/pj-health-like-bar.tsx\");\n\n\nfunction PJListSelection(props) {\n const pjs = props.pjs;\n if (pjs === null) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"Aun no se han descargado los pjs, espera un segundo...\")));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, pjs.map((item, i) => react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { onClick: () => {\n props.setSelectedPJ(item);\n }, href: \"#\", key: i },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", null, item.full_name),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", null, item.short_name),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", null, item.nick),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bar-container\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_pj_health_like_bar__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { value: item.health, max: item.max_health })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bar-container\" },\n \"Mana\",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_pj_health_like_bar__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { value: item.mana, max: item.max_mana }))))));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/pj-list-selection.tsx?");
2023-06-08 09:02:32 +02:00
/***/ }),
2023-06-01 08:45:43 +02:00
/***/ "./js-src/components/pj-selection-menu.tsx":
/*!*************************************************!*\
!*** ./js-src/components/pj-selection-menu.tsx ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2023-06-22 21:54:28 +02:00
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PJSelectionMenu)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_pj_creation_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/pj-creation-menu */ \"./js-src/components/pj-creation-menu.tsx\");\n/* harmony import */ var _lastres_components_pj_list_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/components/pj-list-selection */ \"./js-src/components/pj-list-selection.tsx\");\n/* harmony import */ var _lastres_pj__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lastres/pj */ \"./js-src/pj.ts\");\n\n\n\n\nfunction PJSelectionMenu(props) {\n const [pjs, setPJs] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);\n const createPJ = () => {\n props.setUserWantsToCreatePJ(true);\n };\n if (props.userWantsToCreatePJ) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_pj_creation_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { setSelectedPJ: props.setSelectedPJ, setUserWantsToCreatePJ: props.setUserWantsToCreatePJ, error: props.error, setError: props.setError, setPJs: setPJs }));\n }\n if (pjs === null) {\n (0,_lastres_pj__WEBPACK_IMPORTED_MODULE_3__.fetchMyPjs)(props.setError)\n .then((pjs) => { setPJs(pjs); })\n .catch((error) => { console.log(error); });\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"pj-selection-menu\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"pj-selection-menu-container\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h1\", null, \"L3TDE\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h2\", null, \"Selecciona un Personaje\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"pj-list\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { onClick: createPJ, href: \"#\" }, \"Crear un nuevo personaje\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_pj_list_selection__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { setSelectedPJ: props.setSelectedPJ, pjs: pjs })))));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/pj-selection-menu.tsx?");
2023-06-01 08:45:43 +02:00
/***/ }),
/***/ "./js-src/components/presentation-item.tsx":
/*!*************************************************!*\
!*** ./js-src/components/presentation-item.tsx ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PresentationItem)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction PresentationItem(props) {\n if (props.presentationItemRef === undefined) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"presentation-item\" }, props.children));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: props.presentationItemRef, className: \"presentation-item\" }, props.children));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/presentation-item.tsx?");
/***/ }),
/***/ "./js-src/components/presentation.tsx":
/*!********************************************!*\
!*** ./js-src/components/presentation.tsx ***!
\********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Presentation)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction Presentation(props) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"presentation\" }, props.children));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/presentation.tsx?");
/***/ }),
2023-06-01 08:45:43 +02:00
/***/ "./js-src/components/registration-page.tsx":
/*!*************************************************!*\
!*** ./js-src/components/registration-page.tsx ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ RegistrationPage)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction RegistrationPage(props) {\n const userInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const passwordInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const repeatPasswordInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const emailInputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n const onUserAsksForLogin = () => {\n props.setIsAskingForRegistration(false);\n };\n function registerUser() {\n if (userInputRef.current === null) {\n return;\n }\n if (passwordInputRef.current === null) {\n return;\n }\n if (repeatPasswordInputRef.current === null) {\n return;\n }\n if (emailInputRef.current === null) {\n return;\n }\n fetch('/player/register', {\n method: 'POST',\n mode: 'same-origin',\n cache: 'no-cache',\n body: JSON.stringify({\n username: userInputRef.current.value,\n password: passwordInputRef.current.value,\n repeat_password: repeatPasswordInputRef.current.value,\n email: emailInputRef.current.value\n })\n }).then(async (response) => {\n const statusCode = response.status;\n const data = await response.json();\n if (statusCode !== 200) {\n props.setError(data.error);\n return;\n }\n props.setError(null);\n }).catch((error) => {\n console.log(error);\n });\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-container\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-contained\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h1\", null, \"Inicia sesi\\u00F3n en L3TDE online\"),\n (props.error !== null\n ? (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", { style: { background: 'red' } }, props.error))\n : (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"login-form\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"input\", { ref: userInputRef, type: \"text\", placeholder: \"Nombre de usuario.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"input\", { ref: passwordInputRef, type: \"password\", placeholder: \"Password.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"input\", { ref: repeatPasswordInputRef, type: \"password\", placeholder: \"Repeat password.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"input\", { ref: emailInputRef, type: \"text\", placeholder: \"Email.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"width-max-content align-self-end\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { onClick: registerUser }, \"Registrate\"))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null,\n \"\\u00BFYa tienes cuenta? \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { href: \"#\", onClick: onUserAsksForLogi
/***/ }),
/***/ "./js-src/components/talk-npc.tsx":
/*!****************************************!*\
!*** ./js-src/components/talk-npc.tsx ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TalkNPCComponent)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_game__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/game */ \"./js-src/components/game.tsx\");\n/* harmony import */ var _lastres_output_packet_talk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/output-packet/talk */ \"./js-src/output-packet/talk.ts\");\n\n\n\nfunction TalkNPCComponent(props) {\n const npc = props.npc;\n function onWordlesslyTalk(npc) {\n if (props.websocket === null) {\n return;\n }\n new _lastres_output_packet_talk__WEBPACK_IMPORTED_MODULE_2__[\"default\"](npc.identifier).send(props.websocket);\n }\n function onWantToSayWord() {\n props.setStateGame(_lastres_components_game__WEBPACK_IMPORTED_MODULE_1__.StateGame.SelectingWord);\n props.setNPCToSayWord(npc);\n }\n function printAvatar(npc) {\n if (npc.icon === undefined) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"avatar\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"img\", { src: npc.icon }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"shadow\" }));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: npc.identifier, className: \"talk-npc\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"detail\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"name-container\" },\n printAvatar(npc),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"name\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, npc.name))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"buttons\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { onClick: () => {\n onWordlesslyTalk(npc);\n } }, \"Hablar\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { onClick: () => {\n onWantToSayWord();\n } }, \"Decir palabra\"))));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/talk-npc.tsx?");
/***/ }),
2023-07-12 16:01:27 +02:00
/***/ "./js-src/components/talk-npcs.tsx":
/*!*****************************************!*\
!*** ./js-src/components/talk-npcs.tsx ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TalkNPCsComponent)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_talk_npc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/talk-npc */ \"./js-src/components/talk-npc.tsx\");\n\n\nfunction TalkNPCsComponent(props) {\n const npcs = props.talkNPCs;\n if (npcs === null) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n if (Object.keys(npcs).length < 1) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"No hay nadie para hablar ahora.\"));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"Disponible para hablar:\"),\n Object.keys(npcs).map((identifier) => {\n const npc = npcs[identifier];\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_talk_npc__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { key: identifier, npc: npc, websocket: props.websocket, setStateGame: props.setStateGame, setNPCToSayWord: props.setNPCToSayWord }));\n })));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/talk-npcs.tsx?");
2023-07-12 16:01:27 +02:00
/***/ }),
2023-06-01 08:45:43 +02:00
/***/ "./js-src/components/upper-panel.tsx":
/*!*******************************************!*\
!*** ./js-src/components/upper-panel.tsx ***!
\*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ UpperPanel)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_pj_list_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/pj-list-item */ \"./js-src/components/pj-list-item.tsx\");\n/* harmony import */ var _lastres_components_presentation_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/components/presentation-item */ \"./js-src/components/presentation-item.tsx\");\n/* harmony import */ var _lastres_components_presentation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lastres/components/presentation */ \"./js-src/components/presentation.tsx\");\n/* harmony import */ var _lastres_components_log_panel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lastres/components/log-panel */ \"./js-src/components/log-panel.tsx\");\n/* harmony import */ var _lastres_output_packet_move_to__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lastres/output-packet/move-to */ \"./js-src/output-packet/move-to.ts\");\n\n\n\n\n\n\nfunction UpperPanel(props) {\n const connectedLocations = props.connectedLocations;\n const teamPJs = props.teamPJs;\n const currentLocation = props.currentLocation;\n const logLines = props.logLines;\n const websocket = props.websocket;\n const logPresentationRef = props.logPresentationRef;\n const isBattling = props.isBattling;\n const enemyTeamPJs = props.enemyTeamPJs;\n if (!(teamPJs !== null && currentLocation !== null && connectedLocations !== null && isBattling != null)) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"Esperando datos...\")));\n }\n function onClickLocation(item) {\n const moveToPacket = new _lastres_output_packet_move_to__WEBPACK_IMPORTED_MODULE_5__[\"default\"](item);\n if (websocket !== null) {\n moveToPacket.send(websocket);\n }\n }\n function availableLocationsToMove() {\n if (connectedLocations === null || connectedLocations.length === 0) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"Puedes ir a:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"ul\", null, connectedLocations.map((item, i) => {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"li\", { key: i },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { href: \"#\", onClick: () => {\n onClickLocation(item);\n } },\n item.area.name,\n \"/\",\n item.location.name));\n }))));\n }\n function showLocationMenuHeaderText() {\n if (currentLocation === null) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n if (props.movingTo === null) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null,\n \"Est\\u00E1s en \",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: { color: 'red' } }, currentLocation.area.name),\n \"/\",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: { color: 'gr
2023-06-01 08:45:43 +02:00
/***/ }),
2023-07-13 10:28:24 +02:00
/***/ "./js-src/components/word-selector.tsx":
/*!*********************************************!*\
!*** ./js-src/components/word-selector.tsx ***!
\*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WordSelector)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lastres_components_game__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/components/game */ \"./js-src/components/game.tsx\");\n/* harmony import */ var _lastres_output_packet_talk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/output-packet/talk */ \"./js-src/output-packet/talk.ts\");\n\n\n\nfunction WordSelector(props) {\n const words = props.words;\n if (props.NPCToSayWord === null) {\n console.log('Error, should be a NPC to talk with, exiting this screen.');\n props.setStateGame(_lastres_components_game__WEBPACK_IMPORTED_MODULE_1__.StateGame.MainScreen);\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);\n }\n function onClickWord(word) {\n if (props.NPCToSayWord === null || props.websocket === null) {\n return;\n }\n new _lastres_output_packet_talk__WEBPACK_IMPORTED_MODULE_2__[\"default\"](props.NPCToSayWord.identifier, word.identifier).send(props.websocket);\n props.setStateGame(_lastres_components_game__WEBPACK_IMPORTED_MODULE_1__.StateGame.MainScreen);\n }\n function printWord(word) {\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { key: word.identifier, onClick: () => {\n onClickWord(word);\n }, href: \"#\", className: \"word\" }, word.name));\n }\n function wordList() {\n if (words === null) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", null, \"No hay palabras para poder decir aun.\");\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"word-list\" }, Object.keys(words).map((key) => {\n const word = words[key];\n return printWord(word);\n })));\n }\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"word-selector\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { href: \"#\", className: \"close-button\", onClick: () => {\n props.setStateGame(_lastres_components_game__WEBPACK_IMPORTED_MODULE_1__.StateGame.MainScreen);\n } }, \"x\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h2\", null, \"Selecciona una palabra.\"),\n wordList()));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/components/word-selector.tsx?");
2023-07-13 10:28:24 +02:00
/***/ }),
2023-06-01 08:45:43 +02:00
/***/ "./js-src/index.tsx":
/*!**************************!*\
!*** ./js-src/index.tsx ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ \"./node_modules/react-dom/client.js\");\n/* harmony import */ var _lastres_components_page__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lastres/components/page */ \"./js-src/components/page.tsx\");\n\n\n\n\nconst gameContainer = document.querySelector('#game-container');\nif (gameContainer !== null) {\n const root = react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot(gameContainer);\n root.render(react__WEBPACK_IMPORTED_MODULE_0__.createElement(_lastres_components_page__WEBPACK_IMPORTED_MODULE_2__[\"default\"], null));\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/index.tsx?");
/***/ }),
/***/ "./js-src/input-packet.ts":
/*!********************************!*\
!*** ./js-src/input-packet.ts ***!
\********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ InputPacket)\n/* harmony export */ });\nclass InputPacket {\n constructor() {\n this.onreceive = null;\n }\n onReceive(callback) {\n this.onreceive = callback;\n }\n recv(packet) {\n if (this.onreceive !== null) {\n this.onreceive(packet.data);\n }\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/input-packet.ts?");
/***/ }),
/***/ "./js-src/input-packet/info.ts":
/*!*************************************!*\
!*** ./js-src/input-packet/info.ts ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ InputPacketInfo)\n/* harmony export */ });\n/* harmony import */ var _lastres_input_packet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/input-packet */ \"./js-src/input-packet.ts\");\n\nclass InputPacketInfo extends _lastres_input_packet__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n identifier() {\n return 'info';\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/input-packet/info.ts?");
/***/ }),
/***/ "./js-src/input-packet/pong.ts":
/*!*************************************!*\
!*** ./js-src/input-packet/pong.ts ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ InputPacketPong)\n/* harmony export */ });\n/* harmony import */ var _lastres_input_packet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/input-packet */ \"./js-src/input-packet.ts\");\n\nclass InputPacketPong extends _lastres_input_packet__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n identifier() {\n return 'pong';\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/input-packet/pong.ts?");
/***/ }),
/***/ "./js-src/input-packets.ts":
/*!*********************************!*\
!*** ./js-src/input-packets.ts ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ InputPackets)\n/* harmony export */ });\n/* harmony import */ var _lastres_input_packet_info__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/input-packet/info */ \"./js-src/input-packet/info.ts\");\n/* harmony import */ var _lastres_input_packet_pong__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lastres/input-packet/pong */ \"./js-src/input-packet/pong.ts\");\n\n\nclass InputPackets {\n constructor(setTeamPJs, setEnemyTeamPJs, setIsBattling, setCurrentLocation, setConnectedLocations, logLines, setLogLines, setError, setScrollLog, logPresentationRef, setMovingTo, setRemainingFrames, setActionHash, setTalkNPCs, setWords) {\n this.cachedHash = null;\n this.cachedArray = null;\n this.setTeamPJs = setTeamPJs;\n this.setEnemyTeamPJs = setEnemyTeamPJs;\n this.setCurrentLocation = setCurrentLocation;\n this.setConnectedLocations = setConnectedLocations;\n this.logLines = logLines;\n this.setLogLines = setLogLines;\n this.setError = setError;\n this.setScrollLog = setScrollLog;\n this.logPresentationRef = logPresentationRef;\n this.setMovingTo = setMovingTo;\n this.setRemainingFrames = setRemainingFrames;\n this.setIsBattling = setIsBattling;\n this.setActionHash = setActionHash;\n this.setTalkNPCs = setTalkNPCs;\n this.setWords = setWords;\n }\n handle(packet) {\n const hash = this.hashAvailablePackets();\n const identifier = packet.command;\n const inputPacket = hash[identifier];\n inputPacket.recv(packet);\n }\n listAvailablePackets() {\n let firstTime = true;\n if (this.cachedArray === null) {\n const infoPacket = new _lastres_input_packet_info__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n const pongPacket = new _lastres_input_packet_pong__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n infoPacket.onReceive((data) => {\n const logPresentationRef = this.logPresentationRef;\n let scrollData = [];\n function saveScroll() {\n if (logPresentationRef.current === null) {\n return;\n }\n scrollData = [\n logPresentationRef.current.scrollHeight,\n logPresentationRef.current.scrollTop,\n logPresentationRef.current.offsetHeight\n ];\n }\n function applyScroll() {\n if (scrollData.length < 3) {\n return;\n }\n if (logPresentationRef.current === null) {\n console.log('Not defined');\n return;\n }\n const logPresentation = logPresentationRef.current;\n const [scrollHeight, scrollTop, offsetHeight] = scrollData;\n if (firstTime) {\n firstTime = false;\n logPresentation.scrollTo(0, logPresentation.scrollHeight);\n return;\n }\n if (scrollHeight <= scrollTop + offsetHeight * (3 / 2)) {\n logPresentation.scrollTo(0, logPresentation.scrollHeight);\n }\n }\n if (data.error !== undefined) {\n this.setError(data.error);\n return;\n }\n if (data.team_pjs !== undefined) {\n this.setTeamPJs(data.team_pjs);\n }\n if (data.enemy_team_pjs !== undefined) {\n this.setEnemyTeamPJs(data.enemy_team_pjs);\n }\n if (data.is_battling !== undefined) {\n this.setIsBat
/***/ }),
2023-06-01 08:45:43 +02:00
/***/ "./js-src/login.ts":
/*!*************************!*\
!*** ./js-src/login.ts ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkLogin: () => (/* binding */ checkLogin)\n/* harmony export */ });\nfunction checkLogin(setError, setIsLoggedIn) {\n fetch('/player/check_login', {\n method: 'POST',\n mode: 'same-origin',\n cache: 'no-cache'\n }).then(async (response) => {\n const data = await response.json();\n if (data.is_login === 1) {\n setIsLoggedIn(true);\n }\n }).catch((error) => {\n console.log(error);\n });\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/login.ts?");
2023-06-08 09:02:32 +02:00
/***/ }),
/***/ "./js-src/output-packet.ts":
/*!*********************************!*\
!*** ./js-src/output-packet.ts ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ OutputPacket)\n/* harmony export */ });\nclass OutputPacket {\n send(ws) {\n ws.send(JSON.stringify({\n command: this.command(),\n data: this.data()\n }));\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/output-packet.ts?");
/***/ }),
/***/ "./js-src/output-packet/execute_action.ts":
/*!************************************************!*\
!*** ./js-src/output-packet/execute_action.ts ***!
\************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ OutputPacketExecuteAction)\n/* harmony export */ });\n/* harmony import */ var _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/output-packet */ \"./js-src/output-packet.ts\");\n\nclass OutputPacketExecuteAction extends _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(action) {\n super();\n this.action = action;\n }\n command() {\n return 'execute_action';\n }\n data() {\n return {\n action: this.action\n };\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/output-packet/execute_action.ts?");
/***/ }),
/***/ "./js-src/output-packet/init.ts":
/*!**************************************!*\
!*** ./js-src/output-packet/init.ts ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ OutputPacketInit)\n/* harmony export */ });\n/* harmony import */ var _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/output-packet */ \"./js-src/output-packet.ts\");\n\nclass OutputPacketInit extends _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(pj_uuid) {\n super();\n this.pj_uuid = pj_uuid;\n }\n command() {\n return 'init';\n }\n data() {\n return {\n pj_uuid: this.pj_uuid\n };\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/output-packet/init.ts?");
/***/ }),
/***/ "./js-src/output-packet/move-to.ts":
/*!*****************************************!*\
!*** ./js-src/output-packet/move-to.ts ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MoveToPacket)\n/* harmony export */ });\n/* harmony import */ var _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/output-packet */ \"./js-src/output-packet.ts\");\n\nclass MoveToPacket extends _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(location) {\n super();\n this.location = location;\n }\n command() {\n return 'move_to';\n }\n data() {\n return {\n location: this.location.location.identifier,\n area: this.location.area.identifier,\n super_area: this.location.super_area.identifier,\n planet: this.location.planet.identifier\n };\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/output-packet/move-to.ts?");
/***/ }),
/***/ "./js-src/output-packet/ping.ts":
/*!**************************************!*\
!*** ./js-src/output-packet/ping.ts ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ OutputPacketPing)\n/* harmony export */ });\n/* harmony import */ var _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/output-packet */ \"./js-src/output-packet.ts\");\n\nclass OutputPacketPing extends _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor() {\n super();\n }\n command() {\n return 'ping';\n }\n data() {\n return null;\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/output-packet/ping.ts?");
/***/ }),
2023-07-10 00:04:30 +02:00
/***/ "./js-src/output-packet/talk.ts":
/*!**************************************!*\
!*** ./js-src/output-packet/talk.ts ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ OutputPacketTalk)\n/* harmony export */ });\n/* harmony import */ var _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lastres/output-packet */ \"./js-src/output-packet.ts\");\n\nclass OutputPacketTalk extends _lastres_output_packet__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(npc, word = null) {\n super();\n this.npc = npc;\n this.word = word;\n }\n command() {\n return 'talk';\n }\n data() {\n const output = {\n npc: this.npc\n };\n if (this.word !== null) {\n output.word = this.word;\n }\n return output;\n }\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/output-packet/talk.ts?");
/***/ }),
2023-06-08 09:02:32 +02:00
/***/ "./js-src/pj.ts":
/*!**********************!*\
!*** ./js-src/pj.ts ***!
\**********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fetchMyPjs: () => (/* binding */ fetchMyPjs)\n/* harmony export */ });\nasync function fetchMyPjs(setError) {\n const response = await fetch('/my/pjs', {\n method: 'GET',\n mode: 'same-origin',\n cache: 'no-cache'\n }).catch((error) => {\n console.log(error);\n setError('Error recuperando tus pjs');\n });\n if (response === undefined) {\n return [];\n }\n const statusCode = response.status;\n const data = await response.json();\n if (statusCode !== 200) {\n setError(data.error);\n return [];\n }\n return data;\n}\n\n\n//# sourceURL=webpack://LasTres/./js-src/pj.ts?");
2023-06-01 08:45:43 +02:00
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ id: moduleId,
/******/ loaded: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/node module decorator */
/******/ (() => {
/******/ __webpack_require__.nmd = (module) => {
/******/ module.paths = [];
/******/ if (!module.children) module.children = [];
/******/ return module;
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./js-src/index.tsx");
/******/
/******/ })()
;