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,EAAU/jB,SACrC+jB,EAAU/jB,OAAOkF,YAGnB4c,GAAUW,kBAGXsB,CACX,ECjPJtsB,OAAOyP,aAAe2b,GAAUmB,UAAUvsB,OAAOyP,aAAc,Q","sources":["webpack://ruffle-selfhosted/webpack/runtime/load script","webpack://ruffle-selfhosted/webpack/bootstrap","webpack://ruffle-selfhosted/webpack/runtime/define property getters","webpack://ruffle-selfhosted/webpack/runtime/ensure chunk","webpack://ruffle-selfhosted/webpack/runtime/get javascript chunk filename","webpack://ruffle-selfhosted/webpack/runtime/global","webpack://ruffle-selfhosted/webpack/runtime/harmony module decorator","webpack://ruffle-selfhosted/webpack/runtime/hasOwnProperty shorthand","webpack://ruffle-selfhosted/webpack/runtime/make namespace object","webpack://ruffle-selfhosted/webpack/runtime/publicPath","webpack://ruffle-selfhosted/webpack/runtime/jsonp chunk loading","webpack://ruffle-selfhosted/../core/dist/version.js","webpack://ruffle-selfhosted/../core/dist/version-range.js","webpack://ruffle-selfhosted/../../node_modules/wasm-feature-detect/dist/esm/index.js","webpack://ruffle-selfhosted/../core/dist/js-polyfills.js","webpack://ruffle-selfhosted/../core/dist/public-path.js","webpack://ruffle-selfhosted/../core/dist/load-ruffle.js","webpack://ruffle-selfhosted/../core/dist/shadow-template.js","webpack://ruffle-selfhosted/../core/dist/register-element.js","webpack://ruffle-selfhosted/../core/dist/config.js","webpack://ruffle-selfhosted/../core/dist/flash-identifiers.js","webpack://ruffle-selfhosted/../core/dist/swf-utils.js","webpack://ruffle-selfhosted/../core/dist/build-info.js","webpack://ruffle-selfhosted/../core/dist/ruffle-player.js","webpack://ruffle-selfhosted/../core/dist/ruffle-embed.js","webpack://ruffle-selfhosted/../core/dist/ruffle-object.js","webpack://ruffle-selfhosted/../core/dist/plugin-polyfill.js","webpack://ruffle-selfhosted/../core/dist/polyfills.js","webpack://ruffle-selfhosted/../core/dist/source-api.js","webpack://ruffle-selfhosted/../core/dist/public-api.js","webpack://ruffle-selfhosted/./js/ruffle.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"ruffle-selfhosted:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"core.ruffle.\" + {\"159\":\"eb34badb9c860590f371\",\"339\":\"7d3ff466cfbd971981de\"}[chunkId] + \".js\";\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})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"\";","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkruffle_selfhosted\"] = self[\"webpackChunkruffle_selfhosted\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","/**\n * A representation of a semver 2 compliant version string\n */\nexport class Version {\n /**\n * Construct a Version from specific components.\n *\n * If you wish to parse a string into a Version then please use [[fromSemver]].\n *\n * @param major The major version component.\n * @param minor The minor version component.\n * @param patch The patch version component.\n * @param prIdent A list of pre-release identifiers, if any\n * @param buildIdent A list of build identifiers, if any\n */\n constructor(major, minor, patch, prIdent, \n // @ts-expect-error: Property 'buildIdent' is declared but its value is never read.\n buildIdent) {\n this.major = major;\n this.minor = minor;\n this.patch = patch;\n this.prIdent = prIdent;\n this.buildIdent = buildIdent;\n }\n /**\n * Construct a version from a semver 2 compliant string.\n *\n * This function is intended for use with semver 2 compliant strings.\n * Malformed strings may still parse correctly, but this result is not\n * guaranteed.\n *\n * @param versionString A semver 2.0.0 compliant version string\n * @returns A version object\n */\n static fromSemver(versionString) {\n const buildSplit = versionString.split(\"+\"), prSplit = buildSplit[0].split(\"-\"), versionSplit = prSplit[0].split(\".\");\n const major = parseInt(versionSplit[0], 10);\n let minor = 0;\n let patch = 0;\n let prIdent = null;\n let buildIdent = null;\n if (versionSplit[1] !== undefined) {\n minor = parseInt(versionSplit[1], 10);\n }\n if (versionSplit[2] !== undefined) {\n patch = parseInt(versionSplit[2], 10);\n }\n if (prSplit[1] !== undefined) {\n prIdent = prSplit[1].split(\".\");\n }\n if (buildSplit[1] !== undefined) {\n buildIdent = buildSplit[1].split(\".\");\n }\n return new Version(major, minor, patch, prIdent, buildIdent);\n }\n /**\n * Returns true if a given version is compatible with this one.\n *\n * Compatibility is defined as having the same nonzero major version\n * number, or if both major versions are zero, the same nonzero minor\n * version number, or if both minor versions are zero, the same nonzero\n * patch version number.\n *\n * This implements the ^ operator in npm's semver package, with the\n * exception of the prerelease exclusion rule.\n *\n * @param other The other version to test against\n * @returns True if compatible\n */\n isCompatibleWith(other) {\n return ((this.major !== 0 && this.major === other.major) ||\n (this.major === 0 &&\n other.major === 0 &&\n this.minor !== 0 &&\n this.minor === other.minor) ||\n (this.major === 0 &&\n other.major === 0 &&\n this.minor === 0 &&\n other.minor === 0 &&\n this.patch !== 0 &&\n this.patch === other.patch));\n }\n /**\n * Returns true if this version has precedence over (is newer than) another\n * version.\n *\n * Precedence is defined as in the Semver 2 spec. This implements the >\n * operator in npm's semver package, with the exception of the prerelease\n * exclusion rule.\n *\n * @param other The other version to test against\n * @returns True if this version has precedence over the other one\n */\n hasPrecedenceOver(other) {\n if (this.major > other.major) {\n return true;\n }\n else if (this.major < other.major) {\n return false;\n }\n if (this.minor > other.minor) {\n return true;\n }\n else if (this.minor < other.minor) {\n return false;\n }\n if (this.patch > other.patch) {\n return true;\n }\n else if (this.patch < other.patch) {\n return false;\n }\n if (this.prIdent === null && other.prIdent !== null) {\n return true;\n }\n else if (this.prIdent !== null && other.prIdent !== null) {\n const isNumeric = /^[0-9]*$/;\n for (let i = 0; i < this.prIdent.length && i < other.prIdent.length; i += 1) {\n if (!isNumeric.test(this.prIdent[i]) &&\n isNumeric.test(other.prIdent[i])) {\n return true;\n }\n else if (isNumeric.test(this.prIdent[i]) &&\n isNumeric.test(other.prIdent[i])) {\n if (parseInt(this.prIdent[i], 10) >\n parseInt(other.prIdent[i], 10)) {\n return true;\n }\n else if (parseInt(this.prIdent[i], 10) <\n parseInt(other.prIdent[i], 10)) {\n return false;\n }\n }\n else if (isNumeric.test(this.prIdent[i]) &&\n !isNumeric.test(other.prIdent[i])) {\n return false;\n }\n else if (!isNumeric.test(this.prIdent[i]) &&\n !isNumeric.test(other.prIdent[i])) {\n if (this.prIdent[i] > other.prIdent[i]) {\n return true;\n }\n else if (this.prIdent[i] < other.prIdent[i]) {\n return false;\n }\n }\n }\n return this.prIdent.length > other.prIdent.length;\n }\n return false;\n }\n /**\n * Tests if a given version is equivalent to this one.\n *\n * Build and prerelease tags are ignored.\n *\n * @param other The other version to test against\n * @returns True if the given version is equivalent\n */\n isEqual(other) {\n return (this.major === other.major &&\n this.minor === other.minor &&\n this.patch === other.patch);\n }\n /**\n * Tests if a given version is stable or a compatible prerelease for this\n * version.\n *\n * This implements the prerelease exclusion rule of NPM semver: a\n * prerelease version can only pass this check if the major/minor/patch\n * components of both versions are the same. Otherwise, the prerelease\n * version always fails.\n *\n * @param other The other version to test against\n * @returns True if the given version is either stable, or a\n * prerelease in the same series as this one.\n */\n isStableOrCompatiblePrerelease(other) {\n if (other.prIdent === null) {\n return true;\n }\n else {\n return (this.major === other.major &&\n this.minor === other.minor &&\n this.patch === other.patch);\n }\n }\n}\n","import { Version } from \"./version\";\n/**\n * Represents a set of version requirements.\n */\nexport class VersionRange {\n /**\n * Constructs a range of versions as specified by the given requirements.\n *\n * If you wish to construct this object from a string representation,\n * then use [[fromRequirementString]].\n *\n * @param requirements Requirements to set this range by\n */\n constructor(requirements) {\n this.requirements = requirements;\n }\n /**\n * Determine if a given version satisfies this range.\n *\n * @param fver A version object to test against.\n * @returns Whether or not the given version matches this range\n */\n satisfiedBy(fver) {\n for (const requirement of this.requirements) {\n let matches = true;\n for (const { comparator, version } of requirement) {\n matches =\n matches && version.isStableOrCompatiblePrerelease(fver);\n if (comparator === \"\" || comparator === \"=\") {\n matches = matches && version.isEqual(fver);\n }\n else if (comparator === \">\") {\n matches = matches && fver.hasPrecedenceOver(version);\n }\n else if (comparator === \">=\") {\n matches =\n matches &&\n (fver.hasPrecedenceOver(version) ||\n version.isEqual(fver));\n }\n else if (comparator === \"<\") {\n matches = matches && version.hasPrecedenceOver(fver);\n }\n else if (comparator === \"<=\") {\n matches =\n matches &&\n (version.hasPrecedenceOver(fver) ||\n version.isEqual(fver));\n }\n else if (comparator === \"^\") {\n matches = matches && version.isCompatibleWith(fver);\n }\n }\n if (matches) {\n return true;\n }\n }\n return false;\n }\n /**\n * Parse a requirement string into a version range.\n *\n * @param requirement The version requirements, consisting of a\n * series of space-separated strings, each one being a semver version\n * optionally prefixed by a comparator or a separator.\n *\n * Valid comparators are:\n * - `\"\"` or `\"=\"`: Precisely this version\n * - `\">`\": A version newer than this one\n * - `\">`=\": A version newer or equal to this one\n * - `\"<\"`: A version older than this one\n * - `\"<=\"`: A version older or equal to this one\n * - `\"^\"`: A version that is compatible with this one\n *\n * A separator is `\"||`\" which splits the requirement string into\n * left OR right.\n * @returns A version range object.\n */\n static fromRequirementString(requirement) {\n const components = requirement.split(\" \");\n let set = [];\n const requirements = [];\n for (const component of components) {\n if (component === \"||\") {\n if (set.length > 0) {\n requirements.push(set);\n set = [];\n }\n }\n else if (component.length > 0) {\n const match = /[0-9]/.exec(component);\n if (match) {\n const comparator = component.slice(0, match.index).trim();\n const version = Version.fromSemver(component.slice(match.index).trim());\n set.push({ comparator, version });\n }\n }\n }\n if (set.length > 0) {\n requirements.push(set);\n }\n return new VersionRange(requirements);\n }\n}\n","export const bigInt=()=>(async e=>{try{return(await WebAssembly.instantiate(e)).instance.exports.b(BigInt(0))===BigInt(0)}catch(e){return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,126,1,126,3,2,1,0,7,5,1,1,98,0,0,10,6,1,4,0,32,0,11])),bulkMemory=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),exceptions=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),extendedConst=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0])),gc=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,10,2,95,1,125,0,96,0,1,107,0,3,2,1,1,10,12,1,10,0,67,0,0,0,0,251,7,0,11])),memory64=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,4,1])),multiValue=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,0,2,127,127,3,2,1,0,10,8,1,6,0,65,0,65,0,11])),mutableGlobals=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1])),referenceTypes=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11])),relaxedSimd=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11])),saturatedFloatToInt=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),signExtensions=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),simd=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),streamingCompilation=()=>(async()=>\"compileStreaming\"in WebAssembly)(),tailCall=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,6,1,4,0,18,0,11])),threads=()=>(async e=>{try{return\"undefined\"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch(e){return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));\n","/**\n * Polyfills the `Array.prototype.reduce` method.\n *\n * Production steps of ECMA-262, Edition 5, 15.4.4.21\n * Reference: https://es5.github.io/#x15.4.4.21\n * https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n */\nfunction polyfillArrayPrototypeReduce() {\n Object.defineProperty(Array.prototype, \"reduce\", {\n value(...args) {\n if (args.length === 0 &&\n window.Prototype &&\n window.Prototype.Version &&\n window.Prototype.Version < \"1.6.1\") {\n // Off-spec: compatibility with prototype.js\n return this.length > 1 ? this : this[0];\n }\n const callback = args[0];\n if (this === null) {\n throw new TypeError(\"Array.prototype.reduce called on null or undefined\");\n }\n if (typeof callback !== \"function\") {\n throw new TypeError(`${callback} is not a function`);\n }\n const o = Object(this);\n const len = o.length >>> 0;\n let k = 0;\n let value;\n if (args.length >= 2) {\n value = args[1];\n }\n else {\n while (k < len && !(k in o)) {\n k++;\n }\n if (k >= len) {\n throw new TypeError(\"Reduce of empty array with no initial value\");\n }\n value = o[k++];\n }\n while (k < len) {\n if (k in o) {\n value = callback(value, o[k], k, o);\n }\n k++;\n }\n return value;\n },\n });\n}\n/**\n * Polyfills the `Window` function.\n */\nfunction polyfillWindow() {\n if (typeof window.constructor !== \"function\" ||\n !isNativeFunction(window.constructor)) {\n // Don't polyfill `Window` if `window.constructor` has been overridden.\n return;\n }\n // @ts-expect-error: `Function not assignable to { new (): Window; prototype: Window; }`\n window.Window = window.constructor;\n}\n/**\n * Polyfills the `Reflect` object and members.\n *\n * This is a partial implementation, just enough to match our needs.\n */\nfunction tryPolyfillReflect() {\n if (window.Reflect === undefined || window.Reflect === null) {\n // @ts-expect-error: {} indeed doesn't implement Reflect's interface.\n window.Reflect = {};\n }\n if (typeof Reflect.get !== \"function\") {\n Object.defineProperty(Reflect, \"get\", {\n value(target, key) {\n return target[key];\n },\n });\n }\n if (typeof Reflect.set !== \"function\") {\n Object.defineProperty(Reflect, \"set\", {\n value(target, key, value) {\n target[key] = value;\n },\n });\n }\n if (typeof Reflect.has !== \"function\") {\n Object.defineProperty(Reflect, \"has\", {\n value(target, key) {\n // @ts-expect-error: Type 'T' is not assignable to type 'object'.\n return key in target;\n },\n });\n }\n if (typeof Reflect.ownKeys !== \"function\") {\n Object.defineProperty(Reflect, \"ownKeys\", {\n value(target) {\n return [\n ...Object.getOwnPropertyNames(target),\n ...Object.getOwnPropertySymbols(target),\n ];\n },\n });\n }\n}\n/**\n * Determines whether a function is native or not.\n *\n * @param func The function to test.\n * @returns True if the function hasn't been overridden.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isNativeFunction(func) {\n const val = typeof Function.prototype.toString === \"function\"\n ? Function.prototype.toString()\n : null;\n if (typeof val === \"string\" && val.indexOf(\"[native code]\") >= 0) {\n return (Function.prototype.toString.call(func).indexOf(\"[native code]\") >= 0);\n }\n return false;\n}\n/**\n * Checks and applies the polyfills to the current window, if needed.\n */\nexport function setPolyfillsOnLoad() {\n if (typeof Array.prototype.reduce !== \"function\" ||\n !isNativeFunction(Array.prototype.reduce)) {\n // Some external libraries override the `Array.prototype.reduce` method in a way\n // that causes Webpack to crash (#1507, #1865), so we need to override it again.\n polyfillArrayPrototypeReduce();\n }\n if (typeof Window !== \"function\" || !isNativeFunction(Window)) {\n // Overriding the native `Window` function causes issues in wasm-bindgen, as a\n // code like `window instanceof Window` will no longer work.\n polyfillWindow();\n }\n // Some pages override the native `Reflect` object, which causes various issues:\n // 1- wasm-bindgen's stdlib may crash (#3173).\n // 2- FlashVars may be ignored (#8537).\n tryPolyfillReflect();\n}\n","// This must be in global scope because `document.currentScript`\n// works only while the script is initially being processed.\nlet currentScriptURL = \"\";\ntry {\n if (document.currentScript !== undefined &&\n document.currentScript !== null &&\n \"src\" in document.currentScript &&\n document.currentScript.src !== \"\") {\n let src = document.currentScript.src;\n // CDNs allow omitting the filename. If it's omitted, append a slash to\n // prevent the last component from being dropped.\n if (!src.endsWith(\".js\") && !src.endsWith(\"/\")) {\n src += \"/\";\n }\n currentScriptURL = new URL(\".\", src).href;\n }\n}\ncatch (e) {\n console.warn(\"Unable to get currentScript URL\");\n}\n/**\n * Attempt to discover the public path of the current Ruffle source. This can\n * be used to configure Webpack.\n *\n * A global public path can be specified for all sources using the RufflePlayer\n * config:\n *\n * ```js\n * window.RufflePlayer.config.publicPath = \"/dist/\";\n * ```\n *\n * If no such config is specified, then the parent path of where this script is\n * hosted is assumed, which should be the correct default in most cases.\n *\n * @param config The `window.RufflePlayer.config` object.\n * @returns The public path for the given source.\n */\nexport function publicPath(config) {\n // Default to the directory where this script resides.\n let path = currentScriptURL;\n if (\"publicPath\" in config &&\n config.publicPath !== null &&\n config.publicPath !== undefined) {\n path = config.publicPath;\n }\n // Webpack expects the paths to end with a slash.\n if (path !== \"\" && !path.endsWith(\"/\")) {\n path += \"/\";\n }\n return path;\n}\n","/**\n * Conditional ruffle loader\n */\nimport { bulkMemory, simd, saturatedFloatToInt, signExtensions, referenceTypes, } from \"wasm-feature-detect\";\nimport { setPolyfillsOnLoad } from \"./js-polyfills\";\nimport { publicPath } from \"./public-path\";\n/**\n * Load ruffle from an automatically-detected location.\n *\n * This function returns a new instance of Ruffle and downloads it every time.\n * You should not use it directly; this module will memoize the resource\n * download.\n *\n * @param config The `window.RufflePlayer.config` object.\n * @param progressCallback The callback that will be run with Ruffle's download progress.\n * @returns A ruffle constructor that may be used to create new Ruffle\n * instances.\n */\nasync function fetchRuffle(config, progressCallback) {\n // Apply some pure JavaScript polyfills to prevent conflicts with external\n // libraries, if needed.\n setPolyfillsOnLoad();\n // NOTE: Keep this list in sync with $RUSTFLAGS in the CI build config!\n const extensionsSupported = (await Promise.all([\n bulkMemory(),\n simd(),\n saturatedFloatToInt(),\n signExtensions(),\n referenceTypes(),\n ])).every(Boolean);\n if (!extensionsSupported) {\n console.log(\"Some WebAssembly extensions are NOT available, falling back to the vanilla WebAssembly module\");\n }\n __webpack_public_path__ = publicPath(config);\n // Note: The argument passed to import() has to be a simple string literal,\n // otherwise some bundler will get confused and won't include the module?\n const { default: init, Ruffle } = await (extensionsSupported\n ? import(\"../dist/ruffle_web-wasm_extensions\")\n : import(\"../dist/ruffle_web\"));\n let response;\n const wasmUrl = extensionsSupported\n ? new URL(\"../dist/ruffle_web-wasm_extensions_bg.wasm\", import.meta.url)\n : new URL(\"../dist/ruffle_web_bg.wasm\", import.meta.url);\n const wasmResponse = await fetch(wasmUrl);\n if (progressCallback) {\n const contentLength = wasmResponse.headers.get(\"content-length\") || \"\";\n let bytesLoaded = 0;\n // Use parseInt rather than Number so the empty string is coerced to NaN instead of 0\n const bytesTotal = parseInt(contentLength);\n response = new Response(new ReadableStream({\n async start(controller) {\n var _a;\n const reader = (_a = wasmResponse.body) === null || _a === void 0 ? void 0 : _a.getReader();\n if (!reader) {\n throw \"Response had no body\";\n }\n progressCallback(bytesLoaded, bytesTotal);\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n if (value === null || value === void 0 ? void 0 : value.byteLength) {\n bytesLoaded += value === null || value === void 0 ? void 0 : value.byteLength;\n }\n controller.enqueue(value);\n progressCallback(bytesLoaded, bytesTotal);\n }\n controller.close();\n },\n }), wasmResponse);\n }\n else {\n response = wasmResponse;\n }\n await init(response);\n return Ruffle;\n}\nlet lastLoaded = null;\n/**\n * Obtain an instance of `Ruffle`.\n *\n * This function returns a promise which yields `Ruffle` asynchronously.\n *\n * @param config The `window.RufflePlayer.config` object.\n * @param progressCallback The callback that will be run with Ruffle's download progress.\n * @returns A ruffle constructor that may be used to create new Ruffle\n * instances.\n */\nexport function loadRuffle(config, progressCallback) {\n if (lastLoaded === null) {\n lastLoaded = fetchRuffle(config, progressCallback);\n }\n return lastLoaded;\n}\n","/**\n * The shadow template which is used to fill the actual Ruffle player element\n * on the page.\n */\nexport const ruffleShadowTemplate = document.createElement(\"template\");\nruffleShadowTemplate.innerHTML = `\n \n \n\n
\n
\n
Click to unmute
\n \n
\n
\n \n \n \n \n
\n
\n\n
\n
\n ×\n
\n Backup all saves (download all sols)\n
\n
\n
\n
\n \n`;\n","/**\n * Number of times to try defining a custom element.\n */\nconst MAX_TRIES = 999;\n/**\n * A mapping between internal element IDs and DOM element IDs.\n */\nconst privateRegistry = {};\n/**\n * Lookup a previously registered custom element.\n *\n * The returned object will have `name`, `class`, and `internal_name`\n * properties listing the external name, implementing class, and internal name\n * respectively.\n *\n * @param elementName The internal element name, previously used to\n * register the element with the private registry.\n * @returns The element data in the registry, or null if there is\n * no such element name registered.\n */\nexport function lookupElement(elementName) {\n const data = privateRegistry[elementName];\n if (data !== undefined) {\n return {\n internalName: elementName,\n name: data.name,\n class: data.class,\n };\n }\n else {\n return null;\n }\n}\n/**\n * Register a custom element.\n *\n * This function is designed to be tolerant of naming conflicts. If\n * registration fails, we modify the name, and try again. As a result, this\n * function returns the real element name to use.\n *\n * Calling this function multiple times will *not* register multiple elements.\n * We store a private registry mapping internal element names to DOM names.\n * Thus, the proper way to use this function is to call it every time you are\n * about to work with custom element names.\n *\n * @param elementName The internal name of the element.\n * @param elementClass The class of the element.\n *\n * You must call this function with the same class every time.\n * @returns The actual element name.\n * @throws Throws an error if two different elements were registered with the\n * same internal name.\n */\nexport function registerElement(elementName, elementClass) {\n const registration = privateRegistry[elementName];\n if (registration !== undefined) {\n if (registration.class !== elementClass) {\n throw new Error(\"Internal naming conflict on \" + elementName);\n }\n else {\n return registration.name;\n }\n }\n let tries = 0;\n if (window.customElements !== undefined) {\n while (tries < MAX_TRIES) {\n let externalName = elementName;\n if (tries > 0) {\n externalName = externalName + \"-\" + tries;\n }\n if (window.customElements.get(externalName) !== undefined) {\n tries += 1;\n continue;\n }\n else {\n window.customElements.define(externalName, elementClass);\n }\n privateRegistry[elementName] = {\n class: elementClass,\n name: externalName,\n internalName: elementName,\n };\n return externalName;\n }\n }\n throw new Error(\"Failed to assign custom element \" + elementName);\n}\n","export const DEFAULT_CONFIG = {\n allowScriptAccess: false,\n parameters: {},\n autoplay: \"auto\" /* AutoPlay.Auto */,\n backgroundColor: null,\n letterbox: \"fullscreen\" /* Letterbox.Fullscreen */,\n unmuteOverlay: \"visible\" /* UnmuteOverlay.Visible */,\n upgradeToHttps: true,\n compatibilityRules: true,\n warnOnUnsupportedContent: true,\n logLevel: \"error\" /* LogLevel.Error */,\n showSwfDownload: false,\n contextMenu: true,\n // Backwards-compatibility option\n preloader: true,\n splashScreen: true,\n maxExecutionDuration: 15,\n base: null,\n menu: true,\n salign: \"\",\n quality: \"high\",\n scale: \"showAll\",\n forceScale: false,\n frameRate: null,\n wmode: \"opaque\" /* WindowMode.Opaque */,\n publicPath: null,\n polyfills: true,\n playerVersion: null,\n preferredRenderer: null,\n openUrlMode: \"allow\" /* OpenURLMode.Allow */,\n allowNetworking: \"all\" /* NetworkingAccessMode.All */,\n};\n","export const FLASH_MIMETYPE = \"application/x-shockwave-flash\";\nexport const FUTURESPLASH_MIMETYPE = \"application/futuresplash\";\nexport const FLASH7_AND_8_MIMETYPE = \"application/x-shockwave-flash2-preview\";\nexport const FLASH_MOVIE_MIMETYPE = \"application/vnd.adobe.flash.movie\";\nexport const FLASH_ACTIVEX_CLASSID = \"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\";\n","import { FLASH_MIMETYPE, FUTURESPLASH_MIMETYPE, FLASH7_AND_8_MIMETYPE, FLASH_MOVIE_MIMETYPE, } from \"./flash-identifiers\";\n/**\n * Returns whether the given filename ends in a known flash extension.\n *\n * @param filename The filename to test.\n * @returns True if the filename is a flash movie (swf or spl).\n */\nexport function isSwfFilename(filename) {\n if (filename) {\n let pathname = \"\";\n try {\n // A base URL is required if `filename` is a relative URL, but we don't need to detect the real URL origin.\n pathname = new URL(filename, \"https://example.com\").pathname;\n }\n catch (err) {\n // Some invalid filenames, like `///`, could raise a TypeError. Let's fail silently in this situation.\n }\n if (pathname && pathname.length >= 4) {\n const extension = pathname.slice(-4).toLowerCase();\n if (extension === \".swf\" || extension === \".spl\") {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Returns whether the given MIME type is a known flash type.\n *\n * @param mimeType The MIME type to test.\n * @returns True if the MIME type is a flash MIME type.\n */\nexport function isSwfMimeType(mimeType) {\n switch (mimeType.toLowerCase()) {\n case FLASH_MIMETYPE.toLowerCase():\n case FUTURESPLASH_MIMETYPE.toLowerCase():\n case FLASH7_AND_8_MIMETYPE.toLowerCase():\n case FLASH_MOVIE_MIMETYPE.toLowerCase():\n return true;\n default:\n return false;\n }\n}\n/**\n * Create a filename to save a downloaded SWF into.\n *\n * @param swfUrl The URL of the SWF file.\n * @returns The filename the SWF file can be saved at.\n */\nexport function swfFileName(swfUrl) {\n const pathName = swfUrl.pathname;\n const name = pathName.substring(pathName.lastIndexOf(\"/\") + 1);\n return name;\n}\n","/**\n * Stores build information. The string literals are replaces at compile time by `set_version.js`.\n */\nexport const buildInfo = {\n versionNumber: \"0.1.0\",\n versionName: \"nightly 2023-05-04\",\n versionChannel: \"nightly\",\n buildDate: \"2023-05-04T00:18:58.562Z\",\n commitHash: \"891d1dce7e1577f950d1c54cac1b84dad3c30291\",\n};\n","import { loadRuffle } from \"./load-ruffle\";\nimport { ruffleShadowTemplate } from \"./shadow-template\";\nimport { lookupElement } from \"./register-element\";\nimport { DEFAULT_CONFIG } from \"./config\";\nimport { swfFileName } from \"./swf-utils\";\nimport { buildInfo } from \"./build-info\";\nconst RUFFLE_ORIGIN = \"https://ruffle.rs\";\nconst DIMENSION_REGEX = /^\\s*(\\d+(\\.\\d+)?(%)?)/;\nlet isAudioContextUnmuted = false;\n/**\n * Converts arbitrary input to an easy to use record object.\n *\n * @param parameters Parameters to sanitize\n * @returns A sanitized map of param name to param value\n */\nfunction sanitizeParameters(parameters) {\n if (parameters === null || parameters === undefined) {\n return {};\n }\n if (!(parameters instanceof URLSearchParams)) {\n parameters = new URLSearchParams(parameters);\n }\n const output = {};\n for (const [key, value] of parameters) {\n // Every value must be type of string\n output[key] = value.toString();\n }\n return output;\n}\nclass Point {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n distanceTo(other) {\n const dx = other.x - this.x;\n const dy = other.y - this.y;\n return Math.sqrt(dx * dx + dy * dy);\n }\n}\n/**\n * The ruffle player element that should be inserted onto the page.\n *\n * This element will represent the rendered and intractable flash movie.\n */\nclass RufflePlayer extends HTMLElement {\n /**\n * Indicates the readiness of the playing movie.\n *\n * @returns The `ReadyState` of the player.\n */\n get readyState() {\n return this._readyState;\n }\n /**\n * The metadata of the playing movie (such as movie width and height).\n * These are inherent properties stored in the SWF file and are not affected by runtime changes.\n * For example, `metadata.width` is the width of the SWF file, and not the width of the Ruffle player.\n *\n * @returns The metadata of the movie, or `null` if the movie metadata has not yet loaded.\n */\n get metadata() {\n return this._metadata;\n }\n /**\n * Constructs a new Ruffle flash player for insertion onto the page.\n */\n constructor() {\n super();\n // Allows the user to permanently disable the context menu.\n this.contextMenuForceDisabled = false;\n // Whether this device is a touch device.\n // Set to true when a touch event is encountered.\n this.isTouch = false;\n // Whether this device sends contextmenu events.\n // Set to true when a contextmenu event is seen.\n this.contextMenuSupported = false;\n this.panicked = false;\n this._cachedDebugInfo = null;\n this.isExtension = false;\n this.longPressTimer = null;\n this.pointerDownPosition = null;\n this.pointerMoveMaxDistance = 0;\n /**\n * Any configuration that should apply to this specific player.\n * This will be defaulted with any global configuration.\n */\n this.config = {};\n this.shadow = this.attachShadow({ mode: \"open\" });\n this.shadow.appendChild(ruffleShadowTemplate.content.cloneNode(true));\n this.dynamicStyles = (this.shadow.getElementById(\"dynamic_styles\"));\n this.container = this.shadow.getElementById(\"container\");\n this.playButton = this.shadow.getElementById(\"play_button\");\n this.playButton.addEventListener(\"click\", () => this.play());\n this.unmuteOverlay = this.shadow.getElementById(\"unmute_overlay\");\n this.splashScreen = this.shadow.getElementById(\"splash-screen\");\n this.virtualKeyboard = (this.shadow.getElementById(\"virtual-keyboard\"));\n this.virtualKeyboard.addEventListener(\"input\", this.virtualKeyboardInput.bind(this));\n this.saveManager = (this.shadow.getElementById(\"save-manager\"));\n this.saveManager.addEventListener(\"click\", () => this.saveManager.classList.add(\"hidden\"));\n const modalArea = this.saveManager.querySelector(\"#modal-area\");\n if (modalArea) {\n modalArea.addEventListener(\"click\", (event) => event.stopPropagation());\n }\n const closeSaveManager = this.saveManager.querySelector(\"#close-modal\");\n if (closeSaveManager) {\n closeSaveManager.addEventListener(\"click\", () => this.saveManager.classList.add(\"hidden\"));\n }\n const backupSaves = this.saveManager.querySelector(\"#backup-saves\");\n if (backupSaves) {\n backupSaves.addEventListener(\"click\", this.backupSaves.bind(this));\n }\n this.contextMenuElement = this.shadow.getElementById(\"context-menu\");\n window.addEventListener(\"pointerdown\", this.checkIfTouch.bind(this));\n this.addEventListener(\"contextmenu\", this.showContextMenu.bind(this));\n this.container.addEventListener(\"pointerdown\", this.pointerDown.bind(this));\n this.container.addEventListener(\"pointermove\", this.checkLongPressMovement.bind(this));\n this.container.addEventListener(\"pointerup\", this.checkLongPress.bind(this));\n this.container.addEventListener(\"pointercancel\", this.clearLongPressTimer.bind(this));\n this.addEventListener(\"fullscreenchange\", this.fullScreenChange.bind(this));\n this.addEventListener(\"webkitfullscreenchange\", this.fullScreenChange.bind(this));\n this.instance = null;\n this.onFSCommand = null;\n this._readyState = 0 /* ReadyState.HaveNothing */;\n this._metadata = null;\n this.lastActivePlayingState = false;\n this.setupPauseOnTabHidden();\n }\n /**\n * Setup event listener to detect when tab is not active to pause instance playback.\n * this.instance.play() is called when the tab becomes visible only if the\n * the instance was not paused before tab became hidden.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n * @ignore\n * @internal\n */\n setupPauseOnTabHidden() {\n document.addEventListener(\"visibilitychange\", () => {\n if (!this.instance) {\n return;\n }\n // Tab just changed to be inactive. Record whether instance was playing.\n if (document.hidden) {\n this.lastActivePlayingState = this.instance.is_playing();\n this.instance.pause();\n }\n // Play only if instance was playing originally.\n if (!document.hidden && this.lastActivePlayingState === true) {\n this.instance.play();\n }\n }, false);\n }\n /**\n * @ignore\n * @internal\n */\n connectedCallback() {\n this.updateStyles();\n }\n /**\n * @ignore\n * @internal\n */\n static get observedAttributes() {\n return [\"width\", \"height\"];\n }\n /**\n * @ignore\n * @internal\n */\n attributeChangedCallback(name, _oldValue, _newValue) {\n if (name === \"width\" || name === \"height\") {\n this.updateStyles();\n }\n }\n /**\n * @ignore\n * @internal\n */\n disconnectedCallback() {\n this.destroy();\n }\n /**\n * Updates the internal shadow DOM to reflect any set attributes from\n * this element.\n */\n updateStyles() {\n if (this.dynamicStyles.sheet) {\n if (this.dynamicStyles.sheet.rules) {\n for (let i = 0; i < this.dynamicStyles.sheet.rules.length; i++) {\n this.dynamicStyles.sheet.deleteRule(i);\n }\n }\n const widthAttr = this.attributes.getNamedItem(\"width\");\n if (widthAttr !== undefined && widthAttr !== null) {\n const width = RufflePlayer.htmlDimensionToCssDimension(widthAttr.value);\n if (width !== null) {\n this.dynamicStyles.sheet.insertRule(`:host { width: ${width}; }`);\n }\n }\n const heightAttr = this.attributes.getNamedItem(\"height\");\n if (heightAttr !== undefined && heightAttr !== null) {\n const height = RufflePlayer.htmlDimensionToCssDimension(heightAttr.value);\n if (height !== null) {\n this.dynamicStyles.sheet.insertRule(`:host { height: ${height}; }`);\n }\n }\n }\n }\n /**\n * Determine if this element is the fallback content of another Ruffle\n * player.\n *\n * This heuristic assumes Ruffle objects will never use their fallback\n * content. If this changes, then this code also needs to change.\n *\n * @private\n */\n isUnusedFallbackObject() {\n const element = lookupElement(\"ruffle-object\");\n if (element !== null) {\n let parent = this.parentNode;\n while (parent !== document && parent !== null) {\n if (parent.nodeName === element.name) {\n return true;\n }\n parent = parent.parentNode;\n }\n }\n return false;\n }\n /**\n * Ensure a fresh Ruffle instance is ready on this player before continuing.\n *\n * @throws Any exceptions generated by loading Ruffle Core will be logged\n * and passed on.\n *\n * @private\n */\n async ensureFreshInstance() {\n var _a;\n this.destroy();\n if (this.loadedConfig &&\n this.loadedConfig.splashScreen !== false &&\n this.loadedConfig.preloader !== false) {\n this.showSplashScreen();\n }\n if (this.loadedConfig && this.loadedConfig.preloader === false) {\n console.warn(\"The configuration option preloader has been replaced with splashScreen. If you own this website, please update the configuration.\");\n }\n if (this.loadedConfig &&\n this.loadedConfig.maxExecutionDuration &&\n typeof this.loadedConfig.maxExecutionDuration !== \"number\") {\n console.warn(\"Configuration: An obsolete format for duration for 'maxExecutionDuration' was used, \" +\n \"please use a single number indicating seconds instead. For instance '15' instead of \" +\n \"'{secs: 15, nanos: 0}'.\");\n }\n const ruffleConstructor = await loadRuffle(this.loadedConfig || {}, this.onRuffleDownloadProgress.bind(this)).catch((e) => {\n console.error(`Serious error loading Ruffle: ${e}`);\n // Serious duck typing. In error conditions, let's not make assumptions.\n if (window.location.protocol === \"file:\") {\n e.ruffleIndexError = 2 /* PanicError.FileProtocol */;\n }\n else {\n e.ruffleIndexError = 9 /* PanicError.WasmNotFound */;\n const message = String(e.message).toLowerCase();\n if (message.includes(\"mime\")) {\n e.ruffleIndexError = 8 /* PanicError.WasmMimeType */;\n }\n else if (message.includes(\"networkerror\") ||\n message.includes(\"failed to fetch\")) {\n e.ruffleIndexError = 6 /* PanicError.WasmCors */;\n }\n else if (message.includes(\"disallowed by embedder\")) {\n e.ruffleIndexError = 1 /* PanicError.CSPConflict */;\n }\n else if (e.name === \"CompileError\") {\n e.ruffleIndexError = 3 /* PanicError.InvalidWasm */;\n }\n else if (message.includes(\"could not download wasm module\") &&\n e.name === \"TypeError\") {\n e.ruffleIndexError = 7 /* PanicError.WasmDownload */;\n }\n else if (e.name === \"TypeError\") {\n e.ruffleIndexError = 5 /* PanicError.JavascriptConflict */;\n }\n else if (navigator.userAgent.includes(\"Edg\") &&\n message.includes(\"webassembly is not defined\")) {\n // Microsoft Edge detection.\n e.ruffleIndexError = 10 /* PanicError.WasmDisabledMicrosoftEdge */;\n }\n }\n this.panic(e);\n throw e;\n });\n this.instance = await new ruffleConstructor(this.container, this, this.loadedConfig);\n this._cachedDebugInfo = this.instance.renderer_debug_info();\n const actuallyUsedRendererName = this.instance.renderer_name();\n console.log(\"%c\" +\n \"New Ruffle instance created (WebAssembly extensions: \" +\n (ruffleConstructor.is_wasm_simd_used() ? \"ON\" : \"OFF\") +\n \" | Used renderer: \" +\n (actuallyUsedRendererName !== null && actuallyUsedRendererName !== void 0 ? actuallyUsedRendererName : \"\") +\n \")\", \"background: #37528C; color: #FFAD33\");\n // In Firefox, AudioContext.state is always \"suspended\" when the object has just been created.\n // It may change by itself to \"running\" some milliseconds later. So we need to wait a little\n // bit before checking if autoplay is supported and applying the instance config.\n if (this.audioState() !== \"running\") {\n this.container.style.visibility = \"hidden\";\n await new Promise((resolve) => {\n window.setTimeout(() => {\n resolve();\n }, 200);\n });\n this.container.style.visibility = \"\";\n }\n this.unmuteAudioContext();\n // On Android, the virtual keyboard needs to be dismissed as otherwise it re-focuses when clicking elsewhere\n if (navigator.userAgent.toLowerCase().includes(\"android\")) {\n this.container.addEventListener(\"click\", () => this.virtualKeyboard.blur());\n }\n // Treat invalid values as `AutoPlay.Auto`.\n if (!this.loadedConfig ||\n this.loadedConfig.autoplay === \"on\" /* AutoPlay.On */ ||\n (this.loadedConfig.autoplay !== \"off\" /* AutoPlay.Off */ &&\n this.audioState() === \"running\")) {\n this.play();\n if (this.audioState() !== \"running\") {\n // Treat invalid values as `UnmuteOverlay.Visible`.\n if (!this.loadedConfig ||\n this.loadedConfig.unmuteOverlay !== \"hidden\" /* UnmuteOverlay.Hidden */) {\n this.unmuteOverlay.style.display = \"block\";\n }\n this.container.addEventListener(\"click\", this.unmuteOverlayClicked.bind(this), {\n once: true,\n });\n const audioContext = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.audio_context();\n if (audioContext) {\n audioContext.onstatechange = () => {\n if (audioContext.state === \"running\") {\n this.unmuteOverlayClicked();\n }\n audioContext.onstatechange = null;\n };\n }\n }\n }\n else {\n this.playButton.style.display = \"block\";\n }\n }\n /**\n * Uploads the splash screen progress bar.\n *\n * @param bytesLoaded The size of the Ruffle WebAssembly file downloaded so far.\n * @param bytesTotal The total size of the Ruffle WebAssembly file.\n */\n onRuffleDownloadProgress(bytesLoaded, bytesTotal) {\n const loadBar = (this.splashScreen.querySelector(\".loadbar-inner\"));\n const outerLoadbar = (this.splashScreen.querySelector(\".loadbar\"));\n if (Number.isNaN(bytesTotal)) {\n if (outerLoadbar) {\n outerLoadbar.style.display = \"none\";\n }\n }\n else {\n loadBar.style.width = `${100.0 * (bytesLoaded / bytesTotal)}%`;\n }\n }\n /**\n * Destroys the currently running instance of Ruffle.\n */\n destroy() {\n if (this.instance) {\n this.instance.destroy();\n this.instance = null;\n this._metadata = null;\n this._readyState = 0 /* ReadyState.HaveNothing */;\n console.log(\"Ruffle instance destroyed.\");\n }\n }\n checkOptions(options) {\n if (typeof options === \"string\") {\n return { url: options };\n }\n const check = (condition, message) => {\n if (!condition) {\n const error = new TypeError(message);\n error.ruffleIndexError = 4 /* PanicError.JavascriptConfiguration */;\n this.panic(error);\n throw error;\n }\n };\n check(options !== null && typeof options === \"object\", \"Argument 0 must be a string or object\");\n check(\"url\" in options || \"data\" in options, \"Argument 0 must contain a `url` or `data` key\");\n check(!(\"url\" in options) || typeof options.url === \"string\", \"`url` must be a string\");\n return options;\n }\n /**\n * Gets the configuration set by the Ruffle extension\n *\n * @returns The configuration set by the Ruffle extension\n */\n getExtensionConfig() {\n var _a;\n return window.RufflePlayer &&\n window.RufflePlayer.conflict &&\n (window.RufflePlayer.conflict[\"newestName\"] === \"extension\" ||\n window.RufflePlayer[\"newestName\"] === \"extension\")\n ? (_a = window.RufflePlayer) === null || _a === void 0 ? void 0 : _a.conflict[\"config\"]\n : {};\n }\n /**\n * Loads a specified movie into this player.\n *\n * This will replace any existing movie that may be playing.\n *\n * @param options One of the following:\n * - A URL, passed as a string, which will load a URL with default options.\n * - A [[URLLoadOptions]] object, to load a URL with options.\n * - A [[DataLoadOptions]] object, to load data with options.\n *\n * The options will be defaulted by the [[config]] field, which itself\n * is defaulted by a global `window.RufflePlayer.config`.\n */\n async load(options) {\n var _a, _b;\n options = this.checkOptions(options);\n if (!this.isConnected || this.isUnusedFallbackObject()) {\n console.warn(\"Ignoring attempt to play a disconnected or suspended Ruffle element\");\n return;\n }\n if (isFallbackElement(this)) {\n // Silently fail on attempt to play a Ruffle element inside a specific node.\n return;\n }\n try {\n const extensionConfig = this.getExtensionConfig();\n this.loadedConfig = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, DEFAULT_CONFIG), extensionConfig), ((_b = (_a = window.RufflePlayer) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {})), this.config), options);\n // `allowScriptAccess` can only be set in `options`.\n this.loadedConfig.allowScriptAccess =\n options.allowScriptAccess === true;\n // Pre-emptively set background color of container while Ruffle/SWF loads.\n if (this.loadedConfig.backgroundColor &&\n this.loadedConfig.wmode !== \"transparent\" /* WindowMode.Transparent */) {\n this.container.style.backgroundColor =\n this.loadedConfig.backgroundColor;\n }\n await this.ensureFreshInstance();\n if (\"url\" in options) {\n console.log(`Loading SWF file ${options.url}`);\n this.swfUrl = new URL(options.url, document.baseURI);\n const parameters = Object.assign(Object.assign({}, sanitizeParameters(options.url.substring(options.url.indexOf(\"?\")))), sanitizeParameters(options.parameters));\n this.instance.stream_from(this.swfUrl.href, parameters);\n }\n else if (\"data\" in options) {\n console.log(\"Loading SWF data\");\n this.instance.load_data(new Uint8Array(options.data), sanitizeParameters(options.parameters), options.swfFileName || \"movie.swf\");\n }\n }\n catch (e) {\n console.error(`Serious error occurred loading SWF file: ${e}`);\n const err = new Error(e);\n if (err.message.includes(\"Error parsing config\")) {\n err.ruffleIndexError = 4 /* PanicError.JavascriptConfiguration */;\n }\n this.panic(err);\n throw err;\n }\n }\n /**\n * Plays or resumes the movie.\n */\n play() {\n if (this.instance) {\n this.instance.play();\n this.playButton.style.display = \"none\";\n }\n }\n /**\n * Whether this player is currently playing.\n *\n * @returns True if this player is playing, false if it's paused or hasn't started yet.\n */\n get isPlaying() {\n if (this.instance) {\n return this.instance.is_playing();\n }\n return false;\n }\n /**\n * Returns the master volume of the player.\n *\n * @returns The volume. 1.0 is 100% volume.\n */\n get volume() {\n if (this.instance) {\n return this.instance.volume();\n }\n return 1.0;\n }\n /**\n * Sets the master volume of the player.\n *\n * @param value The volume. 1.0 is 100% volume.\n */\n set volume(value) {\n if (this.instance) {\n this.instance.set_volume(value);\n }\n }\n /**\n * Checks if this player is allowed to be fullscreen by the browser.\n *\n * @returns True if you may call [[enterFullscreen]].\n */\n get fullscreenEnabled() {\n return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);\n }\n /**\n * Checks if this player is currently fullscreen inside the browser.\n *\n * @returns True if it is fullscreen.\n */\n get isFullscreen() {\n return ((document.fullscreenElement || document.webkitFullscreenElement) ===\n this);\n }\n /**\n * Exported function that requests the browser to change the fullscreen state if\n * it is allowed.\n *\n * @param isFull Whether to set to fullscreen or return to normal.\n */\n setFullscreen(isFull) {\n if (this.fullscreenEnabled) {\n if (isFull) {\n this.enterFullscreen();\n }\n else {\n this.exitFullscreen();\n }\n }\n }\n /**\n * Requests the browser to make this player fullscreen.\n *\n * This is not guaranteed to succeed, please check [[fullscreenEnabled]] first.\n */\n enterFullscreen() {\n const options = {\n navigationUI: \"hide\",\n };\n if (this.requestFullscreen) {\n this.requestFullscreen(options);\n }\n else if (this.webkitRequestFullscreen) {\n this.webkitRequestFullscreen(options);\n }\n else if (this.webkitRequestFullScreen) {\n this.webkitRequestFullScreen(options);\n }\n }\n /**\n * Requests the browser to no longer make this player fullscreen.\n */\n exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n }\n else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n /**\n * Called when entering / leaving fullscreen\n */\n fullScreenChange() {\n var _a;\n (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_fullscreen(this.isFullscreen);\n }\n checkIfTouch(event) {\n if (event.pointerType === \"touch\" || event.pointerType === \"pen\") {\n this.isTouch = true;\n }\n }\n base64ToBlob(bytesBase64, mimeString) {\n const byteString = atob(bytesBase64);\n const ab = new ArrayBuffer(byteString.length);\n const ia = new Uint8Array(ab);\n for (let i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n const blob = new Blob([ab], { type: mimeString });\n return blob;\n }\n /**\n * Download base-64 string as file\n *\n * @param bytesBase64 The base-64 encoded SOL string\n * @param mimeType The MIME type\n * @param fileName The name to give the file\n */\n saveFile(bytesBase64, mimeType, fileName) {\n const blob = this.base64ToBlob(bytesBase64, mimeType);\n const blobURL = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = blobURL;\n link.style.display = \"none\";\n link.download = fileName;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(blobURL);\n }\n /**\n * @returns If the string represent a base-64 encoded SOL file\n * Check if string is a base-64 encoded SOL file\n * @param solData The base-64 encoded SOL string\n */\n isB64SOL(solData) {\n try {\n const decodedData = atob(solData);\n return decodedData.slice(6, 10) === \"TCSO\";\n }\n catch (e) {\n return false;\n }\n }\n confirmReloadSave(solKey, b64SolData, replace) {\n if (this.isB64SOL(b64SolData)) {\n if (localStorage[solKey]) {\n if (!replace) {\n const confirmDelete = confirm(\"Are you sure you want to delete this save file?\");\n if (!confirmDelete) {\n return;\n }\n }\n const swfPath = this.swfUrl ? this.swfUrl.pathname : \"\";\n const swfHost = this.swfUrl\n ? this.swfUrl.hostname\n : document.location.hostname;\n const savePath = solKey.split(\"/\").slice(1, -1).join(\"/\");\n if (swfPath.includes(savePath) && solKey.startsWith(swfHost)) {\n const confirmReload = confirm(`The only way to ${replace ? \"replace\" : \"delete\"} this save file without potential conflict is to reload this content. Do you wish to continue anyway?`);\n if (confirmReload && this.loadedConfig) {\n this.destroy();\n replace\n ? localStorage.setItem(solKey, b64SolData)\n : localStorage.removeItem(solKey);\n this.load(this.loadedConfig);\n this.populateSaves();\n this.saveManager.classList.add(\"hidden\");\n }\n return;\n }\n replace\n ? localStorage.setItem(solKey, b64SolData)\n : localStorage.removeItem(solKey);\n this.populateSaves();\n this.saveManager.classList.add(\"hidden\");\n }\n }\n }\n /**\n * Replace save from SOL file.\n *\n * @param event The change event fired\n * @param solKey The localStorage save file key\n */\n replaceSOL(event, solKey) {\n const fileInput = event.target;\n const reader = new FileReader();\n reader.addEventListener(\"load\", () => {\n if (reader.result && typeof reader.result === \"string\") {\n const b64Regex = new RegExp(\"data:.*;base64,\");\n const b64SolData = reader.result.replace(b64Regex, \"\");\n this.confirmReloadSave(solKey, b64SolData, true);\n }\n });\n if (fileInput &&\n fileInput.files &&\n fileInput.files.length > 0 &&\n fileInput.files[0]) {\n reader.readAsDataURL(fileInput.files[0]);\n }\n }\n /**\n * Delete local save.\n *\n * @param key The key to remove from local storage\n */\n deleteSave(key) {\n const b64SolData = localStorage.getItem(key);\n if (b64SolData) {\n this.confirmReloadSave(key, b64SolData, false);\n }\n }\n /**\n * Puts the local save SOL file keys in a table.\n */\n populateSaves() {\n const saveTable = this.saveManager.querySelector(\"#local-saves\");\n if (!saveTable) {\n return;\n }\n try {\n localStorage;\n }\n catch (e) {\n return;\n }\n saveTable.textContent = \"\";\n Object.keys(localStorage).forEach((key) => {\n const solName = key.split(\"/\").pop();\n const solData = localStorage.getItem(key);\n if (solName && solData && this.isB64SOL(solData)) {\n const row = document.createElement(\"TR\");\n const keyCol = document.createElement(\"TD\");\n keyCol.textContent = solName;\n keyCol.title = key;\n const downloadCol = document.createElement(\"TD\");\n const downloadSpan = document.createElement(\"SPAN\");\n downloadSpan.textContent = \"Download\";\n downloadSpan.className = \"save-option\";\n downloadSpan.addEventListener(\"click\", () => this.saveFile(solData, \"application/octet-stream\", solName + \".sol\"));\n downloadCol.appendChild(downloadSpan);\n const replaceCol = document.createElement(\"TD\");\n const replaceInput = (document.createElement(\"INPUT\"));\n replaceInput.type = \"file\";\n replaceInput.accept = \".sol\";\n replaceInput.className = \"replace-save\";\n replaceInput.id = \"replace-save-\" + key;\n const replaceLabel = (document.createElement(\"LABEL\"));\n replaceLabel.htmlFor = \"replace-save-\" + key;\n replaceLabel.textContent = \"Replace\";\n replaceLabel.className = \"save-option\";\n replaceInput.addEventListener(\"change\", (event) => this.replaceSOL(event, key));\n replaceCol.appendChild(replaceInput);\n replaceCol.appendChild(replaceLabel);\n const deleteCol = document.createElement(\"TD\");\n const deleteSpan = document.createElement(\"SPAN\");\n deleteSpan.textContent = \"Delete\";\n deleteSpan.className = \"save-option\";\n deleteSpan.addEventListener(\"click\", () => this.deleteSave(key));\n deleteCol.appendChild(deleteSpan);\n row.appendChild(keyCol);\n row.appendChild(downloadCol);\n row.appendChild(replaceCol);\n row.appendChild(deleteCol);\n saveTable.appendChild(row);\n }\n });\n }\n /**\n * Gets the local save information as SOL files and downloads them.\n */\n backupSaves() {\n Object.keys(localStorage).forEach((key) => {\n const solName = key.split(\"/\").pop();\n const solData = localStorage.getItem(key);\n if (solData && this.isB64SOL(solData)) {\n this.saveFile(solData, \"application/octet-stream\", solName + \".sol\");\n }\n });\n }\n /**\n * Opens the save manager.\n */\n openSaveManager() {\n this.saveManager.classList.remove(\"hidden\");\n }\n /**\n * Fetches the loaded SWF and downloads it.\n */\n async downloadSwf() {\n try {\n if (this.swfUrl) {\n console.log(\"Downloading SWF: \" + this.swfUrl);\n const response = await fetch(this.swfUrl.href);\n if (!response.ok) {\n console.error(\"SWF download failed\");\n return;\n }\n const blob = await response.blob();\n const blobUrl = URL.createObjectURL(blob);\n const swfDownloadA = document.createElement(\"a\");\n swfDownloadA.style.display = \"none\";\n swfDownloadA.href = blobUrl;\n swfDownloadA.download = swfFileName(this.swfUrl);\n document.body.appendChild(swfDownloadA);\n swfDownloadA.click();\n document.body.removeChild(swfDownloadA);\n URL.revokeObjectURL(blobUrl);\n }\n else {\n console.error(\"SWF download failed\");\n }\n }\n catch (err) {\n console.error(\"SWF download failed\");\n }\n }\n virtualKeyboardInput() {\n const input = this.virtualKeyboard;\n const string = input.value;\n for (const char of string) {\n for (const eventType of [\"keydown\", \"keyup\"]) {\n this.dispatchEvent(new KeyboardEvent(eventType, {\n key: char,\n bubbles: true,\n }));\n }\n }\n input.value = \"\";\n }\n openVirtualKeyboard() {\n // On Android, the Rust code that opens the virtual keyboard triggers\n // before the TypeScript code that closes it, so delay opening it\n if (navigator.userAgent.toLowerCase().includes(\"android\")) {\n setTimeout(() => {\n this.virtualKeyboard.focus({ preventScroll: true });\n }, 100);\n }\n else {\n this.virtualKeyboard.focus({ preventScroll: true });\n }\n }\n contextMenuItems() {\n const CHECKMARK = String.fromCharCode(0x2713);\n const items = [];\n const addSeparator = () => {\n // Don't start with or duplicate separators.\n if (items.length > 0 && items[items.length - 1] !== null) {\n items.push(null);\n }\n };\n if (this.instance) {\n const customItems = this.instance.prepare_context_menu();\n customItems.forEach((item, index) => {\n if (item.separatorBefore) {\n addSeparator();\n }\n items.push({\n // TODO: better checkboxes\n text: item.caption + (item.checked ? ` (${CHECKMARK})` : ``),\n onClick: () => { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.run_context_menu_callback(index); },\n enabled: item.enabled,\n });\n });\n addSeparator();\n }\n if (this.fullscreenEnabled) {\n if (this.isFullscreen) {\n items.push({\n text: \"Exit fullscreen\",\n onClick: () => { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_fullscreen(false); },\n });\n }\n else {\n items.push({\n text: \"Enter fullscreen\",\n onClick: () => { var _a; return (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_fullscreen(true); },\n });\n }\n }\n if (this.instance &&\n this.swfUrl &&\n this.loadedConfig &&\n this.loadedConfig.showSwfDownload === true) {\n addSeparator();\n items.push({\n text: \"Download .swf\",\n onClick: this.downloadSwf.bind(this),\n });\n }\n if (window.isSecureContext) {\n items.push({\n text: \"Copy debug info\",\n onClick: () => navigator.clipboard.writeText(this.getPanicData()),\n });\n }\n this.populateSaves();\n const localSaveTable = this.saveManager.querySelector(\"#local-saves\");\n if (localSaveTable && localSaveTable.textContent !== \"\") {\n items.push({\n text: \"Open Save Manager\",\n onClick: this.openSaveManager.bind(this),\n });\n }\n addSeparator();\n const extensionString = this.isExtension ? \"extension\" : \"\";\n items.push({\n text: `About Ruffle ${extensionString} (${buildInfo.versionName})`,\n onClick() {\n window.open(RUFFLE_ORIGIN, \"_blank\");\n },\n });\n // Give option to disable context menu when touch support is being used\n // to avoid a long press triggering the context menu. (#1972)\n if (this.isTouch) {\n addSeparator();\n items.push({\n text: \"Hide this menu\",\n onClick: () => (this.contextMenuForceDisabled = true),\n });\n }\n return items;\n }\n pointerDown(event) {\n this.pointerDownPosition = new Point(event.pageX, event.pageY);\n this.pointerMoveMaxDistance = 0;\n this.startLongPressTimer();\n }\n clearLongPressTimer() {\n if (this.longPressTimer) {\n clearTimeout(this.longPressTimer);\n this.longPressTimer = null;\n }\n }\n startLongPressTimer() {\n const longPressTimeout = 800;\n this.clearLongPressTimer();\n this.longPressTimer = setTimeout(() => this.clearLongPressTimer(), longPressTimeout);\n }\n checkLongPressMovement(event) {\n if (this.pointerDownPosition !== null) {\n const currentPosition = new Point(event.pageX, event.pageY);\n const distance = this.pointerDownPosition.distanceTo(currentPosition);\n if (distance > this.pointerMoveMaxDistance) {\n this.pointerMoveMaxDistance = distance;\n }\n }\n }\n checkLongPress(event) {\n const maxAllowedDistance = 15;\n if (this.longPressTimer) {\n this.clearLongPressTimer();\n // The pointerType condition is to ensure right-click does not trigger\n // a context menu the wrong way the first time you right-click,\n // before contextMenuSupported is set.\n }\n else if (!this.contextMenuSupported &&\n event.pointerType !== \"mouse\" &&\n this.pointerMoveMaxDistance < maxAllowedDistance) {\n this.showContextMenu(event);\n }\n }\n showContextMenu(event) {\n event.preventDefault();\n if (event.type === \"contextmenu\") {\n this.contextMenuSupported = true;\n window.addEventListener(\"click\", this.hideContextMenu.bind(this), {\n once: true,\n });\n }\n else {\n window.addEventListener(\"pointerup\", this.hideContextMenu.bind(this), { once: true });\n event.stopPropagation();\n }\n if ((this.loadedConfig && this.loadedConfig.contextMenu === false) ||\n this.contextMenuForceDisabled) {\n return;\n }\n // Clear all context menu items.\n while (this.contextMenuElement.firstChild) {\n this.contextMenuElement.removeChild(this.contextMenuElement.firstChild);\n }\n // Populate context menu items.\n for (const item of this.contextMenuItems()) {\n if (item === null) {\n const menuSeparator = document.createElement(\"li\");\n menuSeparator.className = \"menu_separator\";\n const hr = document.createElement(\"hr\");\n menuSeparator.appendChild(hr);\n this.contextMenuElement.appendChild(menuSeparator);\n }\n else {\n const { text, onClick, enabled } = item;\n const menuItem = document.createElement(\"li\");\n menuItem.className = \"menu_item\";\n menuItem.textContent = text;\n this.contextMenuElement.appendChild(menuItem);\n if (enabled !== false) {\n menuItem.addEventListener(this.contextMenuSupported ? \"click\" : \"pointerup\", onClick);\n }\n else {\n menuItem.classList.add(\"disabled\");\n }\n }\n }\n // Place a context menu in the top-left corner, so\n // its `clientWidth` and `clientHeight` are not clamped.\n this.contextMenuElement.style.left = \"0\";\n this.contextMenuElement.style.top = \"0\";\n this.contextMenuElement.style.display = \"block\";\n const rect = this.getBoundingClientRect();\n const x = event.clientX - rect.x;\n const y = event.clientY - rect.y;\n const maxX = rect.width - this.contextMenuElement.clientWidth - 1;\n const maxY = rect.height - this.contextMenuElement.clientHeight - 1;\n this.contextMenuElement.style.left =\n Math.floor(Math.min(x, maxX)) + \"px\";\n this.contextMenuElement.style.top =\n Math.floor(Math.min(y, maxY)) + \"px\";\n }\n hideContextMenu() {\n var _a;\n (_a = this.instance) === null || _a === void 0 ? void 0 : _a.clear_custom_menu_items();\n this.contextMenuElement.style.display = \"none\";\n }\n /**\n * Pauses this player.\n *\n * No more frames, scripts or sounds will be executed.\n * This movie will be considered inactive and will not wake up until resumed.\n */\n pause() {\n if (this.instance) {\n this.instance.pause();\n this.playButton.style.display = \"block\";\n }\n }\n audioState() {\n if (this.instance) {\n const audioContext = this.instance.audio_context();\n return (audioContext && audioContext.state) || \"running\";\n }\n return \"suspended\";\n }\n unmuteOverlayClicked() {\n if (this.instance) {\n if (this.audioState() !== \"running\") {\n const audioContext = this.instance.audio_context();\n if (audioContext) {\n audioContext.resume();\n }\n }\n this.unmuteOverlay.style.display = \"none\";\n }\n }\n /**\n * Plays a silent sound based on the AudioContext's sample rate.\n *\n * This is used to unmute audio on iOS and iPadOS when silent mode is enabled on the device (issue 1552).\n */\n unmuteAudioContext() {\n // No need to play the dummy sound again once audio is unmuted.\n if (isAudioContextUnmuted) {\n return;\n }\n // TODO: Use `navigator.userAgentData` to detect the platform when support improves?\n if (navigator.maxTouchPoints < 1) {\n isAudioContextUnmuted = true;\n return;\n }\n this.container.addEventListener(\"click\", () => {\n var _a;\n if (isAudioContextUnmuted) {\n return;\n }\n const audioContext = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.audio_context();\n if (!audioContext) {\n return;\n }\n const audio = new Audio();\n audio.src = (() => {\n // Returns a seven samples long 8 bit mono WAVE file.\n // This is required to prevent the AudioContext from desyncing and crashing.\n const arrayBuffer = new ArrayBuffer(10);\n const dataView = new DataView(arrayBuffer);\n const sampleRate = audioContext.sampleRate;\n dataView.setUint32(0, sampleRate, true);\n dataView.setUint32(4, sampleRate, true);\n dataView.setUint16(8, 1, true);\n const missingCharacters = window\n .btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)))\n .slice(0, 13);\n return `data:audio/wav;base64,UklGRisAAABXQVZFZm10IBAAAAABAAEA${missingCharacters}AgAZGF0YQcAAACAgICAgICAAAA=`;\n })();\n audio.load();\n audio\n .play()\n .then(() => {\n isAudioContextUnmuted = true;\n })\n .catch((err) => {\n console.warn(`Failed to play dummy sound: ${err}`);\n });\n }, { once: true });\n }\n /**\n * Copies attributes and children from another element to this player element.\n * Used by the polyfill elements, RuffleObject and RuffleEmbed.\n *\n * @param element The element to copy all attributes from.\n */\n copyElement(element) {\n if (element) {\n for (const attribute of element.attributes) {\n if (attribute.specified) {\n // Issue 468: Chrome \"Click to Active Flash\" box stomps on title attribute\n if (attribute.name === \"title\" &&\n attribute.value === \"Adobe Flash Player\") {\n continue;\n }\n try {\n this.setAttribute(attribute.name, attribute.value);\n }\n catch (err) {\n // The embed may have invalid attributes, so handle these gracefully.\n console.warn(`Unable to set attribute ${attribute.name} on Ruffle instance`);\n }\n }\n }\n for (const node of Array.from(element.children)) {\n this.appendChild(node);\n }\n }\n }\n /**\n * Converts a dimension attribute on an HTML embed/object element to a valid CSS dimension.\n * HTML element dimensions are unitless, but can also be percentages.\n * Add a 'px' unit unless the value is a percentage.\n * Returns null if this is not a valid dimension.\n *\n * @param attribute The attribute to convert\n *\n * @private\n */\n static htmlDimensionToCssDimension(attribute) {\n if (attribute) {\n const match = attribute.match(DIMENSION_REGEX);\n if (match) {\n let out = match[1];\n if (!match[3]) {\n // Unitless -- add px for CSS.\n out += \"px\";\n }\n return out;\n }\n }\n return null;\n }\n /**\n * When a movie presents a new callback through `ExternalInterface.addCallback`,\n * we are informed so that we can expose the method on any relevant DOM element.\n *\n * This should only be called by Ruffle itself and not by users.\n *\n * @param name The name of the callback that is now available.\n *\n * @internal\n * @ignore\n */\n onCallbackAvailable(name) {\n const instance = this.instance;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[name] = (...args) => {\n return instance === null || instance === void 0 ? void 0 : instance.call_exposed_callback(name, args);\n };\n }\n /**\n * Sets a trace observer on this flash player.\n *\n * The observer will be called, as a function, for each message that the playing movie will \"trace\" (output).\n *\n * @param observer The observer that will be called for each trace.\n */\n set traceObserver(observer) {\n var _a;\n (_a = this.instance) === null || _a === void 0 ? void 0 : _a.set_trace_observer(observer);\n }\n /**\n * Get data included in any panic of this ruffle-player\n *\n * @returns A string containing all the data included in the panic.\n */\n getPanicData() {\n const dataArray = [];\n dataArray.push(\"\\n# Player Info\\n\");\n dataArray.push(this.debugPlayerInfo());\n dataArray.push(\"\\n# Page Info\\n\");\n dataArray.push(`Page URL: ${document.location.href}\\n`);\n if (this.swfUrl) {\n dataArray.push(`SWF URL: ${this.swfUrl}\\n`);\n }\n dataArray.push(\"\\n# Browser Info\\n\");\n dataArray.push(`User Agent: ${window.navigator.userAgent}\\n`);\n dataArray.push(`Platform: ${window.navigator.platform}\\n`);\n dataArray.push(`Has touch support: ${window.navigator.maxTouchPoints > 0}\\n`);\n dataArray.push(\"\\n# Ruffle Info\\n\");\n dataArray.push(`Version: ${buildInfo.versionNumber}\\n`);\n dataArray.push(`Name: ${buildInfo.versionName}\\n`);\n dataArray.push(`Channel: ${buildInfo.versionChannel}\\n`);\n dataArray.push(`Built: ${buildInfo.buildDate}\\n`);\n dataArray.push(`Commit: ${buildInfo.commitHash}\\n`);\n dataArray.push(`Is extension: ${this.isExtension}\\n`);\n dataArray.push(\"\\n# Metadata\\n\");\n if (this.metadata) {\n for (const [key, value] of Object.entries(this.metadata)) {\n dataArray.push(`${key}: ${value}\\n`);\n }\n }\n return dataArray.join(\"\");\n }\n /**\n * Panics this specific player, forcefully destroying all resources and displays an error message to the user.\n *\n * This should be called when something went absolutely, incredibly and disastrously wrong and there is no chance\n * of recovery.\n *\n * Ruffle will attempt to isolate all damage to this specific player instance, but no guarantees can be made if there\n * was a core issue which triggered the panic. If Ruffle is unable to isolate the cause to a specific player, then\n * all players will panic and Ruffle will become \"poisoned\" - no more players will run on this page until it is\n * reloaded fresh.\n *\n * @param error The error, if any, that triggered this panic.\n */\n panic(error) {\n var _a;\n if (this.panicked) {\n // Only show the first major error, not any repeats - they aren't as important\n return;\n }\n this.panicked = true;\n this.hideSplashScreen();\n if (error instanceof Error &&\n (error.name === \"AbortError\" ||\n error.message.includes(\"AbortError\"))) {\n // Firefox: Don't display the panic screen if the user leaves the page while something is still loading\n return;\n }\n const errorIndex = (_a = error === null || error === void 0 ? void 0 : error.ruffleIndexError) !== null && _a !== void 0 ? _a : 0 /* PanicError.Unknown */;\n const errorArray = Object.assign([], {\n stackIndex: -1,\n avmStackIndex: -1,\n });\n errorArray.push(\"# Error Info\\n\");\n if (error instanceof Error) {\n errorArray.push(`Error name: ${error.name}\\n`);\n errorArray.push(`Error message: ${error.message}\\n`);\n if (error.stack) {\n const stackIndex = errorArray.push(`Error stack:\\n\\`\\`\\`\\n${error.stack}\\n\\`\\`\\`\\n`) - 1;\n if (error.avmStack) {\n const avmStackIndex = errorArray.push(`AVM2 stack:\\n\\`\\`\\`\\n ${error.avmStack\n .trim()\n .replace(/\\t/g, \" \")}\\n\\`\\`\\`\\n`) - 1;\n errorArray.avmStackIndex = avmStackIndex;\n }\n errorArray.stackIndex = stackIndex;\n }\n }\n else {\n errorArray.push(`Error: ${error}\\n`);\n }\n errorArray.push(this.getPanicData());\n const errorText = errorArray.join(\"\");\n const buildDate = new Date(buildInfo.buildDate);\n const monthsPrior = new Date();\n monthsPrior.setMonth(monthsPrior.getMonth() - 6); // 6 months prior\n const isBuildOutdated = monthsPrior > buildDate;\n // Create a link to GitHub with all of the error data, if the build is not outdated.\n // Otherwise, create a link to the downloads section on the Ruffle website.\n let actionTag;\n if (!isBuildOutdated) {\n // Remove query params for the issue title.\n const pageUrl = document.location.href.split(/[?#]/)[0];\n const issueTitle = `Error on ${pageUrl}`;\n let issueLink = `https://github.com/ruffle-rs/ruffle/issues/new?title=${encodeURIComponent(issueTitle)}&template=error_report.md&labels=error-report&body=`;\n let issueBody = encodeURIComponent(errorText);\n if (errorArray.stackIndex > -1 &&\n String(issueLink + issueBody).length > 8195) {\n // Strip the stack error from the array when the produced URL is way too long.\n // This should prevent \"414 Request-URI Too Large\" errors on GitHub.\n errorArray[errorArray.stackIndex] = null;\n if (errorArray.avmStackIndex > -1) {\n errorArray[errorArray.avmStackIndex] = null;\n }\n issueBody = encodeURIComponent(errorArray.join(\"\"));\n }\n issueLink += issueBody;\n actionTag = `Report Bug`;\n }\n else {\n actionTag = `Update Ruffle`;\n }\n // Clears out any existing content (ie play button or canvas) and replaces it with the error screen\n let errorBody, errorFooter;\n switch (errorIndex) {\n case 2 /* PanicError.FileProtocol */:\n // General error: Running on the `file:` protocol\n errorBody = `\n

It appears you are running Ruffle on the \"file:\" protocol.

\n

This doesn't work as browsers block many features from working for security reasons.

\n

Instead, we invite you to setup a local server or either use the web demo or the desktop application.

\n `;\n errorFooter = `\n
  • Web Demo
  • \n
  • Desktop Application
  • \n `;\n break;\n case 4 /* PanicError.JavascriptConfiguration */:\n // General error: Incorrect JavaScript configuration\n errorBody = `\n

    Ruffle has encountered a major issue due to an incorrect JavaScript configuration.

    \n

    If you are the server administrator, we invite you to check the error details to find out which parameter is at fault.

    \n

    You can also consult the Ruffle wiki for help.

    \n `;\n errorFooter = `\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n `;\n break;\n case 9 /* PanicError.WasmNotFound */:\n // Self hosted: Cannot load `.wasm` file - file not found\n errorBody = `\n

    Ruffle failed to load the required \".wasm\" file component.

    \n

    If you are the server administrator, please ensure the file has correctly been uploaded.

    \n

    If the issue persists, you may need to use the \"publicPath\" setting: please consult the Ruffle wiki for help.

    \n `;\n errorFooter = `\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n `;\n break;\n case 8 /* PanicError.WasmMimeType */:\n // Self hosted: Cannot load `.wasm` file - incorrect MIME type\n errorBody = `\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    This web server is not serving \".wasm\" files with the correct MIME type.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n `;\n errorFooter = `\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n `;\n break;\n case 11 /* PanicError.SwfFetchError */:\n errorBody = `\n

    Ruffle failed to load the Flash SWF file.

    \n

    The most likely reason is that the file no longer exists, so there is nothing for Ruffle to load.

    \n

    Try contacting the website administrator for help.

    \n `;\n errorFooter = `\n
  • View Error Details
  • \n `;\n break;\n case 12 /* PanicError.SwfCors */:\n // Self hosted: Cannot load SWF file - CORS issues\n errorBody = `\n

    Ruffle failed to load the Flash SWF file.

    \n

    Access to fetch has likely been blocked by CORS policy.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n `;\n errorFooter = `\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n `;\n break;\n case 6 /* PanicError.WasmCors */:\n // Self hosted: Cannot load `.wasm` file - CORS issues\n errorBody = `\n

    Ruffle failed to load the required \".wasm\" file component.

    \n

    Access to fetch has likely been blocked by CORS policy.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n `;\n errorFooter = `\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n `;\n break;\n case 3 /* PanicError.InvalidWasm */:\n // Self hosted: Cannot load `.wasm` file - incorrect configuration or missing files\n errorBody = `\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    It seems like this page has missing or invalid files for running Ruffle.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n `;\n errorFooter = `\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n `;\n break;\n case 7 /* PanicError.WasmDownload */:\n // Usually a transient network error or botched deployment\n errorBody = `\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    This can often resolve itself, so you can try reloading the page.

    \n

    Otherwise, please contact the website administrator.

    \n `;\n errorFooter = `\n
  • View Error Details
  • \n `;\n break;\n case 10 /* PanicError.WasmDisabledMicrosoftEdge */:\n // Self hosted: User has disabled WebAssembly in Microsoft Edge through the\n // \"Enhance your Security on the web\" setting.\n errorBody = `\n

    Ruffle failed to load the required \".wasm\" file component.

    \n

    To fix this, try opening your browser's settings, clicking \"Privacy, search, and services\", scrolling down, and turning off \"Enhance your security on the web\".

    \n

    This will allow your browser to load the required \".wasm\" files.

    \n

    If the issue persists, you might have to use a different browser.

    \n `;\n errorFooter = `\n
  • More Information
  • \n
  • View Error Details
  • \n `;\n break;\n case 5 /* PanicError.JavascriptConflict */:\n // Self hosted: Cannot load `.wasm` file - a native object / function is overriden\n errorBody = `\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    It seems like this page uses JavaScript code that conflicts with Ruffle.

    \n

    If you are the server administrator, we invite you to try loading the file on a blank page.

    \n `;\n if (isBuildOutdated) {\n errorBody += `

    You can also try to upload a more recent version of Ruffle that may circumvent the issue (current build is outdated: ${buildInfo.buildDate}).

    `;\n }\n errorFooter = `\n
  • ${actionTag}
  • \n
  • View Error Details
  • \n `;\n break;\n case 1 /* PanicError.CSPConflict */:\n // General error: Cannot load `.wasm` file - a native object / function is overriden\n errorBody = `\n

    Ruffle has encountered a major issue whilst trying to initialize.

    \n

    This web server's Content Security Policy does not allow the required \".wasm\" component to run.

    \n

    If you are the server administrator, please consult the Ruffle wiki for help.

    \n `;\n errorFooter = `\n
  • View Ruffle Wiki
  • \n
  • View Error Details
  • \n `;\n break;\n default:\n // Unknown error\n errorBody = `

    Ruffle has encountered a major issue whilst trying to display this Flash content.

    `;\n if (!isBuildOutdated) {\n errorBody += `

    This isn't supposed to happen, so we'd really appreciate if you could file a bug!

    `;\n }\n else {\n errorBody += `

    If you are the server administrator, please try to upload a more recent version of Ruffle (current build is outdated: ${buildInfo.buildDate}).

    `;\n }\n errorFooter = `\n
  • ${actionTag}
  • \n
  • View Error Details
  • \n `;\n break;\n }\n this.container.innerHTML = `\n
    \n
    Something went wrong :(
    \n
    ${errorBody}
    \n
    \n \n
    \n
    \n `;\n const viewDetails = (this.container.querySelector(\"#panic-view-details\"));\n if (viewDetails) {\n viewDetails.onclick = () => {\n const panicBody = (this.container.querySelector(\"#panic-body\"));\n panicBody.classList.add(\"details\");\n const panicText = document.createElement(\"textarea\");\n panicText.readOnly = true;\n panicText.value = errorText;\n panicBody.replaceChildren(panicText);\n return false;\n };\n }\n // Do this last, just in case it causes any cascading issues.\n this.destroy();\n }\n displayRootMovieDownloadFailedMessage() {\n if (this.isExtension &&\n window.location.origin !== this.swfUrl.origin) {\n this.hideSplashScreen();\n const div = document.createElement(\"div\");\n div.id = \"message_overlay\";\n div.innerHTML = `
    \n

    Ruffle wasn't able to run the Flash embedded in this page.

    \n

    You can try to open the file in a separate tab, to sidestep this issue.

    \n
    \n Open in a new tab\n
    \n
    `;\n this.container.prepend(div);\n }\n else {\n const error = new Error(\"Failed to fetch: \" + this.swfUrl);\n if (!this.swfUrl.protocol.includes(\"http\")) {\n error.ruffleIndexError = 2 /* PanicError.FileProtocol */;\n }\n else if (window.location.origin === this.swfUrl.origin) {\n error.ruffleIndexError = 11 /* PanicError.SwfFetchError */;\n }\n else {\n // This is a selfhosted build of Ruffle that tried to make a cross-origin request\n error.ruffleIndexError = 12 /* PanicError.SwfCors */;\n }\n this.panic(error);\n }\n }\n displayUnsupportedMessage() {\n const div = document.createElement(\"div\");\n div.id = \"message_overlay\";\n // TODO: Change link to https://ruffle.rs/faq or similar\n // TODO: Pause content until message is dismissed\n div.innerHTML = `
    \n

    The Ruffle emulator may not yet fully support all of ActionScript 3 used by this content.

    \n

    Some parts of the content may not work as expected.

    \n
    \n More info\n \n
    \n
    `;\n this.container.prepend(div);\n const button = div.querySelector(\"#run-anyway-btn\");\n button.onclick = () => {\n div.parentNode.removeChild(div);\n };\n }\n /**\n * Show a dismissible message in front of the player.\n *\n * @param message The message shown to the user.\n */\n displayMessage(message) {\n const div = document.createElement(\"div\");\n div.id = \"message_overlay\";\n div.innerHTML = `
    \n

    ${message}

    \n
    \n \n
    \n
    `;\n this.container.prepend(div);\n (this.container.querySelector(\"#continue-btn\")).onclick = () => {\n div.parentNode.removeChild(div);\n };\n }\n debugPlayerInfo() {\n let result = `Allows script access: ${this.loadedConfig ? this.loadedConfig.allowScriptAccess : false}\\n`;\n let renderInfo = `(Cached) ${this._cachedDebugInfo}`;\n if (this.instance) {\n try {\n renderInfo = this.instance.renderer_debug_info();\n }\n catch (_a) {\n // ignored\n }\n }\n if (renderInfo) {\n result += `${renderInfo}\\n`;\n }\n return result;\n }\n hideSplashScreen() {\n this.splashScreen.classList.add(\"hidden\");\n this.container.classList.remove(\"hidden\");\n }\n showSplashScreen() {\n this.splashScreen.classList.remove(\"hidden\");\n this.container.classList.add(\"hidden\");\n }\n setMetadata(metadata) {\n this._metadata = metadata;\n // TODO: Switch this to ReadyState.Loading when we have streaming support.\n this._readyState = 2 /* ReadyState.Loaded */;\n this.hideSplashScreen();\n this.dispatchEvent(new Event(RufflePlayer.LOADED_METADATA));\n // TODO: Move this to whatever function changes the ReadyState to Loaded when we have streaming support.\n this.dispatchEvent(new Event(RufflePlayer.LOADED_DATA));\n }\n setIsExtension(isExtension) {\n this.isExtension = isExtension;\n }\n}\n/**\n * Triggered when a movie metadata has been loaded (such as movie width and height).\n *\n * @event RufflePlayer#loadedmetadata\n */\nRufflePlayer.LOADED_METADATA = \"loadedmetadata\";\n/**\n * Triggered when a movie is fully loaded.\n *\n * @event RufflePlayer#loadeddata\n */\nRufflePlayer.LOADED_DATA = \"loadeddata\";\nexport { RufflePlayer };\n/**\n * Returns whether a SWF file can call JavaScript code in the surrounding HTML file.\n *\n * @param access The value of the `allowScriptAccess` attribute.\n * @param url The URL of the SWF file.\n * @returns True if script access is allowed.\n */\nexport function isScriptAccessAllowed(access, url) {\n if (!access) {\n access = \"sameDomain\";\n }\n switch (access.toLowerCase()) {\n case \"always\":\n return true;\n case \"never\":\n return false;\n case \"samedomain\":\n default:\n try {\n return (new URL(window.location.href).origin ===\n new URL(url, window.location.href).origin);\n }\n catch (_a) {\n return false;\n }\n }\n}\n/**\n * Returns whether a SWF file should show the built-in context menu items.\n *\n * @param menu The value of the `menu` attribute.\n * @returns True if the built-in context items should be shown.\n */\nexport function isBuiltInContextMenuVisible(menu) {\n if (menu === null || menu.toLowerCase() === \"true\") {\n return true;\n }\n return false;\n}\n/**\n * Returns whether the given filename is a Youtube Flash source.\n *\n * @param filename The filename to test.\n * @returns True if the filename is a Youtube Flash source.\n */\nexport function isYoutubeFlashSource(filename) {\n if (filename) {\n let pathname = \"\";\n let cleaned_hostname = \"\";\n try {\n // A base URL is required if `filename` is a relative URL, but we don't need to detect the real URL origin.\n const url = new URL(filename, RUFFLE_ORIGIN);\n pathname = url.pathname;\n cleaned_hostname = url.hostname.replace(\"www.\", \"\");\n }\n catch (err) {\n // Some invalid filenames, like `///`, could raise a TypeError. Let's fail silently in this situation.\n }\n // See https://wiki.mozilla.org/QA/Youtube_Embedded_Rewrite\n if (pathname.startsWith(\"/v/\") &&\n (cleaned_hostname === \"youtube.com\" ||\n cleaned_hostname === \"youtube-nocookie.com\")) {\n return true;\n }\n }\n return false;\n}\n/**\n * Workaround Youtube mixed content if upgradeToHttps is true.\n *\n * @param elem The element to change.\n * @param attr The attribute to adjust.\n */\nexport function workaroundYoutubeMixedContent(elem, attr) {\n var _a, _b;\n const elem_attr = elem.getAttribute(attr);\n const window_config = (_b = (_a = window.RufflePlayer) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {};\n if (elem_attr) {\n try {\n const url = new URL(elem_attr);\n if (url.protocol === \"http:\" &&\n window.location.protocol === \"https:\" &&\n (!(\"upgradeToHttps\" in window_config) ||\n window_config.upgradeToHttps !== false)) {\n url.protocol = \"https:\";\n elem.setAttribute(attr, url.toString());\n }\n }\n catch (err) {\n // Some invalid filenames, like `///`, could raise a TypeError. Let's fail silently in this situation.\n }\n }\n}\n/**\n * Determine if an element is a child of a node that was not supported\n * in non-HTML5 compliant browsers. If so, the element was meant to be\n * used as a fallback content.\n *\n * @param elem The element to test.\n * @returns True if the element is inside an