miniquad_add_plugin({name:"gamepads",version:"0.1.6",register_plugin:function(e,u){const l=8;const m=28;const p=.04;globalThis.addEventListener(`gamepadconnected`,()=>{});e.env.getGamepads=t=>{const e=navigator.getGamepads();const n=u?u.memory:wasm_memory;const a=new Float32Array(n.buffer);const s=new Uint32Array(n.buffer);const o=new Uint8Array(n.buffer);for(const[r,i]of e.slice(0,l).entries()){let e=t+m*r+1;if(!i||!i.connected||i.mapping!=="standard"){o[e]=0;continue}o[e]=1;e+=3;let n=0;for(const[c,d]of i.buttons.entries()){if(c<17&&d.pressed)n|=1<{const o=navigator.getGamepads().find(e=>e?.index===n);o?.vibrationActuator?.playEffect("dual-rumble",{duration:e,startDelay:t,strongMagnitude:a,weakMagnitude:s})}}});