null==t?void 0:t.call_exposed_callback(e,n)}set traceObserver(e){var t;null===(t=this.instance)||void 0===t||t.set_trace_observer(e)}panic(e){var t;if(this.panicked)return;if(this.panicked=!0,e instanceof Error&&("AbortError"===e.name||e.message.includes("AbortError")))return;const n=null!==(t=null==e?void 0:e.ruffleIndexError)&&void 0!==t?t:0,r=Object.assign([],{stackIndex:-1});if(r.push("# Error Info\n"),e instanceof Error){if(r.push(`Error name: ${e.name}\n`),r.push(`Error message: ${e.message}\n`),e.stack){const t=r.push(`Error stack:\n\`\`\`\n${e.stack}\n\`\`\`\n`)-1;r.stackIndex=t}}else r.push(`Error: ${e}\n`);r.push("\n# Player Info\n"),r.push(this.debugPlayerInfo()),r.push("\n# Page Info\n"),r.push(`Page URL: ${document.location.href}\n`),this.swfUrl&&r.push(`SWF URL: ${this.swfUrl}\n`),r.push("\n# Browser Info\n"),r.push(`Useragent: ${window.navigator.userAgent}\n`),r.push(`OS: ${window.navigator.platform}\n`),r.push("\n# Ruffle Info\n"),r.push("Version: 0.1.0\n"),r.push("Name: nightly 2021-12-22\n"),r.push("Channel: nightly\n"),r.push("Built: 2021-12-22T00:14:15.814Z\n"),r.push("Commit: 74ab24c0c3345025a1b7297c526c37783ecc9990\n"),r.push(`Is extension: ${this.isExtension}\n`);const i=r.join(""),o=document.location.href.split(/[?#]/)[0];let a,s,c=`https://github.com/ruffle-rs/ruffle/issues/new?title=${encodeURIComponent(`Error on ${o}`)}&labels=error-report&body=`,u=encodeURIComponent(i);switch(r.stackIndex>-1&&String(c+u).length>8195&&(r[r.stackIndex]=null,u=encodeURIComponent(r.join(""))),c+=u,n){case 2:a='\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 ',s=`\n Web Demo \n Desktop Application \n `;break;case 4:a="\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 ",s='\n View Ruffle Wiki \n View Error Details \n ';break;case 9:a='\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 ',s='\n View Ruffle Wiki \n View Error Details \n ';break;case 8:a='\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 ',s='\n View Ruffle Wiki \n View Error Details \n ';break;case 10:a="\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 ",s='\n View Error Details \n ';break;case 6:a='\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 ',s='\n View Ruffle Wiki \n View Error Details \n ';break;case 3:a="\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 ",s='\n View Ruffle Wiki \n View Error Details \n ';break;case 7:a="\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 ",s='\n View Error Details \n ';break;case 5:a="\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 ",s=`\n Report Bug \n View Error Details \n `;break;case 1:a='\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 ',s='\n View Ruffle Wiki \n View Error Details \n ';break;default:a="\n Ruffle has encountered a major issue whilst trying to display this Flash content.
\n This isn't supposed to happen, so we'd really appreciate if you could file a bug!
\n ",s=`\n Report Bug \n View Error Details \n `}this.container.innerHTML=`\n \n
Something went wrong :(
\n
${a}
\n \n
\n `;const l=this.container.querySelector("#panic-view-details");l&&(l.onclick=()=>{const e=this.container.querySelector("#panic-body");return e.classList.add("details"),e.innerHTML=``,!1}),this.destroy()}displayRootMovieDownloadFailedMessage(){const e=new URL(this.swfUrl);if(window.location.origin==e.origin||!this.isExtension||!window.location.protocol.includes("http")){const e=new Error("Failed to fetch: "+this.swfUrl);return e.ruffleIndexError=10,void this.panic(e)}const t=document.createElement("div");t.id="message_overlay",t.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
`,this.container.prepend(t)}displayUnsupportedMessage(){const e=document.createElement("div");e.id="message_overlay",e.innerHTML='\n
Flash Player has been removed from browsers in 2021.
\n
This content is not yet supported by the Ruffle emulator and will likely not run as intended.
\n
\n
',this.container.prepend(e),e.querySelector("#run-anyway-btn").onclick=()=>{e.parentNode.removeChild(e)}}displayMessage(e){const t=document.createElement("div");t.id="message_overlay",t.innerHTML=`\n
${e}
\n
\n continue \n
\n
`,this.container.prepend(t),this.container.querySelector("#continue-btn").onclick=()=>{t.parentNode.removeChild(t)}}debugPlayerInfo(){var e,t;return`Allows script access: ${null!==(t=null===(e=this.options)||void 0===e?void 0:e.allowScriptAccess)&&void 0!==t&&t}\n`}setMetadata(e){this._metadata=e,this._readyState=2,this.dispatchEvent(new Event(ce.LOADED_METADATA)),this.dispatchEvent(new Event(ce.LOADED_DATA))}setIsExtension(e){this.isExtension=e}}function ue(e,t){switch(e||(e="sameDomain"),e.toLowerCase()){case"always":return!0;case"never":return!1;default:try{return new URL(window.location.href).origin===new URL(t,window.location.href).origin}catch(e){return!1}}}function le(e){return null===e||"true"===e.toLowerCase()}function _e(e){if(e){let t="";try{t=new URL(e,ie).pathname}catch(e){}if(t&&t.length>=4){const e=t.slice(-4).toLowerCase();if(".swf"===e||".spl"===e)return!0}}return!1}function fe(e){let t=e.parentElement;for(;null!==t;){switch(t.tagName){case"AUDIO":case"VIDEO":return!0}t=t.parentElement}return!1}ce.LOADED_METADATA="loadedmetadata",ce.LOADED_DATA="loadeddata";class be extends ce{constructor(){super()}connectedCallback(){var e,t,n,r,i,o,a,s,c,u,l,_,f;super.connectedCallback();const b=this.attributes.getNamedItem("src");if(b){const d=null!==(t=null===(e=this.attributes.getNamedItem("allowScriptAccess"))||void 0===e?void 0:e.value)&&void 0!==t?t:null,g=null!==(r=null===(n=this.attributes.getNamedItem("menu"))||void 0===n?void 0:n.value)&&void 0!==r?r:null;this.load({url:b.value,allowScriptAccess:ue(d,b.value),parameters:null===(i=this.attributes.getNamedItem("flashvars"))||void 0===i?void 0:i.value,backgroundColor:null===(o=this.attributes.getNamedItem("bgcolor"))||void 0===o?void 0:o.value,base:null===(a=this.attributes.getNamedItem("base"))||void 0===a?void 0:a.value,menu:le(g),salign:null!==(c=null===(s=this.attributes.getNamedItem("salign"))||void 0===s?void 0:s.value)&&void 0!==c?c:"",quality:null!==(l=null===(u=this.attributes.getNamedItem("quality"))||void 0===u?void 0:u.value)&&void 0!==l?l:"high",scale:null!==(f=null===(_=this.attributes.getNamedItem("scale"))||void 0===_?void 0:_.value)&&void 0!==f?f:"showAll"})}}get src(){var e;return null===(e=this.attributes.getNamedItem("src"))||void 0===e?void 0:e.value}set src(e){if(null!=e){const t=document.createAttribute("src");t.value=e,this.attributes.setNamedItem(t)}else this.attributes.removeNamedItem("src")}static get observedAttributes(){return["src","width","height"]}attributeChangedCallback(e,t,n){var r;if(super.attributeChangedCallback(e,t,n),this.isConnected&&"src"===e){let e;const t=this.attributes.getNamedItem("flashvars");t&&(e=t.value);const n=this.attributes.getNamedItem("src");n&&this.load({url:n.value,parameters:e,base:null===(r=this.attributes.getNamedItem("base"))||void 0===r?void 0:r.value})}}static isInterdictable(e){var t;if(fe(e))return!1;if(!e.getAttribute("src"))return!1;const n=null===(t=e.getAttribute("type"))||void 0===t?void 0:t.toLowerCase();return n===ee.toLowerCase()||n===te.toLowerCase()||n===ne.toLowerCase()||n===re.toLowerCase()||(null==n||""===n)&&_e(e.getAttribute("src"))}static fromNativeEmbedElement(e){const t=K("ruffle-embed",be),n=document.createElement(t);return n.copyElement(e),n}}function de(e,t,n){t=t.toLowerCase();for(const n in e)if(Object.hasOwnProperty.call(e,n)&&t===n.toLowerCase())return e[n];return n}function ge(e){var t,n;const r={};for(const i of e.children)if(i instanceof HTMLParamElement){const e=null===(t=i.attributes.getNamedItem("name"))||void 0===t?void 0:t.value,o=null===(n=i.attributes.getNamedItem("value"))||void 0===n?void 0:n.value;e&&o&&(r[e]=o)}return r}class we extends ce{constructor(){super(),this.params={}}connectedCallback(){var e;super.connectedCallback(),this.params=ge(this);let t=null;this.attributes.getNamedItem("data")?t=null===(e=this.attributes.getNamedItem("data"))||void 0===e?void 0:e.value:this.params.movie&&(t=this.params.movie);const n=de(this.params,"allowScriptAccess",null),r=de(this.params,"flashvars",this.getAttribute("flashvars")),i=de(this.params,"bgcolor",this.getAttribute("bgcolor")),o=de(this.params,"base",this.getAttribute("base")),a=de(this.params,"menu",null),s=de(this.params,"salign",""),c=de(this.params,"quality","high"),u=de(this.params,"scale","showAll");if(t){const e={url:t};e.allowScriptAccess=ue(n,t),r&&(e.parameters=r),i&&(e.backgroundColor=i),o&&(e.base=o),e.menu=le(a),s&&(e.salign=s),c&&(e.quality=c),u&&(e.scale=u),this.load(e)}}debugPlayerInfo(){var e;let t=super.debugPlayerInfo();t+="Player type: Object\n";let n=null;return this.attributes.getNamedItem("data")?n=null===(e=this.attributes.getNamedItem("data"))||void 0===e?void 0:e.value:this.params.movie&&(n=this.params.movie),t+=`SWF URL: ${n}\n`,Object.keys(this.params).forEach((e=>{t+=`Param ${e}: ${this.params[e]}\n`})),Object.keys(this.attributes).forEach((e=>{var n;t+=`Attribute ${e}: ${null===(n=this.attributes.getNamedItem(e))||void 0===n?void 0:n.value}\n`})),t}get data(){return this.getAttribute("data")}set data(e){if(null!=e){const t=document.createAttribute("data");t.value=e,this.attributes.setNamedItem(t)}else this.attributes.removeNamedItem("data")}static isInterdictable(e){var t,n,r;if(fe(e))return!1;if(e.getElementsByTagName("ruffle-embed").length>0)return!1;const i=null===(t=e.attributes.getNamedItem("data"))||void 0===t?void 0:t.value.toLowerCase(),o=ge(e);let a;if(i)a=_e(i);else{if(!o||!o.movie)return!1;a=_e(o.movie)}const s=null===(n=e.attributes.getNamedItem("classid"))||void 0===n?void 0:n.value.toLowerCase();if(s==="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000".toLowerCase())return!Array.from(e.getElementsByTagName("embed")).some(be.isInterdictable);if(null!=s&&""!==s)return!1;const c=null===(r=e.attributes.getNamedItem("type"))||void 0===r?void 0:r.value.toLowerCase();return c===ee.toLowerCase()||c===te.toLowerCase()||c===ne.toLowerCase()||c===re.toLowerCase()||(null==c||""===c)&&a}static fromNativeObjectElement(e){const t=K("ruffle-object",we),n=document.createElement(t);for(const t of Array.from(e.getElementsByTagName("embed")))be.isInterdictable(t)&&t.remove();for(const t of Array.from(e.getElementsByTagName("object")))we.isInterdictable(t)&&t.remove();return n.copyElement(e),n}}var he,me;let pe;const ye=null!==(me=null===(he=window.RufflePlayer)||void 0===he?void 0:he.config)&&void 0!==me?me:{},ve=q(ye)+"ruffle.js";let xe,ke,Ee,Ae;function Se(){try{xe=null!=xe?xe:document.getElementsByTagName("object"),ke=null!=ke?ke:document.getElementsByTagName("embed");for(const e of Array.from(xe))if(we.isInterdictable(e)){const t=we.fromNativeObjectElement(e);t.setIsExtension(pe),e.replaceWith(t)}for(const e of Array.from(ke))if(be.isInterdictable(e)){const t=be.fromNativeEmbedElement(e);t.setIsExtension(pe),e.replaceWith(t)}}catch(e){console.error(`Serious error encountered when polyfilling native Flash elements: ${e}`)}}function Ce(){Ee=null!=Ee?Ee:document.getElementsByTagName("iframe"),Ae=null!=Ae?Ae:document.getElementsByTagName("frame"),[Ee,Ae].forEach((e=>{for(let t=0;t{Ie(r,i)}),!1)}}))}async function Ie(e,t){var n;let r;await new Promise((e=>{window.setTimeout((()=>{e()}),100)}));try{if(r=e.document,!r)return}catch(e){return void(pe||console.warn(t+e))}if(pe||void 0===r.documentElement.dataset.ruffleOptout)if(pe)e.RufflePlayer||(e.RufflePlayer={}),e.RufflePlayer.config=Object.assign(Object.assign({},ye),null!==(n=e.RufflePlayer.config)&&void 0!==n?n:{});else if(!e.RufflePlayer){const t=r.createElement("script");t.setAttribute("src",ve),t.onload=()=>{e.RufflePlayer={},e.RufflePlayer.config=ye},r.head.appendChild(t)}}class Re{constructor(e,t,n,r,i){this.major=e,this.minor=t,this.patch=n,this.prIdent=r,this.buildIdent=i}static fromSemver(e){const t=e.split("+"),n=t[0].split("-"),r=n[0].split("."),i=parseInt(r[0],10);let o=0,a=0,s=null,c=null;return null!=r[1]&&(o=parseInt(r[1],10)),null!=r[2]&&(a=parseInt(r[2],10)),null!=n[1]&&(s=n[1].split(".")),null!=t[1]&&(c=t[1].split(".")),new Re(i,o,a,s,c)}isCompatibleWith(e){return 0!==this.major&&this.major===e.major||0===this.major&&0===e.major&&0!==this.minor&&this.minor===e.minor||0===this.major&&0===e.major&&0===this.minor&&0===e.minor&&0!==this.patch&&this.patch===e.patch}hasPrecedenceOver(e){if(this.major>e.major)return!0;if(this.majore.minor)return!0;if(this.minore.patch)return!0;if(this.patchparseInt(e.prIdent[n],10))return!0;if(parseInt(this.prIdent[n],10)e.prIdent[n])return!0;if(this.prIdent[n]e.prIdent.length}return!1}isEqual(e){return this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}isStableOrCompatiblePrerelease(e){return null==e.prIdent||this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}}class Fe{constructor(e){this.requirements=e}satisfiedBy(e){for(let t=0;t"===i?n=n&&e.hasPrecedenceOver(o):">="===i?n=n&&(e.hasPrecedenceOver(o)||o.isEqual(e)):"<"===i?n=n&&o.hasPrecedenceOver(e):"<="===i?n=n&&(o.hasPrecedenceOver(e)||o.isEqual(e)):"^"===i&&(n=n&&o.isCompatibleWith(e))}if(n)return!0}return!1}static fromRequirementString(e){const t=e.split(" ");let n=[];const r=[];for(let e=0;e0&&(r.push(n),n=[]);else if(t[e].length>0){const r=/[0-9]/.exec(t[e]);if(r){const i=t[e].slice(0,r.index).trim(),o=Re.fromSemver(t[e].slice(r.index).trim());n.push({comparator:i,version:o})}}return n.length>0&&r.push(n),new Fe(r)}}class Te{constructor(e){this.sources={},this.config={},this.invoked=!1,this.newestName=null,this.conflict=null,null!=e&&(e instanceof Te?(this.sources=e.sources,this.config=e.config,this.invoked=e.invoked,this.conflict=e.conflict,this.newestName=e.newestName,e.superseded()):e.constructor===Object&&e.config instanceof Object?this.config=e.config:this.conflict=e),"loading"===document.readyState?window.addEventListener("DOMContentLoaded",this.init.bind(this)):window.setTimeout(this.init.bind(this),0)}get version(){return"0.1.0"}registerSource(e,t){this.sources[e]=t}newestSourceName(){let e=null,t=Re.fromSemver("0.0.0");for(const n in this.sources)if(Object.prototype.hasOwnProperty.call(this.sources,n)){const r=Re.fromSemver(this.sources[n].version);r.hasPrecedenceOver(t)&&(e=n,t=r)}return e}init(){if(!this.invoked){if(this.invoked=!0,this.newestName=this.newestSourceName(),null===this.newestName)throw new Error("No registered Ruffle source!");!1!==this.config.polyfills&&this.sources[this.newestName].polyfill("extension"===this.newestName)}}newest(){const e=this.newestSourceName();return null!=e?this.sources[e]:null}satisfying(e){const t=Fe.fromRequirementString(e);let n=null;for(const e in this.sources)if(Object.prototype.hasOwnProperty.call(this.sources,e)){const r=Re.fromSemver(this.sources[e].version);t.satisfiedBy(r)&&(n=this.sources[e])}return n}localCompatible(){return void 0!==this.sources.local?this.satisfying("^"+this.sources.local.version):this.newest()}local(){return void 0!==this.sources.local?this.satisfying("="+this.sources.local.version):this.newest()}superseded(){this.invoked=!0}static negotiate(e,t,n){let r;return r=e instanceof Te?e:new Te(e),void 0!==t&&void 0!==n&&(r.registerSource(t,n),!1!==r.config.polyfills&&n.pluginPolyfill()),r}}window.RufflePlayer=Te.negotiate(window.RufflePlayer,"local",new class{constructor(e){this.name=e}get version(){return"0.1.0"}polyfill(e){!function(e){pe=e,Se(),Ce(),new MutationObserver((function(e){e.some((e=>e.addedNodes.length>0))&&(Se(),Ce())})).observe(document,{childList:!0,subtree:!0})}(e)}pluginPolyfill(){!function(e){"install"in navigator.plugins&&navigator.plugins.install||Object.defineProperty(navigator,"plugins",{value:new J(navigator.plugins),writable:!1}),navigator.plugins.install(e),!(e.length>0)||"install"in navigator.mimeTypes&&navigator.mimeTypes.install||Object.defineProperty(navigator,"mimeTypes",{value:new G(navigator.mimeTypes),writable:!1});const t=navigator.mimeTypes;for(let n=0;n
-
-
-
-
-
-
-