{"version":3,"file":"about_content_3cff00b92629f54af86ebc94af0e7142.bundle.js","mappings":"mBACA,IAAIA,EAAsB,CAAC,EC2BpB,SAASC,EAAWC,EAAiBC,EAAyB,MAEpE,GAAc,OAAVD,EACH,MAAM,IAAIE,UAAU,YAFW,OAAZD,EAAmBA,EAAU,mBAIjD,OAAOD,CACR,CClCAF,EAAoBK,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOC,MAAQ,IAAIC,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCSjB,MAQMC,EAAc,UCK3BV,EAAQW,SAASC,eAAe,iBAAiBC,UAAY,WAAWH,IACxEV,EAAQW,SAASC,eAAe,kBAAkBC,UAAY,uDAG9B,OADd,IAAIC,gBAAgBL,OAAOM,SAASC,QACxCC,IAAI,UACjBjB,EAAQW,SAASC,eAAe,oBAAoBM,MAAMC,QAAU,GAEpEnB,EAAQW,SAASC,eAAe,sBAAsBM,MAAMC,QAAU,E","sources":["webpack://ch.enlightware.gamecreator/webpack/bootstrap","webpack://ch.enlightware.gamecreator/./src/utils/types.ts","webpack://ch.enlightware.gamecreator/webpack/runtime/global","webpack://ch.enlightware.gamecreator/./src/apps/common/version.ts","webpack://ch.enlightware.gamecreator/./src/about/about-content.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","/**\n * A collection of utilities related to types, serialization, rendering and HTML/DOM.\n * @module utils\n * @preferred\n */\n/** comment to work-around limitation of typedoc module plugin */\n\n\n// Copyright 2018-2024 Enlightware GmbH, Switzerland\n\nimport { robustStringify } from './text';\n\n/**\n * Perform a logical XOR.\n * @param lhs -left hand side\n * @param rhs - right hand side\n * @returns lhs XOR rhs\n */\nexport function logicalXor(lhs: boolean, rhs: boolean): boolean {\n\treturn ((lhs ? 1 : 0) ^ (rhs ? 1 : 0)) !== 0;\n}\n\n/**\n * Return [[value]], throw if null.\n * @param value - Value of type T | null\n * @param message - An optional user message to send with the exception\n * @return value of type T or throw if value is null\n */\nexport function nonnull(value: T | null, message: string | null = null): T {\n\tconst userMessage = message !== null ? message : 'value is null';\n\tif (value === null) {\n\t\tthrow new TypeError(`nonnull: ${userMessage}`);\n\t}\n\treturn value;\n}\n\n/**\n * Return [[value]], throw if null, only call messageF if value is null.\n * @param value - Value of type T | null\n * @param messageF - A function generating the user message to send with the exception\n * @return value of type T or throw if value is null\n */\nexport function nonnullOr(value: T | null, messageF: () => string): T {\n\tif (value === null) {\n\t\tthrow new TypeError(`nonnull: ${messageF()}`);\n\t}\n\treturn value;\n}\n\n/**\n * Return [[value]], throw if undefined.\n * @param value - Value of type T | undefined\n * @param message - An optional user message to send with the exception\n * @return value of type T or throw if value is undefined\n */\nexport function defined(value: T | undefined, message: string | null = null): T {\n\tconst userMessage = message !== null ? message : 'value is undefined';\n\tif (value === undefined) {\n\t\tthrow new TypeError(`defined: ${userMessage}`);\n\t}\n\treturn value;\n}\n\n/**\n * Return [[value]], throw if undefined, only call messageF if value is undefined.\n * @param value - Value of type T | undefined\n * @param messageF - A function generating the user message to send with the exception\n * @return value of type T or throw if value is undefined\n */\nexport function definedOr(value: T | undefined, messageF: () => string): T {\n\tif (value === undefined) {\n\t\tthrow new TypeError(`defined: ${messageF()}`);\n\t}\n\treturn value;\n}\n\n/** Return a string version of value */\nexport function toStr(value: any): string {\n\tif (Object(value) !== value) {\n\t\t// primitive value\n\t\treturn value + '';\n\t}\n\tif (value instanceof Error) {\n\t\treturn value.toString();\n\t}\n\tconst className = value.constructor?.name;\n\tconst textValue = robustStringify(value);\n\tif (className !== undefined) {\n\t\treturn `${className}(${textValue})`;\n\t} else {\n\t\treturn textValue;\n\t}\n}\n\n// downcast, for a discussion why it is cumbersome, see\n// https://github.com/Microsoft/TypeScript/issues/2444\n// https://stackoverflow.com/questions/36886082/abstract-constructor-type-in-typescript\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport type Constructor = Function & { prototype: T };\n\n/**\n * Return a value casted to U. Throws if cast fails.\n * @param type - The type to cast to, this allows to pass abstract classes using [[Constructor]] type.\n * @param value - The value to cast from.\n * @return object of type U or throw if cannot cast to U.\n */\nexport function cast(type: Constructor, value: unknown): U {\n\tif (!(value instanceof type)) {\n\t\tthrow new TypeError(`cast error: value ${toStr(value)} is not an instance of ${type.toString()}`);\n\t}\n\treturn value as U;\n}\n\n/**\n * Return an object of type T downcasted to U. Throws if downcast fails.\n * @param type - The type to downcast to, this allows to pass abstract classes using [[Constructor]] type.\n * @param object - The object to downcast from.\n * @return object of type U or throw if cannot cast to U.\n */\nexport function downcast(type: Constructor, object: T): U {\n\treturn cast(type, object);\n}\n\n/**\n * Return an object of type T downcasted to U if it is of type U, null otherwise.\n * @param type - The type to downcast to, this allows to pass abstract classes using [[Constructor]] type.\n * @param object - The object to downcast from, possibly null.\n * @return object of type U or null cannot cast to U.\n */\nexport function dynamicCast(type: Constructor, object: T | null): U | null {\n\tif (!(object instanceof type)) {\n\t\treturn null;\n\t}\n\treturn object as U;\n}\n\n/**\n * Return a value casted to string (the value, not the wrapper object). Throws if cast fails.\n * @param value - The value to cast from.\n * @return string or throw if value is not a string.\n */\nexport function castStringValue(value: unknown): string{\n\tif (!(typeof value === 'string')) {\n\t\tthrow new TypeError(`cast error: value ${toStr(value)} is not a string`);\n\t}\n\treturn value;\n}\n\nexport function isRunningInJest() {\n\treturn !!(global as any).IS_RUNNING_IN_JEST;\n}\n\nexport function castArrayWithTypeChecker(typeChecker: (value: unknown) => boolean, typename: string, values: unknown): U[] {\n\tif (isRunningInJest()) {\n\t\treturn values as U[];\n\t}\n\n\tif (!(values instanceof Array)) {\n\t\tthrow new TypeError(`cast error: value '${toStr(values)}' is not an array (of type ${typename}), it is a ${typeof values}`);\n\t}\n\tif (values.length > 0) {\n\t\tfor (let i = 0; i < values.length; ++i) {\n\t\t\tconst value = values[i] as unknown;\n\t\t\tif (!typeChecker(value)) {\n\t\t\t\tthrow new TypeError(`cast error: value '${toStr(value)}' at index ${i} is not an instance of ${typename}`);\n\t\t\t}\n\t\t}\n\t}\n\treturn values as U[];\n}\n\n/**\n * Return an array of values casted to U. Throws if cast fails. Slow as each element of the array must be checked for being of type U.\n * @param type - The type to cast to, this allows to pass abstract classes using [[Constructor]] type.\n * @param object - The values to downcast from.\n * @return objects of type U or throw if any cannot cast to U.\n */\nexport function castArray(type: Constructor, values: unknown): U[] {\n\treturn castArrayWithTypeChecker((value: unknown) => value instanceof type, type.toString(), values);\n}\n\n/**\n * Return an array of values casted to strings. Throws if cast fails. Slow as each element of the array must be checked for being of type string.\n * @param object - The values to downcast from.\n * @return string array or throw if any cannot cast to string.\n */\nexport function castStringArray(values: unknown): string[] {\n\treturn castArrayWithTypeChecker((value: unknown) => typeof value === 'string', 'string', values);\n}\n\n/**\n * Return an array of elements of type T downcasted to U. Throws if downcast fails. Slow as each element of the array must be checked for being of type U.\n * @param type - The type to downcast to, this allows to pass abstract classes using [[Constructor]] type.\n * @param object - The objects to downcast from.\n * @return objects of type U or throw if any cannot cast to U.\n */\nexport function downcastArray(type: Constructor, objects: T[]): U[] {\n\treturn castArray(type, objects);\n}\n\n/**\n * Return an array of elements of type T downcasted to U if all elements are of type U, null otherwise. Slow as each element of the array must be checked for being of type U.\n * @param type - The type to downcast to, this allows to pass abstract classes using [[Constructor]] type.\n * @param object - The objects to downcast from.\n * @return objects of type U or null if not all elements can be casted to U.\n */\nexport function dynamicCastArray(type: Constructor, objects: (T | null)[]): U[] | null {\n\tif (objects.length > 0) {\n\t\tfor (const object of objects) {\n\t\t\tif (!(object instanceof type)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n\treturn objects as U[];\n}\n\n/**\n * Return [[value]], throw if not an integer\n * @param value the number to check for being an integer\n * @return value if it is an integer or throw if not\n */\nexport function integer(value: number) {\n\tif (!Number.isInteger(value)) {\n\t\tthrow new TypeError(`value ${toStr(value)} is not an integer`);\n\t}\n\treturn value | 0;\n}\n\n/**\n * Return [[value]], throw if not an unsigned integer\n * @param value the number to check for being an unsigned integer\n * @return value if it is an unsigned integer or throw if not\n */\nexport function unsigned(value: number) {\n\tconst intValue = integer(value);\n\tif (intValue < 0) {\n\t\tthrow new TypeError(`value ${toStr(value)} is not unsigned`);\n\t}\n\treturn value;\n}\n\n/**\n * Return whether [[obj]] has a property for the key [[key]] without failing the TS type checking.\n * Taken from: https://dev.to/kingdaro/indexing-objects-in-typescript-1cgi\n * @param obj Some object\n * @param key Some potential key\n * @return whether [[obj]] has a property for the key [[key]]\n */\nexport function objectHasKey(obj: O, key: keyof any): key is keyof O {\n\treturn key in obj;\n}\n\n/**\n * Return [[obj]][[[key]]] or null if [[key]] is not a property of [[obj]].\n * @param obj Some object\n * @param key Some potential key\n * @return [[obj]][[[key]]] or null if [[key]] is not a property of [[obj]]\n */\nexport function getPropByNameOrNull(obj: O, key: keyof any) {\n\treturn objectHasKey(obj, key) ? obj[key] : null;\n}\n\n/** Cast to this to access readonly members of T */\nexport type Mutable = { -readonly [P in keyof T]: T[P] };\n\n/** Return whether value is an ArrayBuffer */\nexport function isArrayBuffer(value: unknown): value is ArrayBuffer {\n\treturn (\n\t\t(typeof value === 'object' && value !== null && 'BYTES_PER_ELEMENT' in value) ||\n\t\tvalue instanceof ArrayBuffer\n\t);\n}\n\nexport type TypeOfReturnValues = 'undefined'| 'number' | 'string' | 'boolean'| 'bigint' | 'symbol' | 'object' | 'function';\n\nexport type RemoveIndex = {\n\t[ K in keyof T as string extends K ? never : number extends K ? never : K ] : T[K]\n};\n\nexport type KnownKeys = keyof RemoveIndex;\n","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","/**\n * @module utils\n */\n/** comment to work-around limitation of typedoc module plugin */\n\n// Copyright 2018-2024 Enlightware GmbH, Switzerland\n\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __CODE_VERSION__: string;\nexport const CodeVersion = __CODE_VERSION__;\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __RUST_VERSION__: string;\nexport const RustVersion = __RUST_VERSION__;\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __BUILD_FLAGS__: string;\nexport const BuildFlags = __BUILD_FLAGS__;\n\nexport const UserVersion = 'alpha 1';\n\nexport function showVersion(backendVersion?: string) {\n\tconst serverVersion = backendVersion !== undefined ? backendVersion : 'unknown backend';\n\tconst buildFlags = __BUILD_FLAGS__.length !== 0 ? `, ${__BUILD_FLAGS__}` : '';\n\tconsole.info(`Version ${UserVersion}. Build ${CodeVersion} (${RustVersion}${buildFlags}), ${serverVersion}.`);\n\t// const userText = `${UserVersion}
${CodeVersion}`;\n\tconst userText = `${CodeVersion}`;\n\tfor (const element of document.getElementsByClassName('version-userText')) {\n\t\telement.innerHTML = userText;\n\t}\n\tconst fullText = `Candli ver. ${UserVersion} (build ${CodeVersion}${buildFlags}, ${serverVersion})`;\n\tfor (const element of document.getElementsByClassName('version-fullText')) {\n\t\telement.innerHTML = fullText;\n\t}\n}\n","/**\n * @module mainmenu\n */\n/** comment to work-around limitation of typedoc module plugin */\n\n// Copyright 2018-2024 Enlightware GmbH, Switzerland\n\nimport './about-content.scss';\n\n\nimport { nonnull } from 'utils/types';\nimport { UserVersion } from 'apps/common/version';\n\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __CODE_VERSION__: string;\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __RUST_VERSION__: string;\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __BUILD_FLAGS__: string;\n\nconst buildFlags = __BUILD_FLAGS__.length !== 0 ? `, ${__BUILD_FLAGS__}` : '';\n\nnonnull(document.getElementById('version-user')).innerText = `Version ${UserVersion}`;\nnonnull(document.getElementById('version-build')).innerText = `build ${__CODE_VERSION__} (${__RUST_VERSION__}${buildFlags})`;\n\nconst urlParams = new URLSearchParams(window.location.search);\nif (urlParams.get('logged') !== null) {\n\tnonnull(document.getElementById('feedback-logged')).style.display = '';\n} else {\n\tnonnull(document.getElementById('feedback-unLogged')).style.display = '';\n}"],"names":["__webpack_require__","nonnull","value","message","TypeError","g","globalThis","this","Function","e","window","UserVersion","document","getElementById","innerText","URLSearchParams","location","search","get","style","display"],"sourceRoot":""}