"use strict";window.g_aMb=class{constructor(e,a){this.g_aog=e,this.g_aMc=a,this.g_aMd=!1,this.g_anl=()=>this.g_Jj()}g_aMe(){}g_aMf(e,a,g,_){this.g_aog.g_aMg(this.g_aMc,e,a,g,_)}g_aMh(e,a,g,_){return this.g_aog.g_aMi(this.g_aMc,e,a,g,_)}g_aMj(e,a,g){this.g_aog.g_aMk()?this.g_aMf(e,a,g):this.g_aog.g_aMl()._OnMessageFromDOM({type:"event",component:this.g_aMc,handler:e,dispatchOpts:g||null,data:a,responseId:null})}g_aMm(e,a){this.g_aog.g_aMn(this.g_aMc,e,a)}g_aMo(e){for(const[a,g]of e)this.g_aMm(a,g)}g_aMp(){return this.g_aog}g_aMq(){return this.g_aMc}g_abF(){this.g_aMd||(this.g_aog.g_aMr(this.g_anl),this.g_aMd=!0)}g_abq(){this.g_aMd&&(this.g_aog.g_aMs(this.g_anl),this.g_aMd=!1)}g_Jj(){}},"use strict",window.g_aMt=class extends g_aMb{constructor(e,a){super(e,a),this.g_aMu=new Map,this.g_aMv=!0,this.g_aMm("create",e=>this.g_aMw(e)),this.g_aMm("destroy",e=>this.g_aMx(e)),this.g_aMm("set-visible",e=>this.g_aMy(e)),this.g_aMm("update-position",e=>this.g_aMz(e)),this.g_aMm("update-state",e=>this.g_aDS(e)),this.g_aMm("focus",e=>this.g_aMA(e)),this.g_aMm("set-css-style",e=>this.g_aMB(e))}g_aMC(e){this.g_aMv=!!e}g_aMD(e,g){this.g_aMm(e,e=>{const a=e.elementId,_=this.g_aMu.get(a);return g(_,e)})}g_aMw(e){const a=e.elementId,g=this.g_acd(a,e);this.g_aMu.set(a,g),e.isVisible||(g.style.display="none"),this.g_aMv&&document.body.appendChild(g)}g_acd(){throw new Error("required override")}g_aME(){}g_aMx(e){const a=e.elementId,g=this.g_aMu.get(a);this.g_aME(g),this.g_aMv&&g.parentElement.removeChild(g),this.g_aMu.delete(a)}g_aMF(e,a,g){g||(g={}),g.elementId=a,this.g_aMf(e,g)}g_aMG(e,a,g){g||(g={}),g.elementId=a,this.g_aMj(e,g)}g_aMy(e){if(this.g_aMv){const a=this.g_aMu.get(e.elementId);a.style.display=e.isVisible?"":"none"}}g_aMz(e){if(this.g_aMv){const a=this.g_aMu.get(e.elementId);a.style.left=e.left+"px",a.style.top=e.top+"px",a.style.width=e.width+"px",a.style.height=e.height+"px";const g=e.fontSize;null!==g&&(a.style.fontSize=g+"em")}}g_aDS(e){const a=this.g_aMu.get(e.elementId);this.g_aMH(a,e)}g_aMH(){throw new Error("required override")}g_aMA(e){const a=this.g_aMu.get(e.elementId);e.focus?a.focus():a.blur()}g_aMB(e){const a=this.g_aMu.get(e.elementId);a.style[e.prop]=e.val}g_aMI(e){return this.g_aMu.get(e)}},"use strict";{function _(e){return new Promise((a,g)=>{const _=document.createElement("script");_.onload=a,_.onerror=g,_.async=!1,_.src=e,document.head.appendChild(_)})}async function n(e){const a=await t(e),g=new TextDecoder("utf-8");return g.decode(a)}function t(e){return new Promise((g,_)=>{const a=new FileReader;a.onload=e=>g(e.target.result),a.onerror=e=>_(e),a.readAsArrayBuffer(e)})}const a=/(iphone|ipod|ipad)/i.test(navigator.userAgent);let o=new Audio;const r={"audio/webm; codecs=opus":!!o.canPlayType("audio/webm; codecs=opus"),"audio/ogg; codecs=opus":!!o.canPlayType("audio/ogg; codecs=opus"),"audio/webm; codecs=vorbis":!!o.canPlayType("audio/webm; codecs=vorbis"),"audio/ogg; codecs=vorbis":!!o.canPlayType("audio/ogg; codecs=vorbis"),"audio/mp4":!!o.canPlayType("audio/mp4"),"audio/mpeg":!!o.canPlayType("audio/mpeg")};o=null;const e=[];let g=0;window.RealFile=window.File;const s=[],i=new Map,u=new Map;let p=0;const l=[];self.g_aMJ=function(e){if("function"!=typeof e)throw new Error("runOnStartup called without a function");l.push(e)},window.g_aMK=class o{constructor(e){this.g_aML=e.g_aMM,this.g_aMN=null,this.g_amk="",this.g_aMO=e.g_aMP,this.g_aMQ={},this.g_aMR=null,this.g_aMS=null,this.g_aMT=[],this.g_aMU=null,this.g_akl=null,this.g_aoa=null,this.g_akU=-1,this.g_aMV=()=>this.g_aMW(),this.g_aMX=[],this.g_amp=e.g_aMY,"cordova"===this.g_amp&&this.g_aML&&(console.warn("[C3 runtime] Worker mode is enabled and supported, but is disabled in Cordova due to crbug.com/939775. Reverting to DOM mode."),this.g_aML=!1),/CrOS/.test(navigator.userAgent)&&(console.warn("[C3 runtime] Worker mode is enabled and supported, but is disabled in Chrome OS due to reports of crashes. Reverting to DOM mode."),this.g_aML=!1),this.g_aMZ=!1,this.g_aM_=null,("html5"===this.g_amp||"playable-ad"===this.g_amp)&&"file"===location.protocol.substr(0,4)&&alert("Exported games won't work until you upload them. (When running on the file: protocol, browsers block many features from working for security reasons.)"),this.g_aMn("runtime","cordova-fetch-local-file",e=>this.g_aM$(e)),this.g_aMn("runtime","create-job-worker",e=>this.g_aNa(e)),"cordova"===this.g_amp?document.addEventListener("deviceready",()=>this.g_aat(e)):this.g_aat(e)}g_em(){this.g_aNb(),this.g_aMN&&(this.g_aMN.onmessage=null,this.g_aMN=null),this.g_aMR&&(this.g_aMR.terminate(),this.g_aMR=null),this.g_aMS&&(this.g_aMS.g_em(),this.g_aMS=null),this.g_akl&&(this.g_akl.parentElement.removeChild(this.g_akl),this.g_akl=null)}g_aNc(){return this.g_akl}g_fg(){return this.g_amk}g_aMk(){return this.g_aML}g_apG(){return this.g_amp}g_aoy(){return"cordova"===this.g_amp&&a}g_aNd(){return"cordova"===this.g_amp&&!1===a}async g_aat(e){if("playable-ad"===this.g_amp){this.g_aM_=self.c3_base64files,await this.g_aNe();for(let a=0,g=e.g_aNf.length;athis._OnMessageFromRuntime(e.data),window.c3_addPortMessageHandler&&window.c3_addPortMessageHandler(e=>this.g_aNi(e)),this.g_aoa=new self.g_aNj(this),await this.g_aoa.g_ahs(),this.g_aNk(),"object"==typeof window.StatusBar&&window.StatusBar.hide(),"object"==typeof window.AndroidFullScreen&&window.AndroidFullScreen.immersiveMode(),await this.g_aNl(),this.g_aML?await this.g_aNm(e,a.port2):await this.g_aNn(e,a.port2)}g_aNo(e){return this.g_aMQ.hasOwnProperty(e)?this.g_aMQ[e]:e.endsWith("../../../workermain.html")&&this.g_aMQ.hasOwnProperty("workermain.html")?this.g_aMQ["workermain.js"]:"playable-ad"===this.g_amp&&this.g_aM_.hasOwnProperty(e.toLowerCase())?URL.createObjectURL(this.g_aM_[e.toLowerCase()]):e}async g_aNp(g,a,_){if(g.startsWith("blob:"))return new Worker(g,_);if(this.g_aoy()){const a=await this.g_As(this.g_aMO+g),e=new Blob([a],{type:"application/javascript"});return new Worker(URL.createObjectURL(e),_)}const n=new URL(g%2ca.html),t=location.origin!==n.origin;if(t){const e=await fetch(n);if(!e.ok)throw new Error("failed to fetch worker script");const a=await e.blob();return new Worker(URL.createObjectURL(a),_)}return new Worker(n,_)}g_aNk(){if(this.g_aoy()){const g=document.documentElement.style,a=document.body.style,_=window.innerWidthnew e(this)),this.g_aNy(),self.c3_callFunction=(e,a)=>this.g_aMU.g_SY(e,a),"preview"===this.g_amp&&(self.goToLastErrorScript=()=>this.g_aMg("runtime","go-to-last-error-script"))}async g_aNn(a,g){this.g_akl=document.createElement("canvas"),this.g_akl.style.display="none",document.body.appendChild(this.g_akl),window.c3canvas=this.g_akl,this.g_aMT=s.map(e=>new e(this)),this.g_aNy();const n=a.g_aNf.map(e=>new URL(e%2cthis.html).toString());if(Array.isArray(a.g_aNv)&&n.unshift(...a.g_aNv),await Promise.all(n.map(a=>_(a))),a.g_aNz&&0_(a[1]))),Object.values(e).some(e=>!e))return void self.setTimeout(()=>this.g_aNA(e),100)}catch(g){return console.error("[Preview] Error loading project scripts: ",g),void self.setTimeout(()=>this.g_aNA(e),100)}}if("preview"===this.g_amp&&"object"!=typeof self.g_aQ.g_aMa)return console.error("[C3 runtime] Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax."),void alert("Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax.");const t=Object.assign(this.g_aNq(a),{isInWorker:!1,messagePort:g,canvas:this.g_akl,runOnStartupFunctions:l});this.g_aMS=self.C3_CreateRuntime(t),await self.C3_InitRuntime(this.g_aMS,t)}g_aNA(e){const a=Object.entries(e).filter(e=>!e[1]).map(e=>e[0]),g=`Failed to load project script '${a[0]}'. Check all your JavaScript code has valid syntax.`;console.error("[Preview] "+g),alert(g)}async g_aNa(){const e=await this.g_aoa.g_aNB();return{outputPort:e,transferables:[e]}}g_aMl(){if(this.g_aML)throw new Error("not available in worker mode");return this.g_aMS}g_aMg(g,a,_,n,t){this.g_aMN.postMessage({type:"event",component:g,handler:a,dispatchOpts:n||null,data:_,responseId:null},this.g_aMZ?void 0:t)}g_aMi(_,a,n,t,i){const e=p++,o=new Promise((g,a)=>{u.set(e,{resolve:g,reject:a})});return this.g_aMN.postMessage({type:"event",component:_,handler:a,dispatchOpts:t||null,data:n,responseId:e},this.g_aMZ?void 0:i),o}["_OnMessageFromRuntime"](e){const a=e.type;if("event"===a)this.g_aNC(e);else if("result"===a)this.g_aND(e);else if("runtime-ready"===a)this.g_aNE();else if("alert"===a)alert(e.message);else throw new Error(`unknown message '${a}'`)}g_aNC(_){const n=_.component,t=_.handler,a=_.data,o=_.responseId,e=i.get(n);if(!e)return void console.warn(`[DOM] No event handlers for component '${n}'`);const r=e.get(t);if(!r)return void console.warn(`[DOM] No handler '${t}' for component '${n}'`);let g=null;try{g=r(a)}catch(e){return console.error(`Exception in '${n}' handler '${t}':`,e),void(null!==o&&this.g_aNF(o,!1,e.toString()))}null!==o&&(g&&g.then?g.then(e=>this.g_aNF(o,!0,e)).catch(e=>{console.error(`Rejection from '${n}' handler '${t}':`,e),this.g_aNF(o,!1,e.toString())}):this.g_aNF(o,!0,g))}g_aNF(e,a,g){let _;g&&g.transferables&&(_=g.transferables),this.g_aMN.postMessage({type:"result",responseId:e,isOk:a,result:g},_)}g_aND(g){const a=g.responseId,_=g.isOk,n=g.result,t=u.get(a);_?t.resolve(n):t.reject(n),u.delete(a)}g_aMn(e,a,g){let _=i.get(e);if(_||(_=new Map,i.set(e,_)),_.has(a))throw new Error(`[DOM] Component '${e}' already has handler '${a}'`);_.set(a,g)}static g_aNG(e){if(s.includes(e))throw new Error("DOM handler already added");s.push(e)}g_aNy(){for(const e of this.g_aMT)if("runtime"===e.g_aMq())return void(this.g_aMU=e);throw new Error("cannot find runtime DOM handler")}g_aNi(e){this.g_aMg("debugger","message",e)}g_aNE(){for(const e of this.g_aMT)e.g_aMe()}static g_alw(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement)}async g_aNH(){return await this.g_aMi("runtime","get-remote-preview-status-info")}g_aMr(e){this.g_aMX.push(e),this.g_aNI()}g_aMs(e){const a=this.g_aMX.indexOf(e);if(-1===a)throw new Error("invalid callback");this.g_aMX.splice(a,1),this.g_aMX.length||this.g_aNb()}g_aNI(){-1===this.g_akU&&this.g_aMX.length&&(this.g_akU=requestAnimationFrame(this.g_aMV))}g_aNb(){-1!==this.g_akU&&(cancelAnimationFrame(this.g_akU),this.g_akU=-1)}g_aMW(){this.g_akU=-1;for(const e of this.g_aMX)e();this.g_aNI()}g_aNJ(e){this.g_aMU.g_aNJ(e)}g_aNK(e){this.g_aMU.g_aNK(e)}g_aNL(){this.g_aMU.g_aNL()}g_aEC(e){this.g_aMU.g_aEC(e)}g_AP(e){return!!r[e]}async g_adu(e){const a=await this.g_aMi("runtime","opus-decode",{arrayBuffer:e},null,[e]);return new Float32Array(a)}g_fS(e){return /^(?:[a-z]+:)?\/\//.test(e)||"data:"===e.substr(0,5)||"blob:"===e.substr(0,5)}g_fT(e){return!this.g_fS(e)}async g_aM$(e){const a=e.filename;switch(e.as){case"text":return await this.g_At(a);case"buffer":return await this.g_As(a);default:throw new Error("unsupported type");}}g_aNM(e){const g=window.cordova.file.applicationDirectory+"www/"+e.toLowerCase();return new Promise((e,a)=>{window.resolveLocalFileSystemURL(g,g=>{g.file(e,a)},a)})}async g_At(e){const a=await this.g_aNM(e);return await n(a)}g_aNN(){if(e.length&&!(8<=g)){g++;const _=e.shift();this.g_aNO(_.filename,_.g_aNP,_.g_aNQ)}}g_As(_){return new Promise((n,t)=>{e.push({filename:_,g_aNP:e=>{g--,this.g_aNN(),n(e)},g_aNQ:e=>{g--,this.g_aNN(),t(e)}}),this.g_aNN()})}async g_aNO(g,a,e){try{const _=await this.g_aNM(g),n=await t(_);a(n)}catch(g){e(g)}}async g_aNe(){const e=[];for(const[a,g]of Object.entries(this.g_aM_))e.push(this.g_aNR(a,g));await Promise.all(e)}async g_aNR(e,a){if("object"==typeof a)this.g_aM_[e]=new Blob([a.str],{type:a.type});else{const g=await fetch(a),_=await g.blob();this.g_aM_[e]=_}}g_aNl(){let e=null;const g=new Promise(a=>e=a),_=new ArrayBuffer(1),n=new MessageChannel;return n.port2.onmessage=a=>{a.data&&a.data.arrayBuffer||(this.g_aMZ=!0,console.warn("MessageChannel transfers determined to be broken. Disabling transferables.")),e()},n.port1.postMessage({arrayBuffer:_},[_]),g}}}{function _(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||e.originalEvent&&e.originalEvent.sourceCapabilities&&e.originalEvent.sourceCapabilities.firesTouchEvents}function t(e){return new Promise((a,g)=>{const _=document.createElement("link");_.onload=()=>a(_),_.onerror=e=>g(e),_.rel="stylesheet",_.href=e,document.head.appendChild(_)})}function a(e){return new Promise((a,g)=>{const _=new Image;_.onload=()=>a(_),_.onerror=e=>g(e),_.src=e})}async function r(e){const g=URL.createObjectURL(e);try{return await a(g)}finally{URL.revokeObjectURL(g)}}function s(e){do{if(e.parentNode&&e.hasAttribute("contenteditable"))return!0;e=e.parentNode}while(e);return!1}function d(e){const a=e.target.tagName.toLowerCase();l.has(a)&&e.preventDefault()}function e(e){(e.metaKey||e.ctrlKey)&&e.preventDefault()}function g(){try{return window.parent&&window.parent.document.hasFocus()}catch(e){return!1}}const u=new Map([["OSLeft","MetaLeft"],["OSRight","MetaRight"]]),i={dispatchRuntimeEvent:!0,dispatchUserScriptEvent:!0},p={dispatchUserScriptEvent:!0},c={dispatchRuntimeEvent:!0},l=new Set(["canvas","body","html"]);self.C3_RasterSvgImage=async function(g,a,_){const n=document.createElement("canvas");n.width=a,n.height=_;const t=n.getContext("2d");return t.drawImage(g,0,0,a,_),n};let R=!1;document.addEventListener("pause",()=>R=!0),document.addEventListener("resume",()=>R=!1);const n=class extends g_aMb{constructor(g){super(g,"runtime"),this.g_aNS=!0,this.g_aNT=-1,this.g_aNU="any",this.g_aNV=!1,this.g_aNW=!1,this.g_aNX=null,g.g_aMn("canvas","update-size",e=>this.g_aNY(e)),g.g_aMn("runtime","invoke-download",e=>this.g_aNZ(e)),g.g_aMn("runtime","raster-svg-image",e=>this.g_aN_(e)),g.g_aMn("runtime","set-target-orientation",e=>this.g_aN$(e)),g.g_aMn("runtime","register-sw",()=>this.g_aOa()),g.g_aMn("runtime","post-to-debugger",e=>this.g_aOb(e)),g.g_aMn("runtime","go-to-script",e=>this.g_aOb(e)),g.g_aMn("runtime","before-start-ticking",()=>this.g_aOc()),g.g_aMn("runtime","debug-highlight",e=>this.g_aOd(e)),g.g_aMn("runtime","enable-device-orientation",()=>this.g_aOe()),g.g_aMn("runtime","enable-device-motion",()=>this.g_aOf()),g.g_aMn("runtime","add-stylesheet",e=>this.g_aOg(e));const _=new Set(["input","textarea","datalist"]);window.addEventListener("contextmenu",e=>{const a=e.target,g=a.tagName.toLowerCase();_.has(g)||s(a)||e.preventDefault()}),window.addEventListener("selectstart",d),window.addEventListener("gesturehold",d),window.addEventListener("touchstart",d,{passive:!1});const a=g.g_aNc();"undefined"==typeof PointerEvent?a.addEventListener("touchstart",d):(window.addEventListener("pointerdown",d,{passive:!1}),a.addEventListener("pointerdown",d)),this.g_aOh=0,window.addEventListener("mousedown",e=>{1===e.button&&e.preventDefault()}),window.addEventListener("mousewheel",e,{passive:!1}),window.addEventListener("wheel",e,{passive:!1}),window.addEventListener("resize",()=>this.g_alj()),this.g_aOi=new Set,this.g_aOj=new WeakSet,this.g_aDK=!1}g_aOc(){return document.addEventListener("visibilitychange",()=>this.g_aoc(document.hidden)),document.addEventListener("pause",()=>this.g_aoc(!0)),document.addEventListener("resume",()=>this.g_aoc(!1)),{isSuspended:!!(document.hidden||R)}}g_aMe(){window.addEventListener("focus",()=>this.g_aOk("window-focus")),window.addEventListener("blur",()=>{this.g_aOk("window-blur",{parentHasFocus:g()}),this.g_aOh=0}),window.addEventListener("fullscreenchange",()=>this.g_alk()),window.addEventListener("webkitfullscreenchange",()=>this.g_alk()),window.addEventListener("mozfullscreenchange",()=>this.g_alk()),window.addEventListener("fullscreenerror",e=>this.g_all(e)),window.addEventListener("webkitfullscreenerror",e=>this.g_all(e)),window.addEventListener("mozfullscreenerror",e=>this.g_all(e)),window.addEventListener("keydown",e=>this.g_aOl("keydown",e)),window.addEventListener("keyup",e=>this.g_aOl("keyup",e)),window.addEventListener("dblclick",e=>this.g_aOm("dblclick",e,i)),window.addEventListener("wheel",e=>this.g_aOn("wheel",e)),"undefined"==typeof PointerEvent?(window.addEventListener("mousedown",e=>this.g_aOo("pointerdown",e)),window.addEventListener("mousemove",e=>this.g_aOo("pointermove",e)),window.addEventListener("mouseup",e=>this.g_aOo("pointerup",e)),window.addEventListener("touchstart",e=>this.g_aOp("pointerdown",e)),window.addEventListener("touchmove",e=>this.g_aOp("pointermove",e)),window.addEventListener("touchend",e=>this.g_aOp("pointerup",e)),window.addEventListener("touchcancel",e=>this.g_aOp("pointercancel",e))):(window.addEventListener("pointerdown",e=>this.g_aOq("pointerdown",e)),window.addEventListener("pointermove",e=>this.g_aOq("pointermove",e)),window.addEventListener("pointerup",e=>this.g_aOq("pointerup",e)),window.addEventListener("pointercancel",e=>this.g_aOq("pointercancel",e)));const e=()=>this.g_aNL();window.addEventListener("pointerup",e,!0),window.addEventListener("touchend",e,!0),window.addEventListener("click",e,!0),window.addEventListener("keydown",e,!0),window.addEventListener("gamepadconnected",e,!0)}g_aOk(e,a){this.g_aMf(e,a||null,c)}g_alj(){const e=window.innerWidth,a=window.innerHeight;this.g_aOk("window-resize",{innerWidth:e,innerHeight:a,devicePixelRatio:window.devicePixelRatio}),this.g_aog.g_aoy()&&(-1!==this.g_aNT&&clearTimeout(this.g_aNT),this.g_aOr(e,a,0))}g_aOs(e,a,g){-1!==this.g_aNT&&clearTimeout(this.g_aNT),this.g_aNT=setTimeout(()=>this.g_aOr(e,a,g),48)}g_aOr(g,a,_){const n=window.innerWidth,t=window.innerHeight;this.g_aNT=-1,n!=g||t!=a?this.g_aOk("window-resize",{innerWidth:n,innerHeight:t,devicePixelRatio:window.devicePixelRatio}):10>_&&this.g_aOs(n,t,_+1)}g_aN$(e){this.g_aNU=e.targetOrientation}g_aOt(){const e=this.g_aNU;if(screen.orientation&&screen.orientation.lock)screen.orientation.lock(e).catch(e=>console.warn("[Construct 3] Failed to lock orientation: ",e));else try{let a=!1;screen.lockOrientation?a=screen.lockOrientation(e):screen.webkitLockOrientation?a=screen.webkitLockOrientation(e):screen.mozLockOrientation?a=screen.mozLockOrientation(e):screen.msLockOrientation&&(a=screen.msLockOrientation(e)),a||console.warn("[Construct 3] Failed to lock orientation")}catch(e){console.warn("[Construct 3] Failed to lock orientation: ",e)}}g_alk(){const e=g_aMK.g_alw();e&&"any"!==this.g_aNU&&this.g_aOt(),this.g_aMf("fullscreenchange",{isFullscreen:e,innerWidth:window.innerWidth,innerHeight:window.innerHeight})}g_all(e){console.warn("[Construct 3] Fullscreen request failed: ",e),this.g_aMf("fullscreenerror",{isFullscreen:g_aMK.g_alw(),innerWidth:window.innerWidth,innerHeight:window.innerHeight})}g_aoc(e){e?this.g_aog.g_aNb():this.g_aog.g_aNI(),this.g_aMf("visibilitychange",{hidden:e})}g_aOl(e,a){const g=u.get(a.code)||a.code;this.g_aMj(e,{code:g,key:a.key,which:a.which,repeat:a.repeat,altKey:a.altKey,ctrlKey:a.ctrlKey,metaKey:a.metaKey,shiftKey:a.shiftKey,timeStamp:a.timeStamp},i)}g_aOn(e,a){this.g_aMf(e,{clientX:a.clientX,clientY:a.clientY,deltaX:a.deltaX,deltaY:a.deltaY,deltaZ:a.deltaZ,deltaMode:a.deltaMode,timeStamp:a.timeStamp},i)}g_aOm(a,e,g){_(e)||("mousedown"===a&&window!==window.top&&window.focus(),this.g_aMj(a,{button:e.button,buttons:e.buttons,clientX:e.clientX,clientY:e.clientY,timeStamp:e.timeStamp},g))}g_aOo(a,e){if(!_(e)){"pointerdown"===a&&window!==window.top&&window.focus();const g=this.g_aOh;"pointerdown"===a&&0!==g?a="pointermove":"pointerup"==a&&0!==e.buttons&&(a="pointermove"),this.g_aMj(a,{pointerId:1,pointerType:"mouse",button:e.button,buttons:e.buttons,lastButtons:g,clientX:e.clientX,clientY:e.clientY,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,timeStamp:e.timeStamp},i),this.g_aOh=e.buttons,this.g_aOm(e.type,e,p)}}g_aOq(e,a){"pointerdown"===e&&window!==window.top&&window.focus();let g=0;if("mouse"===a.pointerType&&(g=this.g_aOh),this.g_aMj(e,{pointerId:a.pointerId,pointerType:a.pointerType,button:a.button,buttons:a.buttons,lastButtons:g,clientX:a.clientX,clientY:a.clientY,width:a.width||0,height:a.height||0,pressure:a.pressure||0,tangentialPressure:a.tangentialPressure||0,tiltX:a.tiltX||0,tiltY:a.tiltY||0,twist:a.twist||0,timeStamp:a.timeStamp},i),"mouse"===a.pointerType){let g="mousemove";"pointerdown"===e?g="mousedown":"pointerup"==e&&(g="pointerup"),this.g_aOm(g,a,p),this.g_aOh=a.buttons}}g_aOp(e,a){"pointerdown"===e&&window!==window.top&&window.focus();for(let g=0,_=a.changedTouches.length;g<_;++g){const _=a.changedTouches[g];this.g_aMj(e,{pointerId:_.identifier,pointerType:"touch",button:0,buttons:0,lastButtons:0,clientX:_.clientX,clientY:_.clientY,width:2*(_.radiusX||_.webkitRadiusX||0),height:2*(_.radiusY||_.webkitRadiusY||0),pressure:_.force||_.webkitForce||0,tangentialPressure:0,tiltX:0,tiltY:0,twist:_.rotationAngle||0,timeStamp:a.timeStamp},i)}}g_aOe(){this.g_aNV||(this.g_aNV=!0,window.addEventListener("deviceorientation",e=>this.g_aAC(e)))}g_aOf(){this.g_aNW||(this.g_aNW=!0,window.addEventListener("devicemotion",e=>this.g_aAD(e)))}g_aAC(e){this.g_aMf("deviceorientation",{alpha:e.alpha||0,beta:e.beta||0,gamma:e.gamma||0,timeStamp:e.timeStamp},i)}g_aAD(_){let a=null;const n=_.acceleration;n&&(a={x:n.x||0,y:n.y||0,z:n.z||0});let t=null;const o=_.accelerationIncludingGravity;o&&(t={x:o.x||0,y:o.y||0,z:o.z||0});let e=null;const r=_.rotationRate;r&&(e={alpha:r.alpha||0,beta:r.beta||0,gamma:r.gamma||0}),this.g_aMf("devicemotion",{acceleration:a,accelerationIncludingGravity:t,rotationRate:e,interval:_.interval,timeStamp:_.timeStamp},i)}g_aNY(e){const a=this.g_aMp(),g=a.g_aNc();g.style.width=e.styleWidth+"px",g.style.height=e.styleHeight+"px",g.style.marginLeft=e.marginLeft+"px",g.style.marginTop=e.marginTop+"px",a.g_aNk(),this.g_aNS&&(g.style.display="",this.g_aNS=!1)}g_aNZ(g){const _=g.url,n=g.filename,t=document.createElement("a"),e=document.body;t.textContent=n,t.href=_,t.download=n,e.appendChild(t),t.click(),e.removeChild(t)}async g_aN_(_){const a=_.blob,n=_.width,t=_.height,e=await r(a),i=await self.C3_RasterSvgImage(e,n,t);return await createImageBitmap(i)}async g_aOg(e){await t(e.url)}g_aNL(){const e=[...this.g_aOi];if(this.g_aOi.clear(),!this.g_aDK)for(const g of e){const e=g.play();e&&e.catch(()=>{this.g_aOj.has(g)||this.g_aOi.add(g)})}}g_aNJ(e){if("function"!=typeof e.play)throw new Error("missing play function");this.g_aOj.delete(e);let a;try{a=e.play()}catch(a){return void this.g_aOi.add(e)}a&&a.catch(()=>{this.g_aOj.has(e)||this.g_aOi.add(e)})}g_aNK(e){this.g_aOi.delete(e),this.g_aOj.add(e)}g_aEC(e){this.g_aDK=!!e}g_aOd(e){const a=e.show;if(!a)return void(this.g_aNX&&(this.g_aNX.style.display="none"));this.g_aNX||(this.g_aNX=document.createElement("div"),this.g_aNX.id="inspectOutline",document.body.appendChild(this.g_aNX));const g=this.g_aNX;g.style.display="",g.style.left=e.left-1+"px",g.style.top=e.top-1+"px",g.style.width=e.width+2+"px",g.style.height=e.height+2+"px",g.textContent=e.name}g_aOa(){window.C3_RegisterSW&&window.C3_RegisterSW()}g_aOb(e){window.c3_postToMessagePort&&(e.from="runtime",window.c3_postToMessagePort(e))}g_SY(e,a){return this.g_aMh("js-invoke-function",{name:e,params:a})}};g_aMK.g_aNG(n)}{const e=document.currentScript.src;self.g_aNj=class{constructor(a){this.g_aOu=a,this.g_amk=e?e.substr(0,e.lastIndexOf("../../../index.html")+1):a.g_fg(),this.g_aql=Math.min(navigator.hardwareConcurrency||2,16),this.g_aOv=null,this.g_aOw=[],this.g_aqj=null,this.g_aOx=null}async g_ahs(){if(this.g_aOy)throw new Error("already initialised");this.g_aOy=!0;const e=this.g_aOu.g_aNo("dispatchworker.html");this.g_aOv=await this.g_aOu.g_aNp(e,this.g_amk,{name:"DispatchWorker"});const a=new MessageChannel;this.g_aqj=a.port1,this.g_aOv.postMessage({type:"_init","in-port":a.port2},[a.port2]),this.g_aOx=await this.g_aNB()}async g_aNB(){const g=this.g_aOw.length,a=this.g_aOu.g_aNo("jobworker.html"),_=await this.g_aOu.g_aNp(a,this.g_amk,{name:"JobWorker"+g}),n=new MessageChannel,t=new MessageChannel;return this.g_aOv.postMessage({type:"_addJobWorker",port:n.port1},[n.port1]),_.postMessage({type:"init",number:g,"dispatch-port":n.port2,"output-port":t.port2},[n.port2,t.port2]),this.g_aOw.push(_),t.port1}g_aNt(){return{inputPort:this.g_aqj,outputPort:this.g_aOx,maxNumWorkers:this.g_aql}}g_aNx(){return[this.g_aqj,this.g_aOx]}}}if("use strict",window.C3_IsSupported){"undefined"!=typeof OffscreenCanvas;window.c3_runtimeInterface=new g_aMK({g_aMM:!1,g_aNu:"workermain.js",g_aNf:["scripts/c3runtime.js"],g_aMP:"scripts/",g_aNv:[],g_aMY:"html5"})}{const e=class extends g_aMb{constructor(e){super(e,"touch"),this.g_aMm("request-permission",e=>this.g_aOz(e))}async g_aOz(e){const a=e.type;let g=!0;0===a?g=await this.g_aOA():1===a&&(g=await this.g_aOB()),this.g_aMf("permission-result",{type:a,result:g})}async g_aOA(){if(!self.DeviceOrientationEvent||!self.DeviceOrientationEvent.requestPermission)return!0;try{const e=await self.DeviceOrientationEvent.requestPermission();return"granted"===e}catch(e){return console.warn("[Touch] Failed to request orientation permission: ",e),!1}}async g_aOB(){if(!self.DeviceMotionEvent||!self.DeviceMotionEvent.requestPermission)return!0;try{const e=await self.DeviceMotionEvent.requestPermission();return"granted"===e}catch(e){return console.warn("[Touch] Failed to request motion permission: ",e),!1}}};g_aMK.g_aNG(e)}{const e=class extends g_aMb{constructor(e){super(e,"browser"),this.g_amp="",this.g_aMm("get-initial-state",e=>this.g_aOC(e)),this.g_aMm("ready-for-sw-messages",()=>this.g_aOD()),this.g_aMm("alert",e=>this.g_aOE(e)),this.g_aMm("close",()=>this.g_aOF()),this.g_aMm("set-focus",e=>this.g_aMA(e)),this.g_aMm("vibrate",e=>this.g_aOG(e)),this.g_aMm("lock-orientation",e=>this.g_aOH(e)),this.g_aMm("unlock-orientation",()=>this.g_aOI()),this.g_aMm("navigate",e=>this.g_aOJ(e)),this.g_aMm("request-fullscreen",e=>this.g_aOK(e)),this.g_aMm("exit-fullscreen",()=>this.g_aOL()),window.addEventListener("online",()=>this.g_aCb(!0)),window.addEventListener("offline",()=>this.g_aCb(!1)),document.addEventListener("backbutton",()=>this.g_aOM()),"undefined"!=typeof Windows&&Windows.UI.Core.SystemNavigationManager.getForCurrentView().addEventListener("backrequested",e=>this.g_aON(e))}g_aOC(e){return this.g_amp=e.exportType,{location:location.toString(),isOnline:!!navigator.onLine,referrer:document.referrer,title:document.title,isCookieEnabled:!!navigator.cookieEnabled,screenWidth:screen.width,screenHeight:screen.height,windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight,isScirraArcade:"undefined"!=typeof window.is_scirra_arcade}}g_aOD(){window.C3_RegisterSW&&window.OfflineClientInfo&&window.OfflineClientInfo.SetMessageCallback(e=>this.g_aMf("sw-message",e.data))}g_aCb(e){this.g_aMf("online-state",{isOnline:e})}g_aOM(){this.g_aMf("backbutton")}g_aON(e){e.handled=!0,this.g_aMf("backbutton")}g_aOO(){return"nwjs"===this.g_amp?nw.Window.get():null}g_aOE(e){alert(e.message)}g_aOF(){navigator.app&&navigator.app.exitApp?navigator.app.exitApp():navigator.device&&navigator.device.exitApp?navigator.device.exitApp():window.close()}g_aMA(e){const g=e.isFocus;if("nwjs"===this.g_amp){const e=this.g_aOO();g?e.focus():e.blur()}else g?window.focus():window.blur()}g_aOG(e){navigator.vibrate&&navigator.vibrate(e.pattern)}g_aOH(e){const g=e.orientation;if(screen.orientation&&screen.orientation.lock)screen.orientation.lock(g).catch(e=>console.warn("[Construct 3] Failed to lock orientation: ",e));else try{let e=!1;screen.lockOrientation?e=screen.lockOrientation(g):screen.webkitLockOrientation?e=screen.webkitLockOrientation(g):screen.mozLockOrientation?e=screen.mozLockOrientation(g):screen.msLockOrientation&&(e=screen.msLockOrientation(g)),e||console.warn("[Construct 3] Failed to lock orientation")}catch(e){console.warn("[Construct 3] Failed to lock orientation: ",e)}}g_aOI(){try{screen.orientation&&screen.orientation.unlock?screen.orientation.unlock():screen.unlockOrientation?screen.unlockOrientation():screen.webkitUnlockOrientation?screen.webkitUnlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()}catch(e){}}g_aOJ(e){const a=e.type;if("back"===a)navigator.app&&navigator.app.backHistory?navigator.app.backHistory():window.back();else if("forward"===a)window.forward();else if("home"===a)window.g_aOP();else if("reload"===a)location.reload();else if("url"===a){const a=e.url,g=e.target,_=e.exportType;"windows-uwp"===_&&"undefined"!=typeof Windows?Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(a)):navigator.app&&navigator.app.loadUrl?navigator.app.loadUrl(a,{openExternal:!0}):"cordova"===_?window.open(a,"_system"):"preview"===_?window.open(a,"_blank"):!this.g_aCa&&(2===g?window.top.location=a:1===g?window.parent.location=a:window.location=a)}else if("new-window"===a){const a=e.url,g=e.tag,_=e.exportType;"windows-uwp"===_&&"undefined"!=typeof Windows?Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(a)):navigator.app&&navigator.app.loadUrl?navigator.app.loadUrl(a,{openExternal:!0}):"cordova"===_?window.open(a,"_system"):window.open(a,g)}}g_aOK(e){const a={navigationUI:"auto"},g=e.navUI;1===g?a.navigationUI="hide":2===g&&(a.navigationUI="show");const _=document.documentElement;_.requestFullscreen?_.requestFullscreen(a):_.mozRequestFullScreen?_.mozRequestFullScreen(a):_.msRequestFullscreen?_.msRequestFullscreen(a):_.webkitRequestFullScreen&&("undefined"==typeof Element.ALLOW_KEYBOARD_INPUT?_.webkitRequestFullScreen():_.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))}g_aOL(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}};g_aMK.g_aNG(e)}{function e(e,g){return e.length===g.length&&(e===g||e.toLowerCase()===g.toLowerCase())}const a=class extends g_aMb{constructor(e){super(e,"audio"),this.g_aOQ=null,this.g_aOR=null,this.g_aOS=!1,this.g_aOT=()=>this.g_aOU(),this.g_aOV=[],this.g_aOW=[],this.g_aOX=null,this.g_aOY="",this.g_aOZ=-1,this.g_aO_=new Map,this.g_aDJ=1,this.g_aDK=!1,this.g_aDw=0,this.g_aho=1,this.g_anB=0,this.g_aDz="HRTF",this.g_aDA="inverse",this.g_aO$=600,this.g_aDF=1e4,this.g_aDG=1,this.g_aPa=!1,this.g_aPb=!1,this.g_aPc=this.g_aog.g_AP("audio/webm; codecs=opus"),this.g_aPd=new Map,this.g_aPe=new Set,this.g_aPf=!1,this.g_aPg="",this.g_aPh=null,self.C3Audio_OnMicrophoneStream=(e,a)=>this.g_aPi(e,a),this.g_aPj=null,self.C3Audio_GetOutputStream=()=>this.g_aPk(),this.g_aMo([["create-audio-context",e=>this.g_aPl(e)],["play",e=>this.g_aPm(e)],["stop",e=>this.g_aPn(e)],["stop-all",()=>this.g_aPo()],["set-paused",e=>this.g_aPp(e)],["set-volume",e=>this.g_aPq(e)],["fade-volume",e=>this.g_aPr(e)],["set-master-volume",e=>this.g_aPs(e)],["set-muted",e=>this.g_aPt(e)],["set-silent",e=>this.g_aPu(e)],["set-looping",e=>this.g_aPv(e)],["set-playback-rate",e=>this.g_aPw(e)],["seek",e=>this.g_aPx(e)],["preload",e=>this.g_aPy(e)],["unload",e=>this.g_F_(e)],["unload-all",()=>this.g_aPz()],["set-suspended",e=>this.g_aPA(e)],["add-effect",e=>this.g_aPB(e)],["set-effect-param",e=>this.g_aPC(e)],["remove-effects",e=>this.g_aPD(e)],["tick",e=>this.g_Ip(e)],["load-state",e=>this.g_aPE(e)]])}async g_aPl(e){e.isWKWebView&&(this.g_aPa=!0),this.g_aDw=e.timeScaleMode,this.g_aDz=["equalpower","HRTF","soundfield"][e.panningModel],this.g_aDA=["linear","inverse","exponential"][e.distanceModel],this.g_aO$=e.refDistance,this.g_aDF=e.maxDistance,this.g_aDG=e.rolloffFactor;const a={latencyHint:e.latencyHint};if("undefined"!=typeof AudioContext)this.g_aOQ=new AudioContext(a);else if("undefined"!=typeof webkitAudioContext)this.g_aOQ=new webkitAudioContext(a);else throw new Error("Web Audio API not supported");this.g_aOR=this.g_aOQ.createGain(),this.g_aOR.connect(this.g_aOQ.destination);const g=e.listenerPos;this.g_aOQ.listener.setPosition(g[0],g[1],g[2]),this.g_aOQ.listener.setOrientation(0,0,1,0,-1,0),window.addEventListener("pointerup",this.g_aOT,!0),window.addEventListener("touchend",this.g_aOT,!0),window.addEventListener("click",this.g_aOT,!0),window.addEventListener("keydown",this.g_aOT,!0),self.C3_GetAudioContextCurrentTime=()=>this.g_aPF();try{await Promise.all(e.preloadList.map(e=>this.g_aPG(e.originalUrl,e.url,e.type,!1)))}catch(e){console.error("[Construct 3] Preloading sounds failed: ",e)}return{sampleRate:this.g_aOQ.sampleRate}}g_aOU(){if(!this.g_aOS){const e=this.g_aOQ;"suspended"===e.state&&e.resume&&e.resume();const a=e.createBuffer(1,220,22050),g=e.createBufferSource();g.buffer=a,g.connect(e.destination),g.start(0),"running"===e.state&&(this.g_aOS=!0,window.removeEventListener("pointerup",this.g_aOT,!0),window.removeEventListener("touchend",this.g_aOT,!0),window.removeEventListener("click",this.g_aOT,!0),window.removeEventListener("keydown",this.g_aOT,!0),this.g_aOT=null)}}g_aPH(){return this.g_aOQ}g_aPF(){return this.g_aOQ.currentTime}g_aPI(){return this.g_aOR}g_aPJ(e){const a=this.g_aPd.get(e.toLowerCase());return a?a[0].g_aPK():this.g_aPI()}g_aPL(e,g){e=e.toLowerCase();let _=this.g_aPd.get(e);_||(_=[],this.g_aPd.set(e,_)),g.g_aiX(_.length),g.g_aPM(e),_.push(g),this.g_aPN(e)}g_aPN(e){let a=this.g_aPI();const g=this.g_aPd.get(e);if(g&&g.length){a=g[0].g_aPK();for(let e=0,a=g.length;e{const a=this.g_aOQ.createBuffer(1,e.length,48e3),g=a.getChannelData(0);return g.set(e),a}):new Promise((a,g)=>{this.g_aOQ.decodeAudioData(e,a,g)})}g_aNJ(e){this.g_aog.g_aNJ(e)}g_aNK(e){this.g_aog.g_aNK(e)}g_aQa(a){let g=0;for(let _=0,e=this.g_aOW.length;_g=e);a={g_aQm:0,promise:_,resolve:g},this.g_aO_.set(e,a)}a.g_aQm++}g_aQn(e){const a=this.g_aO_.get(e);if(!a)throw new Error("expected pending tag");a.g_aQm--,0===a.g_aQm&&(a.resolve(),this.g_aO_.delete(e))}g_aQo(e){e||(e=this.g_aOY);const g=this.g_aO_.get(e);return g?g.promise:Promise.resolve()}g_aQp(){if(0a.g_VJ()).map(a=>a.g_aQq());this.g_aMf("state",{tickCount:this.g_aOZ,audioInstances:a,analysers:[...this.g_aPe].map(a=>a.g_aQr())}),0===a.length&&0===this.g_aPe.size&&this.g_abq()}g_aQs(e,a){this.g_aMf("trigger",{type:e,tag:a})}async g_aPm(_){const a=_.originalUrl,n=_.url,t=_.type,o=_.isMusic,e=_.tag,r=_.isLooping,g=_.vol,s=_.pos,i=_.panning;let d=_.off;if(0n||n>=g.length||(g[n].g_aQP(t,i,e,o),this.g_aQO())}g_aPD(e){const a=e.tag.toLowerCase(),g=this.g_aPd.get(a);if(g&&g.length){for(const e of g)e.g_em();this.g_aPd.delete(a),this.g_aPN(a)}}g_aQQ(e){this.g_aPe.add(e),this.g_aQp()}g_aQR(e){this.g_aPe.delete(e)}g_aQO(){this.g_aPf||(this.g_aPf=!0,Promise.resolve().then(()=>this.g_aQS()))}g_aQS(){const e={};for(const[a,g]of this.g_aPd)e[a]=g.map(e=>e.g_aQq());this.g_aMf("fxstate",{fxstate:e}),this.g_aPf=!1}async g_aPE(e){const g=e.saveLoadMode;if(3!==g)for(const e of this.g_aOW)e.g_aQd()&&1===g||!e.g_aQd()&&2===g||e.g_Iz();for(const g of this.g_aPd.values())for(const e of g)e.g_em();this.g_aPd.clear(),this.g_aho=e.timeScale,this.g_anB=e.gameTime;const a=e.listenerPos;this.g_aOQ.listener.setPosition(a[0],a[1],a[2]),this.g_aDK=e.isSilent,this.g_aog.g_aEC(this.g_aDK),this.g_aDJ=e.masterVolume;const _=[];for(const a of Object.values(e.effects))_.push(Promise.all(a.map(e=>this.g_aPB(e))));await Promise.all(_),await Promise.all(e.playing.map(e=>this.g_aQT(e,g))),this.g_aQp()}async g_aQT(_,a){if(3===a)return;const n=_.bufferOriginalUrl,t=_.bufferUrl,o=_.bufferType,e=_.isMusic,r=_.tag,g=_.isLooping,s=_.volume,i=_.playbackTime;if(e&&1===a)return;if(!e&&2===a)return;let d=null;try{d=await this.g_aQi(n,t,o,r,e)}catch(e){return void console.error("[Construct 3] Audio: error loading audio state: ",e)}d.g_aQU(_.pan),d.g_KQ(g,s,i,0),_.isPlaying||d.g_aQw(),d.g_aQV(_)}g_aPi(e,a){this.g_aPh&&this.g_aPh.disconnect(),this.g_aPg=a.toLowerCase(),this.g_aPh=this.g_aOQ.createMediaStreamSource(e),this.g_aPh.connect(this.g_aPJ(this.g_aPg))}g_aPk(){return this.g_aPj||(this.g_aPj=this.g_aOQ.createMediaStreamDestination(),this.g_aOR.connect(this.g_aPj)),this.g_aPj.stream}};g_aMK.g_aNG(a)}"use strict",self.g_aQh=class{constructor(g,a,_,n,t){this.g_aQW=g,this.g_aQX=a,this.g_Bd=_,this.g_ko=n,this.g_aQY=t,this.g_aQZ="",this.g_aQ_="not-loaded",this.g_Bi=null}g_em(){this.g_aQ_="not-loaded",this.g_aQW=null,this.g_Bi=null}static g_pB(g,a,_,n,t){const e="audio/webm; codecs=opus"===n&&!g.g_aPU();return t&&e&&g.g_aPV(),!t||g.g_aPT()||e?new g_aQ$(g,a,_,n,t,e):new g_aRa(g,a,_,n,t)}g_adJ(e){return"html5"===this.g_aQZ?new g_aRb(this.g_aQW,this,e):new g_aRc(this.g_aQW,this,e)}g_FU(){}g_AE(){return this.g_Bi||(this.g_Bi=this.g_FU()),this.g_Bi}g_Bj(){}g_aRd(){}g_aRe(){return"failed"===this.g_aQ_}g_aPH(){return this.g_aQW.g_aPH()}g_aRf(){return this.g_aQZ}g_aRg(){return this.g_aQX}g_aQg(){return this.g_Bd}g_aRh(){return this.g_ko}g_aQd(){return this.g_aQY}g_afk(){}},"use strict",self.g_aRa=class extends g_aQh{constructor(g,a,_,n,t){super(g,a,_,n,t),this.g_aQZ="html5",this.g_aRi=new Audio,this.g_aRi.crossOrigin="anonymous",this.g_aRi.autoplay=!1,this.g_aRi.preload="auto",this.g_aRj=null,this.g_aRk=null,this.g_aRl=!1,this.g_aRi.addEventListener("canplaythrough",()=>this.g_aRl=!0),this.g_aRm=this.g_aPH().createGain(),this.g_aRn=null,this.g_aRi.addEventListener("canplay",()=>{this.g_aRj&&(this.g_aQ_="loaded",this.g_aRj(),this.g_aRj=null,this.g_aRk=null),this.g_aRn||!this.g_aRi||(this.g_aRn=this.g_aPH().createMediaElementSource(this.g_aRi),this.g_aRn.connect(this.g_aRm))}),this.onended=null,this.g_aRi.addEventListener("ended",()=>{this.onended&&this.onended()}),this.g_aRi.addEventListener("error",e=>this.g_aRo(e))}g_em(){this.g_aQW.g_aQa(this),this.g_aRm.disconnect(),this.g_aRm=null,this.g_aRn.disconnect(),this.g_aRn=null,this.g_aRi&&!this.g_aRi.paused&&this.g_aRi.pause(),this.onended=null,this.g_aRi=null,super.g_em()}g_FU(){return this.g_aQ_="loading",new Promise((e,a)=>{this.g_aRj=e,this.g_aRk=a,this.g_aRi.src=this.g_Bd})}g_aRo(e){console.error(`[Construct 3] Audio '${this.g_Bd}' error: `,e),this.g_aRk&&(this.g_aQ_="failed",this.g_aRk(e),this.g_aRj=null,this.g_aRk=null)}g_Bj(){const e=4<=this.g_aRi.readyState;return e&&(this.g_aRl=!0),e||this.g_aRl}g_aRd(){return this.g_Bj()}g_aRp(){return this.g_aRi}g_aRq(){return this.g_aRm}g_afk(){return this.g_aRi.duration}},"use strict",self.g_aQ$=class extends g_aQh{constructor(g,a,_,n,t,e){super(g,a,_,n,t),this.g_aQZ="webaudio",this.g_aRr=null,this.g_aRs=null,this.g_aRt=!!e}g_em(){this.g_aQW.g_aQa(this),this.g_aRr=null,this.g_aRs=null,super.g_em()}async g_aRu(){if(this.g_aRr)return this.g_aRr;const e=this.g_aQW.g_aMp();if("cordova"===e.g_apG()&&e.g_fT(this.g_Bd))this.g_aRr=await e.g_As(this.g_Bd);else{const e=await fetch(this.g_Bd);if(!e.ok)throw new Error(`error fetching audio data: ${e.status} ${e.statusText}`);this.g_aRr=await e.arrayBuffer()}}async g_aRv(){return this.g_aRs?this.g_aRs:void(this.g_aRs=await this.g_aQW.g_aP$(this.g_aRr,this.g_aRt),this.g_aRr=null)}async g_FU(){try{this.g_aQ_="loading",await this.g_aRu(),await this.g_aRv(),this.g_aQ_="loaded"}catch(e){this.g_aQ_="failed",console.error(`[Construct 3] Failed to load audio '${this.g_Bd}': `,e)}}g_Bj(){return!!(this.g_aRr||this.g_aRs)}g_aRd(){return!!this.g_aRs}g_aQE(){return this.g_aRs}g_afk(){return this.g_aRs?this.g_aRs.duration:0}},"use strict";{function _(g){return g*e}const e=180/Math.PI;self.g_aRw=class{constructor(e,a,g){this.g_aQW=e,this.g_vg=a,this.g_aRx=g,this.g_aRy=this.g_aPH().createGain(),this.g_aRy.connect(this.g_aPI()),this.g_aRz=null,this.g_aRA=!1,this.g_St=!0,this.g_aRB=!1,this.g_aRC=!1,this.g_ZC=!1,this.g_aRD=1,this.g_aRE=!1,this.g_Jw=1;const _=this.g_aQW.g_aPS();this.g_aRF=1===_&&!this.g_aQd()||2===_,this.g_aRG=-1,this.g_aRH=-1,this.g_aRI=!1}g_em(){this.g_aQW=null,this.g_vg=null,this.g_aRz&&(this.g_aRz.disconnect(),this.g_aRz=null),this.g_aRy.disconnect(),this.g_aRy=null}g_aPH(){return this.g_aQW.g_aPH()}g_aPI(){return this.g_aQW.g_aPJ(this.g_aRx)}g_aPR(){return this.g_aQW.g_aPR()}g_aRJ(){return this.g_aRF?this.g_aQW.g_EK():performance.now()/1e3}g_aRg(){return this.g_vg.g_aRg()}g_aQg(){return this.g_vg.g_aQg()}g_aRh(){return this.g_vg.g_aRh()}g_aQb(){return this.g_vg}g_aQd(){return this.g_vg.g_aQd()}g_aQk(e){this.g_aRx=e}g_aQe(){return this.g_aRx}g_aQf(){}g_aQj(){}g_Kf(){return!this.g_St&&!this.g_aRB&&!this.g_aQf()}g_VJ(){return!this.g_St&&!this.g_aQf()}g_aRK(){}g_afk(e){let a=this.g_vg.g_afk();return e&&(a/=this.g_Jw||.001),a}g_KQ(){}g_Iz(){}g_aQw(){}g_aRL(){return this.g_aRB}g_KP(){}g_aEv(e){this.g_aRD=e,this.g_aRy.gain.cancelScheduledValues(0),this.g_aRH=-1,this.g_aRy.gain.value=this.g_aRM()}g_aEw(g,_,n){if(!this.g_aRN()){g*=this.g_aPR();const a=this.g_aRy.gain;a.cancelScheduledValues(0);const t=this.g_aQW.g_aPF(),e=t+_;a.setValueAtTime(this.g_aRM(),t),a.linearRampToValueAtTime(g,e),this.g_aRD=g,this.g_aRH=e,this.g_aRI=n}}g_aQx(){this.g_aEv(this.g_aRD)}g_Jj(e){-1!==this.g_aRH&&e>=this.g_aRH&&(this.g_aRH=-1,this.g_aRI&&this.g_Iz(),this.g_aQW.g_aQs("fade-ended",this.g_aRx))}g_aRM(){const e=this.g_aRD*this.g_aPR();return isFinite(e)?e:0}g_aEu(e){e=!!e,this.g_aRE===e||(this.g_aRE=e,this.g_aQy())}g_aRN(){return this.g_aRE}g_aEl(){return this.g_aQW.g_aEl()}g_aQy(){}g_aEt(){}g_Xr(){return this.g_ZC}g_Kc(e){this.g_Jw===e||(this.g_Jw=e,this.g_aQz())}g_aQz(){}g_Kd(){return this.g_Jw}g_aEB(){}g_aoV(){}g_aQt(e){e=!!e,this.g_aRA===e||(this.g_aRA=e,this.g_aRA?(!this.g_aRz&&(this.g_aRz=this.g_aPH().createPanner(),this.g_aRz.panningModel=this.g_aQW.g_aPW(),this.g_aRz.distanceModel=this.g_aQW.g_aPX(),this.g_aRz.refDistance=this.g_aQW.g_aPY(),this.g_aRz.maxDistance=this.g_aQW.g_aPZ(),this.g_aRz.rolloffFactor=this.g_aQW.g_aP_()),this.g_aRy.disconnect(),this.g_aRy.connect(this.g_aRz),this.g_aRz.connect(this.g_aPI())):(this.g_aRz.disconnect(),this.g_aRy.disconnect(),this.g_aRy.connect(this.g_aPI())))}g_aQu(a,n,t,i,e,o){this.g_aRA&&(this.g_aQA(a,n,t),this.g_aRz.coneInnerAngle=_(i),this.g_aRz.coneOuterAngle=_(e),this.g_aRz.coneOuterGain=o)}g_aQA(e,a,g){this.g_aRA&&(this.g_aRz.setPosition(e,a,0),this.g_aRz.setOrientation(Math.cos(g),Math.sin(g),0))}g_aQv(e){this.g_aRG=e}g_CJ(){return this.g_aRG}g_aRO(){}g_aPQ(e){const a=this.g_aRz||this.g_aRy;a.disconnect(),a.connect(e)}g_aQq(){return{tag:this.g_aRx,duration:this.g_afk(),volume:this.g_aRD,isPlaying:this.g_Kf(),playbackTime:this.g_aRK(),playbackRate:this.g_Kd(),uid:this.g_aRG,bufferOriginalUrl:this.g_aRg(),bufferUrl:"",bufferType:this.g_aRh(),isMusic:this.g_aQd(),isLooping:this.g_Xr(),isMuted:this.g_aRN(),resumePosition:this.g_aRO(),pan:this.g_aRP()}}g_aQV(e){this.g_Kc(e.playbackRate),this.g_aEu(e.isMuted)}g_aRP(){if(!this.g_aRz)return null;const e=this.g_aRz;return{pos:[e.positionX.value,e.positionY.value,e.positionZ.value],orient:[e.orientationX.value,e.orientationY.value,e.orientationZ.value],cia:e.coneInnerAngle,coa:e.coneOuterAngle,cog:e.coneOuterGain,uid:this.g_aRG}}g_aQU(e){if(!e)return void this.g_aQt(!1);this.g_aQt(!0);const a=this.g_aRz;a.setPosition(...a.pos),a.setOrientation(...a.orient),a.coneInnerAngle=a.cia,a.coneOuterAngle=a.coa,a.coneOuterGain=a.cog,this.g_aRG=a.uid}}}"use strict",self.g_aRb=class extends g_aRw{constructor(e,a,g){super(e,a,g),this.g_vg.g_aRq().connect(this.g_aRy),this.g_vg.onended=()=>this.g_aRQ()}g_em(){this.g_Iz(),this.g_vg.g_aRq().disconnect(),super.g_em()}g_aRp(){return this.g_vg.g_aRp()}g_aRQ(){this.g_St=!0,this.g_aRG=-1,this.g_aQW.g_aQs("ended",this.g_aRx)}g_aQf(){return this.g_aRp().ended}g_aQj(){return!!this.g_St||this.g_aQf()}g_aRK(e){let a=this.g_aRp().currentTime;return e&&(a*=this.g_Jw),this.g_ZC||(a=Math.min(a,this.g_afk())),a}g_KQ(e,a,g){const _=this.g_aRp();if(1!==_.playbackRate&&(_.playbackRate=1),_.loop!==e&&(_.loop=e),this.g_aEv(a),_.muted&&(_.muted=!1),_.currentTime!==g)try{_.currentTime=g}catch(e){console.warn(`[Construct 3] Exception seeking audio '${this.g_vg.g_aQg()}' to position '${g}': `,e)}this.g_aQW.g_aNJ(_),this.g_St=!1,this.g_aRB=!1,this.g_ZC=e,this.g_Jw=1}g_Iz(){const e=this.g_aRp();e.paused||e.pause(),this.g_aQW.g_aNK(e),this.g_St=!0,this.g_aRB=!1,this.g_aRG=-1}g_aQw(){if(!(this.g_aRB||this.g_St||this.g_aQf())){const e=this.g_aRp();e.paused||e.pause(),this.g_aQW.g_aNK(e),this.g_aRB=!0}}g_KP(){!this.g_aRB||this.g_St||this.g_aQf()||(this.g_aQW.g_aNJ(this.g_aRp()),this.g_aRB=!1)}g_aQy(){this.g_aRp().muted=this.g_aRE||this.g_aEl()}g_aEt(e){e=!!e,this.g_ZC===e||(this.g_ZC=e,this.g_aRp().loop=e)}g_aQz(){let e=this.g_Jw;this.g_aRF&&(e*=this.g_aQW.g_Jh());try{this.g_aRp().playbackRate=e}catch(a){console.warn(`[Construct 3] Unable to set playback rate '${e}':`,a)}}g_aEB(e){if(!(this.g_St||this.g_aQf()))try{this.g_aRp().currentTime=e}catch(a){console.warn(`[Construct 3] Error seeking audio to '${e}': `,a)}}g_aRO(){return this.g_aRK()}g_aoV(e){e?this.g_Kf()?(this.g_aRp().pause(),this.g_aRC=!0):this.g_aRC=!1:this.g_aRC&&(this.g_aQW.g_aNJ(this.g_aRp()),this.g_aRC=!1)}},"use strict",self.g_aRc=class extends g_aRw{constructor(e,a,g){super(e,a,g),this.g_aRR=null,this.g_aRS=e=>this.g_aRQ(e),this.g_aRT=!0,this.g_aRU=null,this.g_anw=0,this.g_aRV=0,this.g_aRW=1}g_em(){this.g_Iz(),this.g_aRX(),this.g_aRS=null,super.g_em()}g_aRX(){this.g_aRR&&this.g_aRR.disconnect(),this.g_aRR=null,this.g_aRU=null}g_aRQ(e){this.g_aRB||this.g_aRC||e.target!==this.g_aRU||(this.g_aRT=!0,this.g_St=!0,this.g_aRG=-1,this.g_aRX(),this.g_aQW.g_aQs("ended",this.g_aRx))}g_aQf(){return!(!this.g_St&&this.g_aRR&&this.g_aRR.loop)&&!this.g_aRB&&this.g_aRT}g_aQj(){return!this.g_aRR||this.g_St||this.g_aQf()}g_aRK(e){let a=0;return a=this.g_aRB?this.g_aRV:this.g_aRJ()-this.g_anw,e&&(a*=this.g_Jw),this.g_ZC||(a=Math.min(a,this.g_afk())),a}g_KQ(e,a,g,_){this.g_aRW=1,this.g_aEv(a),this.g_aRX(),this.g_aRR=this.g_aPH().createBufferSource(),this.g_aRR.buffer=this.g_vg.g_aQE(),this.g_aRR.connect(this.g_aRy),this.g_aRU=this.g_aRR,this.g_aRR.onended=this.g_aRS,this.g_aRR.loop=e,this.g_aRR.start(_,g),this.g_aRT=!1,this.g_St=!1,this.g_aRB=!1,this.g_ZC=e,this.g_Jw=1,this.g_anw=this.g_aRJ()-g}g_Iz(){this.g_aRR&&this.g_aRR.stop(0),this.g_St=!0,this.g_aRB=!1,this.g_aRG=-1}g_aQw(){this.g_aRB||this.g_St||this.g_aQf()||(this.g_aRV=this.g_aRK(!0),this.g_ZC&&(this.g_aRV%=this.g_afk()),this.g_aRB=!0,this.g_aRR.stop(0))}g_KP(){!this.g_aRB||this.g_St||this.g_aQf()||(this.g_aRX(),this.g_aRR=this.g_aPH().createBufferSource(),this.g_aRR.buffer=this.g_vg.g_aQE(),this.g_aRR.connect(this.g_aRy),this.g_aRU=this.g_aRR,this.g_aRR.onended=this.g_aRS,this.g_aRR.loop=this.g_ZC,this.g_aQx(),this.g_aQz(),this.g_anw=this.g_aRJ()-this.g_aRV/(this.g_Jw||.001),this.g_aRR.start(0,this.g_aRV),this.g_aRB=!1)}g_aRM(){return super.g_aRM()*this.g_aRW}g_aQy(){this.g_aRW=this.g_aRE||this.g_aEl()?0:1,this.g_aQx()}g_aEt(e){e=!!e,this.g_ZC===e||(this.g_ZC=e,this.g_aRR&&(this.g_aRR.loop=e))}g_aQz(){let e=this.g_Jw;this.g_aRF&&(e*=this.g_aQW.g_Jh()),this.g_aRR&&(this.g_aRR.playbackRate.value=e)}g_aEB(e){this.g_St||this.g_aQf()||(this.g_aRB?this.g_aRV=e:(this.g_aQw(),this.g_aRV=e,this.g_KP()))}g_aRO(){return this.g_aRV}g_aoV(e){e?this.g_Kf()?(this.g_aRC=!0,this.g_aRV=this.g_aRK(!0),this.g_ZC&&(this.g_aRV%=this.g_afk()),this.g_aRR.stop(0)):this.g_aRC=!1:this.g_aRC&&(this.g_aRX(),this.g_aRR=this.g_aPH().createBufferSource(),this.g_aRR.buffer=this.g_vg.g_aQE(),this.g_aRR.connect(this.g_aRy),this.g_aRU=this.g_aRR,this.g_aRR.onended=this.g_aRS,this.g_aRR.loop=this.g_ZC,this.g_aQx(),this.g_aQz(),this.g_anw=this.g_aRJ()-this.g_aRV/(this.g_Jw||.001),this.g_aRR.start(0,this.g_aRV),this.g_aRC=!1)}g_aQV(e){super.g_aQV(e),this.g_aRV=e.resumePosition}},"use strict";{function g(e){return Math.pow(10,e/20)}function _(a){return Math.max(Math.min(g(a),1),0)}function n(e){return 20*(Math.log(e)/2.302585092994046)}function t(e){return n(Math.max(Math.min(e,1),0))}function i(e,a){return 1-Math.exp(-a*e)}class a{constructor(e){this.g_aQW=e,this.g_aOQ=e.g_aPH(),this.g_BS=-1,this.g_aRx="",this.g_ko="",this.g_aRY=null}g_em(){this.g_aOQ=null}g_aiX(e){this.g_BS=e}g_Dl(){return this.g_BS}g_aPM(e){this.g_aRx=e}g_aQe(){return this.g_aRx}g_aRZ(){return this.g_aOQ.createGain()}g_aPK(){}g_aPO(){}g_aR_(g,a,_,n){if(g.cancelScheduledValues(0),0===n)return void(g.value=a);const t=this.g_aOQ.currentTime;n+=t,0===_?g.setValueAtTime(a,n):1===_?(g.setValueAtTime(g.value,t),g.linearRampToValueAtTime(a,n)):2===_?(g.setValueAtTime(g.value,t),g.exponentialRampToValueAtTime(a,n)):void 0}g_aQq(){return{type:this.g_ko,tag:this.g_aRx,params:this.g_aRY}}}self.g_aQB=class extends a{constructor(_,a,n,t,i,e,o){super(_),this.g_ko="filter",this.g_aRY=[a,n,t,i,e,o],this.g_aR$=this.g_aRZ(),this.g_aSa=this.g_aRZ(),this.g_aSa.gain.value=o,this.g_aSb=this.g_aRZ(),this.g_aSb.gain.value=1-o,this.g_aSc=this.g_aOQ.createBiquadFilter(),this.g_aSc.type=a,this.g_aSc.frequency.value=n,this.g_aSc.detune.value=t,this.g_aSc.Q.value=i,this.g_aSc.gain.vlaue=e,this.g_aR$.connect(this.g_aSc),this.g_aR$.connect(this.g_aSb),this.g_aSc.connect(this.g_aSa)}g_em(){this.g_aR$.disconnect(),this.g_aSc.disconnect(),this.g_aSa.disconnect(),this.g_aSb.disconnect(),super.g_em()}g_aPO(e){this.g_aSa.disconnect(),this.g_aSa.connect(e),this.g_aSb.disconnect(),this.g_aSb.connect(e)}g_aPK(){return this.g_aR$}g_aQP(e,a,g,_){0===e?(a=Math.max(Math.min(a/100,1),0),this.g_aRY[5]=a,this.g_aR_(this.g_aSa.gain,a,g,_),this.g_aR_(this.g_aSb.gain,1-a,g,_)):1===e?(this.g_aRY[1]=a,this.g_aR_(this.g_aSc.frequency,a,g,_)):2===e?(this.g_aRY[2]=a,this.g_aR_(this.g_aSc.detune,a,g,_)):3===e?(this.g_aRY[3]=a,this.g_aR_(this.g_aSc.Q,a,g,_)):4===e?(this.g_aRY[4]=a,this.g_aR_(this.g_aSc.gain,a,g,_)):void 0}},self.g_aQC=class extends a{constructor(e,a,g,_){super(e),this.g_ko="delay",this.g_aRY=[a,g,_],this.g_aR$=this.g_aRZ(),this.g_aSa=this.g_aRZ(),this.g_aSa.gain.value=_,this.g_aSb=this.g_aRZ(),this.g_aSb.gain.value=1-_,this.g_aSd=this.g_aRZ(),this.g_aSe=this.g_aOQ.createDelay(a),this.g_aSe.delayTime.value=a,this.g_aSf=this.g_aRZ(),this.g_aSf.gain.value=g,this.g_aR$.connect(this.g_aSd),this.g_aR$.connect(this.g_aSb),this.g_aSd.connect(this.g_aSa),this.g_aSd.connect(this.g_aSe),this.g_aSe.connect(this.g_aSf),this.g_aSf.connect(this.g_aSd)}g_em(){this.g_aR$.disconnect(),this.g_aSa.disconnect(),this.g_aSb.disconnect(),this.g_aSd.disconnect(),this.g_aSe.disconnect(),this.g_aSf.disconnect(),super.g_em()}g_aPO(e){this.g_aSa.disconnect(),this.g_aSa.connect(e),this.g_aSb.disconnect(),this.g_aSb.connect(e)}g_aPK(){return this.g_aR$}g_aQP(g,a,n,t){0===g?(a=Math.max(Math.min(a/100,1),0),this.g_aRY[2]=a,this.g_aR_(this.g_aSa.gain,a,n,t),this.g_aR_(this.g_aSb.gain,1-a,n,t)):4===g?(this.g_aRY[1]=_(a),this.g_aR_(this.g_aSf.gain,_(a),n,t)):5===g?(this.g_aRY[0]=a,this.g_aR_(this.g_aSe.delayTime,a,n,t)):void 0}},self.g_aQD=class extends a{constructor(e,a,g,_){super(e),this.g_ko="convolution",this.g_aRY=[g,_],this.g_aSg="",this.g_aSh="",this.g_aSi="",this.g_aR$=this.g_aRZ(),this.g_aSa=this.g_aRZ(),this.g_aSa.gain.value=_,this.g_aSb=this.g_aRZ(),this.g_aSb.gain.value=1-_,this.g_aSj=this.g_aOQ.createConvolver(),this.g_aSj.normalize=g,this.g_aSj.buffer=a,this.g_aR$.connect(this.g_aSj),this.g_aR$.connect(this.g_aSb),this.g_aSj.connect(this.g_aSa)}g_em(){this.g_aR$.disconnect(),this.g_aSj.disconnect(),this.g_aSa.disconnect(),this.g_aSb.disconnect(),super.g_em()}g_aPO(e){this.g_aSa.disconnect(),this.g_aSa.connect(e),this.g_aSb.disconnect(),this.g_aSb.connect(e)}g_aPK(){return this.g_aR$}g_aQP(e,a,g,_){0===e?(a=Math.max(Math.min(a/100,1),0),this.g_aRY[1]=a,this.g_aR_(this.g_aSa.gain,a,g,_),this.g_aR_(this.g_aSb.gain,1-a,g,_)):void 0}g_aQF(e,a,g){this.g_aSg=e,this.g_aSh=a,this.g_aSi=g}g_aQq(){const e=super.g_aQq();return e.bufferOriginalUrl=this.g_aSg,e.bufferUrl="",e.bufferType=this.g_aSi,e}},self.g_aQG=class extends a{constructor(g,a,_,n,t,e){super(g),this.g_ko="flanger",this.g_aRY=[a,_,n,t,e],this.g_aR$=this.g_aRZ(),this.g_aSb=this.g_aRZ(),this.g_aSb.gain.value=1-e/2,this.g_aSa=this.g_aRZ(),this.g_aSa.gain.value=e/2,this.g_aSk=this.g_aRZ(),this.g_aSk.gain.value=t,this.g_aSe=this.g_aOQ.createDelay(a+_),this.g_aSe.delayTime.value=a,this.g_aSl=this.g_aOQ.createOscillator(),this.g_aSl.frequency.value=n,this.g_aSm=this.g_aRZ(),this.g_aSm.gain.value=_,this.g_aR$.connect(this.g_aSe),this.g_aR$.connect(this.g_aSb),this.g_aSe.connect(this.g_aSa),this.g_aSe.connect(this.g_aSk),this.g_aSk.connect(this.g_aSe),this.g_aSl.connect(this.g_aSm),this.g_aSm.connect(this.g_aSe.delayTime),this.g_aSl.start(0)}g_em(){this.g_aSl.stop(0),this.g_aR$.disconnect(),this.g_aSe.disconnect(),this.g_aSl.disconnect(),this.g_aSm.disconnect(),this.g_aSb.disconnect(),this.g_aSa.disconnect(),this.g_aSk.disconnect(),super.g_em()}g_aPO(e){this.g_aSa.disconnect(),this.g_aSa.connect(e),this.g_aSb.disconnect(),this.g_aSb.connect(e)}g_aPK(){return this.g_aR$}g_aQP(e,a,g,_){0===e?(a=Math.max(Math.min(a/100,1),0),this.g_aRY[4]=a,this.g_aR_(this.g_aSa.gain,a/2,g,_),this.g_aR_(this.g_aSb.gain,1-a/2,g,_)):6===e?(this.g_aRY[1]=a/1e3,this.g_aR_(this.g_aSm.gain,a/1e3,g,_)):7===e?(this.g_aRY[2]=a,this.g_aR_(this.g_aSl.frequency,a,g,_)):8===e?(this.g_aRY[3]=a/100,this.g_aR_(this.g_aSk.gain,a/100,g,_)):void 0}},self.g_aQH=class extends a{constructor(_,a,n,t,i,e,o){super(_),this.g_ko="phaser",this.g_aRY=[a,n,t,i,e,o],this.g_aR$=this.g_aRZ(),this.g_aSb=this.g_aRZ(),this.g_aSb.gain.value=1-o/2,this.g_aSa=this.g_aRZ(),this.g_aSa.gain.value=o/2,this.g_aSc=this.g_aOQ.createBiquadFilter(),this.g_aSc.type="allpass",this.g_aSc.frequency.value=a,this.g_aSc.detune.value=n,this.g_aSc.Q.value=t,this.g_aSl=this.g_aOQ.createOscillator(),this.g_aSl.frequency.value=e,this.g_aSm=this.g_aRZ(),this.g_aSm.gain.value=i,this.g_aR$.connect(this.g_aSc),this.g_aR$.connect(this.g_aSb),this.g_aSc.connect(this.g_aSa),this.g_aSl.connect(this.g_aSm),this.g_aSm.connect(this.g_aSc.frequency),this.g_aSl.start(0)}g_em(){this.g_aSl.stop(0),this.g_aR$.disconnect(),this.g_aSc.disconnect(),this.g_aSl.disconnect(),this.g_aSm.disconnect(),this.g_aSb.disconnect(),this.g_aSa.disconnect(),super.g_em()}g_aPO(e){this.g_aSa.disconnect(),this.g_aSa.connect(e),this.g_aSb.disconnect(),this.g_aSb.connect(e)}g_aPK(){return this.g_aR$}g_aQP(e,a,g,_){0===e?(a=Math.max(Math.min(a/100,1),0),this.g_aRY[5]=a,this.g_aR_(this.g_aSa.gain,a/2,g,_),this.g_aR_(this.g_aSb.gain,1-a/2,g,_)):1===e?(this.g_aRY[0]=a,this.g_aR_(this.g_aSc.frequency,a,g,_)):2===e?(this.g_aRY[1]=a,this.g_aR_(this.g_aSc.detune,a,g,_)):3===e?(this.g_aRY[2]=a,this.g_aR_(this.g_aSc.Q,a,g,_)):6===e?(this.g_aRY[3]=a,this.g_aR_(this.g_aSm.gain,a,g,_)):7===e?(this.g_aRY[4]=a,this.g_aR_(this.g_aSl.frequency,a,g,_)):void 0}},self.g_aQI=class extends a{constructor(e,a){super(e),this.g_ko="gain",this.g_aRY=[a],this.g_aSn=this.g_aRZ(),this.g_aSn.gain.value=a}g_em(){this.g_aSn.disconnect(),super.g_em()}g_aPO(e){this.g_aSn.disconnect(),this.g_aSn.connect(e)}g_aPK(){return this.g_aSn}g_aQP(g,a,n,t){4===g?(this.g_aRY[0]=_(a),this.g_aR_(this.g_aSn.gain,_(a),n,t)):void 0}},self.g_aQJ=class extends a{constructor(e,a,g){super(e),this.g_ko="tremolo",this.g_aRY=[a,g],this.g_aSn=this.g_aRZ(),this.g_aSn.gain.value=1-g/2,this.g_aSl=this.g_aOQ.createOscillator(),this.g_aSl.frequency.value=a,this.g_aSm=this.g_aRZ(),this.g_aSm.gain.value=g/2,this.g_aSl.connect(this.g_aSm),this.g_aSm.connect(this.g_aSn.gain),this.g_aSl.start(0)}g_em(){this.g_aSl.stop(0),this.g_aSl.disconnect(),this.g_aSm.disconnect(),this.g_aSn.disconnect(),super.g_em()}g_aPO(e){this.g_aSn.disconnect(),this.g_aSn.connect(e)}g_aPK(){return this.g_aSn}g_aQP(e,a,g,_){0===e?(a=Math.max(Math.min(a/100,1),0),this.g_aRY[1]=a,this.g_aR_(this.g_aSn.gain.value,1-a/2,g,_),this.g_aR_(this.g_aSm.gain.value,a/2,g,_)):7===e?(this.g_aRY[0]=a,this.g_aR_(this.g_aSl.frequency,a,g,_)):void 0}},self.g_aQK=class extends a{constructor(e,a,g){super(e),this.g_ko="ringmod",this.g_aRY=[a,g],this.g_aR$=this.g_aRZ(),this.g_aSa=this.g_aRZ(),this.g_aSa.gain.value=g,this.g_aSb=this.g_aRZ(),this.g_aSb.gain.value=1-g,this.g_aSo=this.g_aRZ(),this.g_aSo.gain.value=0,this.g_aSl=this.g_aOQ.createOscillator(),this.g_aSl.frequency.value=a,this.g_aSl.connect(this.g_aSo.gain),this.g_aSl.start(0),this.g_aR$.connect(this.g_aSo),this.g_aR$.connect(this.g_aSb),this.g_aSo.connect(this.g_aSa)}g_em(){this.g_aSl.stop(0),this.g_aSl.disconnect(),this.g_aSo.disconnect(),this.g_aR$.disconnect(),this.g_aSa.disconnect(),this.g_aSb.disconnect(),super.g_em()}g_aPO(e){this.g_aSa.disconnect(),this.g_aSa.connect(e),this.g_aSb.disconnect(),this.g_aSb.connect(e)}g_aPK(){return this.g_aR$}g_aQP(e,a,g,_){0===e?(a=Math.max(Math.min(a/100,1),0),this.g_aRY[1]=a,this.g_aR_(this.g_aSa.gain,a,g,_),this.g_aR_(this.g_aSb.gain,1-a,g,_)):7===e?(this.g_aRY[0]=a,this.g_aR_(this.g_aSl.frequency,a,g,_)):void 0}},self.g_aQL=class extends a{constructor(g,a,_,n,t,e){super(g),this.g_ko="distortion",this.g_aRY=[a,_,n,t,e],this.g_aR$=this.g_aRZ(),this.g_aSp=this.g_aRZ(),this.g_aSq=this.g_aRZ(),this.g_aSr(n,t),this.g_aSa=this.g_aRZ(),this.g_aSa.gain.value=e,this.g_aSb=this.g_aRZ(),this.g_aSb.gain.value=1-e,this.g_aSs=this.g_aOQ.createWaveShaper(),this.g_aSt=new Float32Array(65536),this.g_aSu(a,_),this.g_aSs.curve=this.g_aSt,this.g_aR$.connect(this.g_aSp),this.g_aR$.connect(this.g_aSb),this.g_aSp.connect(this.g_aSs),this.g_aSs.connect(this.g_aSq),this.g_aSq.connect(this.g_aSa)}g_em(){this.g_aR$.disconnect(),this.g_aSp.disconnect(),this.g_aSs.disconnect(),this.g_aSq.disconnect(),this.g_aSa.disconnect(),this.g_aSb.disconnect(),super.g_em()}g_aSr(e,g){.01>e&&(e=.01),this.g_aSp.gain.value=e,this.g_aSq.gain.value=Math.pow(1/e,.6)*g}g_aSu(e,a){for(let g,_=0;32768>_;++_)g=_/32768,g=this.g_aSv(g,e,a),this.g_aSt[32768+_]=g,this.g_aSt[32768-_-1]=-g}g_aSv(e,a,_){const n=1.05*_*a-a,t=0>e?-1:1,o=0>e?-e:e;let g=og&&(g=-g),this.g_aSythis.g_aOC()),window.addEventListener("resize",()=>this.g_aSA())}g_aOC(){return{screenWidth:screen.width,screenHeight:screen.height,windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight}}g_aSA(){this.g_aMf("window-resize",{windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight})}};g_aMK.g_aNG(e)}