import{b as e,f as t,s as r,a,g as n}from"./core-CD65WG6A.js";let o=!0;const s={main:{onReady:async(e,s)=>{if(o&&(o=!1,console.warn("⚠️ EXPERIMENTAL `py-game` FEATURE")),s.hasAttribute("config")){const r=s.getAttribute("config"),{json:a,toml:n,text:o}=t(r);let i={};if(a)i=JSON.parse(o);else if(n){const{parse:e}=await import("./toml-BLBSZ43A.js");i=e(o)}if(i.packages){const t=e.interpreter.pyimport("micropip");await t.install(i.packages,{keep_going:!0}),t.destroy()}}e.interpreter.registerJsModule("_pyscript",{PyWorker(){throw new Error("Unable to use PyWorker in py-game scripts")},js_import:(...e)=>Promise.all(e.map((e=>import(e)))),get target(){return s.id}}),await e.interpreter.runPythonAsync(r);let i=a(s.textContent);s.src&&(i=await fetch(s.src).then(n));const p=s.getAttribute("target")||"canvas",c=document.getElementById(p);e.interpreter.canvas.setCanvas2D(c),await e.interpreter.runPythonAsync(i)}}};e("py-game",{config:{packages:["pygame-ce"]},configURL:new URL("./config.txt",location.href).href,interpreter:"pyodide",env:"py-game",hooks:s});
//# sourceMappingURL=py-game-C1iibhPv.js.map
