@joy-ride/joy-ride 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/npm/bookmarklet.js +1 -1
- package/npm/embed-chunks/{Documentation-COD3aHk0.js → Documentation-LUmJnMX1.js} +1 -1
- package/npm/embed-chunks/{bookmarklet-DiJXCaH2.js → bookmarklet-wdtwjNRT.js} +1 -1
- package/npm/embed-chunks/{src-Dk3uJEXq.js → src-CkDR5hqs.js} +5 -5
- package/npm/embed-chunks/{vehicle-popover-BOloRPP9.js → vehicle-popover-COqSWppE.js} +3 -3
- package/npm/embed.js +1 -1
- package/npm/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./vehicle-popover-
|
|
2
|
-
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{$ as n,A as r,At as i,B as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,Ft as p,G as m,H as h,I as g,It as _,J as v,K as y,L as b,Lt as x,M as S,Mt as C,N as w,Nt as T,O as E,Ot as D,P as O,Pt as ee,Q as te,R as ne,S as k,St as re,T as A,Tt as j,U as ie,V as ae,W as oe,X as se,Y as ce,_ as le,_t as ue,a as de,at as fe,bt as pe,c as me,ct as he,d as M,dt as N,et as ge,f as _e,ft as ve,g as ye,gt as be,h as xe,ht as Se,i as Ce,it as we,j as P,jt as Te,k as Ee,kt as De,l as Oe,m as ke,n as Ae,o as je,ot as Me,p as Ne,q as Pe,r as Fe,rt as Ie,s as Le,st as Re,t as ze,tt as Be,u as Ve,ut as He,v as Ue,vt as We,w as Ge,wt as Ke,x as qe,xt as Je,y as Ye,yt as Xe,z as Ze}from"./bookmarklet-DiJXCaH2.js";import{H as Qe,n as $e,r as et,t as tt}from"./IconBase.es-CgBjh3hj.js";var nt=De.map(e=>`Digit${e}`),rt=[{id:`accelerate`,label:`Accelerate`,keys:[`W`,`↑`],codes:[`KeyW`,`ArrowUp`]},{id:`reverse`,label:`Reverse / brake with gas`,keys:[`S`,`↓`],codes:[`KeyS`,`ArrowDown`]},{id:`left`,label:`Steer left`,keys:[`A`,`←`],codes:[`KeyA`,`ArrowLeft`]},{id:`right`,label:`Steer right`,keys:[`D`,`→`],codes:[`KeyD`,`ArrowRight`]},{id:`handbrake`,label:`Handbrake`,keys:[`Space`],codes:[`Space`]},{id:`boost`,label:`Hold boost / charge burnout launch`,keys:[`Shift`],codes:[`ShiftLeft`,`ShiftRight`]},...De.map(e=>({id:`slot${e}`,label:`Use assigned action in slot ${e}`,keys:[String(e)],codes:[`Digit${e}`]})),{id:`slowMo`,label:`Hold slow-mo`,keys:[`V`],codes:[`KeyV`]},{id:`underglow`,label:`Toggle underglow`,keys:[`U`],codes:[`KeyU`]},{id:`horn`,label:`Horn`,keys:[`H`],codes:[`KeyH`]},{id:`record`,label:`Record`,keys:[`R`],codes:[`KeyR`]},{id:`clean`,label:`Reset screen`,keys:[`C`],codes:[`KeyC`]},{id:`targets`,label:`Flash destroyable objects`,keys:[`F`],codes:[`KeyF`]},{id:`pause`,label:`Pause`,keys:[`P`],codes:[`KeyP`]},{id:`exit`,label:`Exit`,keys:[`Esc`],codes:[`Escape`]}],it=new Set([`KeyW`,`KeyA`,`KeyS`,`KeyD`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Space`,`ShiftLeft`,`ShiftRight`,...nt]),at=new Set([`KeyR`,`KeyU`,`KeyC`,`KeyF`,`KeyV`,`KeyP`,`KeyB`,`KeyG`,`KeyZ`,`KeyX`,`Escape`]);function ot(e){return(e instanceof Event?e.composedPath():[e]).some(e=>e instanceof Element&&!!e.closest(`input, textarea, select, [contenteditable="true"]`))}function st(e,t){return{throttle:e?1:-Number(t),brake:Number(e&&t)}}function ct(e){return{...st(e.has(`KeyW`)||e.has(`ArrowUp`),e.has(`KeyS`)||e.has(`ArrowDown`)),steer:Number(e.has(`KeyA`)||e.has(`ArrowLeft`))-Number(e.has(`KeyD`)||e.has(`ArrowRight`)),action:e.has(`Space`),boost:e.has(`ShiftLeft`)||e.has(`ShiftRight`),slots:De.filter(t=>e.has(`Digit${t}`))}}var lt=new Set([`KeyW`,`ArrowUp`,`KeyS`,`ArrowDown`,`KeyA`,`ArrowLeft`,`KeyD`,`ArrowRight`,`Space`,`ShiftLeft`,`ShiftRight`,`KeyH`,`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`,`Digit6`,`Digit7`,`Digit8`,`Digit9`]),ut=e=>lt.has(e),dt=class{metadata;elapsed=0;held=new Set;events=[];constructor(e){this.metadata=e,this.metadata=structuredClone(e)}get elapsedMs(){return Math.round(this.elapsed)}advance(e){this.elapsed+=e*1e3}down(e){ut(e)&&!this.held.has(e)&&(this.held.add(e),this.events.push({atMs:this.elapsedMs,code:e,type:`down`}))}up(e){ut(e)&&this.held.delete(e)&&this.events.push({atMs:this.elapsedMs,code:e,type:`up`})}releaseAll(){for(let e of[...this.held])this.up(e)}finish(){return this.releaseAll(),structuredClone({...this.metadata,durationMs:this.elapsedMs,events:this.events})}},ft=class{elapsed=0;index=0;pendingWeaponPresses=new Set;held=new Set;recording;constructor(e){this.recording=structuredClone(e)}get elapsedMs(){return Math.min(this.recording.durationMs,Math.round(this.elapsed))}get complete(){return Math.round(this.elapsed)>=this.recording.durationMs&&this.index>=this.recording.events.length}applyThrough(e){for(;this.index<this.recording.events.length&&this.recording.events[this.index].atMs<=e;){let e=this.recording.events[this.index++];e.type===`down`?(this.held.add(e.code),/^Digit[1-9]$/.test(e.code)&&this.pendingWeaponPresses.add(e.code)):this.held.delete(e.code)}}next(e){this.applyThrough(Math.round(this.elapsed));let t=ct(this.held);return t.slotPresses=[...this.pendingWeaponPresses].map(e=>Number(e.slice(-1))),this.pendingWeaponPresses.clear(),this.elapsed+=e*1e3,Math.round(this.elapsed)>=this.recording.durationMs&&this.applyThrough(this.recording.durationMs),t}};function pt(e){if(!e||typeof e!=`object`)throw Error(`This is not a Joy Ride recording.`);let t=e,n=e=>typeof e==`number`&&Number.isFinite(e),r=t.viewport,i=t.initial;if(t.format!==`joy-ride-recording`||t.version!==2||typeof t.createdAt!=`string`||typeof t.viewportWalls!=`boolean`||!r||!n(r.widthPx)||r.widthPx<=0||!n(r.heightPx)||r.heightPx<=0||!n(r.pixelsPerMeter)||r.pixelsPerMeter<=0||!i||![`xPx`,`yPx`,`angleRad`,`velocityXMps`,`velocityYMps`,`spinRadPerSecond`].every(e=>n(i[e]))||!Number.isSafeInteger(t.durationMs)||t.durationMs<0||t.durationMs>18e5||!Array.isArray(t.events)||t.events.length>2e4)throw Error(`This recording has missing or invalid fields.`);let a=new Set,o=0;for(let e of t.events){if(!e||typeof e!=`object`)throw Error(`Invalid key event.`);let n=e;if(!Number.isSafeInteger(n.atMs)||n.atMs<o||n.atMs>t.durationMs||typeof n.code!=`string`||!ut(n.code)||n.type!==`down`&&n.type!==`up`)throw Error(`Invalid key event.`);if(n.type===`down`){if(a.has(n.code))throw Error(`A key was pressed twice without release.`);a.add(n.code)}else if(!a.delete(n.code))throw Error(`A key was released before it was pressed.`);o=n.atMs}if(a.size)throw Error(`This recording ends with keys still held.`);let s=m(t.vehicle);return structuredClone({...t,vehicle:s})}var mt=`joy-ride:recording:v2`;function ht(){try{let e=localStorage.getItem(mt);if(e===null)return null;let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let n=t;return n.recording==null?null:pt(n.recording)}catch{return null}}var gt=class{listeners=new Set;state;constructor(e=`playback`){let t=ht();this.state={recording:t,mode:t?`ready`:`idle`,uiMode:e,pose:`recorded`,customPose:null,playbackStart:null,showPath:!1,error:null}}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});update(e,t=!1){if(this.state={...this.state,...e},t)try{localStorage.setItem(mt,JSON.stringify({version:2,recording:this.state.recording}))}catch{this.state.error=`Browser storage is unavailable. Export the recording to keep it.`}this.listeners.forEach(e=>e())}setRecording(e){let t=pt(e);this.update({recording:t,mode:`ready`,pose:`recorded`,customPose:null,playbackStart:null,error:null},!0)}clear(){this.update({recording:null,mode:`idle`,pose:`recorded`,customPose:null,playbackStart:null,showPath:!1,error:null},!0)}setMode(e){this.update({mode:e,playbackStart:e===`playing`?this.state.playbackStart:null,error:null})}setUiMode(e){this.update({uiMode:e})}beginPlayback(e){this.update({mode:`playing`,playbackStart:e,error:null})}setShowPath(e){this.update({showPath:e})}setPose(e,t){this.update({pose:e,customPose:e===`custom`?t??this.state.customPose:null})}setError(e){this.update({error:e})}};function _t(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`joy-ride-recording.json`,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var vt=1/120,yt=class{sim=new qe;playback;steps;sampleEvery;index=0;points=[P()];angle=0;constructor(e,t){this.sim.setPreset(t),this.sim.body.angle=e.initial.angleRad,this.sim.body.velocity=P(e.initial.velocityXMps,e.initial.velocityYMps),this.sim.body.spin=e.initial.spinRadPerSecond,this.playback=new ft(e),this.steps=Math.ceil(e.durationMs/(vt*1e3)),this.sampleEvery=Math.max(4,Math.ceil(this.steps/4e3)),this.angle=this.sim.body.angle}advance(e){let t=Math.min(this.steps,this.index+e);for(;this.index<t;)this.sim.tick(this.playback.next(vt),vt,null),this.index++,(this.index%this.sampleEvery===0||this.index===this.steps)&&this.points.push({...this.sim.body.position});return this.angle=this.sim.body.angle,this.index>=this.steps}},bt=(e,t)=>e.childNodes.length===1&&e.firstChild===t.node&&t.node.data===t.last,xt=class{registry;values=new Map;disposed=!1;constructor(e){this.registry=e}update(e){if(this.disposed)return;let t=new Set;for(let n of this.registry.objects){let r=n.spec.hud;if(!r||n.spec.enabled===!1)continue;let i=n.target;t.add(i);let a=St(r,e),o=this.values.get(i);if(!o||!bt(i,o)){let e=[...i.childNodes],t=i.ownerDocument.createTextNode(a);i.replaceChildren(t),o={original:e,node:t,last:a},this.values.set(i,o)}else o.last!==a&&(o.node.data=a,o.last=a)}for(let e of this.values.keys())t.has(e)||this.restore(e)}restore(e){let t=this.values.get(e);t&&(bt(e,t)&&e.replaceChildren(...t.original),this.values.delete(e))}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.values.keys())this.restore(e)}}};function St(e,t){let n=e.field===`speed`?t.speedMps:t[e.field];return e.field===`gear`?n==null?`—`:String(n):typeof n!=`number`||!Number.isFinite(n)?`—`:(e.field===`speed`&&(n*=e.unit===`kmh`?3.6:e.unit===`mps`?1:1/.44704),n.toFixed(e.precision??0))}var Ct=[`low`,`medium`,`high`],wt=1e3/60,Tt=2e3,Et=8,Dt=2e3,Ot=1e4,kt=12e4,At=5e3,jt=class{cap=Ct.length-1;misses=[];lastTime=null;lastChange=-1/0;lastStepUp=-1/0;stepUpDelay=Ot;get limit(){return Ct[this.cap]}apply(e){return Ct[Math.min(Ct.indexOf(e),this.cap)]}sample(e,t,n,r){let i=this.lastTime;if(this.lastTime=e,i===null)return!1;let a=e-i;if(!(a>0)||a>250)return!1;for(a>wt*1.5&&t<wt*.8&&n&&this.misses.push(e);this.misses.length&&e-this.misses[0]>Tt;)this.misses.shift();if(e-this.lastChange<Dt)return!1;let o=Ct.indexOf(r);return this.misses.length>=Et&&Math.min(this.cap,o)>0?(e-this.lastStepUp<At&&(this.stepUpDelay=Math.min(kt,this.stepUpDelay*2)),this.cap=Math.min(this.cap,o)-1,this.changed(e),!0):n&&this.cap<o&&!this.misses.length&&e-this.lastChange>=this.stepUpDelay?(this.cap++,this.lastStepUp=e,this.changed(e),!0):!1}restoreLimit(e){this.cap=e?Math.max(0,Ct.indexOf(e)):Ct.length-1,this.misses=[],this.lastTime=null}reset(){this.cap=Ct.length-1,this.misses=[],this.lastTime=null,this.lastChange=this.lastStepUp=-1/0,this.stepUpDelay=Ot}changed(e){this.lastChange=e,this.misses=[]}};function Mt(e,t){let n=t.x-e.point.x,r=t.y-e.point.y;if(Math.hypot(e.direction.x,e.direction.y)<.1)return Math.exp(-(n*n+r*r)/Math.max(1,e.radius*e.radius))*e.intensity;let i=n*e.direction.x+r*e.direction.y;if(i<0||i>e.range)return 0;let a=n*-e.direction.y+r*e.direction.x,o=e.radius+i*e.spread,s=i/Math.max(1,e.range),c=Math.max(0,Math.min(1,(1-s)/.36));return Math.exp(-(a*a)/Math.max(1,o*o))*c*c*(3-2*c)*(1-s*.42)*e.intensity}var Nt=`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./vehicle-popover-COqSWppE.js","./rolldown-runtime-XKyaHtl9.js","./bookmarklet-wdtwjNRT.js","./IconBase.es-CgBjh3hj.js","../embed-assets/vehicle-popover-B6vGzw7u.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{$ as n,A as r,At as i,B as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,Ft as p,G as m,H as h,I as g,It as _,J as v,K as y,L as b,Lt as x,M as S,Mt as C,N as w,Nt as T,O as E,Ot as D,P as O,Pt as ee,Q as te,R as ne,S as k,St as re,T as A,Tt as j,U as ie,V as ae,W as oe,X as se,Y as ce,_ as le,_t as ue,a as de,at as fe,bt as pe,c as me,ct as he,d as M,dt as N,et as ge,f as _e,ft as ve,g as ye,gt as be,h as xe,ht as Se,i as Ce,it as we,j as P,jt as Te,k as Ee,kt as De,l as Oe,m as ke,n as Ae,o as je,ot as Me,p as Ne,q as Pe,r as Fe,rt as Ie,s as Le,st as Re,t as ze,tt as Be,u as Ve,ut as He,v as Ue,vt as We,w as Ge,wt as Ke,x as qe,xt as Je,y as Ye,yt as Xe,z as Ze}from"./bookmarklet-wdtwjNRT.js";import{H as Qe,n as $e,r as et,t as tt}from"./IconBase.es-CgBjh3hj.js";var nt=De.map(e=>`Digit${e}`),rt=[{id:`accelerate`,label:`Accelerate`,keys:[`W`,`↑`],codes:[`KeyW`,`ArrowUp`]},{id:`reverse`,label:`Reverse / brake with gas`,keys:[`S`,`↓`],codes:[`KeyS`,`ArrowDown`]},{id:`left`,label:`Steer left`,keys:[`A`,`←`],codes:[`KeyA`,`ArrowLeft`]},{id:`right`,label:`Steer right`,keys:[`D`,`→`],codes:[`KeyD`,`ArrowRight`]},{id:`handbrake`,label:`Handbrake`,keys:[`Space`],codes:[`Space`]},{id:`boost`,label:`Hold boost / charge burnout launch`,keys:[`Shift`],codes:[`ShiftLeft`,`ShiftRight`]},...De.map(e=>({id:`slot${e}`,label:`Use assigned action in slot ${e}`,keys:[String(e)],codes:[`Digit${e}`]})),{id:`slowMo`,label:`Hold slow-mo`,keys:[`V`],codes:[`KeyV`]},{id:`underglow`,label:`Toggle underglow`,keys:[`U`],codes:[`KeyU`]},{id:`horn`,label:`Horn`,keys:[`H`],codes:[`KeyH`]},{id:`record`,label:`Record`,keys:[`R`],codes:[`KeyR`]},{id:`clean`,label:`Reset screen`,keys:[`C`],codes:[`KeyC`]},{id:`targets`,label:`Flash destroyable objects`,keys:[`F`],codes:[`KeyF`]},{id:`pause`,label:`Pause`,keys:[`P`],codes:[`KeyP`]},{id:`exit`,label:`Exit`,keys:[`Esc`],codes:[`Escape`]}],it=new Set([`KeyW`,`KeyA`,`KeyS`,`KeyD`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Space`,`ShiftLeft`,`ShiftRight`,...nt]),at=new Set([`KeyR`,`KeyU`,`KeyC`,`KeyF`,`KeyV`,`KeyP`,`KeyB`,`KeyG`,`KeyZ`,`KeyX`,`Escape`]);function ot(e){return(e instanceof Event?e.composedPath():[e]).some(e=>e instanceof Element&&!!e.closest(`input, textarea, select, [contenteditable="true"]`))}function st(e,t){return{throttle:e?1:-Number(t),brake:Number(e&&t)}}function ct(e){return{...st(e.has(`KeyW`)||e.has(`ArrowUp`),e.has(`KeyS`)||e.has(`ArrowDown`)),steer:Number(e.has(`KeyA`)||e.has(`ArrowLeft`))-Number(e.has(`KeyD`)||e.has(`ArrowRight`)),action:e.has(`Space`),boost:e.has(`ShiftLeft`)||e.has(`ShiftRight`),slots:De.filter(t=>e.has(`Digit${t}`))}}var lt=new Set([`KeyW`,`ArrowUp`,`KeyS`,`ArrowDown`,`KeyA`,`ArrowLeft`,`KeyD`,`ArrowRight`,`Space`,`ShiftLeft`,`ShiftRight`,`KeyH`,`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`,`Digit6`,`Digit7`,`Digit8`,`Digit9`]),ut=e=>lt.has(e),dt=class{metadata;elapsed=0;held=new Set;events=[];constructor(e){this.metadata=e,this.metadata=structuredClone(e)}get elapsedMs(){return Math.round(this.elapsed)}advance(e){this.elapsed+=e*1e3}down(e){ut(e)&&!this.held.has(e)&&(this.held.add(e),this.events.push({atMs:this.elapsedMs,code:e,type:`down`}))}up(e){ut(e)&&this.held.delete(e)&&this.events.push({atMs:this.elapsedMs,code:e,type:`up`})}releaseAll(){for(let e of[...this.held])this.up(e)}finish(){return this.releaseAll(),structuredClone({...this.metadata,durationMs:this.elapsedMs,events:this.events})}},ft=class{elapsed=0;index=0;pendingWeaponPresses=new Set;held=new Set;recording;constructor(e){this.recording=structuredClone(e)}get elapsedMs(){return Math.min(this.recording.durationMs,Math.round(this.elapsed))}get complete(){return Math.round(this.elapsed)>=this.recording.durationMs&&this.index>=this.recording.events.length}applyThrough(e){for(;this.index<this.recording.events.length&&this.recording.events[this.index].atMs<=e;){let e=this.recording.events[this.index++];e.type===`down`?(this.held.add(e.code),/^Digit[1-9]$/.test(e.code)&&this.pendingWeaponPresses.add(e.code)):this.held.delete(e.code)}}next(e){this.applyThrough(Math.round(this.elapsed));let t=ct(this.held);return t.slotPresses=[...this.pendingWeaponPresses].map(e=>Number(e.slice(-1))),this.pendingWeaponPresses.clear(),this.elapsed+=e*1e3,Math.round(this.elapsed)>=this.recording.durationMs&&this.applyThrough(this.recording.durationMs),t}};function pt(e){if(!e||typeof e!=`object`)throw Error(`This is not a Joy Ride recording.`);let t=e,n=e=>typeof e==`number`&&Number.isFinite(e),r=t.viewport,i=t.initial;if(t.format!==`joy-ride-recording`||t.version!==2||typeof t.createdAt!=`string`||typeof t.viewportWalls!=`boolean`||!r||!n(r.widthPx)||r.widthPx<=0||!n(r.heightPx)||r.heightPx<=0||!n(r.pixelsPerMeter)||r.pixelsPerMeter<=0||!i||![`xPx`,`yPx`,`angleRad`,`velocityXMps`,`velocityYMps`,`spinRadPerSecond`].every(e=>n(i[e]))||!Number.isSafeInteger(t.durationMs)||t.durationMs<0||t.durationMs>18e5||!Array.isArray(t.events)||t.events.length>2e4)throw Error(`This recording has missing or invalid fields.`);let a=new Set,o=0;for(let e of t.events){if(!e||typeof e!=`object`)throw Error(`Invalid key event.`);let n=e;if(!Number.isSafeInteger(n.atMs)||n.atMs<o||n.atMs>t.durationMs||typeof n.code!=`string`||!ut(n.code)||n.type!==`down`&&n.type!==`up`)throw Error(`Invalid key event.`);if(n.type===`down`){if(a.has(n.code))throw Error(`A key was pressed twice without release.`);a.add(n.code)}else if(!a.delete(n.code))throw Error(`A key was released before it was pressed.`);o=n.atMs}if(a.size)throw Error(`This recording ends with keys still held.`);let s=m(t.vehicle);return structuredClone({...t,vehicle:s})}var mt=`joy-ride:recording:v2`;function ht(){try{let e=localStorage.getItem(mt);if(e===null)return null;let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let n=t;return n.recording==null?null:pt(n.recording)}catch{return null}}var gt=class{listeners=new Set;state;constructor(e=`playback`){let t=ht();this.state={recording:t,mode:t?`ready`:`idle`,uiMode:e,pose:`recorded`,customPose:null,playbackStart:null,showPath:!1,error:null}}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});update(e,t=!1){if(this.state={...this.state,...e},t)try{localStorage.setItem(mt,JSON.stringify({version:2,recording:this.state.recording}))}catch{this.state.error=`Browser storage is unavailable. Export the recording to keep it.`}this.listeners.forEach(e=>e())}setRecording(e){let t=pt(e);this.update({recording:t,mode:`ready`,pose:`recorded`,customPose:null,playbackStart:null,error:null},!0)}clear(){this.update({recording:null,mode:`idle`,pose:`recorded`,customPose:null,playbackStart:null,showPath:!1,error:null},!0)}setMode(e){this.update({mode:e,playbackStart:e===`playing`?this.state.playbackStart:null,error:null})}setUiMode(e){this.update({uiMode:e})}beginPlayback(e){this.update({mode:`playing`,playbackStart:e,error:null})}setShowPath(e){this.update({showPath:e})}setPose(e,t){this.update({pose:e,customPose:e===`custom`?t??this.state.customPose:null})}setError(e){this.update({error:e})}};function _t(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`joy-ride-recording.json`,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var vt=1/120,yt=class{sim=new qe;playback;steps;sampleEvery;index=0;points=[P()];angle=0;constructor(e,t){this.sim.setPreset(t),this.sim.body.angle=e.initial.angleRad,this.sim.body.velocity=P(e.initial.velocityXMps,e.initial.velocityYMps),this.sim.body.spin=e.initial.spinRadPerSecond,this.playback=new ft(e),this.steps=Math.ceil(e.durationMs/(vt*1e3)),this.sampleEvery=Math.max(4,Math.ceil(this.steps/4e3)),this.angle=this.sim.body.angle}advance(e){let t=Math.min(this.steps,this.index+e);for(;this.index<t;)this.sim.tick(this.playback.next(vt),vt,null),this.index++,(this.index%this.sampleEvery===0||this.index===this.steps)&&this.points.push({...this.sim.body.position});return this.angle=this.sim.body.angle,this.index>=this.steps}},bt=(e,t)=>e.childNodes.length===1&&e.firstChild===t.node&&t.node.data===t.last,xt=class{registry;values=new Map;disposed=!1;constructor(e){this.registry=e}update(e){if(this.disposed)return;let t=new Set;for(let n of this.registry.objects){let r=n.spec.hud;if(!r||n.spec.enabled===!1)continue;let i=n.target;t.add(i);let a=St(r,e),o=this.values.get(i);if(!o||!bt(i,o)){let e=[...i.childNodes],t=i.ownerDocument.createTextNode(a);i.replaceChildren(t),o={original:e,node:t,last:a},this.values.set(i,o)}else o.last!==a&&(o.node.data=a,o.last=a)}for(let e of this.values.keys())t.has(e)||this.restore(e)}restore(e){let t=this.values.get(e);t&&(bt(e,t)&&e.replaceChildren(...t.original),this.values.delete(e))}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.values.keys())this.restore(e)}}};function St(e,t){let n=e.field===`speed`?t.speedMps:t[e.field];return e.field===`gear`?n==null?`—`:String(n):typeof n!=`number`||!Number.isFinite(n)?`—`:(e.field===`speed`&&(n*=e.unit===`kmh`?3.6:e.unit===`mps`?1:1/.44704),n.toFixed(e.precision??0))}var Ct=[`low`,`medium`,`high`],wt=1e3/60,Tt=2e3,Et=8,Dt=2e3,Ot=1e4,kt=12e4,At=5e3,jt=class{cap=Ct.length-1;misses=[];lastTime=null;lastChange=-1/0;lastStepUp=-1/0;stepUpDelay=Ot;get limit(){return Ct[this.cap]}apply(e){return Ct[Math.min(Ct.indexOf(e),this.cap)]}sample(e,t,n,r){let i=this.lastTime;if(this.lastTime=e,i===null)return!1;let a=e-i;if(!(a>0)||a>250)return!1;for(a>wt*1.5&&t<wt*.8&&n&&this.misses.push(e);this.misses.length&&e-this.misses[0]>Tt;)this.misses.shift();if(e-this.lastChange<Dt)return!1;let o=Ct.indexOf(r);return this.misses.length>=Et&&Math.min(this.cap,o)>0?(e-this.lastStepUp<At&&(this.stepUpDelay=Math.min(kt,this.stepUpDelay*2)),this.cap=Math.min(this.cap,o)-1,this.changed(e),!0):n&&this.cap<o&&!this.misses.length&&e-this.lastChange>=this.stepUpDelay?(this.cap++,this.lastStepUp=e,this.changed(e),!0):!1}restoreLimit(e){this.cap=e?Math.max(0,Ct.indexOf(e)):Ct.length-1,this.misses=[],this.lastTime=null}reset(){this.cap=Ct.length-1,this.misses=[],this.lastTime=null,this.lastChange=this.lastStepUp=-1/0,this.stepUpDelay=Ot}changed(e){this.lastChange=e,this.misses=[]}};function Mt(e,t){let n=t.x-e.point.x,r=t.y-e.point.y;if(Math.hypot(e.direction.x,e.direction.y)<.1)return Math.exp(-(n*n+r*r)/Math.max(1,e.radius*e.radius))*e.intensity;let i=n*e.direction.x+r*e.direction.y;if(i<0||i>e.range)return 0;let a=n*-e.direction.y+r*e.direction.x,o=e.radius+i*e.spread,s=i/Math.max(1,e.range),c=Math.max(0,Math.min(1,(1-s)/.36));return Math.exp(-(a*a)/Math.max(1,o*o))*c*c*(3-2*c)*(1-s*.42)*e.intensity}var Nt=`
|
|
3
3
|
uniform int vehicleLightCount;
|
|
4
4
|
uniform vec4 vehicleLightPosition[12];
|
|
5
5
|
uniform vec4 vehicleLightShape[12];
|
|
@@ -769,7 +769,7 @@ void main() {
|
|
|
769
769
|
alpha = max(alpha,glow*0.5*heat*uFade);
|
|
770
770
|
}
|
|
771
771
|
color = vec4(hot,alpha);
|
|
772
|
-
}`,zf=class{canvas=document.createElement(`canvas`);gl;program;buffer;viewportUniform;fadeUniform;wallCountUniform;wallsUniform;disturbanceUniform;disturbanceRadiusUniform;electricColorUniform;electricCoronaUniform;wallData=new Float32Array(128);data=new Float32Array(256*If);lost=!1;overlayHost=null;constructor(){this.canvas.width=512,this.canvas.height=512;let e=this.canvas.getContext(`webgl2`,{alpha:!0,depth:!1,stencil:!1,antialias:!0,premultipliedAlpha:!0});if(!e)throw Error(`WebGL2 is required for spark particles`);this.gl=e,this.canvas.addEventListener(`webglcontextlost`,e=>{e.preventDefault(),this.lost=!0});let t=nf(e,Lf,Rf,`Spark`),n=e.createBuffer();if(!n)throw uf(e,t),Error(`Unable to allocate spark buffer`);this.program=t,this.buffer=n,this.viewportUniform=af(t,`uViewport`),this.fadeUniform=af(t,`uFade`),this.wallCountUniform=af(t,`uWallCount`),this.wallsUniform=af(t,`uWalls[0]`),this.disturbanceUniform=af(t,`uDisturbance`),this.disturbanceRadiusUniform=af(t,`uDisturbanceRadius`),this.electricColorUniform=af(t,`uElectricColor`),this.electricCoronaUniform=af(t,`uElectricCorona`),e.bindBuffer(e.ARRAY_BUFFER,n),cf(e,t,{aStart:{buffer:n,numComponents:2,stride:44,offset:0,divisor:1},aEnd:{buffer:n,numComponents:2,stride:44,offset:8,divisor:1},aMotion:{buffer:n,numComponents:2,stride:44,offset:16,divisor:1},aStyle:{buffer:n,numComponents:4,stride:44,offset:24,divisor:1},aSeed:{buffer:n,numComponents:1,stride:44,offset:40,divisor:1}})}clear(){if(this.lost||!this.overlayHost||this.canvas.style.display===`none`)return;let e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null),e.disable(e.SCISSOR_TEST),e.viewport(0,0,this.canvas.width,this.canvas.height),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),this.canvas.style.display!==`none`&&(this.canvas.style.display=`none`)}dispose(){this.canvas.remove(),this.overlayHost=null,uf(this.gl,this.program),this.gl.deleteBuffer(this.buffer),this.gl.getExtension(`WEBGL_lose_context`)?.loseContext(),this.lost=!0}mountOverlay(e,t,n){this.overlayHost!==e&&(this.canvas.remove(),this.overlayHost=e,this.canvas.dataset.jrOverlay=``,this.canvas.style.position=e.style.position===`absolute`?`absolute`:`fixed`,this.canvas.style.pointerEvents=`none`,this.canvas.style.zIndex=e.style.zIndex||jf(`world`),document.body.append(this.canvas)),this.canvas.style.display!==`block`&&(this.canvas.style.display=`block`);let r=e.hasAttribute(`data-jr-overlay`),i=r&&e.style.position===`absolute`,a=i?`absolute`:`fixed`,o=i?e.style.translate:``;this.canvas.style.position!==a&&(this.canvas.style.position=a),this.canvas.style.translate!==o&&(this.canvas.style.translate=o);let s=r?{left:0,top:0}:e.getBoundingClientRect(),c=`${s.left}px`,l=`${s.top}px`,u=`${t.width}px`,d=`${t.height}px`;this.canvas.style.left!==c&&(this.canvas.style.left=c),this.canvas.style.top!==l&&(this.canvas.style.top=l),this.canvas.style.width!==u&&(this.canvas.style.width=u),this.canvas.style.height!==d&&(this.canvas.style.height=d);let f=Math.ceil(t.width*n),p=Math.ceil(t.height*n);(this.canvas.width!==f||this.canvas.height!==p)&&(this.canvas.width=f,this.canvas.height=p)}draw(e,t,n,r,i=1,a,o=[],s,c=Ff){if(this.lost||!t.length||n<=0){this.clear();return}let l=t.filter(e=>{let t=e.kind===2?Bf(e.start,e.motion,e.age,e.seed):e.end;return t.x>-64&&t.x<r.width+64&&t.y>-64&&t.y<r.height+64});if(!l.length){this.clear();return}let u=1/0,d=1/0,f=-1/0,p=-1/0;for(let e of l){let t=e.kind===2?Bf(e.start,e.motion,e.age,e.seed):e.end,n=e.kind===2?Bf(e.start,e.motion,Math.max(0,e.age-.045),e.seed):e.start;u=Math.min(u,n.x,t.x),f=Math.max(f,n.x,t.x),d=Math.min(d,n.y,t.y),p=Math.max(p,n.y,t.y)}let m=a?0:Math.floor((u-16)/32)*32,h=a?0:Math.floor((d-16)/32)*32,g=a?r.width:Math.max(32,Math.ceil((f+16-m)/32)*32),_=a?r.height:Math.max(32,Math.ceil((p+16-h)/32)*32),v=Math.min(2,Math.max(1,i)),y=Math.ceil(g*v),b=Math.ceil(_*v);a?this.mountOverlay(a,r,v):(y>this.canvas.width&&(this.canvas.width=Math.ceil(y/256)*256),b>this.canvas.height&&(this.canvas.height=Math.ceil(b/256)*256)),this.data.length<l.length*If&&(this.data=new Float32Array(Math.max(l.length*If,this.data.length*2)));let x=0;for(let e of l)this.data[x]=(e.start.x-m)*v,this.data[x+1]=(e.start.y-h)*v,this.data[x+2]=(e.end.x-m)*v,this.data[x+3]=(e.end.y-h)*v,this.data[x+4]=e.motion.x*v,this.data[x+5]=e.motion.y*v,this.data[x+6]=e.age,this.data[x+7]=e.life,this.data[x+8]=e.size*v,this.data[x+9]=e.kind,this.data[x+10]=e.seed,x+=If;let S=this.gl;performance.now();let C=a?0:this.canvas.height-b;S.viewport(0,C,y,b),a||(S.enable(S.SCISSOR_TEST),S.scissor(0,C,y,b)),S.clearColor(0,0,0,0),S.clear(S.COLOR_BUFFER_BIT),S.useProgram(this.program),S.bindBuffer(S.ARRAY_BUFFER,this.buffer),S.bufferData(S.ARRAY_BUFFER,this.data.subarray(0,x),S.DYNAMIC_DRAW),S.uniform2f(this.viewportUniform,y,b),S.uniform1f(this.fadeUniform,n),S.uniform3f(this.electricColorUniform,...c.color),S.uniform3f(this.electricCoronaUniform,...c.corona),s?(S.uniform4f(this.disturbanceUniform,(s.point.x-m)*v,(s.point.y-h)*v,s.velocity.x*v,s.velocity.y*v),S.uniform1f(this.disturbanceRadiusUniform,s.radius*v)):(S.uniform4f(this.disturbanceUniform,-1e5,-1e5,0,0),S.uniform1f(this.disturbanceRadiusUniform,1));let w=Math.min(32,o.length);for(let e=0;e<w;e++){let t=o[e],n=e*4;this.wallData[n]=(t.x-m)*v,this.wallData[n+1]=(t.y-h)*v,this.wallData[n+2]=(t.x+t.width-m)*v,this.wallData[n+3]=(t.y+t.height-h)*v}S.uniform1i(this.wallCountUniform,w),w&&S.uniform4fv(this.wallsUniform,this.wallData.subarray(0,w*4)),S.enable(S.BLEND),S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA),S.drawArraysInstanced(S.TRIANGLES,0,6,l.length),S.disable(S.BLEND),a||S.disable(S.SCISSOR_TEST),!a&&(performance.now(),e.drawImage(this.canvas,0,0,y,b,m,h,g,_))}};function Bf(e,t,n,r){let i=r*Math.PI*2,a=3+r*73.19%1*3.1,o=7.5+r*41.73%1*6.2;return{x:e.x+t.x*n+(Math.sin(a*n+i*2.3)-Math.sin(i*2.3))*(5+r*91.7%1*13)+(Math.sin(o*n-i*3.1)-Math.sin(-i*3.1))*3.5,y:e.y+t.y*n-n*n*(24+r*19.3%1*38)+(Math.cos(a*n+i*1.7)-Math.cos(i*1.7))*4+(Math.sin(o*n+i*4.7)-Math.sin(i*4.7))*2.5}}var Vf=360,Hf=(e,t,n)=>Math.max(t,Math.min(n,e));function Uf(e){let t=Math.max(1,e.pixelsPerMeter),n=Math.max(0,-A(e.velocity,e.normal))/t,i=c(e.velocity,r(e.normal,A(e.velocity,e.normal))),a=u(i)/t,o=a/Math.max(.001,a+n),s=Hf((n+(e.wall?.4:0))/1.8,0,1)*Hf((a-.8)/7,0,1)*Hf(o/.65,0,1),l=Hf((n-1.4)/9,0,1)*(1-o*.35);return Math.max(s,l)}function Wf(e){let t=t=>{let n=P(-t.y,t.x);return A(n,e.velocity)<0&&(n=r(n,-1)),n},n=t(e.normal),i=t(e.carNormal??r(e.normal,-1)),a=E(n,i),o=u(a);if(o<.001)return n;let s=E(r(a,1/o),r(e.normal,.12));return r(s,1/u(s))}function Gf(e,t){let n=Hf(e.x,t.x,t.x+t.width),r=Hf(e.y,t.y,t.y+t.height);return e.x!==n||e.y!==r?P(n,r):[{distance:n-t.x,point:P(t.x,r)},{distance:t.x+t.width-n,point:P(t.x+t.width,r)},{distance:r-t.y,point:P(n,t.y)},{distance:t.y+t.height-r,point:P(n,t.y+t.height)}].reduce((e,t)=>t.distance<e.distance?t:e).point}function Kf(e,t,n){if(Math.abs(n.x)>=Math.abs(n.y)){let r=P(n.x<0?-1:1,0);return{point:P(r.x<0?t.x:t.x+t.width,Hf(e.y,t.y,t.y+t.height)),normal:r}}let r=P(0,n.y<0?-1:1);return{point:P(Hf(e.x,t.x,t.x+t.width),r.y<0?t.y:t.y+t.height),normal:r}}function qf(e,t,n){let i=A(e.velocity,t);i<0&&(e.velocity=c(e.velocity,r(t,i*(1+n))))}function Jf(e,t,n){let i=e.point,a=e=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,o=c(i,n),s=0,l=1,d=P(),f=!0;for(let e of[`x`,`y`]){let r=o[e],i=t[e],a=i+(e===`x`?t.width:t.height);if(Math.abs(r)<1e-6){if(n[e]<i||n[e]>a){f=!1;break}continue}let c=(i-n[e])/r,u=(a-n[e])/r,p=Math.min(c,u),m=Math.max(c,u);if(p>s&&(s=p,d=e===`x`?P(r>0?-1:1,0):P(0,r>0?-1:1)),l=Math.min(l,m),s>l){f=!1;break}}if(f&&!a(n)&&s>=0&&s<=1&&s<=l&&u(d)){e.point=E(E(n,r(o,s)),r(d,.75)),qf(e,d,.38);return}if(!a(i))return;let p=Kf(Gf(i,t),t,[{value:Math.abs(n.x-t.x),normal:P(-1,0)},{value:Math.abs(n.x-t.x-t.width),normal:P(1,0)},{value:Math.abs(n.y-t.y),normal:P(0,-1)},{value:Math.abs(n.y-t.y-t.height),normal:P(0,1)}].reduce((e,t)=>t.value<e.value?t:e).normal);e.point=E(p.point,r(p.normal,.75)),qf(e,p.normal,.38),e.previous={...e.point}}var Yf=class{random;particles=[];walls=[];gpu=null;gpuUnavailable=!1;elapsed=0;lastEmission=-1/0;enabled=!0;electricalPalette=Ff;airflow=null;constructor(e=Math.random){this.random=e}captureState(){return j({particles:this.particles,walls:this.walls,gpuUnavailable:this.gpuUnavailable,elapsed:this.elapsed,lastEmission:this.lastEmission,enabled:this.enabled,electricalPalette:this.electricalPalette,airflow:this.airflow})}restoreState(e){this.gpu?.clear();let t=j(e);this.particles=t.particles,this.walls=t.walls,this.gpuUnavailable=t.gpuUnavailable,this.elapsed=t.elapsed,this.lastEmission=t.lastEmission,this.enabled=t.enabled,this.electricalPalette=t.electricalPalette,this.airflow=t.airflow}get count(){return this.particles.length}setEnabled(e){this.enabled=e,e||this.reset()}prepare(){if(!this.enabled||this.gpu||this.gpuUnavailable)return!!this.gpu;try{this.gpu=new zf}catch{this.gpuUnavailable=!0}return!!this.gpu}reset(){this.particles=[],this.lastEmission=-1/0,this.walls=[],this.airflow=null,this.gpu?.clear()}setElectricalPalette(e){let t=(e,t)=>Number.isFinite(e)?Hf(e,0,1):t,n=e.color??this.electricalPalette.color,r=e.corona??this.electricalPalette.corona;this.electricalPalette={color:[0,1,2].map(e=>t(n[e],this.electricalPalette.color[e])),corona:[0,1,2].map(e=>t(r[e],this.electricalPalette.corona[e]))}}electric(e,t,n=1){if(!this.enabled||!Number.isFinite(n)||n<=0||!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(t.x)||!Number.isFinite(t.y))return 0;let i=Hf(n,.1,3),a=u(t)>.001,o=a?Math.atan2(t.y,t.x):0,s=Math.round(3+i*5);for(let t=0;t<s;t++){let t=a?o+(this.random()-.5)*1.6:this.random()*Math.PI*2,n=P(Math.cos(t),Math.sin(t)),s=E(e,r(n,this.random()*1.6));this.particles.push({point:s,previous:{...s},velocity:r(n,(220+this.random()*460)*Math.sqrt(i)),plane:null,age:0,life:.06+this.random()*.16,size:.65+this.random()*.7,kind:4,seed:this.random()})}return this.trim(),s}disturb(e,t,n=90){this.airflow={point:{...e},velocity:{...t},radius:n}}dispose(){this.gpu?.dispose(),this.gpu=null}emit(e){if(!this.enabled||this.elapsed-this.lastEmission<.045)return 0;let t=Uf(e);if(t<=0)return 0;this.lastEmission=this.elapsed;let n=Wf(e),i=c(e.velocity,r(e.normal,A(e.velocity,e.normal))),a=Math.max(0,-A(e.velocity,e.normal)),o=a/Math.max(.001,a+u(i)),s=E(r(n,1-o),r(e.normal,o)),l=u(s),d=l>.001?r(s,1/l):e.normal,f=Math.round(24+80*Math.sqrt(t)),p=u(e.velocity)/Math.max(1,e.pixelsPerMeter),m=e.wall?Kf(e.point,e.wall,e.normal):null,h=m?.point??e.point,g=m?.normal??e.normal;for(let n=0;n<f;n++){let n=(this.random()-.5)*(.4+t*.45+o*1.5),a=Math.cos(n),s=Math.sin(n),c=P(d.x*a-d.y*s,d.x*s+d.y*a),l=(140+Math.min(420,p*30))*(.45+this.random()*1.15),u=E(r(c,l),r(i,.08)),f=e.wall?1.35+this.random()*.25:.35+this.random()*.3,m=E(h,r(g,f));this.particles.push({point:m,previous:{...m},velocity:u,plane:{origin:h,normal:g},age:0,life:.18+this.random()*.34,size:.85+this.random()*1.6,kind:0,seed:this.random()})}let _=E(h,r(g,e.wall?1.5:.8));return this.particles.push({point:_,previous:{..._},velocity:P(),plane:null,age:0,life:.18,size:5.5+t*4,kind:3,seed:this.random()}),this.trim(),f+1}emitBulletImpact(e,t){if(!this.enabled)return;let n=u(t);if(n<.001)return;let i=r(t,-1/n),a=E(e,r(i,1.4));for(let t=0;t<40;t++){let n=(this.random()-.5)*2.7,o=P(i.x*Math.cos(n)-i.y*Math.sin(n),i.x*Math.sin(n)+i.y*Math.cos(n)),s=E(a,r(o,this.random()*1.5));this.particles.push({point:s,previous:{...s},velocity:r(o,t<12?320+this.random()*300:150+this.random()*330),plane:{origin:e,normal:i},age:0,life:.16+this.random()*.24,size:.7+this.random()*1.2,kind:0,seed:this.random()})}this.particles.push({point:a,previous:{...a},velocity:P(),plane:null,age:0,life:.15,size:8,kind:3,seed:this.random()}),this.trim()}emitExplosion(e,t,n,i=1){if(!this.enabled)return 0;let a=Math.max(1,n),o=Hf(i,.5,2),s=Math.atan2(t.y,t.x),c=Math.round(32+20*Math.sqrt(o));for(let t=0;t<c;t++){let n=s+t*Math.PI*(3-Math.sqrt(5))+(this.random()-.5)*.3,i=P(Math.cos(n),Math.sin(n)),c=a*(5+this.random()*9)*Math.sqrt(o),l=E(e,r(i,a*.03));this.particles.push({point:l,previous:{...l},velocity:r(i,c),plane:null,age:0,life:.24+this.random()*.36,size:1+this.random()*1.1,kind:1,seed:this.random()})}return this.trim(),c}emitFire(e,t){if(!this.enabled||this.random()>=Math.min(1,t*15))return;let n=P(e.x+e.width/2,e.y+e.height/2),r=Math.cos(e.angle??0),i=Math.sin(e.angle??0);for(let t=0;t<12;t++){let t=e.fixedRadius??0,a=this.random()*Math.PI*2,o=Math.sqrt(this.random())*t,s=t>0?E(e.origin,P(Math.cos(a)*o,Math.sin(a)*o)):P(e.x+this.random()*e.width,e.y+this.random()*e.height),c=s.x-n.x,l=s.y-n.y,u=c*r+l*i,d=-c*i+l*r,f=Math.floor((u/e.width+.5)*e.pixelWidth),p=Math.floor((d/e.height+.5)*e.pixelHeight);if(f<0||p<0||f>=e.pixelWidth||p>=e.pixelHeight||(e.alpha[p*e.pixelWidth+f]??0)<32)continue;let m=P(n.x+u*r-d*i,n.y+u*i+d*r),h=(e.age-(t>0?0:Math.hypot(m.x-e.origin.x,m.y-e.origin.y)/e.farthest*e.spreadSeconds))/e.burnSeconds;if(!(h<=0||h>=.82)){this.addEmber(m);return}}}emitFireAt(e,t,n,r=10){if(!this.enabled||this.random()>=Math.min(1,n*r))return;let i=this.random()*Math.PI*2,a=Math.sqrt(this.random())*t;this.addEmber(E(e,P(Math.cos(i)*a,Math.sin(i)*a)))}addEmber(e){this.particles.push({point:e,previous:{...e},velocity:P((this.random()-.5)*76,-35-this.random()*100),plane:null,age:0,life:.5+this.random()*1.25,size:.55+this.random()**2*1.25,kind:2,seed:this.random()}),this.trim()}trim(){this.particles.length>Vf&&this.particles.splice(0,this.particles.length-Vf)}step(e,t={walls:[]}){if(this.elapsed+=e,this.airflow){let t=Math.exp(-e*5.5);this.airflow.velocity=r(this.airflow.velocity,t),u(this.airflow.velocity)<1&&(this.airflow=null)}if(this.walls=t.walls,!this.particles.length)return;let n=Math.min(e,.05);for(let e of this.particles)if(e.age+=n,e.kind!==2&&e.kind!==3){e.previous={...e.point};for(let i=0;i<2;i++){let i={...e.point},a=e.kind===4,o=a?8+e.seed*8:3.2+e.seed*6.3;if(e.velocity=r(e.velocity,Math.exp(-o*n/2)),a){let t=(e.seed-.5)*9*n*.5,r=Math.cos(t),i=Math.sin(t);e.velocity=P(e.velocity.x*r-e.velocity.y*i,e.velocity.x*i+e.velocity.y*r)}else e.velocity.y+=(38+e.seed*84)*n*.5;if(e.point=E(e.point,r(e.velocity,n/2)),e.plane){let t=A(c(e.point,e.plane.origin),e.plane.normal);t<0&&(e.point=E(e.point,r(e.plane.normal,-t+.4)),qf(e,e.plane.normal,.55))}for(let n of t.walls)Jf(e,n,i);if(t.car&&gn(t.car.mask,t.car.shape,e.point)){let n=vn(t.car.mask,t.car.shape,e.point);for(let i=0;i<16&&gn(t.car.mask,t.car.shape,e.point);i++)e.point=E(e.point,r(n,1.2));qf(e,n,.48)}}}this.particles=this.particles.filter(e=>e.age<e.life)}draw(e,t,n,i,a=1,o){if(!this.enabled||!this.particles.length||n<=0){this.gpu?.clear();return}if(this.prepare(),!this.gpu)return;let s=this.particles.map(e=>{let n=t(e.point),i=t(E(e.point,e.velocity)),a=c(i,n),o=e.kind<2||e.kind===4,s=o?t(e.previous):n;if(o){let i=c(n,s),o=u(i),l=e.kind===4?Math.min(20,u(a)*.04):Math.min(18,u(a)*(e.kind===1?.032:.038));if(o>.001&&o<l?(s.x=n.x-i.x/o*l,s.y=n.y-i.y/o*l):o<1&&(s.x-=a.x*.02,s.y-=a.y*.02),e.plane){let n=t(e.plane.origin),i=c(t(E(e.plane.origin,e.plane.normal)),n),a=A(c(s,n),i)/Math.max(1e-6,u(i));if(a<.7){let e=r(i,1/Math.max(1e-6,u(i)));s.x+=e.x*(.7-a),s.y+=e.y*(.7-a)}}}return{start:s,end:n,motion:a,age:e.age,life:e.life,size:e.size,kind:e.kind,seed:e.seed}}),l=[];if(o)for(let e of this.walls){let n=t({x:e.x,y:e.y}),r=t({x:e.x+e.width,y:e.y+e.height}),a=Math.min(n.x,r.x),o=Math.min(n.y,r.y),s=Math.abs(n.x-r.x),c=Math.abs(n.y-r.y);if(!(a>i.width||o>i.height||a+s<0||o+c<0)&&(l.push({x:a,y:o,width:s,height:c}),l.length===32))break}let d=this.airflow?{point:t(this.airflow.point),velocity:c(t(E(this.airflow.point,this.airflow.velocity)),t(this.airflow.point)),radius:u(c(t(E(this.airflow.point,P(this.airflow.radius,0))),t(this.airflow.point)))}:void 0;this.gpu.draw(e,s,n,i,a,o,l,d,this.electricalPalette)}};function Xf(e){let{ignitionSeconds:t,spreadSeconds:n,spreadRadiusPx:r,burnSeconds:i,smokePerSecond:a}=e;return{ignitionSeconds:t,spreadSeconds:n,spreadRadiusPx:r,burnSeconds:i,smokePerSecond:a}}function Zf(e){let t=(...e)=>e.every(Number.isFinite);if(!e||!t(e.point?.x,e.point?.y,e.radiusPx)||e.radiusPx<0||e.spreadSeconds!==void 0&&(!t(e.spreadSeconds)||e.spreadSeconds<0)||e.mask&&(!e.bounds||!(e.mask.alpha instanceof Uint8Array)||!Number.isInteger(e.mask.pixelWidth)||!Number.isInteger(e.mask.pixelHeight)||e.mask.pixelWidth<=0||e.mask.pixelHeight<=0||e.mask.alpha.length!==e.mask.pixelWidth*e.mask.pixelHeight||!t(e.mask.origin?.x,e.mask.origin?.y)||e.mask.frontRadius!==1/0&&(!t(e.mask.frontRadius)||e.mask.frontRadius<0))||e.bounds&&(!t(e.bounds.x,e.bounds.y,e.bounds.width,e.bounds.height)||e.bounds.width<0||e.bounds.height<0))throw Error(`Invalid fire source: expected finite coordinates and nonnegative geometry`);return{...e,point:{...e.point},...e.bounds&&{bounds:{...e.bounds}},...e.profile&&{profile:{...e.profile}},...e.mask&&{mask:{...e.mask,alpha:e.mask.alpha.slice(),origin:{...e.mask.origin}}}}}function Qf(e,t){if(e.mask&&e.bounds)return np({rect:e.bounds,alpha:e.mask.alpha,pixelWidth:e.mask.pixelWidth,pixelHeight:e.mask.pixelHeight},e.mask.origin,e.mask.frontRadius,t,e.radiusPx);if(e.bounds){let n=e.bounds;return Math.hypot(Math.max(t.x-n.x-n.width,n.x-t.x-t.width,0),Math.max(t.y-n.y-n.height,n.y-t.y-t.height,0))}return Math.hypot(Math.max(t.x-e.point.x,0,e.point.x-t.x-t.width),Math.max(t.y-e.point.y,0,e.point.y-t.y-t.height))}function $f(e,t,n,r){let i=Qf(t,n);return i>t.radiusPx?0:e/Math.max(.01,t.spreadSeconds??r)*(1.5-.5*i/Math.max(t.radiusPx,1))}function ep(e,t,n=1024){let{x:r,y:i,width:a,height:o}=e,s=Math.max(1,Math.ceil(a/Math.max(1,t))),c=Math.max(1,Math.ceil(o/Math.max(1,t))),l=Math.min(1,Math.sqrt(n/(s*c))),u=Math.min(n,Math.max(1,Math.floor(s*l))),d=Math.min(n,Math.max(1,Math.floor(c*l)));u=Math.min(u,Math.max(1,Math.floor(n/d)));let f=[];for(let e=0;e<d;e++)for(let t=0;t<u;t++)f.push({x:r+(t+.5)*a/u,y:i+(e+.5)*o/d});return f}function tp(e,t){if(!e.bounds)return[e.point];let n=e.bounds,r=e.radiusPx,i=t?{x:Math.max(n.x,t.x-r),y:Math.max(n.y,t.y-r),width:Math.min(n.x+n.width,t.x+t.width+r)-Math.max(n.x,t.x-r),height:Math.min(n.y+n.height,t.y+t.height+r)-Math.max(n.y,t.y-r)}:n;return i.width<=0||i.height<=0?[]:ep(i,Math.max(1,e.radiusPx)).filter(t=>!e.mask||Qf({...e,radiusPx:0},{...t,width:0,height:0})===0)}function np(e,t,n,r,i){let{rect:a,alpha:o,pixelWidth:s,pixelHeight:c}=e;if(a.width<=0||a.height<=0)return 1/0;let l=Math.max(0,Math.floor((r.x-i-a.x)/a.width*s)),u=Math.min(s-1,Math.floor((r.x+r.width+i-a.x)/a.width*s)),d=Math.max(0,Math.floor((r.y-i-a.y)/a.height*c)),f=Math.min(c-1,Math.floor((r.y+r.height+i-a.y)/a.height*c)),p=1/0;for(let e=d;e<=f;e++)for(let i=l;i<=u;i++){if(o[e*s+i]<=32)continue;let l={x:a.x+i*a.width/s,y:a.y+e*a.height/c,width:a.width/s,height:a.height/c};Math.hypot(l.x+l.width/2-t.x,l.y+l.height/2-t.y)>n||(p=Math.min(p,Math.hypot(Math.max(r.x-l.x-l.width,l.x-r.x-r.width,0),Math.max(r.y-l.y-l.height,l.y-r.y-r.height,0))))}return p}var rp=new WeakMap;function ip(e,t){let{rect:n,alpha:r,pixelWidth:i,pixelHeight:a}=e,o=t.spreadRadiusPx,s=rp.get(e);if(!s||s.alpha!==r||s.width!==n.width||s.height!==n.height||s.pixelWidth!==i||s.pixelHeight!==a||s.radius!==o){let t=Math.max(1,o*.75),c=Math.max(1,Math.ceil(n.width/t)),l=Math.max(1,Math.ceil(n.height/t)),u=Array(c*l),d=(e,r)=>{let i=Math.min(c-1,Math.floor(e/t)),a=Math.min(l-1,Math.floor(r/t)),o=a*c+i,s=(i+.5)*n.width/c,d=(a+.5)*n.height/l,f=(e-s)**2+(r-d)**2;(!u[o]||f<u[o].distance)&&(u[o]={x:e,y:r,distance:f})};for(let e=0;e<l;e++)for(let t=0;t<c;t++){let o=(t+.5)*n.width/c,s=(e+.5)*n.height/l,u=Math.min(i-1,Math.floor(o/n.width*i));r[Math.min(a-1,Math.floor(s/n.height*a))*i+u]>32&&d(o,s)}for(let e=0;e<a;e++)for(let t=0;t<i;t++)r[e*i+t]<=32||d((t+.5)*n.width/i,(e+.5)*n.height/a);s={alpha:r,width:n.width,height:n.height,pixelWidth:i,pixelHeight:a,radius:o,points:u.filter(e=>e!==void 0).map(({x:e,y:t})=>({x:e,y:t}))},rp.set(e,s)}return s.points.map(e=>({point:{x:n.x+e.x,y:n.y+e.y},radiusPx:o,spreadSeconds:t.spreadSeconds,profile:t}))}var ap=[[0,0],[60,120],[120,180],[240,240],[300,300],[360,360]];function op(e,t=!1){for(let n=1;n<ap.length;n++){let r=ap[n-1],i=ap[n],a=t?r[1]:r[0],o=t?i[1]:i[0];if(e<=o)return(t?r[0]:r[1])+(e-a)/(o-a)*((t?i[0]:i[1])-(t?r[0]:r[1]))}return e}function sp(e){let[t,n,r]=e.map(e=>e/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a,s=(i+a)*.5,c=o===0?0:o/(1-Math.abs(2*s-1)),l=o===0?0:i===t?(n-r)/o%6:i===n?(r-t)/o+2:(t-n)/o+4;return l=op((l*60+360)%360)*Math.PI/180,[.5+.5*Math.cos(l)*c,.5+.5*Math.sin(l)*c,c,s]}function cp(e){let t=e[0]*2-1,n=e[1]*2-1,r=Math.max(0,Math.min(1,e[2])),i=Math.max(0,Math.min(1,Math.hypot(t,n)/Math.max(r,1e-6))),a=r*Math.min(1,Math.sqrt(i*2)),o=Math.max(0,Math.min(1,e[3]))*(r>1e-6?.65+.35*i:1),s=op((Math.atan2(n,t)*180/Math.PI+360)%360,!0),c=(1-Math.abs(2*o-1))*a,l=c*(1-Math.abs(s/60%2-1)),u=Math.floor(s/60)%6,d=0,f=0,p=0;switch(u){case 0:d=c,f=l;break;case 1:d=l,f=c;break;case 2:f=c,p=l;break;case 3:f=l,p=c;break;case 4:d=l,p=c;break;default:d=c,p=l}let m=o-c*.5;return[Math.max(0,Math.min(255,(d+m)*255)),Math.max(0,Math.min(255,(f+m)*255)),Math.max(0,Math.min(255,(p+m)*255))]}function lp(e){let t=ee[e],n=e===`paint`?null:Te(e),r=Math.max(t?.gloss??0,(n?.surface?.clearcoat??0)*.5),i=Math.max(t?.relief??0,(n?.surface?.microRelief??0)*.7),a=Math.max(t?.film??0,n?.iridescence??0),o=Math.max(t?.grain??0,n?.sediment??0),s=n?.atmosphere?.emission??0;return{gloss:r,relief:i,film:a,grain:o,emission:s,emissionColor:n?.atmosphere?.emissionColor??[0,0,0],shaded:r+i+a+o+s>0}}function up(e,t,n,r,i,a){if(!e.shaded)return t;let o=Math.max(0,-i*.55-a*.8)*e.gloss*82,s=Math.sin(n*.16+r*.08)*e.relief*8,c=Math.sin(n*.095+r*.13+i*3)*e.film*27,l=Math.sin(n*127.1+r*311.7)*43758.5453%1*e.grain*12,u=o+s+l,d=e.emission*.22,f=(t,n,r)=>Math.max(0,Math.min(255,t+u+r+e.emissionColor[n]*d));return[f(t[0],0,c),f(t[1],1,-c*.65),f(t[2],2,c*.8)]}var dp=(e,t,n)=>Math.max(t,Math.min(n,e)),fp=new Uint8Array(new Uint32Array([1]).buffer)[0]===1,pp=(e,t,n)=>e+(t-e)*n,mp=[[1,0],[-1,0],[0,1],[0,-1]],hp=[[.7,.7],[-.7,.7],[.7,-.7],[-.7,-.7]],gp=class{kind;width;height;profile;canvas=document.createElement(`canvas`);splatterCanvas=null;splatterBounds=null;splatterDirty=!1;material;authored;deposited;pigment;colorPixels;basePixels;outline;spring;velocity;drops=[];burnDecay=new Float32Array;revision=0;pulled=!1;maxOutline=0;presented=-1;active=null;activeCells=new Set;outlineCells=new Set;wetBounds=null;renderedBounds=null;dirtyBounds=null;fullDirty=!0;color;appearance;cellSizePx=1;listeners=new Set;constructor(e,t,n,r,i){this.kind=e,this.width=t,this.height=n,this.profile=i,this.color=[...r],this.appearance=lp(e);let a=C[e];this.material={thickness:a.thickness,deformation:i?.deformation??a.deformation,alpha:i?.opacity??a.alpha};let o=t*n;this.authored=new Uint8Array(o),this.deposited=new Uint8Array(o),this.pigment=new Float32Array(o*4),this.colorPixels=new Uint8Array(o*3),this.basePixels=fp&&!this.appearance.shaded?new Uint32Array(o):null,this.outline=new Float32Array(o*2),this.spring=new Float32Array(o*2),this.velocity=new Float32Array(o*2),this.canvas.width=t,this.canvas.height=n}get shapeRevision(){return this.revision}get displaced(){return this.pulled||this.active!==null}get moving(){return this.active!==null}get hasSplatter(){return this.drops.length>0}get hasDeposits(){return this.deposited.some(e=>e>0)}get managedBytes(){return this.authored.byteLength+this.deposited.byteLength+this.pigment.byteLength+this.colorPixels.byteLength+(this.basePixels?.byteLength??0)+this.outline.byteLength+this.spring.byteLength+this.velocity.byteLength+this.canvas.width*this.canvas.height*4+(this.splatterCanvas?this.splatterCanvas.width*this.splatterCanvas.height*4:0)}setCellSize(e){this.cellSizePx=Math.max(.01,e)}configure(e,t){this.color=[...e],this.material.deformation=t?.deformation??C[this.kind].deformation;let n=t?.opacity??C[this.kind].alpha;n!==this.material.alpha&&(this.material.alpha=n,this.rebuildBasePixels()),this.changed()}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}changed(e){e?this.fullDirty||(this.dirtyBounds=this.dirtyBounds?{left:Math.min(this.dirtyBounds.left,e.left),top:Math.min(this.dirtyBounds.top,e.top),right:Math.max(this.dirtyBounds.right,e.right),bottom:Math.max(this.dirtyBounds.bottom,e.bottom)}:{...e}):(this.fullDirty=!0,this.dirtyBounds=null),this.revision++;for(let e of this.listeners)e()}alphaAt(e){return Math.max(this.authored[e],this.deposited[e])}refreshBasePixel(e){if(!this.basePixels)return;let t=this.alphaAt(e),n=e*3;this.basePixels[e]=Math.round(t*this.material.alpha)<<24|this.colorPixels[n+2]<<16|this.colorPixels[n+1]<<8|this.colorPixels[n]}rebuildBasePixels(){if(this.basePixels)for(let e=0;e<this.width*this.height;e++)this.refreshBasePixel(e)}wetAt(e,t){let n=Math.floor(e),r=Math.floor(t);return n>=0&&r>=0&&n<this.width&&r<this.height&&this.alphaAt(r*this.width+n)>=24}includeWetBounds(e){this.wetBounds=this.wetBounds?{left:Math.min(this.wetBounds.left,e.left),top:Math.min(this.wetBounds.top,e.top),right:Math.max(this.wetBounds.right,e.right),bottom:Math.max(this.wetBounds.bottom,e.bottom)}:e}rebuildWetBounds(){let e=this.width,t=this.height,n=-1,r=-1;for(let i=0;i<this.height;i++)for(let a=0;a<this.width;a++)this.alphaAt(i*this.width+a)&&(e=Math.min(e,a),t=Math.min(t,i),n=Math.max(n,a),r=Math.max(r,i));this.wetBounds=n>=e?{left:e,top:t,right:n,bottom:r}:null}componentAt(e,t,n,r){let i=dp(t.x-.5,0,this.width-1),a=dp(t.y-.5,0,this.height-1),o=Math.floor(i),s=Math.floor(a),c=Math.min(this.width-1,o+1),l=Math.min(this.height-1,s+1),u=i-o,d=a-s,f=e[(s*this.width+o)*r+n],p=e[(s*this.width+c)*r+n],m=e[(l*this.width+o)*r+n],h=e[(l*this.width+c)*r+n];return pp(pp(f,p,u),pp(m,h,u),d)}offsetAt(e,t=!0){return{x:this.componentAt(this.spring,e,0,2)+(t?this.componentAt(this.outline,e,0,2):0),y:this.componentAt(this.spring,e,1,2)+(t?this.componentAt(this.outline,e,1,2):0)}}sourcePoint(e){let t=this.offsetAt(e);return{x:e.x-t.x,y:e.y-t.y}}rawCoverage(e){return this.rawCoverageXY(e.x,e.y)}rawCoverageXY(e,t){if(e<0||t<0||e>=this.width||t>=this.height)return 0;let n=dp(e-.5,0,this.width-1),r=dp(t-.5,0,this.height-1),i=Math.floor(n),a=Math.floor(r),o=Math.min(this.width-1,i+1),s=Math.min(this.height-1,a+1),c=n-i,l=r-a;return pp(pp(this.alphaAt(a*this.width+i),this.alphaAt(a*this.width+o),c),pp(this.alphaAt(s*this.width+i),this.alphaAt(s*this.width+o),c),l)/255}densityAt(e){return e.x<0||e.y<0||e.x>=this.width||e.y>=this.height?0:this.rawCoverage(this.sourcePoint(e))}colorAt(e){let t=this.sourcePoint(e),n=dp(Math.floor(t.y),0,this.height-1)*this.width+dp(Math.floor(t.x),0,this.width-1);return this.alphaAt(n)?[this.colorPixels[n*3],this.colorPixels[n*3+1],this.colorPixels[n*3+2]]:this.color}captureFuel(){let e=new Float32Array(this.width*this.height);for(let t=0;t<this.height;t++)for(let n=0;n<this.width;n++)e[t*this.width+n]=this.densityAt({x:n+.5,y:t+.5});return e}inspectState(){let e=this.captureFuel(),t=0,n=1/0,r=0;for(let i of e)t+=i,n=Math.min(n,i),r=Math.max(r,i);return{volume:t,minimum:n,maximum:r,finite:Number.isFinite(t)}}setPigment(e,t,n,r=sp(t)){let i=e*4;if(n>=1||!this.alphaAt(e))for(let e=0;e<4;e++)this.pigment[i+e]=r[e];else for(let e=0;e<4;e++)this.pigment[i+e]=pp(this.pigment[i+e],r[e],n);let a=cp([this.pigment[i],this.pigment[i+1],this.pigment[i+2],this.pigment[i+3]]);for(let t=0;t<3;t++)this.colorPixels[e*3+t]=Math.round(a[t]);this.refreshBasePixel(e)}seedMask(e,t,n,r=this.color){if(e.length!==this.width*this.height)throw RangeError(`Liquid seed must match the field resolution`);this.authored.set(e);let i=sp(r),a=this.width,o=this.height,s=-1,c=-1;for(let t=0;t<e.length;t++){if(e[t]&&!this.deposited[t]&&(this.pigment.set(i,t*4),this.colorPixels.set(r,t*3)),this.refreshBasePixel(t),!e[t]&&!this.deposited[t])continue;let n=t%this.width,l=(t-n)/this.width;n<a&&(a=n),n>s&&(s=n),l<o&&(o=l),l>c&&(c=l)}this.wetBounds=s>=a?{left:a,top:o,right:s,bottom:c}:null,this.changed()}removeSeed(){this.authored.fill(0),this.rebuildBasePixels(),this.rebuildWetBounds(),this.changed()}pour(e,t,n,r,i,a=this.color,o=n,s=r){if(!(e>0))return;n=this.sourcePoint(n),o=this.sourcePoint(o);let c=Math.max(0,Math.floor(Math.min(o.x-s,n.x-r)-2)),l=Math.min(this.width-1,Math.ceil(Math.max(o.x+s,n.x+r)+2)),u=Math.max(0,Math.floor(Math.min(o.y-s,n.y-r)-2)),d=Math.min(this.height-1,Math.ceil(Math.max(o.y+s,n.y+r)+2)),f=n.x-o.x,p=n.y-o.y,m=Math.max(1e-6,f*f+p*p),h=sp(a),g=!1;for(let t=u;t<=d;t++)for(let i=c;i<=l;i++){let c=i+.5,l=t+.5,u=dp(((c-o.x)*f+(l-o.y)*p)/m,0,1),d=pp(o.x,n.x,u),_=pp(o.y,n.y,u),v=pp(s,r,u),y=Math.hypot(c-d,l-_),b=Math.round(dp(v+.5-y,0,1)*255);if(!b)continue;let x=t*this.width+i,S=this.alphaAt(x),C=this.colorPixels[x*3]===a[0]&&this.colorPixels[x*3+1]===a[1]&&this.colorPixels[x*3+2]===a[2];b<=this.deposited[x]&&S&&C||(!S||C?(this.pigment.set(h,x*4),this.colorPixels.set(a,x*3)):this.setPigment(x,a,dp(e*b/(S*2),0,1),h),this.deposited[x]=Math.max(this.deposited[x],b),this.refreshBasePixel(x),g=!0)}g&&(this.includeWetBounds({left:c,top:u,right:l,bottom:d}),this.changed())}transferPigment(e,t,n,r,i){if(!(i>0))return;let a=sp(r),o=this.width,s=this.height,c=-1,l=-1;if(this.eachContactPixel(e,t,n,(e,t,n,u)=>{if(!this.alphaAt(e))return;this.setPigment(e,r,dp(t*i,0,1),a);let d=Math.floor(n),f=Math.floor(u);o=Math.min(o,d),s=Math.min(s,f),c=Math.max(c,d),l=Math.max(l,f)},Math.max(2,n*1.1)),c>=o){let e=Math.ceil(this.maxOutline+8/this.cellSizePx)+2;this.changed({left:o-e,top:s-e,right:c+e,bottom:l+e})}}eachContactPixel(e,t,n,r,i=Math.max(2,n*1.8,(24*this.material.deformation+2)/this.cellSizePx)){let a=this.wetBounds,o=i+(this.pulled||this.active?8/this.cellSizePx:0),s=Math.max(0,Math.floor(Math.min(e.x,t.x)-i),a?Math.floor(a.left-o):0),c=Math.min(this.width-1,Math.ceil(Math.max(e.x,t.x)+i),a?Math.ceil(a.right+o):this.width-1),l=Math.max(0,Math.floor(Math.min(e.y,t.y)-i),a?Math.floor(a.top-o):0),u=Math.min(this.height-1,Math.ceil(Math.max(e.y,t.y)+i),a?Math.ceil(a.bottom+o):this.height-1),d=t.x-e.x,f=t.y-e.y,p=Math.max(1e-6,d*d+f*f),m=i*i;for(let t=l;t<=u;t++)for(let n=s;n<=c;n++){let a=n+.5,o=t+.5,s=dp(((a-e.x)*d+(o-e.y)*f)/p,0,1),c=a-e.x-d*s,l=o-e.y-f*s,u=c*c+l*l;if(u>=m)continue;let h=1-Math.sqrt(u)/i;r(t*this.width+n,h*h,a,o)}return{left:s,top:l,right:c,bottom:u}}drag(e,t,n,r=5.5,i=0){if(this.material.deformation===0)return;let a=t.x-e.x,o=t.y-e.y;if(Math.hypot(a,o)<.5)return;let s=Math.max(2,r*1.8,(24*this.material.deformation+2)/this.cellSizePx),c=Math.max(2,r*1.8),l=Math.hypot(a,o),u=a/l,d=o/l,f=Math.max(2,r*1.25),p=!1,m=this.width,h=this.height,g=-1,_=-1,v=this.eachContactPixel(e,t,r,(e,t,n,r)=>{let i=Math.floor(n),c=Math.floor(r);if(!this.wetAt(n-u*f,r-d*f)||this.wetAt(n+u*f,r+d*f))return;let l=this.alphaAt(e)>=24,v=0;for(let[e,t]of mp)this.wetAt(n+e*s*.35,r+t*s*.35)===l?this.wetAt(n+e*s*.7,r+t*s*.7)===l?this.wetAt(n+e*s,r+t*s)!==l&&(v=Math.max(v,.12)):v=Math.max(v,.3):v=Math.max(v,.65);if(!l&&v===0){for(let[e,t]of hp)if(this.wetAt(n+e*s,r+t*s)){v=.12;break}}if(!l&&v===0)return;let y=this.material.deformation/(.65+this.material.thickness*.7),b=e*2;if(this.velocity[b]=dp(this.velocity[b]+a*t*18*y,-90,90),this.velocity[b+1]=dp(this.velocity[b+1]+o*t*18*y,-90,90),this.activeCells.add(e),v>0){let n=24*this.material.deformation/this.cellSizePx;this.outline[b]=dp(this.outline[b]+a*t*y*v*.48,-n,n),this.outline[b+1]=dp(this.outline[b+1]+o*t*y*v*.48,-n,n),this.maxOutline=Math.max(this.maxOutline,Math.abs(this.outline[b]),Math.abs(this.outline[b+1])),this.pulled=!0,this.outlineCells.add(e)}p=!0,m=Math.min(m,i),h=Math.min(h,c),g=Math.max(g,i),_=Math.max(_,c)},c);p&&(this.active=this.active?{left:Math.min(v.left,this.active.left),top:Math.min(v.top,this.active.top),right:Math.max(v.right,this.active.right),bottom:Math.max(v.bottom,this.active.bottom)}:v,this.changed({left:m,top:h,right:g,bottom:_}))}step(e,t=0,n=[],r,i=e){let a=dp(e,0,1/30);if(this.activeCells.size){let e=Math.exp(-(7+this.material.thickness*5)*a),t=this.width,n=this.height,r=-1,i=-1;for(let o of this.activeCells){let s=o%this.width,c=Math.floor(o/this.width),l=0;for(let t=0;t<2;t++){let n=o*2+t,r=this.spring[n],i=(this.velocity[n]-r*95*a)*e;this.velocity[n]=i,this.spring[n]=dp(r+i*a,-8/this.cellSizePx,8/this.cellSizePx),l=Math.max(l,Math.abs(this.spring[n]),Math.abs(i)*.08)}if(t=Math.min(t,s),n=Math.min(n,c),r=Math.max(r,s),i=Math.max(i,c),l<.012){let e=o*2;this.spring[e]=this.spring[e+1]=0,this.velocity[e]=this.velocity[e+1]=0,this.activeCells.delete(o)}}r>=t&&this.changed({left:t,top:n,right:r,bottom:i}),this.active=this.activeCells.size?{left:t,top:n,right:r,bottom:i}:null}if(t<=0&&!r)return;let o=this.wetBounds;if(!o)return;let s=r?.size??0;if(r){this.burnDecay.length!==r.rates.length&&(this.burnDecay=new Float32Array(r.rates.length));for(let e=0;e<r.rates.length;e++){let n=t+r.rates[e];this.burnDecay[e]=n>0?Math.exp(-n*i):1}}let c=t>0?Math.exp(-t*i):1,l=this.width===s*4&&this.height===s*4,u=this.width,d=this.height,f=-1,p=-1;for(let e=Math.max(0,o.top);e<=Math.min(this.height-1,o.bottom);e++){let t=r?(l?e>>2:Math.floor(e*s/this.height))*s:0;for(let n=Math.max(0,o.left);n<=Math.min(this.width-1,o.right);n++){let i=e*this.width+n;if(!this.authored[i]&&!this.deposited[i])continue;let a=i*2,o=c;if(r){let r=this.spring[a]+this.outline[a],i=this.spring[a+1]+this.outline[a+1],c=r===0&&i===0?t+(l?n>>2:Math.floor(n*s/this.width)):dp(Math.floor((e+i)*s/this.height),0,s-1)*s+dp(Math.floor((n+r)*s/this.width),0,s-1);o=this.burnDecay[c]}if(o>=1)continue;let m=Math.round(this.authored[i]*o),h=Math.round(this.deposited[i]*o);(m!==this.authored[i]||h!==this.deposited[i])&&(this.authored[i]=m,this.deposited[i]=h,this.refreshBasePixel(i),u=Math.min(u,n),d=Math.min(d,e),f=Math.max(f,n),p=Math.max(p,e))}}f>=u&&this.changed({left:u,top:d,right:f,bottom:p})}mayIntersect(e,t,n=1){let r=Math.max(1,Math.ceil(Math.hypot(t.x-e.x,t.y-e.y)/Math.max(1,n)));for(let n=0;n<=r;n++){let i=n/r,a={x:pp(e.x,t.x,i),y:pp(e.y,t.y,i)};if(this.densityAt(a)>.02)return!0}return!1}spray(e,t,n,r,i=1,a=this.color){let o=Math.min(12,Math.ceil(r*2));for(let r of Ne(e,t,Math.max(1,n*.35),o,i,this.material.thickness))this.drops.push({point:{x:r.x,y:r.y},radius:Math.max(.5,r.radius),color:a,opacity:this.material.alpha*r.opacity,age:0});this.drops.length>256&&this.drops.splice(0,this.drops.length-256),this.splatterDirty=!0}grow(e){if(e<=1)return this.width;let t=this.width,n=Math.ceil(this.width*e/2)*2,r=Math.ceil(this.height*e/2)*2,i=Math.floor((n-this.width)/2),a=Math.floor((r-this.height)/2),o=(e,t,r)=>{for(let o=0;o<this.height;o++)r.set(e.subarray(o*this.width*t,(o+1)*this.width*t),((o+a)*n+i)*t);return r};this.authored=o(this.authored,1,new Uint8Array(n*r)),this.deposited=o(this.deposited,1,new Uint8Array(n*r)),this.pigment=o(this.pigment,4,new Float32Array(n*r*4)),this.colorPixels=o(this.colorPixels,3,new Uint8Array(n*r*3)),this.basePixels&&=o(this.basePixels,1,new Uint32Array(n*r)),this.outline=o(this.outline,2,new Float32Array(n*r*2)),this.spring=o(this.spring,2,new Float32Array(n*r*2)),this.velocity=o(this.velocity,2,new Float32Array(n*r*2)),this.activeCells=new Set([...this.activeCells].map(e=>(Math.floor(e/t)+a)*n+e%t+i)),this.outlineCells=new Set([...this.outlineCells].map(e=>(Math.floor(e/t)+a)*n+e%t+i));for(let e of this.drops)e.point.x+=i,e.point.y+=a;return this.splatterDirty=!0,this.active&&(this.active.left+=i,this.active.right+=i,this.active.top+=a,this.active.bottom+=a),this.wetBounds&&(this.wetBounds.left+=i,this.wetBounds.right+=i,this.wetBounds.top+=a,this.wetBounds.bottom+=a),this.width=n,this.height=r,this.canvas.width=n,this.canvas.height=r,this.renderedBounds=null,this.changed(),n}setColor(e){this.color=[...e],this.changed()}reset(){this.authored.fill(0),this.deposited.fill(0),this.outline.fill(0),this.spring.fill(0),this.velocity.fill(0),this.drops=[],this.splatterCanvas=null,this.splatterBounds=null,this.splatterDirty=!1,this.active=null,this.activeCells.clear(),this.outlineCells.clear(),this.basePixels?.fill(0),this.wetBounds=null,this.pulled=!1,this.maxOutline=0,this.changed()}captureState(){return{width:this.width,height:this.height,cellSizePx:this.cellSizePx,active:this.active?{...this.active}:null,pulled:this.pulled,authored:this.authored.slice(),deposited:this.deposited.slice(),pigment:this.pigment.slice(),colorPixels:this.colorPixels.slice(),outline:this.outline.slice(),spring:this.spring.slice(),velocity:this.velocity.slice(),drops:this.drops.map(e=>({...e,point:{...e.point}})),color:[...this.color],dispose(){}}}restoreState(e){this.width=e.width,this.height=e.height,this.canvas.width=e.width,this.canvas.height=e.height,this.cellSizePx=e.cellSizePx,this.active=e.active?{...e.active}:null,this.pulled=e.pulled,this.authored=e.authored.slice(),this.deposited=e.deposited.slice(),this.pigment=e.pigment.slice(),this.colorPixels=e.colorPixels.slice(),this.basePixels=fp&&!this.appearance.shaded?new Uint32Array(this.width*this.height):null,this.outline=e.outline.slice(),this.outlineCells=new Set;for(let e=0;e<this.width*this.height;e++)(this.outline[e*2]||this.outline[e*2+1])&&this.outlineCells.add(e);if(this.maxOutline=this.outline.reduce((e,t)=>Math.max(e,Math.abs(t)),0),this.spring=e.spring.slice(),this.velocity=e.velocity.slice(),this.activeCells=new Set,this.active)for(let e=this.active.top;e<=this.active.bottom;e++)for(let t=this.active.left;t<=this.active.right;t++){let n=e*this.width+t,r=n*2;(this.spring[r]!==0||this.spring[r+1]!==0||this.velocity[r]!==0||this.velocity[r+1]!==0)&&this.activeCells.add(n)}this.activeCells.size||(this.active=null),this.drops=e.drops.map(e=>({...e,point:{...e.point}})),this.splatterDirty=!0,this.color=[...e.color],this.rebuildBasePixels(),this.rebuildWetBounds(),this.renderedBounds=null,this.changed()}dispose(){this.listeners.clear(),this.canvas.remove(),this.splatterCanvas?.remove()}paintUnshaded(e,t){let n=this.basePixels,r=new Uint32Array(e.data.buffer),i=t.right-t.left+1;for(let e=t.top;e<=t.bottom;e++)r.set(n.subarray(e*this.width+t.left,e*this.width+t.right+1),(e-t.top)*i);let a=0,o=e=>{let n=e%this.width,o=Math.floor(e/this.width);if(n<t.left||n>t.right||o<t.top||o>t.bottom)return;let s=e*2,c=this.spring[s]+this.outline[s],l=this.spring[s+1]+this.outline[s+1];if(c===0&&l===0)return;a++;let u=n+.5-c,d=o+.5-l,f=this.rawCoverageXY(u,d),p=(o-t.top)*i+n-t.left;if(f<=0){r[p]=0;return}let m=(dp(Math.floor(d),0,this.height-1)*this.width+dp(Math.floor(u),0,this.width-1))*3;r[p]=Math.round(f*this.material.alpha*255)<<24|this.colorPixels[m+2]<<16|this.colorPixels[m+1]<<8|this.colorPixels[m]};for(let e of this.outlineCells)o(e);for(let e of this.activeCells)this.outlineCells.has(e)||o(e);return i*(t.bottom-t.top+1)-a}present(){if(this.presented!==this.revision){performance.now();let e=this.canvas.getContext(`2d`),t=this.pulled||this.active?Math.ceil(this.maxOutline+8/this.cellSizePx)+2:2,n=this.wetBounds,r=n?{left:Math.max(0,n.left-t),top:Math.max(0,n.top-t),right:Math.min(this.width-1,n.right+t),bottom:Math.min(this.height-1,n.bottom+t)}:null,i=this.renderedBounds,a=this.fullDirty?i&&r?{left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)}:i??r:this.dirtyBounds;a&&e.clearRect(a.left,a.top,a.right-a.left+1,a.bottom-a.top+1);let o=r&&a?{left:Math.max(0,r.left,a.left),top:Math.max(0,r.top,a.top),right:Math.min(this.width-1,r.right,a.right),bottom:Math.min(this.height-1,r.bottom,a.bottom)}:null;if(o&&o.right>=o.left&&o.bottom>=o.top){let t=o.right-o.left+1,n=o.bottom-o.top+1,r=e.createImageData(t,n),i=fp&&!this.appearance.shaded?new Uint32Array(r.data.buffer):null;performance.now();let a=this.basePixels?this.paintUnshaded(r,o):0;if(!this.basePixels)for(let e=o.top;e<=o.bottom;e++)for(let n=o.left;n<=o.right;n++){let s=(e*this.width+n)*2,c=this.spring[s]+this.outline[s],l=this.spring[s+1]+this.outline[s+1],u=c===0&&l===0;u&&a++;let d=((e-o.top)*t+n-o.left)*4;if(u&&i){let t=e*this.width+n,r=this.alphaAt(t);if(!r)continue;let a=t*3;i[d/4]=Math.round(r*this.material.alpha)<<24|this.colorPixels[a+2]<<16|this.colorPixels[a+1]<<8|this.colorPixels[a];continue}let f=n+.5-c,p=e+.5-l,m=u?this.alphaAt(e*this.width+n)/255:this.rawCoverageXY(f,p);if(m<=0)continue;let h=u?e*this.width+n:dp(Math.floor(p),0,this.height-1)*this.width+dp(Math.floor(f),0,this.width-1);if(this.appearance.shaded){let t=[this.colorPixels[h*3],this.colorPixels[h*3+1],this.colorPixels[h*3+2]],i=up(this.appearance,t,n,e,this.rawCoverageXY(f+1,p)-this.rawCoverageXY(f-1,p),this.rawCoverageXY(f,p+1)-this.rawCoverageXY(f,p-1));for(let e=0;e<3;e++)r.data[d+e]=i[e]}else{if(i){i[d/4]=Math.round(m*this.material.alpha*255)<<24|this.colorPixels[h*3+2]<<16|this.colorPixels[h*3+1]<<8|this.colorPixels[h*3];continue}r.data[d]=this.colorPixels[h*3],r.data[d+1]=this.colorPixels[h*3+1],r.data[d+2]=this.colorPixels[h*3+2]}r.data[d+3]=Math.round(m*this.material.alpha*255)}Ye(`liquid raster pixels`,t*n),Ye(`liquid still pixels`,a),performance.now(),e.putImageData(r,o.left,o.top)}this.renderedBounds=r,this.fullDirty=!1,this.dirtyBounds=null,this.presented=this.revision}}draw(e){if(this.present(),this.renderedBounds){let{left:t,top:n,right:r,bottom:i}=this.renderedBounds,a=r-t+1,o=i-n+1;e.drawImage(this.canvas,t,n,a,o,t,n,a,o)}this.drawSplatter(e)}drawSplatter(e){if(this.drops.length){if(this.splatterDirty||!this.splatterCanvas||!this.splatterBounds){let e={left:Math.floor(Math.min(...this.drops.map(e=>e.point.x-e.radius))),top:Math.floor(Math.min(...this.drops.map(e=>e.point.y-e.radius))),right:Math.ceil(Math.max(...this.drops.map(e=>e.point.x+e.radius))),bottom:Math.ceil(Math.max(...this.drops.map(e=>e.point.y+e.radius)))},t=this.splatterCanvas??document.createElement(`canvas`),n=Math.max(1,e.right-e.left),r=Math.max(1,e.bottom-e.top);t.width!==n&&(t.width=n),t.height!==r&&(t.height=r);let i=t.getContext(`2d`);i.clearRect(0,0,n,r);for(let t of this.drops)i.globalAlpha=t.opacity,i.fillStyle=`rgb(${t.color.join(` `)})`,i.beginPath(),i.arc(t.point.x-e.left,t.point.y-e.top,t.radius,0,Math.PI*2),i.fill();this.splatterCanvas=t,this.splatterBounds=e,this.splatterDirty=!1}e.drawImage(this.splatterCanvas,this.splatterBounds.left,this.splatterBounds.top)}}};function _p(e,t,n){let r=Math.ceil(t/4),i=new Float32Array(r*r),a=n.width/r;for(let n=0;n<t;n++)for(let a=0;a<t;a++){let o=Math.floor(n/4)*r+Math.floor(a/4);i[o]=Math.max(i[o],e[n*t+a])}return{size:r,fuel:i,spacing:a,point:e=>({x:n.x+(e%r+.5)*a,y:n.y+(Math.floor(e/r)+.5)*a})}}function vp(e){let t=e.flatMap(e=>Array.from(e.fuel,(t,n)=>({field:e,i:n,fuel:t,point:e.point(n)})).filter(e=>e.fuel>=.035)),n=Math.max(1,...e.map(e=>e.spacing))*2,r=e=>`${Math.floor(e.x/n)},${Math.floor(e.y/n)}`,i=new Map;t.forEach((e,t)=>{let n=r(e.point),a=i.get(n)??[];a.push(t),i.set(n,a)});let a=function*(e,t){let r=Math.ceil(t/n),a=Math.floor(e.x/n),o=Math.floor(e.y/n);for(let e=-r;e<=r;e++)for(let t=-r;t<=r;t++)for(let n of i.get(`${a+e},${o+t}`)??[])yield n};return{nodes:t,neighbors:function*(e){let r=t[e];for(let e of a(r.point,n)){let n=t[e],i=Math.hypot(r.point.x-n.point.x,r.point.y-n.point.y);i<=(r.field.spacing+n.field.spacing)*.74&&(yield{next:e,distance:i})}},nearby:a,cellSize:n}}function yp(e,t,n=0){let r=vp(e),i=new Int32Array(r.nodes.length).fill(-2),a=[];for(let e of t)for(let t of r.nearby(e,n+r.cellSize)){let o=r.nodes[t];i[t]===-2&&Math.hypot(o.point.x-e.x,o.point.y-e.y)<=n+o.field.spacing*.75&&(i[t]=-1,a.push(t))}for(let e=0;e<a.length;e++)for(let{next:t}of r.neighbors(a[e]))i[t]===-2&&(i[t]=a[e],a.push(t));let o=(e,t)=>{let n=-1,a=1/0;for(let o of r.nearby(e,t+r.cellSize)){if(i[o]===-2)continue;let s=r.nodes[o],c=Math.hypot(s.point.x-e.x,s.point.y-e.y);c<=t+s.field.spacing*.75&&c<a&&(n=o,a=c)}return n};return{points:a.map(e=>r.nodes[e].point),contains:(e,t=0)=>o(e,t)>=0,intersects:(e,t=0)=>{let n={x:e.x+e.width/2,y:e.y+e.height/2};for(let a of r.nearby(n,Math.hypot(e.width,e.height)/2+t+r.cellSize)){if(i[a]===-2)continue;let n=r.nodes[a],o=n.point,s=t+n.field.spacing*.5;if(o.x>=e.x-s&&o.x<=e.x+e.width+s&&o.y>=e.y-s&&o.y<=e.y+e.height+s)return!0}return!1},pathTo:(e,t=0)=>{let n=o(e,t),a=[];for(;n>=0;)a.push(r.nodes[n].point),n=i[n];return a.reverse()}}}var bp=class{density;resolution;rect;lifetime;spreadMps;pixelsPerMeter;size;fuel;starts;ends;rates;alpha;baseAlpha;light;pixelsByCell;revision=0;complete=!1;lit=!1;constructor(e,t,n,r,i,a){this.density=e,this.resolution=t,this.rect=n,this.lifetime=r,this.spreadMps=i,this.pixelsPerMeter=a;let o=_p(e,t,n);this.size=o.size,this.fuel=o.fuel,this.starts=new Float64Array(this.fuel.length).fill(1/0),this.ends=new Float64Array(this.fuel.length).fill(1/0),this.rates=new Float32Array(this.fuel.length),this.alpha=new Uint8Array(e.length),this.baseAlpha=new Uint8Array(e.length),this.light=new Float32Array(this.fuel.length);let s=Array.from({length:this.fuel.length},()=>[]);for(let n=0;n<t;n++)for(let r=0;r<t;r++){let i=n*t+r;e[i]<=.035||(this.baseAlpha[i]=Math.round(255*Math.min(1,(e[i]-.035)/.12)),s[Math.floor(n/4)*this.size+Math.floor(r/4)].push(i))}this.pixelsByCell=s.map(e=>e.length?Uint32Array.from(e):void 0)}point(e){return{x:this.rect.x+(e%this.size+.5)*this.spacing,y:this.rect.y+(Math.floor(e/this.size)+.5)*this.spacing}}get spacing(){return this.rect.width/this.size}get managedBytes(){return[this.density,this.fuel,this.starts,this.ends,this.rates,this.alpha,this.baseAlpha,this.light].reduce((e,t)=>e+t.byteLength,0)+this.pixelsByCell.reduce((e,t)=>e+(t?.byteLength??0),0)}indexAt(e){let t=Math.floor((e.x-this.rect.x)/this.spacing),n=Math.floor((e.y-this.rect.y)/this.spacing);return t<0||n<0||t>=this.size||n>=this.size?-1:n*this.size+t}inherit(e,t){for(let n=0;n<this.fuel.length;n++){let r=e.indexAt(this.point(n));if(r>=0&&Number.isFinite(e.starts[r])&&e.ends[r]>t){this.starts[n]=Math.max(t,e.starts[r]);let i=Math.min(1,(e.ends[r]-t)/Math.max(.01,e.ends[r]-e.starts[r])),a=this.fuel[n]>e.fuel[r]*i**2+.05;this.ends[n]=a?Math.max(e.ends[r],t+this.lifetime):e.ends[r]}}}update(e,t){let n=!1,r=this.light,i=!1;for(let a=0;a<this.fuel.length;a++){this.rates[a]=0;let o=this.starts[a],s=this.ends[a],c=r[a],l=0;if(Number.isFinite(o)&&e>=o){let r=Math.max(.01,s-o),i=Math.max(0,Math.min(1,(e-t-o)/r)),c=Math.max(0,Math.min(1,(e-o)/r)),u=Math.max(1e-6,(1-i)**2),d=Math.max(1e-6,(1-c)**2);this.rates[a]=Math.log(u/d)/Math.max(t,1e-4),e<s&&(n=!0,l=Math.min(1,(e-o)/.15)*Math.min(1,(s-e)/Math.min(2,r*.3)))}if(r[a]=l,c<=0&&l<=0)continue;let u=this.pixelsByCell[a];if(u)for(let e of u){let t=Math.round(this.baseAlpha[e]*l);this.alpha[e]=t,i||=t>0}}return this.lit=i,this.revision++,this.complete=this.starts.some(Number.isFinite)&&this.ends.every((t,n)=>this.fuel[n]<.035||t<=e),n}};function xp(e,t,n,r,i=[]){let{nodes:a,neighbors:o,nearby:s,cellSize:c}=vp(e);if(!a.length)return;let l=new Set;for(let e of[t,...i])for(let t of s(e,n+c)){let r=a[t];Math.hypot(r.point.x-e.x,r.point.y-e.y)<=n+r.field.spacing*.75&&l.add(t)}let u=new Float64Array(a.length).fill(1/0),d=[],f=(e,t)=>{if(t>=u[e])return;u[e]=t;let n=d.length;for(d.push({index:e,time:t});n>0;){let e=n-1>>1;if(d[e].time<=t)break;d[n]=d[e],n=e}d[n]={index:e,time:t}};for(a.forEach((e,t)=>{e.field.ends[e.i]<=r||(l.has(t)?f(t,r):Number.isFinite(e.field.starts[e.i])&&e.field.ends[e.i]>r&&f(t,Math.max(r,e.field.starts[e.i])))});d.length;){let e=d[0],t=d.pop();if(d.length){let e=0;for(;e*2+1<d.length;){let n=e*2+1;if(n+1<d.length&&d[n+1].time<d[n].time&&n++,d[n].time>=t.time)break;d[e]=d[n],e=n}d[e]=t}if(e.time===u[e.index])for(let{next:t,distance:n}of o(e.index)){let i=a[t];i.field.ends[i.i]<=r||f(t,e.time+n/Math.max(1,i.field.pixelsPerMeter)/i.field.spreadMps)}}a.forEach((e,t)=>{u[t]>=e.field.starts[e.i]||(e.field.starts[e.i]=u[t],e.field.ends[e.i]=u[t]+e.field.lifetime)})}function Sp(e){let t=e.extentM*e.pixelsPerMeter;return{x:e.center.x-t/2,y:e.center.y-t/2,width:t,height:t}}function Cp(e,t){return e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function wp(e,t,n){return t.x>=e.x-n&&t.x<=e.x+e.width+n&&t.y>=e.y-n&&t.y<=e.y+e.height+n}function Tp(e,t,n=0){if(!e.length||!t.length)return[];let r=e.map(Sp),i=new Uint8Array(e.length),a=[];for(let o=0;o<e.length;o++)t.some(e=>wp(r[o],e,n))&&(i[o]=1,a.push(o));for(let t=0;t<a.length;t++){let n=r[a[t]];for(let t=0;t<e.length;t++)!i[t]&&Cp(n,r[t])&&(i[t]=1,a.push(t))}return a.map(t=>e[t])}function Ep(e,t,n=0){return yp(Tp(e.filter(e=>C[e.kind].conductive),t,n).map(e=>_p(e.fluid.captureFuel(),e.resolution,Sp(e))),t,n)}function Dp(e,t,n){let r=[];for(let i of e){let e=i.fire;if(!e||!C[i.kind].burnable)continue;let a=e.size,o=Math.max(1,Math.ceil(n/e.spacing)),s=(n,r)=>{if(n<0||r<0||n>=a||r>=a)return!1;let i=r*a+n;return e.fuel[i]>=.035&&e.starts[i]<=t&&e.ends[i]>t};for(let t=0;t<a;t++)for(let n=0;n<a;n++)s(n,t)&&(s(n-1,t)&&s(n+1,t)&&s(n,t-1)&&s(n,t+1)&&(n%o!==0||t%o!==0)||r.push(e.point(t*a+n)))}return r}function Op(e,t,n,r){let i=0,a=0,o=0,s=new Set,c=null,l=[0,0,0],u=[],d=[];for(let f of e){let e=n(f,t);if(e>.12&&(c=f.id),e>.1&&s.add(f.kind),T(f.kind)===`water`&&!Te(f.kind)||e<.04)continue;let p=f.fluid.colorAt?.(r(f,t))??f.color;d.push({id:`liquid:${f.id}`,color:`rgb(${p.map(e=>Math.round(e)).join(` `)})`,opacity:Math.min(1,e),distanceM:f.elementProfile?.distanceM??(Te(f.kind)?_(f.kind).carryM:C[f.kind].treadDistanceM),material:_(f.kind)}),u.push(f.id);for(let t=0;t<3;t++)l[t]+=p[t]*e;i+=e,a=1-(1-a)*(1-e),o=Math.max(o,f.elementProfile?.distanceM??C[f.kind].treadDistanceM)}let f=i?{id:`liquid:${u.join(`,`)}`,color:`rgb(${l.map(e=>Math.round(e/i)).join(` `)})`,opacity:a,distanceM:o}:null;return{materials:[...s],paint:f,paints:d,splashFieldId:c}}function kp(e,t,n,r,i){let a=new Uint8Array(e*e),o=0,s=i?Math.max(0,Math.floor(((i.left-t.x)/n+.5)*e)-1):0,c=i?Math.min(e,Math.ceil(((i.right-t.x)/n+.5)*e)+1):e,l=i?Math.max(0,Math.floor(((i.top-t.y)/n+.5)*e)-1):0,u=i?Math.min(e,Math.ceil(((i.bottom-t.y)/n+.5)*e)+1):e;for(let i=l;i<u;i++)for(let l=s;l<c;l++){let s=0;for(let a=0;a<2;a++)for(let o=0;o<2;o++)r({x:t.x+((l+.25+o*.5)/e-.5)*n,y:t.y+((i+.25+a*.5)/e-.5)*n})&&s++;let c=Math.round(s/4*255);a[i*e+l]=c,o+=c/255}return{mask:a,coverage:o/(e*e)}}var Ap=4,jp={low:128,medium:160,high:192},Mp={low:192,medium:256,high:384},Np=.115,Pp=1/10,Fp=(e,t)=>{let n=typeof window>`u`?1:Math.min(3,Math.max(1,window.devicePixelRatio||1));return Math.max(Mp[t],Math.min(768,Math.ceil(e*n/16)*16))},Ip=(e,t)=>e.every((e,n)=>e===t[n]);function Lp(e,t,n,i,a){let o=Ee(P(-1),t),s=Ee(P(0,1),t+n),c=i.x*s.x+i.y*s.y;if(e){let e=u(i),t=Math.min(.55,e/22),n=Math.min(.28,Math.abs(c)/28),l=E(E(r(o,1-t-n),r(a,t)),r(s,-Math.sign(c)*n));return r(l,1/Math.max(.001,u(l)))}if(Math.abs(c)<=.8)return a;let l=Math.min(1,Math.abs(c)/Math.max(.8,u(i))),d=E(r(a,1-l),r(s,-Math.sign(c)*l));return r(d,1/Math.max(.001,u(d)))}var Rp=class{quality;fields=[];clock=0;fireTime=0;nextId=1;lastPours=new Map;lastFirePlan=-1/0;seam=null;wheelContacts=[];splashFields=new Map;captureState(){let e=[];try{for(let{fluid:t,...n}of this.fields)e.push({meta:j(n),fluid:t.captureState()})}catch(t){for(let t of e)t.fluid.dispose();throw t}return{fields:e,clock:this.clock,fireTime:this.fireTime,nextId:this.nextId,lastPours:j(this.lastPours),lastFirePlan:this.lastFirePlan,seam:this.seam?{previousId:this.seam.previous.id,currentId:this.seam.current.id,point:j(this.seam.point)}:null,wheelContacts:j(this.wheelContacts),splashFields:j(this.splashFields),quality:this.quality,dispose:()=>e.forEach(e=>e.fluid.dispose())}}restoreState(e){this.reset(),this.quality=e.quality;try{for(let{meta:t,fluid:n}of e.fields){let e=j(t),r=new gp(e.kind,e.resolution,e.resolution,e.color,e.elementProfile);r.setCellSize(e.extentM*e.pixelsPerMeter/e.resolution);try{r.restoreState(n)}catch(e){throw r.dispose(),e}this.fields.push({...e,fluid:r})}}catch(e){throw this.reset(),e}this.clock=e.clock,this.fireTime=e.fireTime,this.nextId=e.nextId,this.lastPours=j(e.lastPours),this.lastFirePlan=e.lastFirePlan,this.wheelContacts=j(e.wheelContacts),this.splashFields=j(e.splashFields??new Map);let t=this.fields.find(t=>t.id===e.seam?.previousId),n=this.fields.find(t=>t.id===e.seam?.currentId);this.seam=e.seam&&t&&n?{previous:t,current:n,point:j(e.seam.point)}:null}constructor(e=`high`){this.quality=e}get managedBytes(){return this.fields.reduce((e,t)=>e+96+(t.fire?.managedBytes??0)+t.fluid.managedBytes,0)}fireContactBounds(){return this.fields.filter(e=>C[e.kind].burnable).map(e=>{let t=e.extentM*e.pixelsPerMeter;return{x:e.center.x-t/2,y:e.center.y-t/2,width:t,height:t}})}hasConductiveCandidate(e,t){return this.fields.some(n=>{if(!C[n.kind].conductive)return!1;let r=n.extentM*n.pixelsPerMeter/2+t;return e.some(e=>Math.abs(e.x-n.center.x)<=r&&Math.abs(e.y-n.center.y)<=r)})}reset(){for(let e of this.fields)e.fluid.dispose();this.fields=[],this.clock=0,this.fireTime=0,this.lastPours.clear(),this.lastFirePlan=-1/0,this.seam=null,this.wheelContacts=[],this.splashFields.clear()}setQuality(e){this.quality=e}removeSeed(e){for(let t=this.fields.length-1;t>=0;t--){let n=this.fields[t];if(n.seedKey===e){n.fluid.removeSeed(),n.fluid.hasDeposits?n.seedKey=void 0:(n.fluid.dispose(),this.fields.splice(t,1));for(let[e,t]of this.splashFields)t===n.id&&this.splashFields.delete(e)}}}fieldForSeed(e){return this.fields.find(t=>t.seedKey===e)??null}seedShape(e,t,n,r,i,a,o,s,l){let d=this.fieldForSeed(e);d&&d.kind!==t&&(this.removeSeed(e),d=null);let f=Math.max(Ap,i/a+1.4);if(d??=this.create(t,n,r,a,s,Fp(f*a,this.quality)),!d)return!1;try{let t=d.pixelsPerMeter;d.seedKey=e,d.elementProfile=s,d.color=n;let a=Math.max(Ap,i/t+1.4,2*(u(c(r,d.center))/t+i/t/2+.7));d.poured===0?d.extentM=a:a>d.extentM&&this.expand(d,a/d.extentM),d.fluid.setCellSize(d.extentM*t/d.resolution),d.fluid.configure(n,s);let f=d.fluid.displaced,p=d.extentM*t/d.resolution;performance.now();let{mask:m,coverage:h}=(f?null:l?.(d.resolution,d.center,d.extentM*t))??kp(d.resolution,d.center,d.extentM*t,e=>{if(!f)return o(e);let t=d.fluid.offsetAt(this.localPoint(d,e));return o(P(e.x+t.x*p,e.y+t.y*p))},f?void 0:{left:r.x-i/2,top:r.y-i/2,right:r.x+i/2,bottom:r.y+i/2});if(h<=0)return this.removeSeed(e),!1;let g=Math.max(1,h*d.extentM*d.extentM*3);return d.poured=Math.max(d.poured,g),performance.now(),d.fluid.seedMask(m,.85,g,n),!0}catch(t){throw this.removeSeed(e),t}}pour(e,t,n,r,i,a=C[e].color,o=`default`){if(r<=0)return;let s=this.lastPours.get(o),l=s?u(c(t,s.point))/Math.max(1,n):0,d=s?.kind===e&&Ip(a,s.color)&&s.age<.12&&l<2.5?s:void 0,f=d?l:0,p=Math.max(d?.age??1/120,1/120),m=Math.exp(-f/.45),h=(d?.localAmount??0)*m+r,g=Math.min(1.8,.11+Math.sqrt(h)*.32),_=-Math.expm1(-p/.12),v=d?d.radiusM+(g-d.radiusM)*_:g;this.deposit(e,a,t,n,r,i,v,d?.point,d?.radiusM),this.lastPours.set(o,{kind:e,color:a,point:{...t},age:0,localAmount:h,radiusM:v})}emit(e,t,n,r,i,a,o=C[e].color){r<=0||i<=0||this.deposit(e,o,t,n,r,a,i)}deposit(e,t,n,r,i,a,o,s,l=o){let d=this.fields.at(-1),f=e===`paint`||Te(e)?.mixing,p=i=>{if(!(i.kind===e||Te(e)?.mixing&&Te(i.kind)?.mixing)&&!(f&&i.kind===`paint`)||!f&&!Ip(t,i.color))return!1;let a=o*r;return[n,s??n,P((n.x+(s?.x??n.x))/2,(n.y+(s?.y??n.y))/2)].some(e=>u(c(e,i.center))/r+o>6.8?!1:[P(),P(a),P(-a),P(0,a),P(0,-a)].some(t=>{let n=E(e,t);return this.covers(i,n)&&i.fluid.densityAt(this.localPoint(i,n))>.02}))},m=(d&&p(d)?d:[...this.fields].reverse().find(p))??this.create(e,t,n,r);if(!m)return;m!==d&&!d?.seedKey&&d?.kind===e&&Ip(t,d.color)&&(this.seam={previous:d,current:m,point:{...n}});let h=this.seam?.current===m&&u(c(n,this.seam.point))<r*.85;this.depositIn(m,n,h?i*.5:i,a,o,t,s,l),h&&this.seam&&this.depositIn(this.seam.previous,n,i*.5,a,o,t,s,l)}depositIn(e,t,n,i,a,o=e.color,s,l=a){e.poured+=n;let d=2*(Math.max(u(c(t,e.center)),s?u(c(s,e.center)):0)/e.pixelsPerMeter+a+.25);d>e.extentM&&this.expand(e,Math.min(14/e.extentM,Math.max(1.25,d/e.extentM)));let f=this.localPoint(e,t),p=r(i,e.resolution/e.extentM);e.fluid.pour(n,this.clock+e.id,f,a*e.resolution/e.extentM,p,o,this.localPoint(e,s??t),l*e.resolution/e.extentM)}eject(e,t,n,r,i){this.pour(e,t,n,1.1,r,i)}splatter(e,t,n,r,i,a=!1,o=1,s){if(i<=0)return!1;let c=this.wheelContacts[e]?.splashFieldId??(s?this.splashFields.get(e):null),l=c==null?a||this.wheelContacts.length===0?[...this.fields].reverse().find(e=>this.covers(e,t)&&this.coverage(e,t)>.12):null:this.fields.find(e=>e.id===c);if(!l||!this.covers(l,t))return!1;let u=this.localPoint(l,t),d=l.resolution/l.extentM/l.pixelsPerMeter,f=s?.color.match(/[\d.]+/g)?.slice(0,3).map(Number);return l.fluid.spray(u,n,r*d,i*1.5*(s?.opacity??1),o,f?.length===3?f:void 0),!0}create(e,t,n,r,i,a){let o=a??jp[this.quality],s;try{s=new gp(e,o,o,t,i)}catch{return null}let c={id:this.nextId++,kind:e,color:t,center:n,pixelsPerMeter:r,resolution:o,extentM:Ap,fluid:s,poured:0,elementProfile:i};return s.setCellSize(c.extentM*r/o),this.fields.push(c),c}step(e,t=[]){for(let[t,n]of this.lastPours)n.age+=e,n.age>1&&this.lastPours.delete(t);if(this.clock+=e,this.clock<1/30)return;let n=Math.min(.05,this.clock);this.clock=Math.max(0,this.clock-1/30),this.fireTime+=n;let r=this.fields.filter(e=>C[e.kind].burnable);this.fireTime-this.lastFirePlan>=.2&&r.some(e=>e.fire?.starts.some(Number.isFinite))&&r.some(e=>!e.fire||e.poured!==e.firePoured)&&(xp(r.map(e=>!e.fire||e.poured!==e.firePoured?this.prepareFire(e):e.fire),P(1/0,1/0),0,this.fireTime),this.lastFirePlan=this.fireTime);for(let e of this.fields){let r=[];for(let i of t){let t=u(i.velocity);if(u(c(i.point,e.center))>e.extentM*e.pixelsPerMeter*.62)continue;let a=e.resolution/e.extentM/e.pixelsPerMeter,o=this.localPoint(e,i.point);if(t<3&&(i.slip??0)<.05)continue;let s=P(i.point.x-i.velocity.x*n,i.point.y-i.velocity.y*n),l=this.localPoint(e,s);r.push({from:l,to:o,radius:Math.max(.65,i.radiusPx*a),paint:i.paint,slip:i.slip??0})}performance.now();let i=r.filter(t=>this.nearLiquid(e,t.from,t.to,t.radius));performance.now();for(let t of i)if(performance.now(),e.fluid.drag(t.from,t.to,n,t.radius,0),T(e.kind)===`paint`&&t.paint){let r=t.paint.color.match(/[\d.]+/g)?.slice(0,3).map(Number);if(r?.length===3){let i=u(c(t.to,t.from)),a=(1-Math.exp(-i/Math.max(1,t.radius*3)-t.slip*n*2))*t.paint.opacity;performance.now(),e.fluid.transferPigment?.(t.from,t.to,t.radius,r,a*.32)}}let a=C[e.kind].burnable&&e.fire?.starts.some(Number.isFinite)?e.fire:void 0,o=a?this.fireTime-(e.fireUpdatedAt??this.fireTime-n):0,s=!!a&&o+1e-9>=Pp,l=e.firePendingElapsed??0;performance.now(),e.fluid.step(n,0,[],l>0&&a?.rates.some(e=>e>0)?a:void 0,l||n),e.firePendingElapsed=0,s&&(performance.now(),a.update(this.fireTime,o),e.fireUpdatedAt=this.fireTime,e.firePendingElapsed=o)}for(let e=this.fields.length-1;e>=0;e--){let t=this.fields[e];if(!C[t.kind].burnable||!t.fire?.complete||(t.firePendingElapsed??0)>0)continue;let n=t.fluid.captureFuel();n.some(e=>e>=.035)?(this.prepareFire(t,n,.75),xp([t.fire],t.center,t.extentM*t.pixelsPerMeter,this.fireTime)):t.seedKey?(t.fluid.reset(),t.fire=void 0):(t.fluid.dispose(),this.fields.splice(e,1))}performance.now(),this.wheelContacts=t.map((e,t)=>{let n=this.sampleContact(e.point);return n.splashFieldId===null?e.paint||this.splashFields.delete(t):this.splashFields.set(t,n.splashFieldId),n});for(let e of this.splashFields.keys())e>=t.length&&this.splashFields.delete(e)}sampleContact(e){return Op(this.fields,e,(e,t)=>this.coverage(e,t),(e,t)=>this.localPoint(e,t))}nearLiquid(e,t,n,r){return e.fluid.mayIntersect(t,n,r)}expand(e,t){if(t<=1)return;let n=e.resolution;e.resolution=e.fluid.grow(t),e.extentM*=e.resolution/n,e.fire&&(this.prepareFire(e),e.firePoured=-1)}localPoint(e,t){return P(e.resolution/2+(t.x-e.center.x)/e.pixelsPerMeter*e.resolution/e.extentM,e.resolution/2+(t.y-e.center.y)/e.pixelsPerMeter*e.resolution/e.extentM)}covers(e,t){let n=e.extentM*e.pixelsPerMeter*.5;return Math.abs(t.x-e.center.x)<=n&&Math.abs(t.y-e.center.y)<=n}coverage(e,t){if(!this.covers(e,t))return 0;let n=e.fluid.densityAt(this.localPoint(e,t));return Math.max(0,Math.min(1,(n-Np+.012)/.024))*(e.elementProfile?.opacity??C[e.kind].alpha)}contacts(e,t){return this.fields.filter(n=>n.kind===e&&t.some(e=>this.coverage(n,e)>.1)).map(e=>e.id)}conductAt(e,t=0){return Ep(this.fields,e,t)}densityAt(e,t){return Math.max(0,...this.fields.filter(n=>n.kind===e&&this.covers(n,t)).map(e=>e.fluid.densityAt(this.localPoint(e,t))))}prepareFire(e,t=e.fluid.captureFuel(),n){let r=C[e.kind],i=e.extentM*e.pixelsPerMeter,a=new bp(t,e.resolution,{x:e.center.x-i/2,y:e.center.y-i/2,width:i,height:i},n??r.burnLifetime??r.burnSeconds??12,r.fireSpreadMps??C.oil.fireSpreadMps,e.pixelsPerMeter);return e.fire&&a.inherit(e.fire,this.fireTime),e.fire=a,e.firePoured=e.poured,e.fireSampleAt=this.fireTime,e.fireUpdatedAt=this.fireTime-e.id%3*Pp/3,e.firePendingElapsed=0,a}igniteConducted(e,t){if(!e.length)return;let n=Tp(this.fields.filter(e=>C[e.kind].burnable),e,t).map(e=>!e.fire||e.firePoured!==e.poured?this.prepareFire(e):e.fire);if(n.length){xp(n,e[0],t,this.fireTime,e.slice(1));for(let e of n)e.update(this.fireTime,0);this.lastFirePlan=this.fireTime}}igniteAt(e,t=0){if(this.fireTime-this.lastFirePlan<.15)return;let n=[e];if(t>0)for(let r=0;r<8;r++)n.push(P(e.x+Math.cos(r*Math.PI/4)*t,e.y+Math.sin(r*Math.PI/4)*t));let r=this.fields.filter(e=>C[e.kind].burnable&&n.some(t=>this.coverage(e,t)>.08));if(!r.length||(this.lastFirePlan=this.fireTime,r.every(e=>e.fire&&e.firePoured===e.poured&&n.every(t=>{let n=e.fire.indexAt(t);return n<0||e.fire.fuel[n]<.035||Number.isFinite(e.fire.starts[n])}))))return;let i=this.fields.filter(e=>C[e.kind].burnable).map(e=>!e.fire||e.poured!==e.firePoured&&this.fireTime-(e.fireSampleAt??0)>=.2?this.prepareFire(e):e.fire);xp(i,e,t,this.fireTime);for(let e of i)e.update(this.fireTime,0)}igniteAlong(e,t,n=0){for(let r=0;r<=4;r++)this.igniteAt(P(e.x+(t.x-e.x)*r/4,e.y+(t.y-e.y)*r/4),n)}burningSources(e){return Dp(this.fields,this.fireTime,e)}burningMasks(){return this.fields.flatMap(e=>{let t=e.fire;return!C[e.kind].burnable||!t?.lit?[]:[{key:e,alpha:t.alpha,pixelWidth:t.resolution,pixelHeight:t.resolution,...t.rect,origin:e.center,age:.4,farthest:Math.max(1,t.rect.width),spreadSeconds:0,burnSeconds:1,intensity:.55,smokeRate:10,revision:t.revision}]})}kindAt(e){let t=!1,n=!1,r=!1;for(let i=this.fields.length-1;i>=0;i--){let a=this.fields[i];if(!(this.coverage(a,e)<=.1)){if(T(a.kind)===`water`)return`water`;T(a.kind)===`oil`&&(t=!0),T(a.kind)===`paint`&&(n=!0),T(a.kind)===`mud`&&(r=!0)}}return r?`mud`:t?`oil`:n?`paint`:null}pruneOutside(e){this.fields=this.fields.filter(t=>{let n=t.extentM*t.pixelsPerMeter*1.5,r=t.center.x+n>=e.x&&t.center.x-n<=e.x+e.width&&t.center.y+n>=e.y&&t.center.y-n<=e.y+e.height;return r||t.fluid.dispose(),r}),!this.seam||this.fields.includes(this.seam.previous)&&this.fields.includes(this.seam.current)||(this.seam=null)}draw(e,t,n,r,i){performance.now(),e.save(),e.globalAlpha=r;for(let r of this.fields){let a=t(r.center),o=r.extentM*r.pixelsPerMeter*n,s=r.fluid.hasSplatter?o*1.5:o/2;i&&(a.x+s<0||a.y+s<0||a.x-s>i.width||a.y-s>i.height)||(e.save(),e.translate(a.x-o/2,a.y-o/2),e.scale(o/r.resolution,o/r.resolution),r.fluid.draw(e),e.restore())}e.restore()}},zp=class{liquids;camera;pixelSpace;elementFields=new Map;nextElementId=1;initialPuddles=[];constructor(e,t,n){this.liquids=e,this.camera=t,this.pixelSpace=n}captureState(){return j({elementFields:this.elementFields,nextElementId:this.nextElementId,initialPuddles:this.initialPuddles})}restoreState(e){let t=j(e);this.elementFields=t.elementFields,this.nextElementId=t.nextElementId,this.initialPuddles=t.initialPuddles}clearEffects(){this.elementFields.clear(),this.nextElementId=1}pourWorldLiquid(e,t,n,r,i){this.liquids.pour(e,this.camera.particlePoint(t),this.camera.particleScale(),n,P(),r,i)}addLiquid(e,t){let n=p(e),r=t.amount??24;if(!Number.isFinite(t.at.x)||!Number.isFinite(t.at.y)||!Number.isFinite(r)||r<=0)throw RangeError(`Liquid position and positive amount must be finite.`);let a=t.color?i(t.color):void 0;if(t.initial){let e={kind:n,point:this.camera.documentPoint(t.at),amount:r,color:a};this.initialPuddles.push(e),this.depositInitialPuddle(e)}else this.pourWorldLiquid(n,t.at,r,a)}syncElementLiquids(e){performance.now();let t=new Set(e.map(e=>e.key));for(let[e,n]of this.elementFields)t.has(e)||(this.liquids.removeSeed(n.id),this.elementFields.delete(e));let n=new Map,r=!1;for(let t of e){let e=this.localFromDocument({x:t.bounds.x,y:t.bounds.y}),i=this.localFromDocument({x:t.bounds.x+t.bounds.width,y:t.bounds.y+t.bounds.height}),a=P((e.x+i.x)/2,(e.y+i.y)/2),o=this.elementFields.get(t.key),s=o?.signature!==t.signature,c=o&&(o.center.x!==a.x||o.center.y!==a.y);if(!o||s||c){if(t.rasterize){if(r){let e=o&&this.liquids.fieldForSeed(o.id);e&&n.set(t.key,e);continue}r=!0}Ye(`liquid field reseeds`),o&&s&&Ye(`liquid signature reseeds`),o&&c&&Ye(`liquid position reseeds`),performance.now();let l=o?.id??`element-liquid-${this.nextElementId++}`,u=Math.max(Math.abs(i.x-e.x),Math.abs(i.y-e.y));if(!this.liquids.seedShape(l,t.kind,t.color,a,u,this.camera.particleScale(),e=>t.contains(this.pixelSpace?e:this.camera.documentPoint(e)),t.profile,this.pixelSpace?t.rasterize:void 0))continue;o={id:l,signature:t.signature,center:a},this.elementFields.set(t.key,o)}let l=this.liquids.fieldForSeed(o.id);l&&n.set(t.key,l)}return n}setInitialPuddles(e){this.liquids.reset(),this.elementFields.clear(),this.nextElementId=1,this.initialPuddles=e.map(({kind:e,color:t,point:n,amount:r})=>({kind:e,color:t?[...t]:void 0,point:{...n},amount:r})),this.restoreInitialPuddles()}restoreInitialPuddles(){for(let e of this.initialPuddles)this.depositInitialPuddle(e)}depositInitialPuddle({kind:e,color:t,point:n,amount:r}){let i=this.localFromDocument(n),a=this.camera.particleScale(),o=Math.max(1,Math.ceil(r/2));for(let n=0;n<o;n++)this.liquids.pour(e,i,a,r/o,P(),t),this.liquids.step(1/30)}localFromDocument(e){return this.pixelSpace?{...e}:this.camera.worldFromDocument(e)}},Bp=class{bounds=[];tiles=new Map;dpr=1;scale=1;viewportMode=`fixed`;documentOrigin={x:0,y:0};measureDocumentOrigin(){if(this.viewportMode!==`absolute`)return;let e=document.body,t=e.getBoundingClientRect(),n=Nn();this.documentOrigin={x:t.left+n.x+e.clientLeft,y:t.top+n.y+e.clientTop}}setViewportMode(e){this.viewportMode=e,this.measureDocumentOrigin();for(let t of this.tiles.values())t.canvas.style.position=e}setBounds(e){this.bounds=e;for(let[t,n]of this.tiles)t>=e.length&&(n.canvas.remove(),this.tiles.delete(t))}resize(e,t,n,r){this.dpr=n,this.scale=r,this.measureDocumentOrigin()}tile(e){let t=this.tiles.get(e);if(t)return t;let n=document.createElement(`canvas`);n.dataset.jrLiquidTextVehicle=``;let r=n.getContext(`2d`);if(!r)throw Error(`Joy Ride requires a 2D canvas context.`);return n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,{position:this.viewportMode,left:`0`,top:`0`,pointerEvents:`none`,zIndex:jf(`foreground`),transformOrigin:`0 0`,display:`none`}),document.body.append(n),t={canvas:n,context:r,visible:!1},this.tiles.set(e,t),t}draw(e,t,n,r){for(let i=0;i<this.bounds.length;i++){let a=this.bounds[i],o=e({x:a.x,y:a.y}),s=e({x:a.x+a.width,y:a.y+a.height}),c=o.x,l=o.y,u=s.x-c,d=s.y-l;if(!t.some(({point:e,radius:t})=>e.x>=c-t&&e.x<=c+u+t&&e.y>=l-t&&e.y<=l+d+t)||u<=0||d<=0){let e=this.tiles.get(i);e?.visible&&(e.canvas.style.display=`none`,e.visible=!1);continue}let f=this.tile(i),{canvas:p,context:m}=f,h=Math.max(1,Math.ceil(u*this.dpr)),g=Math.max(1,Math.ceil(d*this.dpr));(p.width!==h||p.height!==g)&&(p.width=h,p.height=g,p.style.width=`${u}px`,p.style.height=`${d}px`);let _=this.viewportMode===`absolute`?Nn():{x:0,y:0},v=this.viewportMode===`absolute`?this.documentOrigin:{x:0,y:0},y=`${_.x+c*this.scale-v.x}px ${_.y+l*this.scale-v.y}px`;p.style.translate!==y&&(p.style.translate=y),p.style.scale!==String(this.scale)&&(p.style.scale=String(this.scale)),f.visible||=(p.style.display=`block`,!0),m.setTransform(this.dpr,0,0,this.dpr,0,0),m.clearRect(0,0,u,d),m.save(),m.translate(-c+n.x,-l+n.y),r(m),m.restore()}}dispose(){for(let e of this.tiles.values())e.canvas.remove();this.tiles.clear()}};function Vp(e,t,n,r,i,a,o,s=[]){let{sim:c,tirePaint:l}=e;if(c.mode!==`car`)return;let d=[];c.car.statusEffects.setContacts(`mud`,ae.mud,d),e.isGhost?c.car.tires.forEach((e,t)=>l.pauseTrack(t)):(l.step(a?c.car.tires.map(e=>u(c.body.velocityAt(c.body.world(e.local)))*r):[]),o?(c.car.tires.forEach((e,r)=>{let o=t[r],u=o?.materials??[],f=e=>u.some(t=>T(t)===e&&!x(t)),p=()=>{for(let e of u){let t=x(e);t&&c.car.statusEffects.apply(`liquid:${e}`,t,r)}};if(u.some(e=>T(e)===`water`)&&(c.car.washWheel(r),l.wash(r,o?.paints??[]),!o?.paints?.length)){p();return}f(`oil`)&&c.car.coatWithOil(r),u.some(e=>T(e)===`mud`)&&(f(`mud`)&&c.car.coatWithMud(r),d.push(r)),p();for(let e of o?.paints??(o?.paint?[o.paint]:[]))l.touch(r,e);if(l.touch(r,s[r]??null),!a){l.pauseTrack(r);return}let m=l.coating(r),h=u.length>0&&!!o?.paint&&m?.color!==o.paint.color;(o?.paints?.length??+!!o?.paint)>0||s[r]?l.trackWet(r,n[r],-c.body.angle-e.angle,c.car.preset.geometry.tireWidthM,i,e.slip,h&&!s[r]):l.track(r,n[r],-c.body.angle-e.angle,c.car.preset.geometry.tireWidthM,i,h,e.slip)}),c.car.statusEffects.setContacts(`mud`,ae.mud,d)):c.car.tires.forEach((e,t)=>l.pauseTrack(t)))}function Hp(e,t,n,r,i,a,o){let s=e=>{let t=e.sim;return t.mode!==`car`||e.isGhost?[]:t.car.tires.map((n,r)=>{let i=t.body.world(n.local);return{point:o.particlePoint(i),velocity:o.particleVelocity(t.body.velocityAt(i)),radiusPx:t.car.preset.geometry.tireWidthM*o.particleScale*.7,slip:n.slip,paint:e.tirePaint.coating(r)}})},c=s(t),l=n.map(e=>({vehicle:e,tires:s(e)}));performance.now(),e.step(r,[...c,...l.flatMap(e=>e.tires)]),performance.now();for(let t of e.burningMasks())o.emitFire(t,r);performance.now();let u=e=>typeof a==`function`?a(e.sim.car.tires.map(t=>o.documentPoint(e.sim.body.world(t.local)))):e===t?a:[];Vp(t,e.wheelContacts.slice(0,c.length),c.map(e=>e.point),r,o.particleScale,i,!o.fading,u(t));let d=c.length;for(let{vehicle:t,tires:n}of l)Vp(t,e.wheelContacts.slice(d,d+n.length),n.map(e=>e.point),r,o.particleScale,!0,!o.fading,u(t)),d+=n.length;return{tires:c,companionTires:l}}var Up=class{camera;fields=new Rp;authoring;textVehicles=null;viewportMode=`fixed`;setViewportMode(e){this.viewportMode=e,this.textVehicles?.setViewportMode(e)}constructor(e,t){this.camera=e,this.fields.setQuality(t),this.authoring=new zp(this.fields,e,e.pixelSpace)}get managedBytes(){return this.fields.managedBytes}setQuality(e){this.fields.setQuality(e)}captureState(){let e=this.fields.captureState();try{return{fields:e,authoring:this.authoring.captureState(),dispose:()=>e.dispose()}}catch(t){throw e.dispose(),t}}restoreState(e){this.fields.restoreState(e.fields),this.authoring.restoreState(e.authoring)}clearEffects(){this.fields.reset(),this.authoring.clearEffects()}restoreInitialPuddles(){this.authoring.restoreInitialPuddles()}dispose(){this.textVehicles?.dispose(),this.textVehicles=null,this.fields.reset()}resize(){this.textVehicles?.resize(this.camera.width,this.camera.height,this.camera.dpr,this.camera.regionScale)}pruneOutside(e){this.fields.pruneOutside(e)}draw(e,t){this.fields.draw(e,e=>this.camera.pixelSpace?c(e,this.camera.sceneScroll()):this.camera.screen(e),this.camera.pixelSpace?1:this.camera.zoom,t,{width:this.camera.width,height:this.camera.height})}drawTextVehicles(e,t,n){this.textVehicles?.draw(e=>this.camera.viewportFromDocument(e),e,t,n)}pourWorldLiquid(e,t,n,r,i){this.authoring.pourWorldLiquid(e,t,n,r,i)}emitPaint(e,t,n,r,i){this.fields.emit(`paint`,this.camera.particlePoint(e),this.camera.particleScale(),n,t,this.camera.pixelSpace?P(i.x,-i.y):i,r)}local(e){return this.camera.particlePoint(this.camera.worldFromDocument(e))}get ratio(){return this.camera.particleScale()/this.camera.documentScale()}hasConductiveCandidate(e,t){return this.fields.hasConductiveCandidate(e.map(e=>this.local(e)),t*this.ratio)}conductLightning(e,t=0){let n=e=>this.local(e),r=e=>this.camera.pixelSpace?e:this.camera.documentPoint(e),i=this.ratio,a=this.fields.conductAt(e.map(n),t*i);return{points:a.points.map(r),contains:(e,t=0)=>a.contains(n(e),t*i),intersects:(e,t=0)=>{let r=n(e),o=n({x:e.x+e.width,y:e.y+e.height});return a.intersects({x:Math.min(r.x,o.x),y:Math.min(r.y,o.y),width:Math.abs(r.x-o.x),height:Math.abs(r.y-o.y)},t*i)},pathTo:(e,t=0)=>a.pathTo(n(e),t*i).map(r)}}igniteAt(e,t){this.fields.igniteAt(this.local(e),t*this.ratio)}igniteConducted(e,t){this.fields.igniteConducted(e.map(e=>this.local(e)),t*this.ratio)}igniteFromFire(e){if(!e.length)return;let t=new Map,n=this.fields.fireContactBounds().map(e=>{if(this.camera.pixelSpace)return e;let t=this.camera.documentPoint({x:e.x,y:e.y}),n=this.camera.documentPoint({x:e.x+e.width,y:e.y+e.height});return{x:Math.min(t.x,n.x),y:Math.min(t.y,n.y),width:Math.abs(t.x-n.x),height:Math.abs(t.y-n.y)}});for(let r of e){let e=Math.max(0,Math.round(r.radiusPx/4)*4),i=t.get(e)??[],a=r.bounds?n.flatMap(e=>tp(r,e)):tp(r);for(let e of a)i.push(this.local(e));t.set(e,i)}for(let[e,n]of t)this.fields.igniteConducted(n,e*this.ratio)}burningSources(){let e=24*this.ratio;return this.fields.burningSources(e).map(e=>({point:this.camera.pixelSpace?e:this.camera.documentPoint(e),radiusPx:24,spreadSeconds:N.spreadSeconds}))}hasContact(e,t){return this.fields.contacts(p(e),t.map(e=>this.camera.particlePoint(e))).length>0}add(e,t){this.authoring.addLiquid(e,t)}syncElements(e){if(this.camera.overlay){let t=e.filter(e=>typeof SVGGeometryElement<`u`&&e.key instanceof SVGGeometryElement||typeof HTMLElement<`u`&&e.key instanceof HTMLElement&&(e.key.childElementCount>0||!!e.key.textContent?.trim())).map(e=>e.bounds);t.length&&!this.textVehicles&&(this.textVehicles=new Bp,this.textVehicles.setViewportMode(this.viewportMode)),this.textVehicles?.setBounds(t),this.resize()}return this.authoring.syncElementLiquids(e)}setInitialPuddles(e){this.authoring.setInitialPuddles(e)}pourVehicle(e,t,n,r,i=`player`){if(e.mode!==`car`)return;let a=e.body.world(P(-e.car.preset.geometry.lengthM/2-.58,0)),o=Ee(P(-4,0),e.body.angle);this.fields.pour(t,this.camera.particlePoint(a),this.camera.particleScale(),n,this.camera.pixelSpace?P(o.x,-o.y):o,r,i)}stepVehicles(e,t,n,r,i,a,o){return Hp(this.fields,e,t,n,r,i,{particlePoint:e=>this.camera.particlePoint(e),particleVelocity:e=>this.camera.pixelSpace?P(e.x*this.camera.zoom,-e.y*this.camera.zoom):{...e},documentPoint:e=>this.camera.documentPoint(e),particleScale:this.camera.particleScale(),fading:a,emitFire:o})}splatter(e,t,n,r,i,a,o,s){this.fields.splatter(n,r,i,a,o,!1,s,e.tirePaint.coating(t))||e.tirePaint.splatter(t,r,i,a,o,s,this.camera.particleScale())}igniteAlong(e,t,n){this.fields.igniteAlong(e,t,n)}igniteAtLocal(e){this.fields.igniteAt(e)}pourOilPreview(e,t){this.fields.pour(`oil`,e,this.camera.particleScale(),t*6,P())}},Wp=e=>{let t=Math.sin(e*127.1+311.7)*43758.5453;return t-Math.floor(t)};function Gp(e,t,n,r,i,a,o=1){let s=t.material;e.save();let c=t.exit?.leadInM,l=c?Math.max(.05,c-Math.max(t.widthM*1.5,.25)):0,u=c?Math.max(0,Math.min(1,(c+(t.exit.fromM+t.exit.toM)*.5)/l)):1,d=o*u*u*(3-2*u);if(e.strokeStyle=t.color,e.fillStyle=t.color,e.globalAlpha=t.opacity*d,t.droplet){e.translate(r.x,r.y),e.rotate(t.angle),e.beginPath(),e.ellipse(0,0,i/2,i*t.droplet.aspect/2,0,0,Math.PI*2),e.fill(),e.restore();return}let f=r.x-n.x,p=r.y-n.y,m=Math.hypot(f,p);if(!s){e.lineWidth=i,e.lineCap=`round`,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke(),e.restore();return}e.translate(n.x,n.y),e.rotate(m>.01?Math.atan2(p,f):t.angle);let h=t.wetness??1,g=t.slip??0,_=Math.max(1.5,s.pitchM*a),v=(t.phaseM??0)*a%_,y=t.opacity*d*s.coverage,b=Math.min(1,s.film*(.35+.65*h)+g*.3);if(t.exit){let e=Math.max(0,(t.exit.fromM+t.exit.toM)*.5),n=Math.min(1,e/t.exit.lengthM);b+=(1-b)*(1-n)*(1-n)}b>.005&&m>0&&(e.globalAlpha=y*b,e.lineWidth=i*.88,e.lineCap=t.exit?`round`:`butt`,e.beginPath(),e.moveTo(0,0),e.lineTo(m,0),e.stroke());let x=m<.01?0:_-v;for(let n=x,r=0;n<=m+.001&&r<256;n+=_,r++){let r=Math.round(((t.phaseM??0)*a+n)/_);for(let a=0;a<4;a++){let o=Wp(r*17+a*7);if(o<s.breakup*(1-h*.65))continue;let c=(a-1.5)*i*.245,l=i*(.19+o*.025),u=_*(.5+g*.35),d=(a<2?1:-1)*l*.4;e.globalAlpha=y*(.62+o*.38)*(1-b*.65),e.fillStyle=t.color,e.beginPath(),e.moveTo(n-u*.5,c-l*.5),e.lineTo(n+u*.5,c-l*.5+d),e.lineTo(n+u*.5,c+l*.5+d),e.lineTo(n-u*.5,c+l*.5),e.closePath(),e.fill(),(s.gloss>.1||s.emission>0)&&(e.strokeStyle=s.emission>.5?`#ff9b25`:s.iridescence>.15?r%3?`#7faaa3`:`#9d7d99`:`#e2e8db`,e.globalAlpha=y*h*(s.emission>.5?.7:.11+s.gloss*.16),e.lineWidth=Math.max(.2,i*.035),e.beginPath(),e.moveTo(n-u*.4,c-l*.4),e.lineTo(n+u*.4,c-l*.4+d),e.stroke()),s.grain>.1&&o>.45&&(e.globalAlpha=y*s.grain*.35,e.fillStyle=`#372b22`,e.fillRect(n+u*.1,c,Math.max(.25,i*.05),Math.max(.3,i*.1)))}}e.restore()}var Kp=256,qp=48,Jp=class{overPuddle;constructor(e=null){this.overPuddle=e}tiles=new Map;records=new Map;archived=0;references=0;processed=0;ratio=0;scale=0;captureState(){return{marks:j([...new Set([...this.records.values()].flat())]),processed:this.processed,scale:this.scale}}restoreState(e){this.clear(),this.scale=e.scale,this.seed(j(e.marks),e.scale),this.processed=e.processed}managedBytes(e){return this.tiles.size*(Kp*this.ratio)**2*4+Math.max(0,this.archived-e)*136+this.references*8}clear(){this.tiles.clear(),this.records.clear(),this.archived=0,this.references=0,this.processed=0}seed(e,t){for(let n of e)(this.overPuddle===null||!!n.overPuddle===this.overPuddle)&&this.indexMark(n,t)}draw(e,t,n,r,i,a,o,s,c,l){n<this.processed&&this.clear(),(this.ratio!==c||this.scale!==s)&&(this.tiles.clear(),this.ratio=c,this.scale=s);let u=Math.min(t.length,n-this.processed);for(let e=t.length-u;e<t.length;e++){let n=t[e];(this.overPuddle===null||!!n.overPuddle===this.overPuddle)&&this.indexMark(n,s)}if(this.processed=n,!this.archived)return;let d=Math.floor(r/Kp),f=Math.floor((r+a)/Kp),p=Math.floor(i/Kp),m=Math.floor((i+o)/Kp),h=new Set;e.save(),e.globalAlpha=l;for(let t=p;t<=m;t++)for(let n=d;n<=f;n++){let a=`${n},${t}`;h.add(a);let o=this.records.get(a);if(!o?.length)continue;let c=this.tiles.get(a);if(!c){c=this.createTile(n,t),Ye(`tire tile rebuilds`);for(let e of o)this.stroke(c,e,s);this.tiles.set(a,c)}Ye(`tire tile composites`),e.drawImage(c.canvas,n*Kp-r,t*Kp-i,Kp,Kp)}if(e.restore(),this.tiles.size>qp)for(let e of this.tiles.keys()){if(this.tiles.size<=qp)break;h.has(e)||this.tiles.delete(e)}}pruneOutside(e){for(let t of this.records.keys()){let[n,r]=t.split(`,`).map(Number);((n+1)*Kp<e.x||n*Kp>e.x+e.width||(r+1)*Kp<e.y||r*Kp>e.y+e.height)&&(this.records.delete(t),this.tiles.delete(t))}this.archived=new Set([...this.records.values()].flat()).size,this.references=[...this.records.values()].reduce((e,t)=>e+t.length,0)}indexMark(e,t){this.archived++;let n=e.widthM*Math.max(32,t)*.38+2,r=Math.floor((Math.min(e.from.x,e.point.x)-n)/Kp),i=Math.floor((Math.max(e.from.x,e.point.x)+n)/Kp),a=Math.floor((Math.min(e.from.y,e.point.y)-n)/Kp),o=Math.floor((Math.max(e.from.y,e.point.y)+n)/Kp);for(let n=a;n<=o;n++)for(let a=r;a<=i;a++){let r=`${a},${n}`,i=this.records.get(r);i||(i=[],this.records.set(r,i)),i.push(e),this.references++;let o=this.tiles.get(r);o&&this.stroke(o,e,t)}}createTile(e,t){let n=document.createElement(`canvas`);n.width=Math.ceil(Kp*this.ratio),n.height=Math.ceil(Kp*this.ratio);let r=n.getContext(`2d`);if(!r)throw Error(`Joy Ride tire marks require a 2D canvas context`);return r.setTransform(this.ratio,0,0,this.ratio,-e*Kp*this.ratio,-t*Kp*this.ratio),{canvas:n,context:r}}stroke(e,t,n){Ye(`tire mark strokes`);let r=e.context;Gp(r,t,t.from,t.point,t.widthM*n*.76,n)}},Yp=class{ground=new Jp;dry=new Map;wet=new Map;seed(e,t){this.ground.seed(e,t)}forgetVehicle(e){this.dry.delete(e),this.wet.delete(e)}captureState(){return{ground:this.ground.captureState(),dry:[...this.dry].map(([e,t])=>[e,t.captureState()]),wet:[...this.wet].map(([e,t])=>[e,t.captureState()])}}restoreState(e){this.ground.restoreState(e.ground),this.dry=new Map(e.dry.map(([e,t])=>{let n=new Jp(!1);return n.restoreState(t),[e,n]})),this.wet=new Map(e.wet.map(([e,t])=>{let n=new Jp(!0);return n.restoreState(t),[e,n]}))}get managedBytes(){return this.ground.managedBytes(0)+[...this.dry.values(),...this.wet.values()].reduce((e,t)=>e+t.managedBytes(0),0)}clear(){this.ground.clear(),this.dry.clear(),this.wet.clear()}pruneOutside(e){for(let t of[...this.dry.values(),...this.wet.values()])t.pruneOutside(e)}draw(e,t,n,r){let{pixelSpace:i,scroll:a,width:o,height:s,particleScale:c,rasterRatio:l,zoom:u,effectsAlpha:d,screen:f}=r;if(e.save(),e.lineCap=`round`,i){n||this.ground.draw(e,[],0,a.x,a.y,o,s,c,l,d);let r=n?this.wet:this.dry;for(let i of t){let t=r.get(i.id);t||(t=new Jp(n),r.set(i.id,t)),t.draw(e,i.tirePaint.marks,i.tirePaint.totalMarks,a.x,a.y,o,s,c,l,d)}}else for(let r of t)for(let t of r.tirePaint.marks){if(!!t.overPuddle!==n)continue;let r=f(t.point),i=f(t.from);(r.x<-20||r.x>o+20||r.y<-20||r.y>s+20)&&(i.x<-20||i.x>o+20||i.y<-20||i.y>s+20)||Gp(e,t,i,r,t.widthM*c*u*.76,c*u,d)}e.restore()}};function Xp(e,t,n,i){let a=c(n,t),o=u(a);if(o<1e-5)return;let s=r(a,1/o),l=e.widthPx,d=Math.max(.055*(l/e.widthM),l*.4),f=e.nextStamp,p=0;for(;f<=o&&p++<80;){let n=P(-s.y,s.x),a=E(E(t,r(s,f)),r(n,(Math.random()-.5)*l*.04));e.stamps.push({point:a,direction:s,length:d*(.78+Math.random()*.14),opacity:k(.57+i*.26+(Math.random()-.5)*.12,.3,1),shoulder:(Math.random()-.5)*.06}),f+=d}e.nextStamp=Math.max(0,f-o)}function Zp(e,t,n){if(e.contactStamps>=48)return;let i=e.widthPx,a=P(-n.y,n.x);for(let o=0;o<2;o++)e.stamps.push({point:E(t,E(r(n,(Math.random()-.5)*i*1.4),r(a,(Math.random()-.5)*i*.2))),direction:n,length:i*(.3+Math.random()*.18),opacity:.35+Math.random()*.25,shoulder:(Math.random()-.5)*.06});e.contactStamps+=2}function Qp(e,t,n,i,a,o){if(t.length<2)return;let s=t.map((e,r)=>{let i=t[Math.max(0,r-1)],a=t[Math.min(t.length-1,r+1)],o=c(a,i),s=Math.max(1e-5,u(o));return P(e.x-o.y/s*n,e.y+o.x/s*n)});e.beginPath(),e.moveTo(s[0].x,s[0].y);for(let t=1;t<s.length-1;t++){let n=r(E(s[t],s[t+1]),.5);e.quadraticCurveTo(s[t].x,s[t].y,n.x,n.y)}e.lineTo(s[s.length-1].x,s[s.length-1].y),e.strokeStyle=o,e.globalAlpha=a,e.lineWidth=i,e.stroke()}function $p(e,t,n,r,i,a){t.road&&(r=cr.dark);let o=n?t.points.map(a.screen):t.points,s=Math.max(2,(a.pixelSpace?t.widthPx:t.widthM*a.zoom)*.72);Qp(e,o,0,s*.92,.075*t.opacity*r.alphaScale*i,r.ink),Qp(e,o,-s*.29,s*.22,.17*t.opacity*r.alphaScale*i,r.ink),Qp(e,o,s*.29,s*.22,.17*t.opacity*r.alphaScale*i,r.ink),e.fillStyle=r.ink;for(let o of t.stamps){let c=n?a.screen(o.point):o.point;if(n&&(c.x<-12||c.x>a.width+12||c.y<-12||c.y>a.height+12))continue;let l=a.pixelSpace?o.direction:P(o.direction.x,-o.direction.y),u=o.length*(a.pixelSpace?1:a.zoom);e.save(),e.translate(c.x,c.y),e.rotate(Math.atan2(l.y,l.x)),e.globalAlpha=.28*t.opacity*o.opacity*r.alphaScale*i;let d=s*.2,f=Math.max(1,u*.82),p=s*(.29+o.shoulder);e.beginPath(),e.roundRect(-f/2,-p-d/2,f,d,Math.min(.7,d*.2)),e.roundRect(-f/2,p-d/2,f,d,Math.min(.7,d*.2)),e.fill(),e.restore()}}var em=256,tm=48,nm=class{records=new Map;tiles=new Map;paths=0;pathBytes=0;references=0;ratio=0;theme=``;captureState(){return j([...new Set([...this.records.values()].flat())])}restoreState(e,t){this.clear();for(let n of j(e))this.add(n,t)}get managedBytes(){return this.tiles.size*(em*this.ratio)**2*4+this.pathBytes+this.references*8}clear(){this.records.clear(),this.tiles.clear(),this.paths=0,this.pathBytes=0,this.references=0}add(e,t){this.paths++,this.pathBytes+=96+e.points.length*24+e.stamps.length*64;let n=Math.max(2,e.widthPx)*2,r=Math.floor((e.bounds.left-n)/em),i=Math.floor((e.bounds.right+n)/em),a=Math.floor((e.bounds.bottom-n)/em),o=Math.floor((e.bounds.top+n)/em);for(let n=a;n<=o;n++)for(let a=r;a<=i;a++){let r=`${a},${n}`,i=this.records.get(r);i||(i=[],this.records.set(r,i)),i.push(e),this.references++;let o=this.tiles.get(r);o&&t(o.context,e)}}draw(e,t,n,r,i,a,o,s,c){if(!this.paths)return;(this.ratio!==a||this.theme!==o)&&(this.tiles.clear(),this.ratio=a,this.theme=o);let l=Math.floor(t/em),u=Math.floor((t+r)/em),d=Math.floor(n/em),f=Math.floor((n+i)/em),p=new Set;e.save(),e.globalAlpha=s;for(let r=d;r<=f;r++)for(let i=l;i<=u;i++){let a=`${i},${r}`,o=this.records.get(a);if(!o?.length)continue;p.add(a);let s=this.tiles.get(a);if(!s){s=this.createTile(i,r),Ye(`skid tile rebuilds`);for(let e of o)c(s.context,e);this.tiles.set(a,s)}Ye(`skid tile composites`),e.drawImage(s.canvas,i*em-t,r*em-n,em,em)}if(e.restore(),this.tiles.size>tm)for(let e of this.tiles.keys()){if(this.tiles.size<=tm)break;p.has(e)||this.tiles.delete(e)}}pruneOutside(e){for(let t of this.records.keys()){let[n,r]=t.split(`,`).map(Number);((n+1)*em<e.x||n*em>e.x+e.width||(r+1)*em<e.y||r*em>e.y+e.height)&&(this.records.delete(t),this.tiles.delete(t))}let t=new Set([...this.records.values()].flat());this.paths=t.size,this.references=[...this.records.values()].reduce((e,t)=>e+t.length,0),this.pathBytes=[...t].reduce((e,t)=>e+96+t.points.length*24+t.stamps.length*64,0)}createTile(e,t){let n=document.createElement(`canvas`);n.width=Math.ceil(em*this.ratio),n.height=Math.ceil(em*this.ratio);let r=n.getContext(`2d`);if(!r)throw Error(`Joy Ride skid tiles require a 2D canvas context`);return r.setTransform(this.ratio,0,0,this.ratio,-e*em*this.ratio,-t*em*this.ratio),r.lineCap=`round`,r.lineJoin=`round`,{canvas:n,context:r}}},rm=class{clock=0;time=0;presetId=null;previous=new Map;paths=[];tiles=new nm;revealAlpha=1;pendingReveal=new Set;captureState(){let e=j({previous:this.previous,paths:this.paths});return{clock:this.clock,time:this.time,presetId:this.presetId,previous:e.previous,paths:e.paths,revealAlpha:this.revealAlpha,pendingRevealIndices:this.paths.flatMap((e,t)=>this.pendingReveal.has(e)?[t]:[]),tiles:this.tiles.captureState()}}restoreState(e,t,n){this.clock=e.clock,this.time=e.time,this.presetId=e.presetId;let r=j({previous:e.previous,paths:e.paths});this.previous=r.previous,this.paths=r.paths,this.revealAlpha=e.revealAlpha,this.pendingReveal=new Set(e.pendingRevealIndices.map(e=>this.paths[e]));let i=cr[n?`dark`:`light`];this.tiles.restoreState(e.tiles,(e,n)=>$p(e,n,!1,i,1,t))}get managedBytes(){return this.paths.reduce((e,t)=>e+96+t.points.length*24+t.stamps.length*64,0)+this.tiles.managedBytes}clear(){this.clock=0,this.time=0,this.presetId=null,this.previous.clear(),this.paths=[],this.revealAlpha=1,this.pendingReveal.clear(),this.tiles.clear()}beginReveal(e,t){this.setRevealAlpha(1,e,t),this.stop(e,t),this.revealAlpha=0}setRevealAlpha(e,t,n){let r=k(e,0,1);if((r!==this.revealAlpha||this.pendingReveal.size!==0)&&(this.revealAlpha=r,!(this.revealAlpha<1))){for(let e of this.pendingReveal)this.rasterize(e,t,n);this.pendingReveal.clear()}}fade(){this.previous.clear()}stop(e,t,n=!1){for(let{path:n}of this.previous.values())this.finish(n,e,t);this.previous.clear(),n&&(this.clock=0)}pruneOutside(e){this.tiles.pruneOutside(e)}step(e,t,n,r,i){this.time+=e,this.clock+=e,!(this.clock<1/30)&&(this.clock%=1/30,this.presetId!==t.car.preset.id&&(this.stop(i.view,i.dark),this.presetId=t.car.preset.id),t.car.tires.forEach((e,a)=>{let o=this.previous.get(a);if(r(a)){o&&this.finish(o.path,i.view,i.dark),this.previous.delete(a);return}let s=i.project(t.body.world(e.local)),l=n&&!e.front;if(!e.skidding&&!l){o&&this.finish(o.path,i.view,i.dark),this.previous.delete(a);return}let d=i.project(t.body.world(E(e.local,P(-t.car.preset.geometry.tireLengthM*.8)))),f=!i.dark&&i.roadAt(e,s),p=o&&o.path.road===f&&this.time-o.time<.18&&o.path.stamps.length<(i.pixelSpace?64:320)?o.path:{road:f,points:e.spinning?[d,s]:i.pixelSpace&&o&&o.path.stamps.length>=64?[o.path.points[o.path.points.length-1],s]:[s],stamps:[],contactStamps:0,nextStamp:0,widthM:t.car.preset.geometry.tireWidthM,widthPx:t.car.preset.geometry.tireWidthM*i.scale,opacity:e.spinning?1:l?.72:k(.25+e.slip*.55+e.heat*.2,.3,1),bounds:{left:Math.min(d.x,s.x),right:Math.max(d.x,s.x),bottom:Math.min(d.y,s.y),top:Math.max(d.y,s.y)}};if(p!==o?.path)o&&this.finish(o.path,i.view,i.dark),this.paths.push(p),e.spinning?Xp(p,d,s,1):p.points.length>1&&Xp(p,p.points[0],s,l?.72:e.slip);else{let n=p.points[p.points.length-1];u(c(s,n))>(i.pixelSpace?.05:.001)?(Xp(p,n,s,e.spinning?1:l?.72:e.slip),p.points.push(s),p.bounds.left=Math.min(p.bounds.left,s.x),p.bounds.right=Math.max(p.bounds.right,s.x),p.bounds.bottom=Math.min(p.bounds.bottom,s.y),p.bounds.top=Math.max(p.bounds.top,s.y)):e.spinning&&Zp(p,s,P(Math.cos(t.body.angle),i.pixelSpace?-Math.sin(t.body.angle):Math.sin(t.body.angle)))}this.previous.set(a,{path:p,time:this.time})}))}finish(e,t,n){this.revealAlpha<1?this.pendingReveal.add(e):this.rasterize(e,t,n)}rasterize(e,t,n){if(!t.pixelSpace)return;let r=cr[n?`dark`:`light`];this.tiles.add(e,(e,n)=>$p(e,n,!1,r,1,t));let i=this.paths.indexOf(e);i>=0&&this.paths.splice(i,1)}draw(e,t){let{pixelSpace:n,scroll:r,width:i,height:a,ratio:o,dark:s,alpha:c,visible:l,view:u}=t,d=cr[s?`dark`:`light`];performance.now(),n&&this.tiles.draw(e,r.x,r.y,i,a,o,s?`dark`:`light`,c,(e,t)=>$p(e,t,!1,d,1,u)),performance.now();for(let t of this.paths){let r=(n?t.widthPx:t.widthM*u.zoom)*2;t.bounds.right<l.left-r||t.bounds.left>l.right+r||t.bounds.top<l.bottom-r||t.bounds.bottom>l.top+r||$p(e,t,!0,d,c*this.revealAlpha,u)}}},im={crashLow:{amplitudePx:.65,durationMs:85,frequencyHz:17},crashMedium:{amplitudePx:1.35,durationMs:125,frequencyHz:19},crashFast:{amplitudePx:2.35,durationMs:165,frequencyHz:21},rocketExplosion:{amplitudePx:2.8,durationMs:190,frequencyHz:16},lightning:{amplitudePx:3.1,durationMs:210,frequencyHz:26},combustibleExplosion:{amplitudePx:3.3,durationMs:215,frequencyHz:17}};function am(e){return!Number.isFinite(e)||e<.8?null:e<3.5?`crashLow`:e<8?`crashMedium`:`crashFast`}var om=class{enabled=!0;profiles={...im};impulses=[];lastTriggered=new Map;sequence=0;captureState(){return{at:performance.now(),data:j({enabled:this.enabled,profiles:this.profiles,impulses:this.impulses,lastTriggered:this.lastTriggered,sequence:this.sequence})}}restoreState(e){let t=j(e.data);this.enabled=t.enabled,this.profiles=t.profiles,this.impulses=t.impulses,this.lastTriggered=t.lastTriggered,this.sequence=t.sequence;let n=performance.now()-e.at;for(let e of this.impulses)e.startedAt+=n;for(let[e,t]of this.lastTriggered)this.lastTriggered.set(e,t+n)}get active(){return this.impulses.length>0}setEnabled(e){this.enabled=e,e||this.reset()}setProfiles(e){let t={...im};if(e)for(let n of Object.keys(t)){let r=e[n];if(!r)continue;let i=t[n],a=(e,t,n,r)=>e!==void 0&&Number.isFinite(e)?Math.max(n,Math.min(r,e)):t;t[n]={amplitudePx:a(r.amplitudePx,i.amplitudePx,0,6),durationMs:a(r.durationMs,i.durationMs,25,300),frequencyHz:a(r.frequencyHz,i.frequencyHz,5,35)}}this.profiles=t}reset(){this.impulses.length=0,this.lastTriggered.clear()}trigger(e,t=1,n=performance.now()){if(!this.enabled||!Number.isFinite(t)||t<=0)return;let r=this.profiles[e];!r||r.amplitudePx<=0||n-(this.lastTriggered.get(e)??-1/0)<55||(this.lastTriggered.set(e,n),this.impulses.push({event:e,startedAt:n,profile:r,amplitudePx:Math.min(5,r.amplitudePx*Math.min(2,t)),phase:++this.sequence*2.399963}),this.impulses.length>4&&this.impulses.shift())}sample(e){if(!this.enabled||!this.impulses.length)return{x:0,y:0};let t=0,n=0;for(let r=this.impulses.length-1;r>=0;r--){let i=this.impulses[r],a=Math.max(0,e-i.startedAt);if(a>=i.profile.durationMs){this.impulses.splice(r,1);continue}let o=(1-a/i.profile.durationMs)**2,s=a*i.profile.frequencyHz*Math.PI*2/1e3,c=i.amplitudePx*o;t+=Math.sin(s+i.phase)*c,n+=Math.sin(s*1.17+i.phase*.7+.8)*c*.72}return{x:Math.max(-4,Math.min(4,t)),y:Math.max(-4,Math.min(4,n))}}};function sm(e,t,n,r){let i=e=>e-r.x,a=e=>e-r.y,o=(e,t,n,i)=>n>=r.x&&e<=r.x+r.width&&i>=r.y&&t<=r.y+r.height;e.save(),e.lineCap=`round`,e.lineJoin=`round`,e.font=`bold 11px ui-monospace, SFMono-Regular, monospace`,n.forEach((t,n)=>{let r=t.box;o(r.x,r.y,r.x+r.width,r.y+r.height)&&(e.setLineDash([5,5]),e.strokeStyle=`rgba(210, 95, 255, 0.9)`,e.lineWidth=1.5,e.strokeRect(i(r.x),a(r.y),r.width,r.height),e.setLineDash([]),e.fillStyle=`#d25fff`,e.fillText(`TARGET ${n+1}`,i(r.x)+5,a(r.y)-9))});for(let n of t.segments){if(n.kind===`donut`){if(!o(n.center.x-n.radius,n.center.y-n.radius,n.center.x+n.radius,n.center.y+n.radius))continue;e.setLineDash([5,7]),e.strokeStyle=`#c33bdf`,e.lineWidth=2,e.beginPath(),e.arc(i(n.center.x),a(n.center.y),n.radius,0,Math.PI*2),e.stroke(),e.setLineDash([]),e.fillStyle=`#c33bdf`,e.beginPath(),e.arc(i(n.center.x),a(n.center.y),4,0,Math.PI*2),e.fill(),e.fillText(`${n.laps} PHYSICS DONUT${n.laps===1?``:`S`}`,i(n.center.x)+10,a(n.center.y)-10);continue}if(n.kind===`pause`){if(!o(n.point.x-16,n.point.y-16,n.point.x+16,n.point.y+16))continue;e.fillStyle=`#f7ba4c`,e.beginPath(),e.arc(i(n.point.x),a(n.point.y),6,0,Math.PI*2),e.fill(),e.fillText(`${Math.round(n.seconds*1e3)}ms`,i(n.point.x)+11,a(n.point.y)-10);continue}let t=[n.from,n.control1,n.control2,n.to];o(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)),Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))&&(e.beginPath(),e.moveTo(i(n.from.x),a(n.from.y)),e.bezierCurveTo(i(n.control1.x),a(n.control1.y),i(n.control2.x),a(n.control2.y),i(n.to.x),a(n.to.y)),e.setLineDash([9,7]),e.strokeStyle=`#09b7cf`,e.lineWidth=2.5,e.stroke())}e.setLineDash([]),o(t.entry.x-12,t.entry.y-12,t.entry.x+12,t.entry.y+12)&&(e.fillStyle=`#09b7cf`,e.beginPath(),e.arc(i(t.entry.x),a(t.entry.y),6,0,Math.PI*2),e.fill(),e.fillText(`ENTRY`,i(t.entry.x)+11,a(t.entry.y)-10)),e.restore()}function cm(e,t){return e===null?1:Math.max(0,1-(t-e)/240)}function lm(e,t,n,i,a,o,s=!1){let c=!t.front&&(t.spinning||s);if(!t.skidding&&!s)return null;let l=c?.38+.62*t.heat:k(t.slip*(.22+t.heat*.78),0,1);if(l<.05)return null;let d=u(e.body.velocity),f=d>.1?r(e.body.velocity,-1/d):Ee(P(-1),e.body.angle),p=P(f.x,-f.y),m=P(Math.cos(e.body.angle),-Math.sin(e.body.angle)),h=P(-m.y,m.x),g=Math.sign(t.local.y)||1;return{point:o(e.body.world(E(t.local,P(0,g*e.car.preset.geometry.tireWidthM*.53)))),amount:n*(t.front?3:c?12:6.5)*l,flow:E(r(i,c?.08:.22),E(r(p,(c?110+Math.min(18,Math.abs(t.wheelSurfaceSpeedMps)*3):125)*l),r(h,g*(c?64:45)*l))),radiusPx:(c?.8:.55+t.heat*.16)*a,swirlPx:g*(c?85:105)*l,strength:l,burnout:c}}function um(e,t,n,r,i,a,o,s=!1){let c=e.sim;c.car.tires.forEach((l,d)=>{let f=lm(c,l,r,a,o.zoom,o.particlePoint,s&&!l.front);if(!f)return;let p=c.body.world(l.local),m=Lp(f.burnout,c.body.angle,l.angle,c.body.velocityAt(p),i);o.spray(e,d,n+d,t[d].point,o.particleVelocity(m),t[d].radiusPx,r*(f.burnout?85:48)*f.strength,k(.75+l.slipSpeedMps/12+u(c.body.velocityAt(p))/28,.8,1.9)),o.smoke?.({point:f.point,amount:f.amount,flow:f.flow,radiusPx:f.radiusPx,swirlPx:f.swirlPx})})}var dm=class{canvas=document.createElement(`canvas`);mask=document.createElement(`canvas`);gl=this.canvas.getContext(`webgl2`,{alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0});program=null;texture=null;startedAt=-1/0;duration=680;constructor(){let e=this.gl;e&&(this.program=nf(e,`#version 300 es
|
|
772
|
+
}`,zf=class{canvas=document.createElement(`canvas`);gl;program;buffer;viewportUniform;fadeUniform;wallCountUniform;wallsUniform;disturbanceUniform;disturbanceRadiusUniform;electricColorUniform;electricCoronaUniform;wallData=new Float32Array(128);data=new Float32Array(256*If);lost=!1;overlayHost=null;constructor(){this.canvas.width=512,this.canvas.height=512;let e=this.canvas.getContext(`webgl2`,{alpha:!0,depth:!1,stencil:!1,antialias:!0,premultipliedAlpha:!0});if(!e)throw Error(`WebGL2 is required for spark particles`);this.gl=e,this.canvas.addEventListener(`webglcontextlost`,e=>{e.preventDefault(),this.lost=!0});let t=nf(e,Lf,Rf,`Spark`),n=e.createBuffer();if(!n)throw uf(e,t),Error(`Unable to allocate spark buffer`);this.program=t,this.buffer=n,this.viewportUniform=af(t,`uViewport`),this.fadeUniform=af(t,`uFade`),this.wallCountUniform=af(t,`uWallCount`),this.wallsUniform=af(t,`uWalls[0]`),this.disturbanceUniform=af(t,`uDisturbance`),this.disturbanceRadiusUniform=af(t,`uDisturbanceRadius`),this.electricColorUniform=af(t,`uElectricColor`),this.electricCoronaUniform=af(t,`uElectricCorona`),e.bindBuffer(e.ARRAY_BUFFER,n),cf(e,t,{aStart:{buffer:n,numComponents:2,stride:44,offset:0,divisor:1},aEnd:{buffer:n,numComponents:2,stride:44,offset:8,divisor:1},aMotion:{buffer:n,numComponents:2,stride:44,offset:16,divisor:1},aStyle:{buffer:n,numComponents:4,stride:44,offset:24,divisor:1},aSeed:{buffer:n,numComponents:1,stride:44,offset:40,divisor:1}})}clear(){if(this.lost||!this.overlayHost||this.canvas.style.display===`none`)return;let e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null),e.disable(e.SCISSOR_TEST),e.viewport(0,0,this.canvas.width,this.canvas.height),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),this.canvas.style.display!==`none`&&(this.canvas.style.display=`none`)}dispose(){this.canvas.remove(),this.overlayHost=null,uf(this.gl,this.program),this.gl.deleteBuffer(this.buffer),this.gl.getExtension(`WEBGL_lose_context`)?.loseContext(),this.lost=!0}mountOverlay(e,t,n){this.overlayHost!==e&&(this.canvas.remove(),this.overlayHost=e,this.canvas.dataset.jrOverlay=``,this.canvas.style.position=e.style.position===`absolute`?`absolute`:`fixed`,this.canvas.style.pointerEvents=`none`,this.canvas.style.zIndex=e.style.zIndex||jf(`world`),document.body.append(this.canvas)),this.canvas.style.display!==`block`&&(this.canvas.style.display=`block`);let r=e.hasAttribute(`data-jr-overlay`),i=r&&e.style.position===`absolute`,a=i?`absolute`:`fixed`,o=i?e.style.translate:``;this.canvas.style.position!==a&&(this.canvas.style.position=a),this.canvas.style.translate!==o&&(this.canvas.style.translate=o);let s=r?{left:0,top:0}:e.getBoundingClientRect(),c=`${s.left}px`,l=`${s.top}px`,u=`${t.width}px`,d=`${t.height}px`;this.canvas.style.left!==c&&(this.canvas.style.left=c),this.canvas.style.top!==l&&(this.canvas.style.top=l),this.canvas.style.width!==u&&(this.canvas.style.width=u),this.canvas.style.height!==d&&(this.canvas.style.height=d);let f=Math.ceil(t.width*n),p=Math.ceil(t.height*n);(this.canvas.width!==f||this.canvas.height!==p)&&(this.canvas.width=f,this.canvas.height=p)}draw(e,t,n,r,i=1,a,o=[],s,c=Ff){if(this.lost||!t.length||n<=0){this.clear();return}let l=t.filter(e=>{let t=e.kind===2?Bf(e.start,e.motion,e.age,e.seed):e.end;return t.x>-64&&t.x<r.width+64&&t.y>-64&&t.y<r.height+64});if(!l.length){this.clear();return}let u=1/0,d=1/0,f=-1/0,p=-1/0;for(let e of l){let t=e.kind===2?Bf(e.start,e.motion,e.age,e.seed):e.end,n=e.kind===2?Bf(e.start,e.motion,Math.max(0,e.age-.045),e.seed):e.start;u=Math.min(u,n.x,t.x),f=Math.max(f,n.x,t.x),d=Math.min(d,n.y,t.y),p=Math.max(p,n.y,t.y)}let m=a?0:Math.floor((u-16)/32)*32,h=a?0:Math.floor((d-16)/32)*32,g=a?r.width:Math.max(32,Math.ceil((f+16-m)/32)*32),_=a?r.height:Math.max(32,Math.ceil((p+16-h)/32)*32),v=Math.min(2,Math.max(1,i)),y=Math.ceil(g*v),b=Math.ceil(_*v);a?this.mountOverlay(a,r,v):(y>this.canvas.width&&(this.canvas.width=Math.ceil(y/256)*256),b>this.canvas.height&&(this.canvas.height=Math.ceil(b/256)*256)),this.data.length<l.length*If&&(this.data=new Float32Array(Math.max(l.length*If,this.data.length*2)));let x=0;for(let e of l)this.data[x]=(e.start.x-m)*v,this.data[x+1]=(e.start.y-h)*v,this.data[x+2]=(e.end.x-m)*v,this.data[x+3]=(e.end.y-h)*v,this.data[x+4]=e.motion.x*v,this.data[x+5]=e.motion.y*v,this.data[x+6]=e.age,this.data[x+7]=e.life,this.data[x+8]=e.size*v,this.data[x+9]=e.kind,this.data[x+10]=e.seed,x+=If;let S=this.gl;performance.now();let C=a?0:this.canvas.height-b;S.viewport(0,C,y,b),a||(S.enable(S.SCISSOR_TEST),S.scissor(0,C,y,b)),S.clearColor(0,0,0,0),S.clear(S.COLOR_BUFFER_BIT),S.useProgram(this.program),S.bindBuffer(S.ARRAY_BUFFER,this.buffer),S.bufferData(S.ARRAY_BUFFER,this.data.subarray(0,x),S.DYNAMIC_DRAW),S.uniform2f(this.viewportUniform,y,b),S.uniform1f(this.fadeUniform,n),S.uniform3f(this.electricColorUniform,...c.color),S.uniform3f(this.electricCoronaUniform,...c.corona),s?(S.uniform4f(this.disturbanceUniform,(s.point.x-m)*v,(s.point.y-h)*v,s.velocity.x*v,s.velocity.y*v),S.uniform1f(this.disturbanceRadiusUniform,s.radius*v)):(S.uniform4f(this.disturbanceUniform,-1e5,-1e5,0,0),S.uniform1f(this.disturbanceRadiusUniform,1));let w=Math.min(32,o.length);for(let e=0;e<w;e++){let t=o[e],n=e*4;this.wallData[n]=(t.x-m)*v,this.wallData[n+1]=(t.y-h)*v,this.wallData[n+2]=(t.x+t.width-m)*v,this.wallData[n+3]=(t.y+t.height-h)*v}S.uniform1i(this.wallCountUniform,w),w&&S.uniform4fv(this.wallsUniform,this.wallData.subarray(0,w*4)),S.enable(S.BLEND),S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA),S.drawArraysInstanced(S.TRIANGLES,0,6,l.length),S.disable(S.BLEND),a||S.disable(S.SCISSOR_TEST),!a&&(performance.now(),e.drawImage(this.canvas,0,0,y,b,m,h,g,_))}};function Bf(e,t,n,r){let i=r*Math.PI*2,a=3+r*73.19%1*3.1,o=7.5+r*41.73%1*6.2;return{x:e.x+t.x*n+(Math.sin(a*n+i*2.3)-Math.sin(i*2.3))*(5+r*91.7%1*13)+(Math.sin(o*n-i*3.1)-Math.sin(-i*3.1))*3.5,y:e.y+t.y*n-n*n*(24+r*19.3%1*38)+(Math.cos(a*n+i*1.7)-Math.cos(i*1.7))*4+(Math.sin(o*n+i*4.7)-Math.sin(i*4.7))*2.5}}var Vf=360,Hf=(e,t,n)=>Math.max(t,Math.min(n,e));function Uf(e){let t=Math.max(1,e.pixelsPerMeter),n=Math.max(0,-A(e.velocity,e.normal))/t,i=c(e.velocity,r(e.normal,A(e.velocity,e.normal))),a=u(i)/t,o=a/Math.max(.001,a+n),s=Hf((n+(e.wall?.4:0))/1.8,0,1)*Hf((a-.8)/7,0,1)*Hf(o/.65,0,1),l=Hf((n-1.4)/9,0,1)*(1-o*.35);return Math.max(s,l)}function Wf(e){let t=t=>{let n=P(-t.y,t.x);return A(n,e.velocity)<0&&(n=r(n,-1)),n},n=t(e.normal),i=t(e.carNormal??r(e.normal,-1)),a=E(n,i),o=u(a);if(o<.001)return n;let s=E(r(a,1/o),r(e.normal,.12));return r(s,1/u(s))}function Gf(e,t){let n=Hf(e.x,t.x,t.x+t.width),r=Hf(e.y,t.y,t.y+t.height);return e.x!==n||e.y!==r?P(n,r):[{distance:n-t.x,point:P(t.x,r)},{distance:t.x+t.width-n,point:P(t.x+t.width,r)},{distance:r-t.y,point:P(n,t.y)},{distance:t.y+t.height-r,point:P(n,t.y+t.height)}].reduce((e,t)=>t.distance<e.distance?t:e).point}function Kf(e,t,n){if(Math.abs(n.x)>=Math.abs(n.y)){let r=P(n.x<0?-1:1,0);return{point:P(r.x<0?t.x:t.x+t.width,Hf(e.y,t.y,t.y+t.height)),normal:r}}let r=P(0,n.y<0?-1:1);return{point:P(Hf(e.x,t.x,t.x+t.width),r.y<0?t.y:t.y+t.height),normal:r}}function qf(e,t,n){let i=A(e.velocity,t);i<0&&(e.velocity=c(e.velocity,r(t,i*(1+n))))}function Jf(e,t,n){let i=e.point,a=e=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,o=c(i,n),s=0,l=1,d=P(),f=!0;for(let e of[`x`,`y`]){let r=o[e],i=t[e],a=i+(e===`x`?t.width:t.height);if(Math.abs(r)<1e-6){if(n[e]<i||n[e]>a){f=!1;break}continue}let c=(i-n[e])/r,u=(a-n[e])/r,p=Math.min(c,u),m=Math.max(c,u);if(p>s&&(s=p,d=e===`x`?P(r>0?-1:1,0):P(0,r>0?-1:1)),l=Math.min(l,m),s>l){f=!1;break}}if(f&&!a(n)&&s>=0&&s<=1&&s<=l&&u(d)){e.point=E(E(n,r(o,s)),r(d,.75)),qf(e,d,.38);return}if(!a(i))return;let p=Kf(Gf(i,t),t,[{value:Math.abs(n.x-t.x),normal:P(-1,0)},{value:Math.abs(n.x-t.x-t.width),normal:P(1,0)},{value:Math.abs(n.y-t.y),normal:P(0,-1)},{value:Math.abs(n.y-t.y-t.height),normal:P(0,1)}].reduce((e,t)=>t.value<e.value?t:e).normal);e.point=E(p.point,r(p.normal,.75)),qf(e,p.normal,.38),e.previous={...e.point}}var Yf=class{random;particles=[];walls=[];gpu=null;gpuUnavailable=!1;elapsed=0;lastEmission=-1/0;enabled=!0;electricalPalette=Ff;airflow=null;constructor(e=Math.random){this.random=e}captureState(){return j({particles:this.particles,walls:this.walls,gpuUnavailable:this.gpuUnavailable,elapsed:this.elapsed,lastEmission:this.lastEmission,enabled:this.enabled,electricalPalette:this.electricalPalette,airflow:this.airflow})}restoreState(e){this.gpu?.clear();let t=j(e);this.particles=t.particles,this.walls=t.walls,this.gpuUnavailable=t.gpuUnavailable,this.elapsed=t.elapsed,this.lastEmission=t.lastEmission,this.enabled=t.enabled,this.electricalPalette=t.electricalPalette,this.airflow=t.airflow}get count(){return this.particles.length}setEnabled(e){this.enabled=e,e||this.reset()}prepare(){if(!this.enabled||this.gpu||this.gpuUnavailable)return!!this.gpu;try{this.gpu=new zf}catch{this.gpuUnavailable=!0}return!!this.gpu}reset(){this.particles=[],this.lastEmission=-1/0,this.walls=[],this.airflow=null,this.gpu?.clear()}setElectricalPalette(e){let t=(e,t)=>Number.isFinite(e)?Hf(e,0,1):t,n=e.color??this.electricalPalette.color,r=e.corona??this.electricalPalette.corona;this.electricalPalette={color:[0,1,2].map(e=>t(n[e],this.electricalPalette.color[e])),corona:[0,1,2].map(e=>t(r[e],this.electricalPalette.corona[e]))}}electric(e,t,n=1){if(!this.enabled||!Number.isFinite(n)||n<=0||!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(t.x)||!Number.isFinite(t.y))return 0;let i=Hf(n,.1,3),a=u(t)>.001,o=a?Math.atan2(t.y,t.x):0,s=Math.round(3+i*5);for(let t=0;t<s;t++){let t=a?o+(this.random()-.5)*1.6:this.random()*Math.PI*2,n=P(Math.cos(t),Math.sin(t)),s=E(e,r(n,this.random()*1.6));this.particles.push({point:s,previous:{...s},velocity:r(n,(220+this.random()*460)*Math.sqrt(i)),plane:null,age:0,life:.06+this.random()*.16,size:.65+this.random()*.7,kind:4,seed:this.random()})}return this.trim(),s}disturb(e,t,n=90){this.airflow={point:{...e},velocity:{...t},radius:n}}dispose(){this.gpu?.dispose(),this.gpu=null}emit(e){if(!this.enabled||this.elapsed-this.lastEmission<.045)return 0;let t=Uf(e);if(t<=0)return 0;this.lastEmission=this.elapsed;let n=Wf(e),i=c(e.velocity,r(e.normal,A(e.velocity,e.normal))),a=Math.max(0,-A(e.velocity,e.normal)),o=a/Math.max(.001,a+u(i)),s=E(r(n,1-o),r(e.normal,o)),l=u(s),d=l>.001?r(s,1/l):e.normal,f=Math.round(24+80*Math.sqrt(t)),p=u(e.velocity)/Math.max(1,e.pixelsPerMeter),m=e.wall?Kf(e.point,e.wall,e.normal):null,h=m?.point??e.point,g=m?.normal??e.normal;for(let n=0;n<f;n++){let n=(this.random()-.5)*(.4+t*.45+o*1.5),a=Math.cos(n),s=Math.sin(n),c=P(d.x*a-d.y*s,d.x*s+d.y*a),l=(140+Math.min(420,p*30))*(.45+this.random()*1.15),u=E(r(c,l),r(i,.08)),f=e.wall?1.35+this.random()*.25:.35+this.random()*.3,m=E(h,r(g,f));this.particles.push({point:m,previous:{...m},velocity:u,plane:{origin:h,normal:g},age:0,life:.18+this.random()*.34,size:.85+this.random()*1.6,kind:0,seed:this.random()})}let _=E(h,r(g,e.wall?1.5:.8));return this.particles.push({point:_,previous:{..._},velocity:P(),plane:null,age:0,life:.18,size:5.5+t*4,kind:3,seed:this.random()}),this.trim(),f+1}emitBulletImpact(e,t){if(!this.enabled)return;let n=u(t);if(n<.001)return;let i=r(t,-1/n),a=E(e,r(i,1.4));for(let t=0;t<40;t++){let n=(this.random()-.5)*2.7,o=P(i.x*Math.cos(n)-i.y*Math.sin(n),i.x*Math.sin(n)+i.y*Math.cos(n)),s=E(a,r(o,this.random()*1.5));this.particles.push({point:s,previous:{...s},velocity:r(o,t<12?320+this.random()*300:150+this.random()*330),plane:{origin:e,normal:i},age:0,life:.16+this.random()*.24,size:.7+this.random()*1.2,kind:0,seed:this.random()})}this.particles.push({point:a,previous:{...a},velocity:P(),plane:null,age:0,life:.15,size:8,kind:3,seed:this.random()}),this.trim()}emitExplosion(e,t,n,i=1){if(!this.enabled)return 0;let a=Math.max(1,n),o=Hf(i,.5,2),s=Math.atan2(t.y,t.x),c=Math.round(32+20*Math.sqrt(o));for(let t=0;t<c;t++){let n=s+t*Math.PI*(3-Math.sqrt(5))+(this.random()-.5)*.3,i=P(Math.cos(n),Math.sin(n)),c=a*(5+this.random()*9)*Math.sqrt(o),l=E(e,r(i,a*.03));this.particles.push({point:l,previous:{...l},velocity:r(i,c),plane:null,age:0,life:.24+this.random()*.36,size:1+this.random()*1.1,kind:1,seed:this.random()})}return this.trim(),c}emitFire(e,t){if(!this.enabled||this.random()>=Math.min(1,t*15))return;let n=P(e.x+e.width/2,e.y+e.height/2),r=Math.cos(e.angle??0),i=Math.sin(e.angle??0);for(let t=0;t<12;t++){let t=e.fixedRadius??0,a=this.random()*Math.PI*2,o=Math.sqrt(this.random())*t,s=t>0?E(e.origin,P(Math.cos(a)*o,Math.sin(a)*o)):P(e.x+this.random()*e.width,e.y+this.random()*e.height),c=s.x-n.x,l=s.y-n.y,u=c*r+l*i,d=-c*i+l*r,f=Math.floor((u/e.width+.5)*e.pixelWidth),p=Math.floor((d/e.height+.5)*e.pixelHeight);if(f<0||p<0||f>=e.pixelWidth||p>=e.pixelHeight||(e.alpha[p*e.pixelWidth+f]??0)<32)continue;let m=P(n.x+u*r-d*i,n.y+u*i+d*r),h=(e.age-(t>0?0:Math.hypot(m.x-e.origin.x,m.y-e.origin.y)/e.farthest*e.spreadSeconds))/e.burnSeconds;if(!(h<=0||h>=.82)){this.addEmber(m);return}}}emitFireAt(e,t,n,r=10){if(!this.enabled||this.random()>=Math.min(1,n*r))return;let i=this.random()*Math.PI*2,a=Math.sqrt(this.random())*t;this.addEmber(E(e,P(Math.cos(i)*a,Math.sin(i)*a)))}addEmber(e){this.particles.push({point:e,previous:{...e},velocity:P((this.random()-.5)*76,-35-this.random()*100),plane:null,age:0,life:.5+this.random()*1.25,size:.55+this.random()**2*1.25,kind:2,seed:this.random()}),this.trim()}trim(){this.particles.length>Vf&&this.particles.splice(0,this.particles.length-Vf)}step(e,t={walls:[]}){if(this.elapsed+=e,this.airflow){let t=Math.exp(-e*5.5);this.airflow.velocity=r(this.airflow.velocity,t),u(this.airflow.velocity)<1&&(this.airflow=null)}if(this.walls=t.walls,!this.particles.length)return;let n=Math.min(e,.05);for(let e of this.particles)if(e.age+=n,e.kind!==2&&e.kind!==3){e.previous={...e.point};for(let i=0;i<2;i++){let i={...e.point},a=e.kind===4,o=a?8+e.seed*8:3.2+e.seed*6.3;if(e.velocity=r(e.velocity,Math.exp(-o*n/2)),a){let t=(e.seed-.5)*9*n*.5,r=Math.cos(t),i=Math.sin(t);e.velocity=P(e.velocity.x*r-e.velocity.y*i,e.velocity.x*i+e.velocity.y*r)}else e.velocity.y+=(38+e.seed*84)*n*.5;if(e.point=E(e.point,r(e.velocity,n/2)),e.plane){let t=A(c(e.point,e.plane.origin),e.plane.normal);t<0&&(e.point=E(e.point,r(e.plane.normal,-t+.4)),qf(e,e.plane.normal,.55))}for(let n of t.walls)Jf(e,n,i);if(t.car&&gn(t.car.mask,t.car.shape,e.point)){let n=vn(t.car.mask,t.car.shape,e.point);for(let i=0;i<16&&gn(t.car.mask,t.car.shape,e.point);i++)e.point=E(e.point,r(n,1.2));qf(e,n,.48)}}}this.particles=this.particles.filter(e=>e.age<e.life)}draw(e,t,n,i,a=1,o){if(!this.enabled||!this.particles.length||n<=0){this.gpu?.clear();return}if(this.prepare(),!this.gpu)return;let s=this.particles.map(e=>{let n=t(e.point),i=t(E(e.point,e.velocity)),a=c(i,n),o=e.kind<2||e.kind===4,s=o?t(e.previous):n;if(o){let i=c(n,s),o=u(i),l=e.kind===4?Math.min(20,u(a)*.04):Math.min(18,u(a)*(e.kind===1?.032:.038));if(o>.001&&o<l?(s.x=n.x-i.x/o*l,s.y=n.y-i.y/o*l):o<1&&(s.x-=a.x*.02,s.y-=a.y*.02),e.plane){let n=t(e.plane.origin),i=c(t(E(e.plane.origin,e.plane.normal)),n),a=A(c(s,n),i)/Math.max(1e-6,u(i));if(a<.7){let e=r(i,1/Math.max(1e-6,u(i)));s.x+=e.x*(.7-a),s.y+=e.y*(.7-a)}}}return{start:s,end:n,motion:a,age:e.age,life:e.life,size:e.size,kind:e.kind,seed:e.seed}}),l=[];if(o)for(let e of this.walls){let n=t({x:e.x,y:e.y}),r=t({x:e.x+e.width,y:e.y+e.height}),a=Math.min(n.x,r.x),o=Math.min(n.y,r.y),s=Math.abs(n.x-r.x),c=Math.abs(n.y-r.y);if(!(a>i.width||o>i.height||a+s<0||o+c<0)&&(l.push({x:a,y:o,width:s,height:c}),l.length===32))break}let d=this.airflow?{point:t(this.airflow.point),velocity:c(t(E(this.airflow.point,this.airflow.velocity)),t(this.airflow.point)),radius:u(c(t(E(this.airflow.point,P(this.airflow.radius,0))),t(this.airflow.point)))}:void 0;this.gpu.draw(e,s,n,i,a,o,l,d,this.electricalPalette)}};function Xf(e){let{ignitionSeconds:t,spreadSeconds:n,spreadRadiusPx:r,burnSeconds:i,smokePerSecond:a}=e;return{ignitionSeconds:t,spreadSeconds:n,spreadRadiusPx:r,burnSeconds:i,smokePerSecond:a}}function Zf(e){let t=(...e)=>e.every(Number.isFinite);if(!e||!t(e.point?.x,e.point?.y,e.radiusPx)||e.radiusPx<0||e.spreadSeconds!==void 0&&(!t(e.spreadSeconds)||e.spreadSeconds<0)||e.mask&&(!e.bounds||!(e.mask.alpha instanceof Uint8Array)||!Number.isInteger(e.mask.pixelWidth)||!Number.isInteger(e.mask.pixelHeight)||e.mask.pixelWidth<=0||e.mask.pixelHeight<=0||e.mask.alpha.length!==e.mask.pixelWidth*e.mask.pixelHeight||!t(e.mask.origin?.x,e.mask.origin?.y)||e.mask.frontRadius!==1/0&&(!t(e.mask.frontRadius)||e.mask.frontRadius<0))||e.bounds&&(!t(e.bounds.x,e.bounds.y,e.bounds.width,e.bounds.height)||e.bounds.width<0||e.bounds.height<0))throw Error(`Invalid fire source: expected finite coordinates and nonnegative geometry`);return{...e,point:{...e.point},...e.bounds&&{bounds:{...e.bounds}},...e.profile&&{profile:{...e.profile}},...e.mask&&{mask:{...e.mask,alpha:e.mask.alpha.slice(),origin:{...e.mask.origin}}}}}function Qf(e,t){if(e.mask&&e.bounds)return np({rect:e.bounds,alpha:e.mask.alpha,pixelWidth:e.mask.pixelWidth,pixelHeight:e.mask.pixelHeight},e.mask.origin,e.mask.frontRadius,t,e.radiusPx);if(e.bounds){let n=e.bounds;return Math.hypot(Math.max(t.x-n.x-n.width,n.x-t.x-t.width,0),Math.max(t.y-n.y-n.height,n.y-t.y-t.height,0))}return Math.hypot(Math.max(t.x-e.point.x,0,e.point.x-t.x-t.width),Math.max(t.y-e.point.y,0,e.point.y-t.y-t.height))}function $f(e,t,n,r){let i=Qf(t,n);return i>t.radiusPx?0:e/Math.max(.01,t.spreadSeconds??r)*(1.5-.5*i/Math.max(t.radiusPx,1))}function ep(e,t,n=1024){let{x:r,y:i,width:a,height:o}=e,s=Math.max(1,Math.ceil(a/Math.max(1,t))),c=Math.max(1,Math.ceil(o/Math.max(1,t))),l=Math.min(1,Math.sqrt(n/(s*c))),u=Math.min(n,Math.max(1,Math.floor(s*l))),d=Math.min(n,Math.max(1,Math.floor(c*l)));u=Math.min(u,Math.max(1,Math.floor(n/d)));let f=[];for(let e=0;e<d;e++)for(let t=0;t<u;t++)f.push({x:r+(t+.5)*a/u,y:i+(e+.5)*o/d});return f}function tp(e,t){if(!e.bounds)return[e.point];let n=e.bounds,r=e.radiusPx,i=t?{x:Math.max(n.x,t.x-r),y:Math.max(n.y,t.y-r),width:Math.min(n.x+n.width,t.x+t.width+r)-Math.max(n.x,t.x-r),height:Math.min(n.y+n.height,t.y+t.height+r)-Math.max(n.y,t.y-r)}:n;return i.width<=0||i.height<=0?[]:ep(i,Math.max(1,e.radiusPx)).filter(t=>!e.mask||Qf({...e,radiusPx:0},{...t,width:0,height:0})===0)}function np(e,t,n,r,i){let{rect:a,alpha:o,pixelWidth:s,pixelHeight:c}=e;if(a.width<=0||a.height<=0)return 1/0;let l=Math.max(0,Math.floor((r.x-i-a.x)/a.width*s)),u=Math.min(s-1,Math.floor((r.x+r.width+i-a.x)/a.width*s)),d=Math.max(0,Math.floor((r.y-i-a.y)/a.height*c)),f=Math.min(c-1,Math.floor((r.y+r.height+i-a.y)/a.height*c)),p=1/0;for(let e=d;e<=f;e++)for(let i=l;i<=u;i++){if(o[e*s+i]<=32)continue;let l={x:a.x+i*a.width/s,y:a.y+e*a.height/c,width:a.width/s,height:a.height/c};Math.hypot(l.x+l.width/2-t.x,l.y+l.height/2-t.y)>n||(p=Math.min(p,Math.hypot(Math.max(r.x-l.x-l.width,l.x-r.x-r.width,0),Math.max(r.y-l.y-l.height,l.y-r.y-r.height,0))))}return p}var rp=new WeakMap;function ip(e,t){let{rect:n,alpha:r,pixelWidth:i,pixelHeight:a}=e,o=t.spreadRadiusPx,s=rp.get(e);if(!s||s.alpha!==r||s.width!==n.width||s.height!==n.height||s.pixelWidth!==i||s.pixelHeight!==a||s.radius!==o){let t=Math.max(1,o*.75),c=Math.max(1,Math.ceil(n.width/t)),l=Math.max(1,Math.ceil(n.height/t)),u=Array(c*l),d=(e,r)=>{let i=Math.min(c-1,Math.floor(e/t)),a=Math.min(l-1,Math.floor(r/t)),o=a*c+i,s=(i+.5)*n.width/c,d=(a+.5)*n.height/l,f=(e-s)**2+(r-d)**2;(!u[o]||f<u[o].distance)&&(u[o]={x:e,y:r,distance:f})};for(let e=0;e<l;e++)for(let t=0;t<c;t++){let o=(t+.5)*n.width/c,s=(e+.5)*n.height/l,u=Math.min(i-1,Math.floor(o/n.width*i));r[Math.min(a-1,Math.floor(s/n.height*a))*i+u]>32&&d(o,s)}for(let e=0;e<a;e++)for(let t=0;t<i;t++)r[e*i+t]<=32||d((t+.5)*n.width/i,(e+.5)*n.height/a);s={alpha:r,width:n.width,height:n.height,pixelWidth:i,pixelHeight:a,radius:o,points:u.filter(e=>e!==void 0).map(({x:e,y:t})=>({x:e,y:t}))},rp.set(e,s)}return s.points.map(e=>({point:{x:n.x+e.x,y:n.y+e.y},radiusPx:o,spreadSeconds:t.spreadSeconds,profile:t}))}var ap=[[0,0],[60,120],[120,180],[240,240],[300,300],[360,360]];function op(e,t=!1){for(let n=1;n<ap.length;n++){let r=ap[n-1],i=ap[n],a=t?r[1]:r[0],o=t?i[1]:i[0];if(e<=o)return(t?r[0]:r[1])+(e-a)/(o-a)*((t?i[0]:i[1])-(t?r[0]:r[1]))}return e}function sp(e){let[t,n,r]=e.map(e=>e/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a,s=(i+a)*.5,c=o===0?0:o/(1-Math.abs(2*s-1)),l=o===0?0:i===t?(n-r)/o%6:i===n?(r-t)/o+2:(t-n)/o+4;return l=op((l*60+360)%360)*Math.PI/180,[.5+.5*Math.cos(l)*c,.5+.5*Math.sin(l)*c,c,s]}function cp(e){let t=e[0]*2-1,n=e[1]*2-1,r=Math.max(0,Math.min(1,e[2])),i=Math.max(0,Math.min(1,Math.hypot(t,n)/Math.max(r,1e-6))),a=r*Math.min(1,Math.sqrt(i*2)),o=Math.max(0,Math.min(1,e[3]))*(r>1e-6?.65+.35*i:1),s=op((Math.atan2(n,t)*180/Math.PI+360)%360,!0),c=(1-Math.abs(2*o-1))*a,l=c*(1-Math.abs(s/60%2-1)),u=Math.floor(s/60)%6,d=0,f=0,p=0;switch(u){case 0:d=c,f=l;break;case 1:d=l,f=c;break;case 2:f=c,p=l;break;case 3:f=l,p=c;break;case 4:d=l,p=c;break;default:d=c,p=l}let m=o-c*.5;return[Math.max(0,Math.min(255,(d+m)*255)),Math.max(0,Math.min(255,(f+m)*255)),Math.max(0,Math.min(255,(p+m)*255))]}function lp(e){let t=ee[e],n=e===`paint`?null:Te(e),r=Math.max(t?.gloss??0,(n?.surface?.clearcoat??0)*.5),i=Math.max(t?.relief??0,(n?.surface?.microRelief??0)*.7),a=Math.max(t?.film??0,n?.iridescence??0),o=Math.max(t?.grain??0,n?.sediment??0),s=n?.atmosphere?.emission??0;return{gloss:r,relief:i,film:a,grain:o,emission:s,emissionColor:n?.atmosphere?.emissionColor??[0,0,0],shaded:r+i+a+o+s>0}}function up(e,t,n,r,i,a){if(!e.shaded)return t;let o=Math.max(0,-i*.55-a*.8)*e.gloss*82,s=Math.sin(n*.16+r*.08)*e.relief*8,c=Math.sin(n*.095+r*.13+i*3)*e.film*27,l=Math.sin(n*127.1+r*311.7)*43758.5453%1*e.grain*12,u=o+s+l,d=e.emission*.22,f=(t,n,r)=>Math.max(0,Math.min(255,t+u+r+e.emissionColor[n]*d));return[f(t[0],0,c),f(t[1],1,-c*.65),f(t[2],2,c*.8)]}var dp=(e,t,n)=>Math.max(t,Math.min(n,e)),fp=new Uint8Array(new Uint32Array([1]).buffer)[0]===1,pp=(e,t,n)=>e+(t-e)*n,mp=[[1,0],[-1,0],[0,1],[0,-1]],hp=[[.7,.7],[-.7,.7],[.7,-.7],[-.7,-.7]],gp=class{kind;width;height;profile;canvas=document.createElement(`canvas`);splatterCanvas=null;splatterBounds=null;splatterDirty=!1;material;authored;deposited;pigment;colorPixels;basePixels;outline;spring;velocity;drops=[];burnDecay=new Float32Array;revision=0;pulled=!1;maxOutline=0;presented=-1;active=null;activeCells=new Set;outlineCells=new Set;wetBounds=null;renderedBounds=null;dirtyBounds=null;fullDirty=!0;color;appearance;cellSizePx=1;listeners=new Set;constructor(e,t,n,r,i){this.kind=e,this.width=t,this.height=n,this.profile=i,this.color=[...r],this.appearance=lp(e);let a=C[e];this.material={thickness:a.thickness,deformation:i?.deformation??a.deformation,alpha:i?.opacity??a.alpha};let o=t*n;this.authored=new Uint8Array(o),this.deposited=new Uint8Array(o),this.pigment=new Float32Array(o*4),this.colorPixels=new Uint8Array(o*3),this.basePixels=fp&&!this.appearance.shaded?new Uint32Array(o):null,this.outline=new Float32Array(o*2),this.spring=new Float32Array(o*2),this.velocity=new Float32Array(o*2),this.canvas.width=t,this.canvas.height=n}get shapeRevision(){return this.revision}get displaced(){return this.pulled||this.active!==null}get moving(){return this.active!==null}get hasSplatter(){return this.drops.length>0}get hasDeposits(){return this.deposited.some(e=>e>0)}get managedBytes(){return this.authored.byteLength+this.deposited.byteLength+this.pigment.byteLength+this.colorPixels.byteLength+(this.basePixels?.byteLength??0)+this.outline.byteLength+this.spring.byteLength+this.velocity.byteLength+this.canvas.width*this.canvas.height*4+(this.splatterCanvas?this.splatterCanvas.width*this.splatterCanvas.height*4:0)}setCellSize(e){this.cellSizePx=Math.max(.01,e)}configure(e,t){this.color=[...e],this.material.deformation=t?.deformation??C[this.kind].deformation;let n=t?.opacity??C[this.kind].alpha;n!==this.material.alpha&&(this.material.alpha=n,this.rebuildBasePixels()),this.changed()}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}changed(e){e?this.fullDirty||(this.dirtyBounds=this.dirtyBounds?{left:Math.min(this.dirtyBounds.left,e.left),top:Math.min(this.dirtyBounds.top,e.top),right:Math.max(this.dirtyBounds.right,e.right),bottom:Math.max(this.dirtyBounds.bottom,e.bottom)}:{...e}):(this.fullDirty=!0,this.dirtyBounds=null),this.revision++;for(let e of this.listeners)e()}alphaAt(e){return Math.max(this.authored[e],this.deposited[e])}refreshBasePixel(e){if(!this.basePixels)return;let t=this.alphaAt(e),n=e*3;this.basePixels[e]=Math.round(t*this.material.alpha)<<24|this.colorPixels[n+2]<<16|this.colorPixels[n+1]<<8|this.colorPixels[n]}rebuildBasePixels(){if(this.basePixels)for(let e=0;e<this.width*this.height;e++)this.refreshBasePixel(e)}wetAt(e,t){let n=Math.floor(e),r=Math.floor(t);return n>=0&&r>=0&&n<this.width&&r<this.height&&this.alphaAt(r*this.width+n)>=24}includeWetBounds(e){this.wetBounds=this.wetBounds?{left:Math.min(this.wetBounds.left,e.left),top:Math.min(this.wetBounds.top,e.top),right:Math.max(this.wetBounds.right,e.right),bottom:Math.max(this.wetBounds.bottom,e.bottom)}:e}rebuildWetBounds(){let e=this.width,t=this.height,n=-1,r=-1;for(let i=0;i<this.height;i++)for(let a=0;a<this.width;a++)this.alphaAt(i*this.width+a)&&(e=Math.min(e,a),t=Math.min(t,i),n=Math.max(n,a),r=Math.max(r,i));this.wetBounds=n>=e?{left:e,top:t,right:n,bottom:r}:null}componentAt(e,t,n,r){let i=dp(t.x-.5,0,this.width-1),a=dp(t.y-.5,0,this.height-1),o=Math.floor(i),s=Math.floor(a),c=Math.min(this.width-1,o+1),l=Math.min(this.height-1,s+1),u=i-o,d=a-s,f=e[(s*this.width+o)*r+n],p=e[(s*this.width+c)*r+n],m=e[(l*this.width+o)*r+n],h=e[(l*this.width+c)*r+n];return pp(pp(f,p,u),pp(m,h,u),d)}offsetAt(e,t=!0){return{x:this.componentAt(this.spring,e,0,2)+(t?this.componentAt(this.outline,e,0,2):0),y:this.componentAt(this.spring,e,1,2)+(t?this.componentAt(this.outline,e,1,2):0)}}sourcePoint(e){let t=this.offsetAt(e);return{x:e.x-t.x,y:e.y-t.y}}rawCoverage(e){return this.rawCoverageXY(e.x,e.y)}rawCoverageXY(e,t){if(e<0||t<0||e>=this.width||t>=this.height)return 0;let n=dp(e-.5,0,this.width-1),r=dp(t-.5,0,this.height-1),i=Math.floor(n),a=Math.floor(r),o=Math.min(this.width-1,i+1),s=Math.min(this.height-1,a+1),c=n-i,l=r-a;return pp(pp(this.alphaAt(a*this.width+i),this.alphaAt(a*this.width+o),c),pp(this.alphaAt(s*this.width+i),this.alphaAt(s*this.width+o),c),l)/255}densityAt(e){return e.x<0||e.y<0||e.x>=this.width||e.y>=this.height?0:this.rawCoverage(this.sourcePoint(e))}colorAt(e){let t=this.sourcePoint(e),n=dp(Math.floor(t.y),0,this.height-1)*this.width+dp(Math.floor(t.x),0,this.width-1);return this.alphaAt(n)?[this.colorPixels[n*3],this.colorPixels[n*3+1],this.colorPixels[n*3+2]]:this.color}captureFuel(){let e=new Float32Array(this.width*this.height);for(let t=0;t<this.height;t++)for(let n=0;n<this.width;n++)e[t*this.width+n]=this.densityAt({x:n+.5,y:t+.5});return e}inspectState(){let e=this.captureFuel(),t=0,n=1/0,r=0;for(let i of e)t+=i,n=Math.min(n,i),r=Math.max(r,i);return{volume:t,minimum:n,maximum:r,finite:Number.isFinite(t)}}setPigment(e,t,n,r=sp(t)){let i=e*4;if(n>=1||!this.alphaAt(e))for(let e=0;e<4;e++)this.pigment[i+e]=r[e];else for(let e=0;e<4;e++)this.pigment[i+e]=pp(this.pigment[i+e],r[e],n);let a=cp([this.pigment[i],this.pigment[i+1],this.pigment[i+2],this.pigment[i+3]]);for(let t=0;t<3;t++)this.colorPixels[e*3+t]=Math.round(a[t]);this.refreshBasePixel(e)}seedMask(e,t,n,r=this.color){if(e.length!==this.width*this.height)throw RangeError(`Liquid seed must match the field resolution`);this.authored.set(e);let i=sp(r),a=this.width,o=this.height,s=-1,c=-1;for(let t=0;t<e.length;t++){if(e[t]&&!this.deposited[t]&&(this.pigment.set(i,t*4),this.colorPixels.set(r,t*3)),this.refreshBasePixel(t),!e[t]&&!this.deposited[t])continue;let n=t%this.width,l=(t-n)/this.width;n<a&&(a=n),n>s&&(s=n),l<o&&(o=l),l>c&&(c=l)}this.wetBounds=s>=a?{left:a,top:o,right:s,bottom:c}:null,this.changed()}removeSeed(){this.authored.fill(0),this.rebuildBasePixels(),this.rebuildWetBounds(),this.changed()}pour(e,t,n,r,i,a=this.color,o=n,s=r){if(!(e>0))return;n=this.sourcePoint(n),o=this.sourcePoint(o);let c=Math.max(0,Math.floor(Math.min(o.x-s,n.x-r)-2)),l=Math.min(this.width-1,Math.ceil(Math.max(o.x+s,n.x+r)+2)),u=Math.max(0,Math.floor(Math.min(o.y-s,n.y-r)-2)),d=Math.min(this.height-1,Math.ceil(Math.max(o.y+s,n.y+r)+2)),f=n.x-o.x,p=n.y-o.y,m=Math.max(1e-6,f*f+p*p),h=sp(a),g=!1;for(let t=u;t<=d;t++)for(let i=c;i<=l;i++){let c=i+.5,l=t+.5,u=dp(((c-o.x)*f+(l-o.y)*p)/m,0,1),d=pp(o.x,n.x,u),_=pp(o.y,n.y,u),v=pp(s,r,u),y=Math.hypot(c-d,l-_),b=Math.round(dp(v+.5-y,0,1)*255);if(!b)continue;let x=t*this.width+i,S=this.alphaAt(x),C=this.colorPixels[x*3]===a[0]&&this.colorPixels[x*3+1]===a[1]&&this.colorPixels[x*3+2]===a[2];b<=this.deposited[x]&&S&&C||(!S||C?(this.pigment.set(h,x*4),this.colorPixels.set(a,x*3)):this.setPigment(x,a,dp(e*b/(S*2),0,1),h),this.deposited[x]=Math.max(this.deposited[x],b),this.refreshBasePixel(x),g=!0)}g&&(this.includeWetBounds({left:c,top:u,right:l,bottom:d}),this.changed())}transferPigment(e,t,n,r,i){if(!(i>0))return;let a=sp(r),o=this.width,s=this.height,c=-1,l=-1;if(this.eachContactPixel(e,t,n,(e,t,n,u)=>{if(!this.alphaAt(e))return;this.setPigment(e,r,dp(t*i,0,1),a);let d=Math.floor(n),f=Math.floor(u);o=Math.min(o,d),s=Math.min(s,f),c=Math.max(c,d),l=Math.max(l,f)},Math.max(2,n*1.1)),c>=o){let e=Math.ceil(this.maxOutline+8/this.cellSizePx)+2;this.changed({left:o-e,top:s-e,right:c+e,bottom:l+e})}}eachContactPixel(e,t,n,r,i=Math.max(2,n*1.8,(24*this.material.deformation+2)/this.cellSizePx)){let a=this.wetBounds,o=i+(this.pulled||this.active?8/this.cellSizePx:0),s=Math.max(0,Math.floor(Math.min(e.x,t.x)-i),a?Math.floor(a.left-o):0),c=Math.min(this.width-1,Math.ceil(Math.max(e.x,t.x)+i),a?Math.ceil(a.right+o):this.width-1),l=Math.max(0,Math.floor(Math.min(e.y,t.y)-i),a?Math.floor(a.top-o):0),u=Math.min(this.height-1,Math.ceil(Math.max(e.y,t.y)+i),a?Math.ceil(a.bottom+o):this.height-1),d=t.x-e.x,f=t.y-e.y,p=Math.max(1e-6,d*d+f*f),m=i*i;for(let t=l;t<=u;t++)for(let n=s;n<=c;n++){let a=n+.5,o=t+.5,s=dp(((a-e.x)*d+(o-e.y)*f)/p,0,1),c=a-e.x-d*s,l=o-e.y-f*s,u=c*c+l*l;if(u>=m)continue;let h=1-Math.sqrt(u)/i;r(t*this.width+n,h*h,a,o)}return{left:s,top:l,right:c,bottom:u}}drag(e,t,n,r=5.5,i=0){if(this.material.deformation===0)return;let a=t.x-e.x,o=t.y-e.y;if(Math.hypot(a,o)<.5)return;let s=Math.max(2,r*1.8,(24*this.material.deformation+2)/this.cellSizePx),c=Math.max(2,r*1.8),l=Math.hypot(a,o),u=a/l,d=o/l,f=Math.max(2,r*1.25),p=!1,m=this.width,h=this.height,g=-1,_=-1,v=this.eachContactPixel(e,t,r,(e,t,n,r)=>{let i=Math.floor(n),c=Math.floor(r);if(!this.wetAt(n-u*f,r-d*f)||this.wetAt(n+u*f,r+d*f))return;let l=this.alphaAt(e)>=24,v=0;for(let[e,t]of mp)this.wetAt(n+e*s*.35,r+t*s*.35)===l?this.wetAt(n+e*s*.7,r+t*s*.7)===l?this.wetAt(n+e*s,r+t*s)!==l&&(v=Math.max(v,.12)):v=Math.max(v,.3):v=Math.max(v,.65);if(!l&&v===0){for(let[e,t]of hp)if(this.wetAt(n+e*s,r+t*s)){v=.12;break}}if(!l&&v===0)return;let y=this.material.deformation/(.65+this.material.thickness*.7),b=e*2;if(this.velocity[b]=dp(this.velocity[b]+a*t*18*y,-90,90),this.velocity[b+1]=dp(this.velocity[b+1]+o*t*18*y,-90,90),this.activeCells.add(e),v>0){let n=24*this.material.deformation/this.cellSizePx;this.outline[b]=dp(this.outline[b]+a*t*y*v*.48,-n,n),this.outline[b+1]=dp(this.outline[b+1]+o*t*y*v*.48,-n,n),this.maxOutline=Math.max(this.maxOutline,Math.abs(this.outline[b]),Math.abs(this.outline[b+1])),this.pulled=!0,this.outlineCells.add(e)}p=!0,m=Math.min(m,i),h=Math.min(h,c),g=Math.max(g,i),_=Math.max(_,c)},c);p&&(this.active=this.active?{left:Math.min(v.left,this.active.left),top:Math.min(v.top,this.active.top),right:Math.max(v.right,this.active.right),bottom:Math.max(v.bottom,this.active.bottom)}:v,this.changed({left:m,top:h,right:g,bottom:_}))}step(e,t=0,n=[],r,i=e){let a=dp(e,0,1/30);if(this.activeCells.size){let e=Math.exp(-(7+this.material.thickness*5)*a),t=this.width,n=this.height,r=-1,i=-1;for(let o of this.activeCells){let s=o%this.width,c=Math.floor(o/this.width),l=0;for(let t=0;t<2;t++){let n=o*2+t,r=this.spring[n],i=(this.velocity[n]-r*95*a)*e;this.velocity[n]=i,this.spring[n]=dp(r+i*a,-8/this.cellSizePx,8/this.cellSizePx),l=Math.max(l,Math.abs(this.spring[n]),Math.abs(i)*.08)}if(t=Math.min(t,s),n=Math.min(n,c),r=Math.max(r,s),i=Math.max(i,c),l<.012){let e=o*2;this.spring[e]=this.spring[e+1]=0,this.velocity[e]=this.velocity[e+1]=0,this.activeCells.delete(o)}}r>=t&&this.changed({left:t,top:n,right:r,bottom:i}),this.active=this.activeCells.size?{left:t,top:n,right:r,bottom:i}:null}if(t<=0&&!r)return;let o=this.wetBounds;if(!o)return;let s=r?.size??0;if(r){this.burnDecay.length!==r.rates.length&&(this.burnDecay=new Float32Array(r.rates.length));for(let e=0;e<r.rates.length;e++){let n=t+r.rates[e];this.burnDecay[e]=n>0?Math.exp(-n*i):1}}let c=t>0?Math.exp(-t*i):1,l=this.width===s*4&&this.height===s*4,u=this.width,d=this.height,f=-1,p=-1;for(let e=Math.max(0,o.top);e<=Math.min(this.height-1,o.bottom);e++){let t=r?(l?e>>2:Math.floor(e*s/this.height))*s:0;for(let n=Math.max(0,o.left);n<=Math.min(this.width-1,o.right);n++){let i=e*this.width+n;if(!this.authored[i]&&!this.deposited[i])continue;let a=i*2,o=c;if(r){let r=this.spring[a]+this.outline[a],i=this.spring[a+1]+this.outline[a+1],c=r===0&&i===0?t+(l?n>>2:Math.floor(n*s/this.width)):dp(Math.floor((e+i)*s/this.height),0,s-1)*s+dp(Math.floor((n+r)*s/this.width),0,s-1);o=this.burnDecay[c]}if(o>=1)continue;let m=Math.round(this.authored[i]*o),h=Math.round(this.deposited[i]*o);(m!==this.authored[i]||h!==this.deposited[i])&&(this.authored[i]=m,this.deposited[i]=h,this.refreshBasePixel(i),u=Math.min(u,n),d=Math.min(d,e),f=Math.max(f,n),p=Math.max(p,e))}}f>=u&&this.changed({left:u,top:d,right:f,bottom:p})}mayIntersect(e,t,n=1){let r=Math.max(1,Math.ceil(Math.hypot(t.x-e.x,t.y-e.y)/Math.max(1,n)));for(let n=0;n<=r;n++){let i=n/r,a={x:pp(e.x,t.x,i),y:pp(e.y,t.y,i)};if(this.densityAt(a)>.02)return!0}return!1}spray(e,t,n,r,i=1,a=this.color){let o=Math.min(12,Math.ceil(r*2));for(let r of Ne(e,t,Math.max(1,n*.35),o,i,this.material.thickness))this.drops.push({point:{x:r.x,y:r.y},radius:Math.max(.5,r.radius),color:a,opacity:this.material.alpha*r.opacity,age:0});this.drops.length>256&&this.drops.splice(0,this.drops.length-256),this.splatterDirty=!0}grow(e){if(e<=1)return this.width;let t=this.width,n=Math.ceil(this.width*e/2)*2,r=Math.ceil(this.height*e/2)*2,i=Math.floor((n-this.width)/2),a=Math.floor((r-this.height)/2),o=(e,t,r)=>{for(let o=0;o<this.height;o++)r.set(e.subarray(o*this.width*t,(o+1)*this.width*t),((o+a)*n+i)*t);return r};this.authored=o(this.authored,1,new Uint8Array(n*r)),this.deposited=o(this.deposited,1,new Uint8Array(n*r)),this.pigment=o(this.pigment,4,new Float32Array(n*r*4)),this.colorPixels=o(this.colorPixels,3,new Uint8Array(n*r*3)),this.basePixels&&=o(this.basePixels,1,new Uint32Array(n*r)),this.outline=o(this.outline,2,new Float32Array(n*r*2)),this.spring=o(this.spring,2,new Float32Array(n*r*2)),this.velocity=o(this.velocity,2,new Float32Array(n*r*2)),this.activeCells=new Set([...this.activeCells].map(e=>(Math.floor(e/t)+a)*n+e%t+i)),this.outlineCells=new Set([...this.outlineCells].map(e=>(Math.floor(e/t)+a)*n+e%t+i));for(let e of this.drops)e.point.x+=i,e.point.y+=a;return this.splatterDirty=!0,this.active&&(this.active.left+=i,this.active.right+=i,this.active.top+=a,this.active.bottom+=a),this.wetBounds&&(this.wetBounds.left+=i,this.wetBounds.right+=i,this.wetBounds.top+=a,this.wetBounds.bottom+=a),this.width=n,this.height=r,this.canvas.width=n,this.canvas.height=r,this.renderedBounds=null,this.changed(),n}setColor(e){this.color=[...e],this.changed()}reset(){this.authored.fill(0),this.deposited.fill(0),this.outline.fill(0),this.spring.fill(0),this.velocity.fill(0),this.drops=[],this.splatterCanvas=null,this.splatterBounds=null,this.splatterDirty=!1,this.active=null,this.activeCells.clear(),this.outlineCells.clear(),this.basePixels?.fill(0),this.wetBounds=null,this.pulled=!1,this.maxOutline=0,this.changed()}captureState(){return{width:this.width,height:this.height,cellSizePx:this.cellSizePx,active:this.active?{...this.active}:null,pulled:this.pulled,authored:this.authored.slice(),deposited:this.deposited.slice(),pigment:this.pigment.slice(),colorPixels:this.colorPixels.slice(),outline:this.outline.slice(),spring:this.spring.slice(),velocity:this.velocity.slice(),drops:this.drops.map(e=>({...e,point:{...e.point}})),color:[...this.color],dispose(){}}}restoreState(e){this.width=e.width,this.height=e.height,this.canvas.width=e.width,this.canvas.height=e.height,this.cellSizePx=e.cellSizePx,this.active=e.active?{...e.active}:null,this.pulled=e.pulled,this.authored=e.authored.slice(),this.deposited=e.deposited.slice(),this.pigment=e.pigment.slice(),this.colorPixels=e.colorPixels.slice(),this.basePixels=fp&&!this.appearance.shaded?new Uint32Array(this.width*this.height):null,this.outline=e.outline.slice(),this.outlineCells=new Set;for(let e=0;e<this.width*this.height;e++)(this.outline[e*2]||this.outline[e*2+1])&&this.outlineCells.add(e);if(this.maxOutline=this.outline.reduce((e,t)=>Math.max(e,Math.abs(t)),0),this.spring=e.spring.slice(),this.velocity=e.velocity.slice(),this.activeCells=new Set,this.active)for(let e=this.active.top;e<=this.active.bottom;e++)for(let t=this.active.left;t<=this.active.right;t++){let n=e*this.width+t,r=n*2;(this.spring[r]!==0||this.spring[r+1]!==0||this.velocity[r]!==0||this.velocity[r+1]!==0)&&this.activeCells.add(n)}this.activeCells.size||(this.active=null),this.drops=e.drops.map(e=>({...e,point:{...e.point}})),this.splatterDirty=!0,this.color=[...e.color],this.rebuildBasePixels(),this.rebuildWetBounds(),this.renderedBounds=null,this.changed()}dispose(){this.listeners.clear(),this.canvas.remove(),this.splatterCanvas?.remove()}paintUnshaded(e,t){let n=this.basePixels,r=new Uint32Array(e.data.buffer),i=t.right-t.left+1;for(let e=t.top;e<=t.bottom;e++)r.set(n.subarray(e*this.width+t.left,e*this.width+t.right+1),(e-t.top)*i);let a=0,o=e=>{let n=e%this.width,o=Math.floor(e/this.width);if(n<t.left||n>t.right||o<t.top||o>t.bottom)return;let s=e*2,c=this.spring[s]+this.outline[s],l=this.spring[s+1]+this.outline[s+1];if(c===0&&l===0)return;a++;let u=n+.5-c,d=o+.5-l,f=this.rawCoverageXY(u,d),p=(o-t.top)*i+n-t.left;if(f<=0){r[p]=0;return}let m=(dp(Math.floor(d),0,this.height-1)*this.width+dp(Math.floor(u),0,this.width-1))*3;r[p]=Math.round(f*this.material.alpha*255)<<24|this.colorPixels[m+2]<<16|this.colorPixels[m+1]<<8|this.colorPixels[m]};for(let e of this.outlineCells)o(e);for(let e of this.activeCells)this.outlineCells.has(e)||o(e);return i*(t.bottom-t.top+1)-a}present(){if(this.presented!==this.revision){performance.now();let e=this.canvas.getContext(`2d`),t=this.pulled||this.active?Math.ceil(this.maxOutline+8/this.cellSizePx)+2:2,n=this.wetBounds,r=n?{left:Math.max(0,n.left-t),top:Math.max(0,n.top-t),right:Math.min(this.width-1,n.right+t),bottom:Math.min(this.height-1,n.bottom+t)}:null,i=this.renderedBounds,a=this.fullDirty?i&&r?{left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)}:i??r:this.dirtyBounds;a&&e.clearRect(a.left,a.top,a.right-a.left+1,a.bottom-a.top+1);let o=r&&a?{left:Math.max(0,r.left,a.left),top:Math.max(0,r.top,a.top),right:Math.min(this.width-1,r.right,a.right),bottom:Math.min(this.height-1,r.bottom,a.bottom)}:null;if(o&&o.right>=o.left&&o.bottom>=o.top){let t=o.right-o.left+1,n=o.bottom-o.top+1,r=e.createImageData(t,n),i=fp&&!this.appearance.shaded?new Uint32Array(r.data.buffer):null;performance.now();let a=this.basePixels?this.paintUnshaded(r,o):0;if(!this.basePixels)for(let e=o.top;e<=o.bottom;e++)for(let n=o.left;n<=o.right;n++){let s=(e*this.width+n)*2,c=this.spring[s]+this.outline[s],l=this.spring[s+1]+this.outline[s+1],u=c===0&&l===0;u&&a++;let d=((e-o.top)*t+n-o.left)*4;if(u&&i){let t=e*this.width+n,r=this.alphaAt(t);if(!r)continue;let a=t*3;i[d/4]=Math.round(r*this.material.alpha)<<24|this.colorPixels[a+2]<<16|this.colorPixels[a+1]<<8|this.colorPixels[a];continue}let f=n+.5-c,p=e+.5-l,m=u?this.alphaAt(e*this.width+n)/255:this.rawCoverageXY(f,p);if(m<=0)continue;let h=u?e*this.width+n:dp(Math.floor(p),0,this.height-1)*this.width+dp(Math.floor(f),0,this.width-1);if(this.appearance.shaded){let t=[this.colorPixels[h*3],this.colorPixels[h*3+1],this.colorPixels[h*3+2]],i=up(this.appearance,t,n,e,this.rawCoverageXY(f+1,p)-this.rawCoverageXY(f-1,p),this.rawCoverageXY(f,p+1)-this.rawCoverageXY(f,p-1));for(let e=0;e<3;e++)r.data[d+e]=i[e]}else{if(i){i[d/4]=Math.round(m*this.material.alpha*255)<<24|this.colorPixels[h*3+2]<<16|this.colorPixels[h*3+1]<<8|this.colorPixels[h*3];continue}r.data[d]=this.colorPixels[h*3],r.data[d+1]=this.colorPixels[h*3+1],r.data[d+2]=this.colorPixels[h*3+2]}r.data[d+3]=Math.round(m*this.material.alpha*255)}Ye(`liquid raster pixels`,t*n),Ye(`liquid still pixels`,a),performance.now(),e.putImageData(r,o.left,o.top)}this.renderedBounds=r,this.fullDirty=!1,this.dirtyBounds=null,this.presented=this.revision}}draw(e){if(this.present(),this.renderedBounds){let{left:t,top:n,right:r,bottom:i}=this.renderedBounds,a=r-t+1,o=i-n+1;e.drawImage(this.canvas,t,n,a,o,t,n,a,o)}this.drawSplatter(e)}drawSplatter(e){if(this.drops.length){if(this.splatterDirty||!this.splatterCanvas||!this.splatterBounds){let e={left:Math.floor(Math.min(...this.drops.map(e=>e.point.x-e.radius))),top:Math.floor(Math.min(...this.drops.map(e=>e.point.y-e.radius))),right:Math.ceil(Math.max(...this.drops.map(e=>e.point.x+e.radius))),bottom:Math.ceil(Math.max(...this.drops.map(e=>e.point.y+e.radius)))},t=this.splatterCanvas??document.createElement(`canvas`),n=Math.max(1,e.right-e.left),r=Math.max(1,e.bottom-e.top);t.width!==n&&(t.width=n),t.height!==r&&(t.height=r);let i=t.getContext(`2d`);i.clearRect(0,0,n,r);for(let t of this.drops)i.globalAlpha=t.opacity,i.fillStyle=`rgb(${t.color.join(` `)})`,i.beginPath(),i.arc(t.point.x-e.left,t.point.y-e.top,t.radius,0,Math.PI*2),i.fill();this.splatterCanvas=t,this.splatterBounds=e,this.splatterDirty=!1}e.drawImage(this.splatterCanvas,this.splatterBounds.left,this.splatterBounds.top)}}};function _p(e,t,n){let r=Math.ceil(t/4),i=new Float32Array(r*r),a=n.width/r;for(let n=0;n<t;n++)for(let a=0;a<t;a++){let o=Math.floor(n/4)*r+Math.floor(a/4);i[o]=Math.max(i[o],e[n*t+a])}return{size:r,fuel:i,spacing:a,point:e=>({x:n.x+(e%r+.5)*a,y:n.y+(Math.floor(e/r)+.5)*a})}}function vp(e){let t=e.flatMap(e=>Array.from(e.fuel,(t,n)=>({field:e,i:n,fuel:t,point:e.point(n)})).filter(e=>e.fuel>=.035)),n=Math.max(1,...e.map(e=>e.spacing))*2,r=e=>`${Math.floor(e.x/n)},${Math.floor(e.y/n)}`,i=new Map;t.forEach((e,t)=>{let n=r(e.point),a=i.get(n)??[];a.push(t),i.set(n,a)});let a=function*(e,t){let r=Math.ceil(t/n),a=Math.floor(e.x/n),o=Math.floor(e.y/n);for(let e=-r;e<=r;e++)for(let t=-r;t<=r;t++)for(let n of i.get(`${a+e},${o+t}`)??[])yield n};return{nodes:t,neighbors:function*(e){let r=t[e];for(let e of a(r.point,n)){let n=t[e],i=Math.hypot(r.point.x-n.point.x,r.point.y-n.point.y);i<=(r.field.spacing+n.field.spacing)*.74&&(yield{next:e,distance:i})}},nearby:a,cellSize:n}}function yp(e,t,n=0){let r=vp(e),i=new Int32Array(r.nodes.length).fill(-2),a=[];for(let e of t)for(let t of r.nearby(e,n+r.cellSize)){let o=r.nodes[t];i[t]===-2&&Math.hypot(o.point.x-e.x,o.point.y-e.y)<=n+o.field.spacing*.75&&(i[t]=-1,a.push(t))}for(let e=0;e<a.length;e++)for(let{next:t}of r.neighbors(a[e]))i[t]===-2&&(i[t]=a[e],a.push(t));let o=(e,t)=>{let n=-1,a=1/0;for(let o of r.nearby(e,t+r.cellSize)){if(i[o]===-2)continue;let s=r.nodes[o],c=Math.hypot(s.point.x-e.x,s.point.y-e.y);c<=t+s.field.spacing*.75&&c<a&&(n=o,a=c)}return n};return{points:a.map(e=>r.nodes[e].point),contains:(e,t=0)=>o(e,t)>=0,intersects:(e,t=0)=>{let n={x:e.x+e.width/2,y:e.y+e.height/2};for(let a of r.nearby(n,Math.hypot(e.width,e.height)/2+t+r.cellSize)){if(i[a]===-2)continue;let n=r.nodes[a],o=n.point,s=t+n.field.spacing*.5;if(o.x>=e.x-s&&o.x<=e.x+e.width+s&&o.y>=e.y-s&&o.y<=e.y+e.height+s)return!0}return!1},pathTo:(e,t=0)=>{let n=o(e,t),a=[];for(;n>=0;)a.push(r.nodes[n].point),n=i[n];return a.reverse()}}}var bp=class{density;resolution;rect;lifetime;spreadMps;pixelsPerMeter;size;fuel;starts;ends;rates;alpha;baseAlpha;light;pixelsByCell;revision=0;complete=!1;lit=!1;constructor(e,t,n,r,i,a){this.density=e,this.resolution=t,this.rect=n,this.lifetime=r,this.spreadMps=i,this.pixelsPerMeter=a;let o=_p(e,t,n);this.size=o.size,this.fuel=o.fuel,this.starts=new Float64Array(this.fuel.length).fill(1/0),this.ends=new Float64Array(this.fuel.length).fill(1/0),this.rates=new Float32Array(this.fuel.length),this.alpha=new Uint8Array(e.length),this.baseAlpha=new Uint8Array(e.length),this.light=new Float32Array(this.fuel.length);let s=Array.from({length:this.fuel.length},()=>[]);for(let n=0;n<t;n++)for(let r=0;r<t;r++){let i=n*t+r;e[i]<=.035||(this.baseAlpha[i]=Math.round(255*Math.min(1,(e[i]-.035)/.12)),s[Math.floor(n/4)*this.size+Math.floor(r/4)].push(i))}this.pixelsByCell=s.map(e=>e.length?Uint32Array.from(e):void 0)}point(e){return{x:this.rect.x+(e%this.size+.5)*this.spacing,y:this.rect.y+(Math.floor(e/this.size)+.5)*this.spacing}}get spacing(){return this.rect.width/this.size}get managedBytes(){return[this.density,this.fuel,this.starts,this.ends,this.rates,this.alpha,this.baseAlpha,this.light].reduce((e,t)=>e+t.byteLength,0)+this.pixelsByCell.reduce((e,t)=>e+(t?.byteLength??0),0)}indexAt(e){let t=Math.floor((e.x-this.rect.x)/this.spacing),n=Math.floor((e.y-this.rect.y)/this.spacing);return t<0||n<0||t>=this.size||n>=this.size?-1:n*this.size+t}inherit(e,t){for(let n=0;n<this.fuel.length;n++){let r=e.indexAt(this.point(n));if(r>=0&&Number.isFinite(e.starts[r])&&e.ends[r]>t){this.starts[n]=Math.max(t,e.starts[r]);let i=Math.min(1,(e.ends[r]-t)/Math.max(.01,e.ends[r]-e.starts[r])),a=this.fuel[n]>e.fuel[r]*i**2+.05;this.ends[n]=a?Math.max(e.ends[r],t+this.lifetime):e.ends[r]}}}update(e,t){let n=!1,r=this.light,i=!1;for(let a=0;a<this.fuel.length;a++){this.rates[a]=0;let o=this.starts[a],s=this.ends[a],c=r[a],l=0;if(Number.isFinite(o)&&e>=o){let r=Math.max(.01,s-o),i=Math.max(0,Math.min(1,(e-t-o)/r)),c=Math.max(0,Math.min(1,(e-o)/r)),u=Math.max(1e-6,(1-i)**2),d=Math.max(1e-6,(1-c)**2);this.rates[a]=Math.log(u/d)/Math.max(t,1e-4),e<s&&(n=!0,l=Math.min(1,(e-o)/.15)*Math.min(1,(s-e)/Math.min(2,r*.3)))}if(r[a]=l,c<=0&&l<=0)continue;let u=this.pixelsByCell[a];if(u)for(let e of u){let t=Math.round(this.baseAlpha[e]*l);this.alpha[e]=t,i||=t>0}}return this.lit=i,this.revision++,this.complete=this.starts.some(Number.isFinite)&&this.ends.every((t,n)=>this.fuel[n]<.035||t<=e),n}};function xp(e,t,n,r,i=[]){let{nodes:a,neighbors:o,nearby:s,cellSize:c}=vp(e);if(!a.length)return;let l=new Set;for(let e of[t,...i])for(let t of s(e,n+c)){let r=a[t];Math.hypot(r.point.x-e.x,r.point.y-e.y)<=n+r.field.spacing*.75&&l.add(t)}let u=new Float64Array(a.length).fill(1/0),d=[],f=(e,t)=>{if(t>=u[e])return;u[e]=t;let n=d.length;for(d.push({index:e,time:t});n>0;){let e=n-1>>1;if(d[e].time<=t)break;d[n]=d[e],n=e}d[n]={index:e,time:t}};for(a.forEach((e,t)=>{e.field.ends[e.i]<=r||(l.has(t)?f(t,r):Number.isFinite(e.field.starts[e.i])&&e.field.ends[e.i]>r&&f(t,Math.max(r,e.field.starts[e.i])))});d.length;){let e=d[0],t=d.pop();if(d.length){let e=0;for(;e*2+1<d.length;){let n=e*2+1;if(n+1<d.length&&d[n+1].time<d[n].time&&n++,d[n].time>=t.time)break;d[e]=d[n],e=n}d[e]=t}if(e.time===u[e.index])for(let{next:t,distance:n}of o(e.index)){let i=a[t];i.field.ends[i.i]<=r||f(t,e.time+n/Math.max(1,i.field.pixelsPerMeter)/i.field.spreadMps)}}a.forEach((e,t)=>{u[t]>=e.field.starts[e.i]||(e.field.starts[e.i]=u[t],e.field.ends[e.i]=u[t]+e.field.lifetime)})}function Sp(e){let t=e.extentM*e.pixelsPerMeter;return{x:e.center.x-t/2,y:e.center.y-t/2,width:t,height:t}}function Cp(e,t){return e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function wp(e,t,n){return t.x>=e.x-n&&t.x<=e.x+e.width+n&&t.y>=e.y-n&&t.y<=e.y+e.height+n}function Tp(e,t,n=0){if(!e.length||!t.length)return[];let r=e.map(Sp),i=new Uint8Array(e.length),a=[];for(let o=0;o<e.length;o++)t.some(e=>wp(r[o],e,n))&&(i[o]=1,a.push(o));for(let t=0;t<a.length;t++){let n=r[a[t]];for(let t=0;t<e.length;t++)!i[t]&&Cp(n,r[t])&&(i[t]=1,a.push(t))}return a.map(t=>e[t])}function Ep(e,t,n=0){return yp(Tp(e.filter(e=>C[e.kind].conductive),t,n).map(e=>_p(e.fluid.captureFuel(),e.resolution,Sp(e))),t,n)}function Dp(e,t,n){let r=[];for(let i of e){let e=i.fire;if(!e||!C[i.kind].burnable)continue;let a=e.size,o=Math.max(1,Math.ceil(n/e.spacing)),s=(n,r)=>{if(n<0||r<0||n>=a||r>=a)return!1;let i=r*a+n;return e.fuel[i]>=.035&&e.starts[i]<=t&&e.ends[i]>t};for(let t=0;t<a;t++)for(let n=0;n<a;n++)s(n,t)&&(s(n-1,t)&&s(n+1,t)&&s(n,t-1)&&s(n,t+1)&&(n%o!==0||t%o!==0)||r.push(e.point(t*a+n)))}return r}function Op(e,t,n,r){let i=0,a=0,o=0,s=new Set,c=null,l=[0,0,0],u=[],d=[];for(let f of e){let e=n(f,t);if(e>.12&&(c=f.id),e>.1&&s.add(f.kind),T(f.kind)===`water`&&!Te(f.kind)||e<.04)continue;let p=f.fluid.colorAt?.(r(f,t))??f.color;d.push({id:`liquid:${f.id}`,color:`rgb(${p.map(e=>Math.round(e)).join(` `)})`,opacity:Math.min(1,e),distanceM:f.elementProfile?.distanceM??(Te(f.kind)?_(f.kind).carryM:C[f.kind].treadDistanceM),material:_(f.kind)}),u.push(f.id);for(let t=0;t<3;t++)l[t]+=p[t]*e;i+=e,a=1-(1-a)*(1-e),o=Math.max(o,f.elementProfile?.distanceM??C[f.kind].treadDistanceM)}let f=i?{id:`liquid:${u.join(`,`)}`,color:`rgb(${l.map(e=>Math.round(e/i)).join(` `)})`,opacity:a,distanceM:o}:null;return{materials:[...s],paint:f,paints:d,splashFieldId:c}}function kp(e,t,n,r,i){let a=new Uint8Array(e*e),o=0,s=i?Math.max(0,Math.floor(((i.left-t.x)/n+.5)*e)-1):0,c=i?Math.min(e,Math.ceil(((i.right-t.x)/n+.5)*e)+1):e,l=i?Math.max(0,Math.floor(((i.top-t.y)/n+.5)*e)-1):0,u=i?Math.min(e,Math.ceil(((i.bottom-t.y)/n+.5)*e)+1):e;for(let i=l;i<u;i++)for(let l=s;l<c;l++){let s=0;for(let a=0;a<2;a++)for(let o=0;o<2;o++)r({x:t.x+((l+.25+o*.5)/e-.5)*n,y:t.y+((i+.25+a*.5)/e-.5)*n})&&s++;let c=Math.round(s/4*255);a[i*e+l]=c,o+=c/255}return{mask:a,coverage:o/(e*e)}}var Ap=4,jp={low:128,medium:160,high:192},Mp={low:192,medium:256,high:384},Np=.115,Pp=1/10,Fp=(e,t)=>{let n=typeof window>`u`?1:Math.min(3,Math.max(1,window.devicePixelRatio||1));return Math.max(Mp[t],Math.min(768,Math.ceil(e*n/16)*16))},Ip=(e,t)=>e.every((e,n)=>e===t[n]);function Lp(e,t,n,i,a){let o=Ee(P(-1),t),s=Ee(P(0,1),t+n),c=i.x*s.x+i.y*s.y;if(e){let e=u(i),t=Math.min(.55,e/22),n=Math.min(.28,Math.abs(c)/28),l=E(E(r(o,1-t-n),r(a,t)),r(s,-Math.sign(c)*n));return r(l,1/Math.max(.001,u(l)))}if(Math.abs(c)<=.8)return a;let l=Math.min(1,Math.abs(c)/Math.max(.8,u(i))),d=E(r(a,1-l),r(s,-Math.sign(c)*l));return r(d,1/Math.max(.001,u(d)))}var Rp=class{quality;fields=[];clock=0;fireTime=0;nextId=1;lastPours=new Map;lastFirePlan=-1/0;seam=null;wheelContacts=[];splashFields=new Map;captureState(){let e=[];try{for(let{fluid:t,...n}of this.fields)e.push({meta:j(n),fluid:t.captureState()})}catch(t){for(let t of e)t.fluid.dispose();throw t}return{fields:e,clock:this.clock,fireTime:this.fireTime,nextId:this.nextId,lastPours:j(this.lastPours),lastFirePlan:this.lastFirePlan,seam:this.seam?{previousId:this.seam.previous.id,currentId:this.seam.current.id,point:j(this.seam.point)}:null,wheelContacts:j(this.wheelContacts),splashFields:j(this.splashFields),quality:this.quality,dispose:()=>e.forEach(e=>e.fluid.dispose())}}restoreState(e){this.reset(),this.quality=e.quality;try{for(let{meta:t,fluid:n}of e.fields){let e=j(t),r=new gp(e.kind,e.resolution,e.resolution,e.color,e.elementProfile);r.setCellSize(e.extentM*e.pixelsPerMeter/e.resolution);try{r.restoreState(n)}catch(e){throw r.dispose(),e}this.fields.push({...e,fluid:r})}}catch(e){throw this.reset(),e}this.clock=e.clock,this.fireTime=e.fireTime,this.nextId=e.nextId,this.lastPours=j(e.lastPours),this.lastFirePlan=e.lastFirePlan,this.wheelContacts=j(e.wheelContacts),this.splashFields=j(e.splashFields??new Map);let t=this.fields.find(t=>t.id===e.seam?.previousId),n=this.fields.find(t=>t.id===e.seam?.currentId);this.seam=e.seam&&t&&n?{previous:t,current:n,point:j(e.seam.point)}:null}constructor(e=`high`){this.quality=e}get managedBytes(){return this.fields.reduce((e,t)=>e+96+(t.fire?.managedBytes??0)+t.fluid.managedBytes,0)}fireContactBounds(){return this.fields.filter(e=>C[e.kind].burnable).map(e=>{let t=e.extentM*e.pixelsPerMeter;return{x:e.center.x-t/2,y:e.center.y-t/2,width:t,height:t}})}hasConductiveCandidate(e,t){return this.fields.some(n=>{if(!C[n.kind].conductive)return!1;let r=n.extentM*n.pixelsPerMeter/2+t;return e.some(e=>Math.abs(e.x-n.center.x)<=r&&Math.abs(e.y-n.center.y)<=r)})}reset(){for(let e of this.fields)e.fluid.dispose();this.fields=[],this.clock=0,this.fireTime=0,this.lastPours.clear(),this.lastFirePlan=-1/0,this.seam=null,this.wheelContacts=[],this.splashFields.clear()}setQuality(e){this.quality=e}removeSeed(e){for(let t=this.fields.length-1;t>=0;t--){let n=this.fields[t];if(n.seedKey===e){n.fluid.removeSeed(),n.fluid.hasDeposits?n.seedKey=void 0:(n.fluid.dispose(),this.fields.splice(t,1));for(let[e,t]of this.splashFields)t===n.id&&this.splashFields.delete(e)}}}fieldForSeed(e){return this.fields.find(t=>t.seedKey===e)??null}seedShape(e,t,n,r,i,a,o,s,l){let d=this.fieldForSeed(e);d&&d.kind!==t&&(this.removeSeed(e),d=null);let f=Math.max(Ap,i/a+1.4);if(d??=this.create(t,n,r,a,s,Fp(f*a,this.quality)),!d)return!1;try{let t=d.pixelsPerMeter;d.seedKey=e,d.elementProfile=s,d.color=n;let a=Math.max(Ap,i/t+1.4,2*(u(c(r,d.center))/t+i/t/2+.7));d.poured===0?d.extentM=a:a>d.extentM&&this.expand(d,a/d.extentM),d.fluid.setCellSize(d.extentM*t/d.resolution),d.fluid.configure(n,s);let f=d.fluid.displaced,p=d.extentM*t/d.resolution;performance.now();let{mask:m,coverage:h}=(f?null:l?.(d.resolution,d.center,d.extentM*t))??kp(d.resolution,d.center,d.extentM*t,e=>{if(!f)return o(e);let t=d.fluid.offsetAt(this.localPoint(d,e));return o(P(e.x+t.x*p,e.y+t.y*p))},f?void 0:{left:r.x-i/2,top:r.y-i/2,right:r.x+i/2,bottom:r.y+i/2});if(h<=0)return this.removeSeed(e),!1;let g=Math.max(1,h*d.extentM*d.extentM*3);return d.poured=Math.max(d.poured,g),performance.now(),d.fluid.seedMask(m,.85,g,n),!0}catch(t){throw this.removeSeed(e),t}}pour(e,t,n,r,i,a=C[e].color,o=`default`){if(r<=0)return;let s=this.lastPours.get(o),l=s?u(c(t,s.point))/Math.max(1,n):0,d=s?.kind===e&&Ip(a,s.color)&&s.age<.12&&l<2.5?s:void 0,f=d?l:0,p=Math.max(d?.age??1/120,1/120),m=Math.exp(-f/.45),h=(d?.localAmount??0)*m+r,g=Math.min(1.8,.11+Math.sqrt(h)*.32),_=-Math.expm1(-p/.12),v=d?d.radiusM+(g-d.radiusM)*_:g;this.deposit(e,a,t,n,r,i,v,d?.point,d?.radiusM),this.lastPours.set(o,{kind:e,color:a,point:{...t},age:0,localAmount:h,radiusM:v})}emit(e,t,n,r,i,a,o=C[e].color){r<=0||i<=0||this.deposit(e,o,t,n,r,a,i)}deposit(e,t,n,r,i,a,o,s,l=o){let d=this.fields.at(-1),f=e===`paint`||Te(e)?.mixing,p=i=>{if(!(i.kind===e||Te(e)?.mixing&&Te(i.kind)?.mixing)&&!(f&&i.kind===`paint`)||!f&&!Ip(t,i.color))return!1;let a=o*r;return[n,s??n,P((n.x+(s?.x??n.x))/2,(n.y+(s?.y??n.y))/2)].some(e=>u(c(e,i.center))/r+o>6.8?!1:[P(),P(a),P(-a),P(0,a),P(0,-a)].some(t=>{let n=E(e,t);return this.covers(i,n)&&i.fluid.densityAt(this.localPoint(i,n))>.02}))},m=(d&&p(d)?d:[...this.fields].reverse().find(p))??this.create(e,t,n,r);if(!m)return;m!==d&&!d?.seedKey&&d?.kind===e&&Ip(t,d.color)&&(this.seam={previous:d,current:m,point:{...n}});let h=this.seam?.current===m&&u(c(n,this.seam.point))<r*.85;this.depositIn(m,n,h?i*.5:i,a,o,t,s,l),h&&this.seam&&this.depositIn(this.seam.previous,n,i*.5,a,o,t,s,l)}depositIn(e,t,n,i,a,o=e.color,s,l=a){e.poured+=n;let d=2*(Math.max(u(c(t,e.center)),s?u(c(s,e.center)):0)/e.pixelsPerMeter+a+.25);d>e.extentM&&this.expand(e,Math.min(14/e.extentM,Math.max(1.25,d/e.extentM)));let f=this.localPoint(e,t),p=r(i,e.resolution/e.extentM);e.fluid.pour(n,this.clock+e.id,f,a*e.resolution/e.extentM,p,o,this.localPoint(e,s??t),l*e.resolution/e.extentM)}eject(e,t,n,r,i){this.pour(e,t,n,1.1,r,i)}splatter(e,t,n,r,i,a=!1,o=1,s){if(i<=0)return!1;let c=this.wheelContacts[e]?.splashFieldId??(s?this.splashFields.get(e):null),l=c==null?a||this.wheelContacts.length===0?[...this.fields].reverse().find(e=>this.covers(e,t)&&this.coverage(e,t)>.12):null:this.fields.find(e=>e.id===c);if(!l||!this.covers(l,t))return!1;let u=this.localPoint(l,t),d=l.resolution/l.extentM/l.pixelsPerMeter,f=s?.color.match(/[\d.]+/g)?.slice(0,3).map(Number);return l.fluid.spray(u,n,r*d,i*1.5*(s?.opacity??1),o,f?.length===3?f:void 0),!0}create(e,t,n,r,i,a){let o=a??jp[this.quality],s;try{s=new gp(e,o,o,t,i)}catch{return null}let c={id:this.nextId++,kind:e,color:t,center:n,pixelsPerMeter:r,resolution:o,extentM:Ap,fluid:s,poured:0,elementProfile:i};return s.setCellSize(c.extentM*r/o),this.fields.push(c),c}step(e,t=[]){for(let[t,n]of this.lastPours)n.age+=e,n.age>1&&this.lastPours.delete(t);if(this.clock+=e,this.clock<1/30)return;let n=Math.min(.05,this.clock);this.clock=Math.max(0,this.clock-1/30),this.fireTime+=n;let r=this.fields.filter(e=>C[e.kind].burnable);this.fireTime-this.lastFirePlan>=.2&&r.some(e=>e.fire?.starts.some(Number.isFinite))&&r.some(e=>!e.fire||e.poured!==e.firePoured)&&(xp(r.map(e=>!e.fire||e.poured!==e.firePoured?this.prepareFire(e):e.fire),P(1/0,1/0),0,this.fireTime),this.lastFirePlan=this.fireTime);for(let e of this.fields){let r=[];for(let i of t){let t=u(i.velocity);if(u(c(i.point,e.center))>e.extentM*e.pixelsPerMeter*.62)continue;let a=e.resolution/e.extentM/e.pixelsPerMeter,o=this.localPoint(e,i.point);if(t<3&&(i.slip??0)<.05)continue;let s=P(i.point.x-i.velocity.x*n,i.point.y-i.velocity.y*n),l=this.localPoint(e,s);r.push({from:l,to:o,radius:Math.max(.65,i.radiusPx*a),paint:i.paint,slip:i.slip??0})}performance.now();let i=r.filter(t=>this.nearLiquid(e,t.from,t.to,t.radius));performance.now();for(let t of i)if(performance.now(),e.fluid.drag(t.from,t.to,n,t.radius,0),T(e.kind)===`paint`&&t.paint){let r=t.paint.color.match(/[\d.]+/g)?.slice(0,3).map(Number);if(r?.length===3){let i=u(c(t.to,t.from)),a=(1-Math.exp(-i/Math.max(1,t.radius*3)-t.slip*n*2))*t.paint.opacity;performance.now(),e.fluid.transferPigment?.(t.from,t.to,t.radius,r,a*.32)}}let a=C[e.kind].burnable&&e.fire?.starts.some(Number.isFinite)?e.fire:void 0,o=a?this.fireTime-(e.fireUpdatedAt??this.fireTime-n):0,s=!!a&&o+1e-9>=Pp,l=e.firePendingElapsed??0;performance.now(),e.fluid.step(n,0,[],l>0&&a?.rates.some(e=>e>0)?a:void 0,l||n),e.firePendingElapsed=0,s&&(performance.now(),a.update(this.fireTime,o),e.fireUpdatedAt=this.fireTime,e.firePendingElapsed=o)}for(let e=this.fields.length-1;e>=0;e--){let t=this.fields[e];if(!C[t.kind].burnable||!t.fire?.complete||(t.firePendingElapsed??0)>0)continue;let n=t.fluid.captureFuel();n.some(e=>e>=.035)?(this.prepareFire(t,n,.75),xp([t.fire],t.center,t.extentM*t.pixelsPerMeter,this.fireTime)):t.seedKey?(t.fluid.reset(),t.fire=void 0):(t.fluid.dispose(),this.fields.splice(e,1))}performance.now(),this.wheelContacts=t.map((e,t)=>{let n=this.sampleContact(e.point);return n.splashFieldId===null?e.paint||this.splashFields.delete(t):this.splashFields.set(t,n.splashFieldId),n});for(let e of this.splashFields.keys())e>=t.length&&this.splashFields.delete(e)}sampleContact(e){return Op(this.fields,e,(e,t)=>this.coverage(e,t),(e,t)=>this.localPoint(e,t))}nearLiquid(e,t,n,r){return e.fluid.mayIntersect(t,n,r)}expand(e,t){if(t<=1)return;let n=e.resolution;e.resolution=e.fluid.grow(t),e.extentM*=e.resolution/n,e.fire&&(this.prepareFire(e),e.firePoured=-1)}localPoint(e,t){return P(e.resolution/2+(t.x-e.center.x)/e.pixelsPerMeter*e.resolution/e.extentM,e.resolution/2+(t.y-e.center.y)/e.pixelsPerMeter*e.resolution/e.extentM)}covers(e,t){let n=e.extentM*e.pixelsPerMeter*.5;return Math.abs(t.x-e.center.x)<=n&&Math.abs(t.y-e.center.y)<=n}coverage(e,t){if(!this.covers(e,t))return 0;let n=e.fluid.densityAt(this.localPoint(e,t));return Math.max(0,Math.min(1,(n-Np+.012)/.024))*(e.elementProfile?.opacity??C[e.kind].alpha)}contacts(e,t){return this.fields.filter(n=>n.kind===e&&t.some(e=>this.coverage(n,e)>.1)).map(e=>e.id)}conductAt(e,t=0){return Ep(this.fields,e,t)}densityAt(e,t){return Math.max(0,...this.fields.filter(n=>n.kind===e&&this.covers(n,t)).map(e=>e.fluid.densityAt(this.localPoint(e,t))))}prepareFire(e,t=e.fluid.captureFuel(),n){let r=C[e.kind],i=e.extentM*e.pixelsPerMeter,a=new bp(t,e.resolution,{x:e.center.x-i/2,y:e.center.y-i/2,width:i,height:i},n??r.burnLifetime??r.burnSeconds??12,r.fireSpreadMps??C.oil.fireSpreadMps,e.pixelsPerMeter);return e.fire&&a.inherit(e.fire,this.fireTime),e.fire=a,e.firePoured=e.poured,e.fireSampleAt=this.fireTime,e.fireUpdatedAt=this.fireTime-e.id%3*Pp/3,e.firePendingElapsed=0,a}igniteConducted(e,t){if(!e.length)return;let n=Tp(this.fields.filter(e=>C[e.kind].burnable),e,t).map(e=>!e.fire||e.firePoured!==e.poured?this.prepareFire(e):e.fire);if(n.length){xp(n,e[0],t,this.fireTime,e.slice(1));for(let e of n)e.update(this.fireTime,0);this.lastFirePlan=this.fireTime}}igniteAt(e,t=0){if(this.fireTime-this.lastFirePlan<.15)return;let n=[e];if(t>0)for(let r=0;r<8;r++)n.push(P(e.x+Math.cos(r*Math.PI/4)*t,e.y+Math.sin(r*Math.PI/4)*t));let r=this.fields.filter(e=>C[e.kind].burnable&&n.some(t=>this.coverage(e,t)>.08));if(!r.length||(this.lastFirePlan=this.fireTime,r.every(e=>e.fire&&e.firePoured===e.poured&&n.every(t=>{let n=e.fire.indexAt(t);return n<0||e.fire.fuel[n]<.035||Number.isFinite(e.fire.starts[n])}))))return;let i=this.fields.filter(e=>C[e.kind].burnable).map(e=>!e.fire||e.poured!==e.firePoured&&this.fireTime-(e.fireSampleAt??0)>=.2?this.prepareFire(e):e.fire);xp(i,e,t,this.fireTime);for(let e of i)e.update(this.fireTime,0)}igniteAlong(e,t,n=0){for(let r=0;r<=4;r++)this.igniteAt(P(e.x+(t.x-e.x)*r/4,e.y+(t.y-e.y)*r/4),n)}burningSources(e){return Dp(this.fields,this.fireTime,e)}burningMasks(){return this.fields.flatMap(e=>{let t=e.fire;return!C[e.kind].burnable||!t?.lit?[]:[{key:e,alpha:t.alpha,pixelWidth:t.resolution,pixelHeight:t.resolution,...t.rect,origin:e.center,age:.4,farthest:Math.max(1,t.rect.width),spreadSeconds:0,burnSeconds:1,intensity:.55,smokeRate:10,revision:t.revision}]})}kindAt(e){let t=!1,n=!1,r=!1;for(let i=this.fields.length-1;i>=0;i--){let a=this.fields[i];if(!(this.coverage(a,e)<=.1)){if(T(a.kind)===`water`)return`water`;T(a.kind)===`oil`&&(t=!0),T(a.kind)===`paint`&&(n=!0),T(a.kind)===`mud`&&(r=!0)}}return r?`mud`:t?`oil`:n?`paint`:null}pruneOutside(e){this.fields=this.fields.filter(t=>{let n=t.extentM*t.pixelsPerMeter*1.5,r=t.center.x+n>=e.x&&t.center.x-n<=e.x+e.width&&t.center.y+n>=e.y&&t.center.y-n<=e.y+e.height;return r||t.fluid.dispose(),r}),!this.seam||this.fields.includes(this.seam.previous)&&this.fields.includes(this.seam.current)||(this.seam=null)}draw(e,t,n,r,i){performance.now(),e.save(),e.globalAlpha=r;for(let r of this.fields){let a=t(r.center),o=r.extentM*r.pixelsPerMeter*n,s=r.fluid.hasSplatter?o*1.5:o/2;i&&(a.x+s<0||a.y+s<0||a.x-s>i.width||a.y-s>i.height)||(e.save(),e.translate(a.x-o/2,a.y-o/2),e.scale(o/r.resolution,o/r.resolution),r.fluid.draw(e),e.restore())}e.restore()}},zp=class{liquids;camera;pixelSpace;elementFields=new Map;nextElementId=1;initialPuddles=[];constructor(e,t,n){this.liquids=e,this.camera=t,this.pixelSpace=n}captureState(){return j({elementFields:this.elementFields,nextElementId:this.nextElementId,initialPuddles:this.initialPuddles})}restoreState(e){let t=j(e);this.elementFields=t.elementFields,this.nextElementId=t.nextElementId,this.initialPuddles=t.initialPuddles}clearEffects(){this.elementFields.clear(),this.nextElementId=1}pourWorldLiquid(e,t,n,r,i){this.liquids.pour(e,this.camera.particlePoint(t),this.camera.particleScale(),n,P(),r,i)}addLiquid(e,t){let n=p(e),r=t.amount??24;if(!Number.isFinite(t.at.x)||!Number.isFinite(t.at.y)||!Number.isFinite(r)||r<=0)throw RangeError(`Liquid position and positive amount must be finite.`);let a=t.color?i(t.color):void 0;if(t.initial){let e={kind:n,point:this.camera.documentPoint(t.at),amount:r,color:a};this.initialPuddles.push(e),this.depositInitialPuddle(e)}else this.pourWorldLiquid(n,t.at,r,a)}syncElementLiquids(e){performance.now();let t=new Set(e.map(e=>e.key));for(let[e,n]of this.elementFields)t.has(e)||(this.liquids.removeSeed(n.id),this.elementFields.delete(e));let n=new Map,r=!1;for(let t of e){let e=this.localFromDocument({x:t.bounds.x,y:t.bounds.y}),i=this.localFromDocument({x:t.bounds.x+t.bounds.width,y:t.bounds.y+t.bounds.height}),a=P((e.x+i.x)/2,(e.y+i.y)/2),o=this.elementFields.get(t.key),s=o?.signature!==t.signature,c=o&&(o.center.x!==a.x||o.center.y!==a.y);if(!o||s||c){if(t.rasterize){if(r){let e=o&&this.liquids.fieldForSeed(o.id);e&&n.set(t.key,e);continue}r=!0}Ye(`liquid field reseeds`),o&&s&&Ye(`liquid signature reseeds`),o&&c&&Ye(`liquid position reseeds`),performance.now();let l=o?.id??`element-liquid-${this.nextElementId++}`,u=Math.max(Math.abs(i.x-e.x),Math.abs(i.y-e.y));if(!this.liquids.seedShape(l,t.kind,t.color,a,u,this.camera.particleScale(),e=>t.contains(this.pixelSpace?e:this.camera.documentPoint(e)),t.profile,this.pixelSpace?t.rasterize:void 0))continue;o={id:l,signature:t.signature,center:a},this.elementFields.set(t.key,o)}let l=this.liquids.fieldForSeed(o.id);l&&n.set(t.key,l)}return n}setInitialPuddles(e){this.liquids.reset(),this.elementFields.clear(),this.nextElementId=1,this.initialPuddles=e.map(({kind:e,color:t,point:n,amount:r})=>({kind:e,color:t?[...t]:void 0,point:{...n},amount:r})),this.restoreInitialPuddles()}restoreInitialPuddles(){for(let e of this.initialPuddles)this.depositInitialPuddle(e)}depositInitialPuddle({kind:e,color:t,point:n,amount:r}){let i=this.localFromDocument(n),a=this.camera.particleScale(),o=Math.max(1,Math.ceil(r/2));for(let n=0;n<o;n++)this.liquids.pour(e,i,a,r/o,P(),t),this.liquids.step(1/30)}localFromDocument(e){return this.pixelSpace?{...e}:this.camera.worldFromDocument(e)}},Bp=class{bounds=[];tiles=new Map;dpr=1;scale=1;viewportMode=`fixed`;documentOrigin={x:0,y:0};measureDocumentOrigin(){if(this.viewportMode!==`absolute`)return;let e=document.body,t=e.getBoundingClientRect(),n=Nn();this.documentOrigin={x:t.left+n.x+e.clientLeft,y:t.top+n.y+e.clientTop}}setViewportMode(e){this.viewportMode=e,this.measureDocumentOrigin();for(let t of this.tiles.values())t.canvas.style.position=e}setBounds(e){this.bounds=e;for(let[t,n]of this.tiles)t>=e.length&&(n.canvas.remove(),this.tiles.delete(t))}resize(e,t,n,r){this.dpr=n,this.scale=r,this.measureDocumentOrigin()}tile(e){let t=this.tiles.get(e);if(t)return t;let n=document.createElement(`canvas`);n.dataset.jrLiquidTextVehicle=``;let r=n.getContext(`2d`);if(!r)throw Error(`Joy Ride requires a 2D canvas context.`);return n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,{position:this.viewportMode,left:`0`,top:`0`,pointerEvents:`none`,zIndex:jf(`foreground`),transformOrigin:`0 0`,display:`none`}),document.body.append(n),t={canvas:n,context:r,visible:!1},this.tiles.set(e,t),t}draw(e,t,n,r){for(let i=0;i<this.bounds.length;i++){let a=this.bounds[i],o=e({x:a.x,y:a.y}),s=e({x:a.x+a.width,y:a.y+a.height}),c=o.x,l=o.y,u=s.x-c,d=s.y-l;if(!t.some(({point:e,radius:t})=>e.x>=c-t&&e.x<=c+u+t&&e.y>=l-t&&e.y<=l+d+t)||u<=0||d<=0){let e=this.tiles.get(i);e?.visible&&(e.canvas.style.display=`none`,e.visible=!1);continue}let f=this.tile(i),{canvas:p,context:m}=f,h=Math.max(1,Math.ceil(u*this.dpr)),g=Math.max(1,Math.ceil(d*this.dpr));(p.width!==h||p.height!==g)&&(p.width=h,p.height=g,p.style.width=`${u}px`,p.style.height=`${d}px`);let _=this.viewportMode===`absolute`?Nn():{x:0,y:0},v=this.viewportMode===`absolute`?this.documentOrigin:{x:0,y:0},y=`${_.x+c*this.scale-v.x}px ${_.y+l*this.scale-v.y}px`;p.style.translate!==y&&(p.style.translate=y),p.style.scale!==String(this.scale)&&(p.style.scale=String(this.scale)),f.visible||=(p.style.display=`block`,!0),m.setTransform(this.dpr,0,0,this.dpr,0,0),m.clearRect(0,0,u,d),m.save(),m.translate(-c+n.x,-l+n.y),r(m),m.restore()}}dispose(){for(let e of this.tiles.values())e.canvas.remove();this.tiles.clear()}};function Vp(e,t,n,r,i,a,o,s=[]){let{sim:c,tirePaint:l}=e;if(c.mode!==`car`)return;let d=[];c.car.statusEffects.setContacts(`mud`,ae.mud,d),e.isGhost?c.car.tires.forEach((e,t)=>l.pauseTrack(t)):(l.step(a?c.car.tires.map(e=>u(c.body.velocityAt(c.body.world(e.local)))*r):[]),o?(c.car.tires.forEach((e,r)=>{let o=t[r],u=o?.materials??[],f=e=>u.some(t=>T(t)===e&&!x(t)),p=()=>{for(let e of u){let t=x(e);t&&c.car.statusEffects.apply(`liquid:${e}`,t,r)}};if(u.some(e=>T(e)===`water`)&&(c.car.washWheel(r),l.wash(r,o?.paints??[]),!o?.paints?.length)){p();return}f(`oil`)&&c.car.coatWithOil(r),u.some(e=>T(e)===`mud`)&&(f(`mud`)&&c.car.coatWithMud(r),d.push(r)),p();for(let e of o?.paints??(o?.paint?[o.paint]:[]))l.touch(r,e);if(l.touch(r,s[r]??null),!a){l.pauseTrack(r);return}let m=l.coating(r),h=u.length>0&&!!o?.paint&&m?.color!==o.paint.color;(o?.paints?.length??+!!o?.paint)>0||s[r]?l.trackWet(r,n[r],-c.body.angle-e.angle,c.car.preset.geometry.tireWidthM,i,e.slip,h&&!s[r]):l.track(r,n[r],-c.body.angle-e.angle,c.car.preset.geometry.tireWidthM,i,h,e.slip)}),c.car.statusEffects.setContacts(`mud`,ae.mud,d)):c.car.tires.forEach((e,t)=>l.pauseTrack(t)))}function Hp(e,t,n,r,i,a,o){let s=e=>{let t=e.sim;return t.mode!==`car`||e.isGhost?[]:t.car.tires.map((n,r)=>{let i=t.body.world(n.local);return{point:o.particlePoint(i),velocity:o.particleVelocity(t.body.velocityAt(i)),radiusPx:t.car.preset.geometry.tireWidthM*o.particleScale*.7,slip:n.slip,paint:e.tirePaint.coating(r)}})},c=s(t),l=n.map(e=>({vehicle:e,tires:s(e)}));performance.now(),e.step(r,[...c,...l.flatMap(e=>e.tires)]),performance.now();for(let t of e.burningMasks())o.emitFire(t,r);performance.now();let u=e=>typeof a==`function`?a(e.sim.car.tires.map(t=>o.documentPoint(e.sim.body.world(t.local)))):e===t?a:[];Vp(t,e.wheelContacts.slice(0,c.length),c.map(e=>e.point),r,o.particleScale,i,!o.fading,u(t));let d=c.length;for(let{vehicle:t,tires:n}of l)Vp(t,e.wheelContacts.slice(d,d+n.length),n.map(e=>e.point),r,o.particleScale,!0,!o.fading,u(t)),d+=n.length;return{tires:c,companionTires:l}}var Up=class{camera;fields=new Rp;authoring;textVehicles=null;viewportMode=`fixed`;setViewportMode(e){this.viewportMode=e,this.textVehicles?.setViewportMode(e)}constructor(e,t){this.camera=e,this.fields.setQuality(t),this.authoring=new zp(this.fields,e,e.pixelSpace)}get managedBytes(){return this.fields.managedBytes}setQuality(e){this.fields.setQuality(e)}captureState(){let e=this.fields.captureState();try{return{fields:e,authoring:this.authoring.captureState(),dispose:()=>e.dispose()}}catch(t){throw e.dispose(),t}}restoreState(e){this.fields.restoreState(e.fields),this.authoring.restoreState(e.authoring)}clearEffects(){this.fields.reset(),this.authoring.clearEffects()}restoreInitialPuddles(){this.authoring.restoreInitialPuddles()}dispose(){this.textVehicles?.dispose(),this.textVehicles=null,this.fields.reset()}resize(){this.textVehicles?.resize(this.camera.width,this.camera.height,this.camera.dpr,this.camera.regionScale)}pruneOutside(e){this.fields.pruneOutside(e)}draw(e,t){this.fields.draw(e,e=>this.camera.pixelSpace?c(e,this.camera.sceneScroll()):this.camera.screen(e),this.camera.pixelSpace?1:this.camera.zoom,t,{width:this.camera.width,height:this.camera.height})}drawTextVehicles(e,t,n){this.textVehicles?.draw(e=>this.camera.viewportFromDocument(e),e,t,n)}pourWorldLiquid(e,t,n,r,i){this.authoring.pourWorldLiquid(e,t,n,r,i)}emitPaint(e,t,n,r,i){this.fields.emit(`paint`,this.camera.particlePoint(e),this.camera.particleScale(),n,t,this.camera.pixelSpace?P(i.x,-i.y):i,r)}local(e){return this.camera.particlePoint(this.camera.worldFromDocument(e))}get ratio(){return this.camera.particleScale()/this.camera.documentScale()}hasConductiveCandidate(e,t){return this.fields.hasConductiveCandidate(e.map(e=>this.local(e)),t*this.ratio)}conductLightning(e,t=0){let n=e=>this.local(e),r=e=>this.camera.pixelSpace?e:this.camera.documentPoint(e),i=this.ratio,a=this.fields.conductAt(e.map(n),t*i);return{points:a.points.map(r),contains:(e,t=0)=>a.contains(n(e),t*i),intersects:(e,t=0)=>{let r=n(e),o=n({x:e.x+e.width,y:e.y+e.height});return a.intersects({x:Math.min(r.x,o.x),y:Math.min(r.y,o.y),width:Math.abs(r.x-o.x),height:Math.abs(r.y-o.y)},t*i)},pathTo:(e,t=0)=>a.pathTo(n(e),t*i).map(r)}}igniteAt(e,t){this.fields.igniteAt(this.local(e),t*this.ratio)}igniteConducted(e,t){this.fields.igniteConducted(e.map(e=>this.local(e)),t*this.ratio)}igniteFromFire(e){if(!e.length)return;let t=new Map,n=this.fields.fireContactBounds().map(e=>{if(this.camera.pixelSpace)return e;let t=this.camera.documentPoint({x:e.x,y:e.y}),n=this.camera.documentPoint({x:e.x+e.width,y:e.y+e.height});return{x:Math.min(t.x,n.x),y:Math.min(t.y,n.y),width:Math.abs(t.x-n.x),height:Math.abs(t.y-n.y)}});for(let r of e){let e=Math.max(0,Math.round(r.radiusPx/4)*4),i=t.get(e)??[],a=r.bounds?n.flatMap(e=>tp(r,e)):tp(r);for(let e of a)i.push(this.local(e));t.set(e,i)}for(let[e,n]of t)this.fields.igniteConducted(n,e*this.ratio)}burningSources(){let e=24*this.ratio;return this.fields.burningSources(e).map(e=>({point:this.camera.pixelSpace?e:this.camera.documentPoint(e),radiusPx:24,spreadSeconds:N.spreadSeconds}))}hasContact(e,t){return this.fields.contacts(p(e),t.map(e=>this.camera.particlePoint(e))).length>0}add(e,t){this.authoring.addLiquid(e,t)}syncElements(e){if(this.camera.overlay){let t=e.filter(e=>typeof SVGGeometryElement<`u`&&e.key instanceof SVGGeometryElement||typeof HTMLElement<`u`&&e.key instanceof HTMLElement&&(e.key.childElementCount>0||!!e.key.textContent?.trim())).map(e=>e.bounds);t.length&&!this.textVehicles&&(this.textVehicles=new Bp,this.textVehicles.setViewportMode(this.viewportMode)),this.textVehicles?.setBounds(t),this.resize()}return this.authoring.syncElementLiquids(e)}setInitialPuddles(e){this.authoring.setInitialPuddles(e)}pourVehicle(e,t,n,r,i=`player`){if(e.mode!==`car`)return;let a=e.body.world(P(-e.car.preset.geometry.lengthM/2-.58,0)),o=Ee(P(-4,0),e.body.angle);this.fields.pour(t,this.camera.particlePoint(a),this.camera.particleScale(),n,this.camera.pixelSpace?P(o.x,-o.y):o,r,i)}stepVehicles(e,t,n,r,i,a,o){return Hp(this.fields,e,t,n,r,i,{particlePoint:e=>this.camera.particlePoint(e),particleVelocity:e=>this.camera.pixelSpace?P(e.x*this.camera.zoom,-e.y*this.camera.zoom):{...e},documentPoint:e=>this.camera.documentPoint(e),particleScale:this.camera.particleScale(),fading:a,emitFire:o})}splatter(e,t,n,r,i,a,o,s){let c=e.tirePaint.coating(t);return this.fields.splatter(n,r,i,a,o,!1,s,c)?!0:(e.tirePaint.splatter(t,r,i,a,o,s,this.camera.particleScale()),!!c)}igniteAlong(e,t,n){this.fields.igniteAlong(e,t,n)}igniteAtLocal(e){this.fields.igniteAt(e)}pourOilPreview(e,t){this.fields.pour(`oil`,e,this.camera.particleScale(),t*6,P())}},Wp=e=>{let t=Math.sin(e*127.1+311.7)*43758.5453;return t-Math.floor(t)};function Gp(e,t,n,r,i,a,o=1){let s=t.material;e.save();let c=t.exit?.leadInM,l=c?Math.max(.05,c-Math.max(t.widthM*1.5,.25)):0,u=c?Math.max(0,Math.min(1,(c+(t.exit.fromM+t.exit.toM)*.5)/l)):1,d=o*u*u*(3-2*u);if(e.strokeStyle=t.color,e.fillStyle=t.color,e.globalAlpha=t.opacity*d,t.droplet){e.translate(r.x,r.y),e.rotate(t.angle),e.beginPath(),e.ellipse(0,0,i/2,i*t.droplet.aspect/2,0,0,Math.PI*2),e.fill(),e.restore();return}let f=r.x-n.x,p=r.y-n.y,m=Math.hypot(f,p);if(!s){e.lineWidth=i,e.lineCap=`round`,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke(),e.restore();return}e.translate(n.x,n.y),e.rotate(m>.01?Math.atan2(p,f):t.angle);let h=t.wetness??1,g=t.slip??0,_=Math.max(1.5,s.pitchM*a),v=(t.phaseM??0)*a%_,y=t.opacity*d*s.coverage,b=Math.min(1,s.film*(.35+.65*h)+g*.3);if(t.exit){let e=Math.max(0,(t.exit.fromM+t.exit.toM)*.5),n=Math.min(1,e/t.exit.lengthM);b+=(1-b)*(1-n)*(1-n)}b>.005&&m>0&&(e.globalAlpha=y*b,e.lineWidth=i*.88,e.lineCap=t.exit?`round`:`butt`,e.beginPath(),e.moveTo(0,0),e.lineTo(m,0),e.stroke());let x=m<.01?0:_-v;for(let n=x,r=0;n<=m+.001&&r<256;n+=_,r++){let r=Math.round(((t.phaseM??0)*a+n)/_);for(let a=0;a<4;a++){let o=Wp(r*17+a*7);if(o<s.breakup*(1-h*.65))continue;let c=(a-1.5)*i*.245,l=i*(.19+o*.025),u=_*(.5+g*.35),d=(a<2?1:-1)*l*.4;e.globalAlpha=y*(.62+o*.38)*(1-b*.65),e.fillStyle=t.color,e.beginPath(),e.moveTo(n-u*.5,c-l*.5),e.lineTo(n+u*.5,c-l*.5+d),e.lineTo(n+u*.5,c+l*.5+d),e.lineTo(n-u*.5,c+l*.5),e.closePath(),e.fill(),(s.gloss>.1||s.emission>0)&&(e.strokeStyle=s.emission>.5?`#ff9b25`:s.iridescence>.15?r%3?`#7faaa3`:`#9d7d99`:`#e2e8db`,e.globalAlpha=y*h*(s.emission>.5?.7:.11+s.gloss*.16),e.lineWidth=Math.max(.2,i*.035),e.beginPath(),e.moveTo(n-u*.4,c-l*.4),e.lineTo(n+u*.4,c-l*.4+d),e.stroke()),s.grain>.1&&o>.45&&(e.globalAlpha=y*s.grain*.35,e.fillStyle=`#372b22`,e.fillRect(n+u*.1,c,Math.max(.25,i*.05),Math.max(.3,i*.1)))}}e.restore()}var Kp=256,qp=48,Jp=class{overPuddle;constructor(e=null){this.overPuddle=e}tiles=new Map;records=new Map;archived=0;references=0;processed=0;ratio=0;scale=0;captureState(){return{marks:j([...new Set([...this.records.values()].flat())]),processed:this.processed,scale:this.scale}}restoreState(e){this.clear(),this.scale=e.scale,this.seed(j(e.marks),e.scale),this.processed=e.processed}managedBytes(e){return this.tiles.size*(Kp*this.ratio)**2*4+Math.max(0,this.archived-e)*136+this.references*8}clear(){this.tiles.clear(),this.records.clear(),this.archived=0,this.references=0,this.processed=0}seed(e,t){for(let n of e)(this.overPuddle===null||!!n.overPuddle===this.overPuddle)&&this.indexMark(n,t)}draw(e,t,n,r,i,a,o,s,c,l){n<this.processed&&this.clear(),(this.ratio!==c||this.scale!==s)&&(this.tiles.clear(),this.ratio=c,this.scale=s);let u=Math.min(t.length,n-this.processed);for(let e=t.length-u;e<t.length;e++){let n=t[e];(this.overPuddle===null||!!n.overPuddle===this.overPuddle)&&this.indexMark(n,s)}if(this.processed=n,!this.archived)return;let d=Math.floor(r/Kp),f=Math.floor((r+a)/Kp),p=Math.floor(i/Kp),m=Math.floor((i+o)/Kp),h=new Set;e.save(),e.globalAlpha=l;for(let t=p;t<=m;t++)for(let n=d;n<=f;n++){let a=`${n},${t}`;h.add(a);let o=this.records.get(a);if(!o?.length)continue;let c=this.tiles.get(a);if(!c){c=this.createTile(n,t),Ye(`tire tile rebuilds`);for(let e of o)this.stroke(c,e,s);this.tiles.set(a,c)}Ye(`tire tile composites`),e.drawImage(c.canvas,n*Kp-r,t*Kp-i,Kp,Kp)}if(e.restore(),this.tiles.size>qp)for(let e of this.tiles.keys()){if(this.tiles.size<=qp)break;h.has(e)||this.tiles.delete(e)}}pruneOutside(e){for(let t of this.records.keys()){let[n,r]=t.split(`,`).map(Number);((n+1)*Kp<e.x||n*Kp>e.x+e.width||(r+1)*Kp<e.y||r*Kp>e.y+e.height)&&(this.records.delete(t),this.tiles.delete(t))}this.archived=new Set([...this.records.values()].flat()).size,this.references=[...this.records.values()].reduce((e,t)=>e+t.length,0)}indexMark(e,t){this.archived++;let n=e.widthM*Math.max(32,t)*.38+2,r=Math.floor((Math.min(e.from.x,e.point.x)-n)/Kp),i=Math.floor((Math.max(e.from.x,e.point.x)+n)/Kp),a=Math.floor((Math.min(e.from.y,e.point.y)-n)/Kp),o=Math.floor((Math.max(e.from.y,e.point.y)+n)/Kp);for(let n=a;n<=o;n++)for(let a=r;a<=i;a++){let r=`${a},${n}`,i=this.records.get(r);i||(i=[],this.records.set(r,i)),i.push(e),this.references++;let o=this.tiles.get(r);o&&this.stroke(o,e,t)}}createTile(e,t){let n=document.createElement(`canvas`);n.width=Math.ceil(Kp*this.ratio),n.height=Math.ceil(Kp*this.ratio);let r=n.getContext(`2d`);if(!r)throw Error(`Joy Ride tire marks require a 2D canvas context`);return r.setTransform(this.ratio,0,0,this.ratio,-e*Kp*this.ratio,-t*Kp*this.ratio),{canvas:n,context:r}}stroke(e,t,n){Ye(`tire mark strokes`);let r=e.context;Gp(r,t,t.from,t.point,t.widthM*n*.76,n)}},Yp=class{ground=new Jp;dry=new Map;wet=new Map;seed(e,t){this.ground.seed(e,t)}forgetVehicle(e){this.dry.delete(e),this.wet.delete(e)}captureState(){return{ground:this.ground.captureState(),dry:[...this.dry].map(([e,t])=>[e,t.captureState()]),wet:[...this.wet].map(([e,t])=>[e,t.captureState()])}}restoreState(e){this.ground.restoreState(e.ground),this.dry=new Map(e.dry.map(([e,t])=>{let n=new Jp(!1);return n.restoreState(t),[e,n]})),this.wet=new Map(e.wet.map(([e,t])=>{let n=new Jp(!0);return n.restoreState(t),[e,n]}))}get managedBytes(){return this.ground.managedBytes(0)+[...this.dry.values(),...this.wet.values()].reduce((e,t)=>e+t.managedBytes(0),0)}clear(){this.ground.clear(),this.dry.clear(),this.wet.clear()}pruneOutside(e){for(let t of[...this.dry.values(),...this.wet.values()])t.pruneOutside(e)}draw(e,t,n,r){let{pixelSpace:i,scroll:a,width:o,height:s,particleScale:c,rasterRatio:l,zoom:u,effectsAlpha:d,screen:f}=r;if(e.save(),e.lineCap=`round`,i){n||this.ground.draw(e,[],0,a.x,a.y,o,s,c,l,d);let r=n?this.wet:this.dry;for(let i of t){let t=r.get(i.id);t||(t=new Jp(n),r.set(i.id,t)),t.draw(e,i.tirePaint.marks,i.tirePaint.totalMarks,a.x,a.y,o,s,c,l,d)}}else for(let r of t)for(let t of r.tirePaint.marks){if(!!t.overPuddle!==n)continue;let r=f(t.point),i=f(t.from);(r.x<-20||r.x>o+20||r.y<-20||r.y>s+20)&&(i.x<-20||i.x>o+20||i.y<-20||i.y>s+20)||Gp(e,t,i,r,t.widthM*c*u*.76,c*u,d)}e.restore()}};function Xp(e,t,n,i){let a=c(n,t),o=u(a);if(o<1e-5)return;let s=r(a,1/o),l=e.widthPx,d=Math.max(.055*(l/e.widthM),l*.4),f=e.nextStamp,p=0;for(;f<=o&&p++<80;){let n=P(-s.y,s.x),a=E(E(t,r(s,f)),r(n,(Math.random()-.5)*l*.04));e.stamps.push({point:a,direction:s,length:d*(.78+Math.random()*.14),opacity:k(.57+i*.26+(Math.random()-.5)*.12,.3,1),shoulder:(Math.random()-.5)*.06}),f+=d}e.nextStamp=Math.max(0,f-o)}function Zp(e,t,n){if(e.contactStamps>=48)return;let i=e.widthPx,a=P(-n.y,n.x);for(let o=0;o<2;o++)e.stamps.push({point:E(t,E(r(n,(Math.random()-.5)*i*1.4),r(a,(Math.random()-.5)*i*.2))),direction:n,length:i*(.3+Math.random()*.18),opacity:.35+Math.random()*.25,shoulder:(Math.random()-.5)*.06});e.contactStamps+=2}function Qp(e,t,n,i,a,o){if(t.length<2)return;let s=t.map((e,r)=>{let i=t[Math.max(0,r-1)],a=t[Math.min(t.length-1,r+1)],o=c(a,i),s=Math.max(1e-5,u(o));return P(e.x-o.y/s*n,e.y+o.x/s*n)});e.beginPath(),e.moveTo(s[0].x,s[0].y);for(let t=1;t<s.length-1;t++){let n=r(E(s[t],s[t+1]),.5);e.quadraticCurveTo(s[t].x,s[t].y,n.x,n.y)}e.lineTo(s[s.length-1].x,s[s.length-1].y),e.strokeStyle=o,e.globalAlpha=a,e.lineWidth=i,e.stroke()}function $p(e,t,n,r,i,a){t.road&&(r=cr.dark);let o=n?t.points.map(a.screen):t.points,s=Math.max(2,(a.pixelSpace?t.widthPx:t.widthM*a.zoom)*.72);Qp(e,o,0,s*.92,.075*t.opacity*r.alphaScale*i,r.ink),Qp(e,o,-s*.29,s*.22,.17*t.opacity*r.alphaScale*i,r.ink),Qp(e,o,s*.29,s*.22,.17*t.opacity*r.alphaScale*i,r.ink),e.fillStyle=r.ink;for(let o of t.stamps){let c=n?a.screen(o.point):o.point;if(n&&(c.x<-12||c.x>a.width+12||c.y<-12||c.y>a.height+12))continue;let l=a.pixelSpace?o.direction:P(o.direction.x,-o.direction.y),u=o.length*(a.pixelSpace?1:a.zoom);e.save(),e.translate(c.x,c.y),e.rotate(Math.atan2(l.y,l.x)),e.globalAlpha=.28*t.opacity*o.opacity*r.alphaScale*i;let d=s*.2,f=Math.max(1,u*.82),p=s*(.29+o.shoulder);e.beginPath(),e.roundRect(-f/2,-p-d/2,f,d,Math.min(.7,d*.2)),e.roundRect(-f/2,p-d/2,f,d,Math.min(.7,d*.2)),e.fill(),e.restore()}}var em=256,tm=48,nm=class{records=new Map;tiles=new Map;paths=0;pathBytes=0;references=0;ratio=0;theme=``;captureState(){return j([...new Set([...this.records.values()].flat())])}restoreState(e,t){this.clear();for(let n of j(e))this.add(n,t)}get managedBytes(){return this.tiles.size*(em*this.ratio)**2*4+this.pathBytes+this.references*8}clear(){this.records.clear(),this.tiles.clear(),this.paths=0,this.pathBytes=0,this.references=0}add(e,t){this.paths++,this.pathBytes+=96+e.points.length*24+e.stamps.length*64;let n=Math.max(2,e.widthPx)*2,r=Math.floor((e.bounds.left-n)/em),i=Math.floor((e.bounds.right+n)/em),a=Math.floor((e.bounds.bottom-n)/em),o=Math.floor((e.bounds.top+n)/em);for(let n=a;n<=o;n++)for(let a=r;a<=i;a++){let r=`${a},${n}`,i=this.records.get(r);i||(i=[],this.records.set(r,i)),i.push(e),this.references++;let o=this.tiles.get(r);o&&t(o.context,e)}}draw(e,t,n,r,i,a,o,s,c){if(!this.paths)return;(this.ratio!==a||this.theme!==o)&&(this.tiles.clear(),this.ratio=a,this.theme=o);let l=Math.floor(t/em),u=Math.floor((t+r)/em),d=Math.floor(n/em),f=Math.floor((n+i)/em),p=new Set;e.save(),e.globalAlpha=s;for(let r=d;r<=f;r++)for(let i=l;i<=u;i++){let a=`${i},${r}`,o=this.records.get(a);if(!o?.length)continue;p.add(a);let s=this.tiles.get(a);if(!s){s=this.createTile(i,r),Ye(`skid tile rebuilds`);for(let e of o)c(s.context,e);this.tiles.set(a,s)}Ye(`skid tile composites`),e.drawImage(s.canvas,i*em-t,r*em-n,em,em)}if(e.restore(),this.tiles.size>tm)for(let e of this.tiles.keys()){if(this.tiles.size<=tm)break;p.has(e)||this.tiles.delete(e)}}pruneOutside(e){for(let t of this.records.keys()){let[n,r]=t.split(`,`).map(Number);((n+1)*em<e.x||n*em>e.x+e.width||(r+1)*em<e.y||r*em>e.y+e.height)&&(this.records.delete(t),this.tiles.delete(t))}let t=new Set([...this.records.values()].flat());this.paths=t.size,this.references=[...this.records.values()].reduce((e,t)=>e+t.length,0),this.pathBytes=[...t].reduce((e,t)=>e+96+t.points.length*24+t.stamps.length*64,0)}createTile(e,t){let n=document.createElement(`canvas`);n.width=Math.ceil(em*this.ratio),n.height=Math.ceil(em*this.ratio);let r=n.getContext(`2d`);if(!r)throw Error(`Joy Ride skid tiles require a 2D canvas context`);return r.setTransform(this.ratio,0,0,this.ratio,-e*em*this.ratio,-t*em*this.ratio),r.lineCap=`round`,r.lineJoin=`round`,{canvas:n,context:r}}},rm=class{clock=0;time=0;presetId=null;previous=new Map;paths=[];tiles=new nm;revealAlpha=1;pendingReveal=new Set;captureState(){let e=j({previous:this.previous,paths:this.paths});return{clock:this.clock,time:this.time,presetId:this.presetId,previous:e.previous,paths:e.paths,revealAlpha:this.revealAlpha,pendingRevealIndices:this.paths.flatMap((e,t)=>this.pendingReveal.has(e)?[t]:[]),tiles:this.tiles.captureState()}}restoreState(e,t,n){this.clock=e.clock,this.time=e.time,this.presetId=e.presetId;let r=j({previous:e.previous,paths:e.paths});this.previous=r.previous,this.paths=r.paths,this.revealAlpha=e.revealAlpha,this.pendingReveal=new Set(e.pendingRevealIndices.map(e=>this.paths[e]));let i=cr[n?`dark`:`light`];this.tiles.restoreState(e.tiles,(e,n)=>$p(e,n,!1,i,1,t))}get managedBytes(){return this.paths.reduce((e,t)=>e+96+t.points.length*24+t.stamps.length*64,0)+this.tiles.managedBytes}clear(){this.clock=0,this.time=0,this.presetId=null,this.previous.clear(),this.paths=[],this.revealAlpha=1,this.pendingReveal.clear(),this.tiles.clear()}beginReveal(e,t){this.setRevealAlpha(1,e,t),this.stop(e,t),this.revealAlpha=0}setRevealAlpha(e,t,n){let r=k(e,0,1);if((r!==this.revealAlpha||this.pendingReveal.size!==0)&&(this.revealAlpha=r,!(this.revealAlpha<1))){for(let e of this.pendingReveal)this.rasterize(e,t,n);this.pendingReveal.clear()}}fade(){this.previous.clear()}stop(e,t,n=!1){for(let{path:n}of this.previous.values())this.finish(n,e,t);this.previous.clear(),n&&(this.clock=0)}pruneOutside(e){this.tiles.pruneOutside(e)}step(e,t,n,r,i){this.time+=e,this.clock+=e,!(this.clock<1/30)&&(this.clock%=1/30,this.presetId!==t.car.preset.id&&(this.stop(i.view,i.dark),this.presetId=t.car.preset.id),t.car.tires.forEach((e,a)=>{let o=this.previous.get(a);if(r(a)){o&&this.finish(o.path,i.view,i.dark),this.previous.delete(a);return}let s=i.project(t.body.world(e.local)),l=n&&!e.front;if(!e.skidding&&!l){o&&this.finish(o.path,i.view,i.dark),this.previous.delete(a);return}let d=i.project(t.body.world(E(e.local,P(-t.car.preset.geometry.tireLengthM*.8)))),f=!i.dark&&i.roadAt(e,s),p=o&&o.path.road===f&&this.time-o.time<.18&&o.path.stamps.length<(i.pixelSpace?64:320)?o.path:{road:f,points:e.spinning?[d,s]:i.pixelSpace&&o&&o.path.stamps.length>=64?[o.path.points[o.path.points.length-1],s]:[s],stamps:[],contactStamps:0,nextStamp:0,widthM:t.car.preset.geometry.tireWidthM,widthPx:t.car.preset.geometry.tireWidthM*i.scale,opacity:e.spinning?1:l?.72:k(.25+e.slip*.55+e.heat*.2,.3,1),bounds:{left:Math.min(d.x,s.x),right:Math.max(d.x,s.x),bottom:Math.min(d.y,s.y),top:Math.max(d.y,s.y)}};if(p!==o?.path)o&&this.finish(o.path,i.view,i.dark),this.paths.push(p),e.spinning?Xp(p,d,s,1):p.points.length>1&&Xp(p,p.points[0],s,l?.72:e.slip);else{let n=p.points[p.points.length-1];u(c(s,n))>(i.pixelSpace?.05:.001)?(Xp(p,n,s,e.spinning?1:l?.72:e.slip),p.points.push(s),p.bounds.left=Math.min(p.bounds.left,s.x),p.bounds.right=Math.max(p.bounds.right,s.x),p.bounds.bottom=Math.min(p.bounds.bottom,s.y),p.bounds.top=Math.max(p.bounds.top,s.y)):e.spinning&&Zp(p,s,P(Math.cos(t.body.angle),i.pixelSpace?-Math.sin(t.body.angle):Math.sin(t.body.angle)))}this.previous.set(a,{path:p,time:this.time})}))}finish(e,t,n){this.revealAlpha<1?this.pendingReveal.add(e):this.rasterize(e,t,n)}rasterize(e,t,n){if(!t.pixelSpace)return;let r=cr[n?`dark`:`light`];this.tiles.add(e,(e,n)=>$p(e,n,!1,r,1,t));let i=this.paths.indexOf(e);i>=0&&this.paths.splice(i,1)}draw(e,t){let{pixelSpace:n,scroll:r,width:i,height:a,ratio:o,dark:s,alpha:c,visible:l,view:u}=t,d=cr[s?`dark`:`light`];performance.now(),n&&this.tiles.draw(e,r.x,r.y,i,a,o,s?`dark`:`light`,c,(e,t)=>$p(e,t,!1,d,1,u)),performance.now();for(let t of this.paths){let r=(n?t.widthPx:t.widthM*u.zoom)*2;t.bounds.right<l.left-r||t.bounds.left>l.right+r||t.bounds.top<l.bottom-r||t.bounds.bottom>l.top+r||$p(e,t,!0,d,c*this.revealAlpha,u)}}},im={crashLow:{amplitudePx:.65,durationMs:85,frequencyHz:17},crashMedium:{amplitudePx:1.35,durationMs:125,frequencyHz:19},crashFast:{amplitudePx:2.35,durationMs:165,frequencyHz:21},rocketExplosion:{amplitudePx:2.8,durationMs:190,frequencyHz:16},lightning:{amplitudePx:3.1,durationMs:210,frequencyHz:26},combustibleExplosion:{amplitudePx:3.3,durationMs:215,frequencyHz:17}};function am(e){return!Number.isFinite(e)||e<.8?null:e<3.5?`crashLow`:e<8?`crashMedium`:`crashFast`}var om=class{enabled=!0;profiles={...im};impulses=[];lastTriggered=new Map;sequence=0;captureState(){return{at:performance.now(),data:j({enabled:this.enabled,profiles:this.profiles,impulses:this.impulses,lastTriggered:this.lastTriggered,sequence:this.sequence})}}restoreState(e){let t=j(e.data);this.enabled=t.enabled,this.profiles=t.profiles,this.impulses=t.impulses,this.lastTriggered=t.lastTriggered,this.sequence=t.sequence;let n=performance.now()-e.at;for(let e of this.impulses)e.startedAt+=n;for(let[e,t]of this.lastTriggered)this.lastTriggered.set(e,t+n)}get active(){return this.impulses.length>0}setEnabled(e){this.enabled=e,e||this.reset()}setProfiles(e){let t={...im};if(e)for(let n of Object.keys(t)){let r=e[n];if(!r)continue;let i=t[n],a=(e,t,n,r)=>e!==void 0&&Number.isFinite(e)?Math.max(n,Math.min(r,e)):t;t[n]={amplitudePx:a(r.amplitudePx,i.amplitudePx,0,6),durationMs:a(r.durationMs,i.durationMs,25,300),frequencyHz:a(r.frequencyHz,i.frequencyHz,5,35)}}this.profiles=t}reset(){this.impulses.length=0,this.lastTriggered.clear()}trigger(e,t=1,n=performance.now()){if(!this.enabled||!Number.isFinite(t)||t<=0)return;let r=this.profiles[e];!r||r.amplitudePx<=0||n-(this.lastTriggered.get(e)??-1/0)<55||(this.lastTriggered.set(e,n),this.impulses.push({event:e,startedAt:n,profile:r,amplitudePx:Math.min(5,r.amplitudePx*Math.min(2,t)),phase:++this.sequence*2.399963}),this.impulses.length>4&&this.impulses.shift())}sample(e){if(!this.enabled||!this.impulses.length)return{x:0,y:0};let t=0,n=0;for(let r=this.impulses.length-1;r>=0;r--){let i=this.impulses[r],a=Math.max(0,e-i.startedAt);if(a>=i.profile.durationMs){this.impulses.splice(r,1);continue}let o=(1-a/i.profile.durationMs)**2,s=a*i.profile.frequencyHz*Math.PI*2/1e3,c=i.amplitudePx*o;t+=Math.sin(s+i.phase)*c,n+=Math.sin(s*1.17+i.phase*.7+.8)*c*.72}return{x:Math.max(-4,Math.min(4,t)),y:Math.max(-4,Math.min(4,n))}}};function sm(e,t,n,r){let i=e=>e-r.x,a=e=>e-r.y,o=(e,t,n,i)=>n>=r.x&&e<=r.x+r.width&&i>=r.y&&t<=r.y+r.height;e.save(),e.lineCap=`round`,e.lineJoin=`round`,e.font=`bold 11px ui-monospace, SFMono-Regular, monospace`,n.forEach((t,n)=>{let r=t.box;o(r.x,r.y,r.x+r.width,r.y+r.height)&&(e.setLineDash([5,5]),e.strokeStyle=`rgba(210, 95, 255, 0.9)`,e.lineWidth=1.5,e.strokeRect(i(r.x),a(r.y),r.width,r.height),e.setLineDash([]),e.fillStyle=`#d25fff`,e.fillText(`TARGET ${n+1}`,i(r.x)+5,a(r.y)-9))});for(let n of t.segments){if(n.kind===`donut`){if(!o(n.center.x-n.radius,n.center.y-n.radius,n.center.x+n.radius,n.center.y+n.radius))continue;e.setLineDash([5,7]),e.strokeStyle=`#c33bdf`,e.lineWidth=2,e.beginPath(),e.arc(i(n.center.x),a(n.center.y),n.radius,0,Math.PI*2),e.stroke(),e.setLineDash([]),e.fillStyle=`#c33bdf`,e.beginPath(),e.arc(i(n.center.x),a(n.center.y),4,0,Math.PI*2),e.fill(),e.fillText(`${n.laps} PHYSICS DONUT${n.laps===1?``:`S`}`,i(n.center.x)+10,a(n.center.y)-10);continue}if(n.kind===`pause`){if(!o(n.point.x-16,n.point.y-16,n.point.x+16,n.point.y+16))continue;e.fillStyle=`#f7ba4c`,e.beginPath(),e.arc(i(n.point.x),a(n.point.y),6,0,Math.PI*2),e.fill(),e.fillText(`${Math.round(n.seconds*1e3)}ms`,i(n.point.x)+11,a(n.point.y)-10);continue}let t=[n.from,n.control1,n.control2,n.to];o(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)),Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))&&(e.beginPath(),e.moveTo(i(n.from.x),a(n.from.y)),e.bezierCurveTo(i(n.control1.x),a(n.control1.y),i(n.control2.x),a(n.control2.y),i(n.to.x),a(n.to.y)),e.setLineDash([9,7]),e.strokeStyle=`#09b7cf`,e.lineWidth=2.5,e.stroke())}e.setLineDash([]),o(t.entry.x-12,t.entry.y-12,t.entry.x+12,t.entry.y+12)&&(e.fillStyle=`#09b7cf`,e.beginPath(),e.arc(i(t.entry.x),a(t.entry.y),6,0,Math.PI*2),e.fill(),e.fillText(`ENTRY`,i(t.entry.x)+11,a(t.entry.y)-10)),e.restore()}function cm(e,t){return e===null?1:Math.max(0,1-(t-e)/240)}function lm(e,t,n,i,a,o,s=!1){let c=!t.front&&(t.spinning||s);if(!t.skidding&&!s)return null;let l=c?.38+.62*t.heat:k(t.slip*(.22+t.heat*.78),0,1);if(l<.05)return null;let d=u(e.body.velocity),f=d>.1?r(e.body.velocity,-1/d):Ee(P(-1),e.body.angle),p=P(f.x,-f.y),m=P(Math.cos(e.body.angle),-Math.sin(e.body.angle)),h=P(-m.y,m.x),g=Math.sign(t.local.y)||1;return{point:o(e.body.world(E(t.local,P(0,g*e.car.preset.geometry.tireWidthM*.53)))),amount:n*(t.front?3:c?12:6.5)*l,flow:E(r(i,c?.08:.22),E(r(p,(c?110+Math.min(18,Math.abs(t.wheelSurfaceSpeedMps)*3):125)*l),r(h,g*(c?64:45)*l))),radiusPx:(c?.8:.55+t.heat*.16)*a,swirlPx:g*(c?85:105)*l,strength:l,burnout:c}}function um(e,t,n,r,i,a,o,s=!1){let c=e.sim;c.car.tires.forEach((l,d)=>{let f=lm(c,l,r,a,o.zoom,o.particlePoint,s&&!l.front);if(!f)return;let p=c.body.world(l.local),m=Lp(f.burnout,c.body.angle,l.angle,c.body.velocityAt(p),i),h=o.spray(e,d,n+d,t[d].point,o.particleVelocity(m),t[d].radiusPx*(f.burnout?3:1),r*(f.burnout?170:48)*f.strength,f.burnout?3.5:k(.75+l.slipSpeedMps/12+u(c.body.velocityAt(p))/28,.8,1.9));o.smoke?.({point:f.point,amount:h?f.amount*.3:f.amount,flow:f.flow,radiusPx:f.radiusPx,swirlPx:f.swirlPx})})}var dm=class{canvas=document.createElement(`canvas`);mask=document.createElement(`canvas`);gl=this.canvas.getContext(`webgl2`,{alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0});program=null;texture=null;startedAt=-1/0;duration=680;constructor(){let e=this.gl;e&&(this.program=nf(e,`#version 300 es
|
|
773
773
|
precision highp float;
|
|
774
774
|
out vec2 uv;
|
|
775
775
|
void main() {
|
|
@@ -1007,7 +1007,7 @@ void main() {
|
|
|
1007
1007
|
float alpha=max(light.r,max(light.g,light.b));
|
|
1008
1008
|
if (alpha<0.001) discard;
|
|
1009
1009
|
color=vec4(light,alpha);
|
|
1010
|
-
}`,Dm=class{canvas;gl;program;buffer;vao;data=new Float32Array(81920);width=1;height=1;lost=!1;disposed=!1;onLost=e=>{e.preventDefault(),this.lost=!0};onRestored=()=>{this.disposed||(this.initialize(),this.lost=!1)};constructor(e=document.createElement(`canvas`)){this.canvas=e;let t=e.getContext(`webgl2`,{alpha:!0,premultipliedAlpha:!0,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1});if(!t)throw Error(`WebGL2 is required for electricity`);this.gl=t,this.initialize(),e.addEventListener(`webglcontextlost`,this.onLost),e.addEventListener(`webglcontextrestored`,this.onRestored)}initialize(){let e=this.gl,t=nf(e,Tm,Em,`Electricity`),n=e.createBuffer(),r=e.createVertexArray();if(!n||!r)throw uf(e,t),e.deleteBuffer(n),e.deleteVertexArray(r),Error(`Unable to allocate electricity renderer`);this.program=t,this.buffer=n,this.vao=r,e.bindVertexArray(r),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,this.data.byteLength,e.DYNAMIC_DRAW),cf(e,t,{aStart:{buffer:n,numComponents:2,stride:40,offset:0,divisor:1},aEnd:{buffer:n,numComponents:2,stride:40,offset:8,divisor:1},aStyle:{buffer:n,numComponents:4,stride:40,offset:16,divisor:1},aDistance:{buffer:n,numComponents:2,stride:40,offset:32,divisor:1}}),e.bindVertexArray(null)}resize(e,t,n=1){if(this.disposed)return;this.width=Math.max(1,Number.isFinite(e)?e:1),this.height=Math.max(1,Number.isFinite(t)?t:1);let r=Math.min(2,Math.max(.25,Number.isFinite(n)?n:1),Math.sqrt(3e6/(this.width*this.height)),4096/this.width,4096/this.height),i=Math.ceil(this.width*r),a=Math.ceil(this.height*r);this.canvas.width!==i&&(this.canvas.width=i),this.canvas.height!==a&&(this.canvas.height=a)}render(e,t,n={}){if(this.lost||this.disposed)return 0;let r=this.gl;r.viewport(0,0,this.canvas.width,this.canvas.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT);let i=0;if(Array.isArray(e))for(let t of e)i+=t.writeInstances(this.data,i);else i=e.writeInstances(this.data);return i?(r.useProgram(this.program),r.bindVertexArray(this.vao),r.bindBuffer(r.ARRAY_BUFFER,this.buffer),r.bufferSubData(r.ARRAY_BUFFER,0,this.data,0,i*10),sf(this.program,{uViewport:[this.width,this.height],uTime:t,uNoiseOrigin:n.noiseOrigin??[0,0],uNoiseScale:n.noiseScale??1,uDark:n.dark===!1?0:1,uExposure:n.exposure??.95,uColor:n.color??[.14,.64,1],uCorona:n.corona??[.28,.13,1]}),r.enable(r.BLEND),r.blendFunc(r.ONE,n.dark===!1?r.ONE_MINUS_SRC_ALPHA:r.ONE),r.drawArraysInstanced(r.TRIANGLES,0,6,i),r.bindVertexArray(null),i):0}dispose(){this.disposed||(this.disposed=!0,this.canvas.removeEventListener(`webglcontextlost`,this.onLost),this.canvas.removeEventListener(`webglcontextrestored`,this.onRestored),this.gl.deleteBuffer(this.buffer),uf(this.gl,this.program),this.gl.deleteVertexArray(this.vao))}},Om={color:[.58,.81,1],corona:[.25,.48,.9]},km=(e,t,n)=>Math.max(t,Math.min(n,e)),Am=(e,t)=>({x:Math.cos(e)*t,y:Math.sin(e)*t});function jm(){return{shape:{kind:`point`,center:{x:0,y:0},radius:154},sources:Array.from({length:12},(e,t)=>Am(t/12*Math.PI*2,126)),targets:Array.from({length:17},(e,t)=>Am(t/17*Math.PI*2+.8,102))}}function Mm(e){let t=e|0,n=()=>(t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)/4294967296),r=[{x:0,y:0},{x:300,y:0}];for(let e=0;e<5;e++){let t=[r[0]],i=82*.54**e;for(let e=1;e<r.length;e++){let a=r[e-1],o=r[e];t.push({x:(a.x+o.x)/2,y:(a.y+o.y)/2+(n()-.5)*i*2},o)}r=t}return{shape:{kind:`path`,points:r,width:82},sources:[{x:0,y:0}],targets:[{x:300,y:0}]}}var Nm=class{vehicles=new Map;visible=[];strikes=[];volumes=[];scratch=new Float32Array(12e3);gpu=null;elapsed=0;emit;failed=!1;cameraOrigin={x:0,y:0};cameraScale=1;get active(){return this.visible.length>0||this.strikes.length>0||this.volumes.length>0}get stats(){let e=[...this.vehicles.values()].flatMap(e=>[e.field,e.charge,e.arc,e.halo]);return{vehicles:this.vehicles.size,fields:e.filter(Boolean).length,nodes:e.reduce((e,t)=>e+(t?.simulation.stats.nodes??0),0),visible:this.visible.length+this.strikes.length+this.volumes.length}}create(e,t){let n=new wm(e===`arc`?Mm(t):e===`field`?{...jm(),targets:[{x:0,y:0}]}:jm(),{seed:t,spacing:e===`field`?13:11,maxNodes:e===`arc`?640:e===`field`?520:330,strikesPerSecond:0,branching:.65,corona:e===`field`?.5:0,nearbyTargets:!1}),r={simulation:n,gain:1,pull:e===`field`};return n.onEmission=e=>{this.emit?.(e.point,e.direction,e.strength*(r.pull?.5:.8))},r}radial(e,t,n,r){let i=t.pixelsPerMetre*n/160;e.simulation.setEmissionFrame({x:t.center.x,y:t.center.y,angle:0,scaleX:i,scaleY:i,width:km(i,.65,2)}),e.gain=r}tether(e,t,n){return{x:e.x,y:e.y,angle:Math.atan2(t.y-e.y,t.x-e.x),scaleX:Math.max(.001,Math.hypot(t.x-e.x,t.y-e.y)/300),scaleY:km(Math.hypot(t.x-e.x,t.y-e.y)/300,.6,3)*(.95-n*.25),width:.75+n*.45}}strike(e,t,n){let r=e.simulation;r.reset(),r.setEmissionFrame(),r.configure({strikesPerSecond:0,branching:1.8,intensity:1.8});let i=r.onEmission;r.onEmission=void 0,r.discharge(1);for(let e=0;e<24;e++)r.step(1/60);r.onEmission=i;let a=r.writeInstances(this.scratch),o=this.scratch.slice(0,a*10),s=[],c=(e,t,n=!1)=>{if(e.length<2)return;let r=[0];for(let t=1;t<e.length;t++)r.push(r[t-1]+Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y));let i=r[r.length-1];for(let c=0;c<a&&s.length<22e3;c++){let a=c*10;for(let t of[0,2]){let c=km(o[a+t]/300,0,1)*i,l=1;for(;l<r.length-1&&r[l]<c;)l++;let u=e[l-1],d=e[l],f=Math.max(.001,r[l]-r[l-1]),p=km((c-r[l-1])/f,0,1),m=n?Math.min(.15,i/300*.1):Math.min(3,Math.max(.65,i/300*.85)),h=o[a+t+1]*m;s.push(u.x+(d.x-u.x)*p-(d.y-u.y)/f*h,u.y+(d.y-u.y)*p+(d.x-u.x)/f*h)}s.push(o[a+4]*t,o[a+5],o[a+6],o[a+7],km(o[a]/300,0,1),km(o[a+2]/300,0,1))}};c([t.center,n],1.25);for(let e of t.lightning.branches.filter(e=>Math.hypot(e.x-n.x,e.y-n.y)>8).slice(0,4))c([n,e],.8),this.emit?.(e,{x:e.x-n.x,y:e.y-n.y},1.2);for(let e of t.lightning.paths?.slice(0,4)??[])c(e,.85,!0),e.length&&this.emit?.(e[e.length-1],{x:0,y:-1},1.2);this.strikes.push({data:new Float32Array(s),age:0,source:{...t.center},target:{...n},shook:!1}),this.strikes.length>4&&this.strikes.shift(),this.emit?.(n,{x:n.x-t.center.x,y:n.y-t.center.y},2.8),this.emit?.(t.center,{x:t.center.x-n.x,y:t.center.y-n.y},1.8),r.reset()}step(e,t,n,r){let i=km(e,0,.05);this.elapsed+=i,this.emit=n,this.visible.length=0,this.volumes.length=0;for(let e=this.strikes.length-1;e>=0;e--){let t=this.strikes[e],a=t.age;t.age+=i,!t.shook&&t.age>=.075&&(t.shook=!0,r?.(t.target),n?.(t.source,{x:0,y:-1},2.4));for(let e=0;e<t.data.length;e+=80){let r=(1-t.data[e+8])*.075;a<=r&&t.age>r&&a<.08&&n?.({x:t.data[e],y:t.data[e+1]},{x:t.data[e+3]-t.data[e+1],y:t.data[e]-t.data[e+2]},.6)}t.age>1.5&&this.strikes.splice(e,1)}for(let e of this.vehicles.values()){e.volumeTarget=0;for(let t of[e.field,e.charge,e.arc,e.halo])t?.simulation.configure({strikesPerSecond:0})}for(let e of t.slice(0,6)){let t=e.lightning.phase===`charging`,n=e.lightning.phase===`discharged`;if(!e.attractor&&!t&&!n&&!e.electrified)continue;let r=this.vehicles.get(e.id);r||(this.vehicles.size>=8&&this.release(this.vehicles.keys().next().value),r={touched:this.elapsed,dischargeId:-1},this.vehicles.set(e.id,r)),r.touched=this.elapsed;let i=km(e.lightning.charge,0,1);if(e.attractor){let t=r.field??=this.create(`field`,131+e.id.length);t.simulation.configure({strikesPerSecond:5,intensity:.95,corona:.6,branching:.35}),this.radial(t,e,e.attractorRadiusM,.9),r.volume={center:e.center,radius:e.attractorRadiusM*e.pixelsPerMetre,pull:!0,gain:r.volume?.gain??0},r.volumeTarget=1.3}if(t){let t=r.charge??=this.create(`field`,431+e.id.length);t.simulation.configure({strikesPerSecond:5+i*6,intensity:1+i*.7}),this.radial(t,e,2.8-i*.8,.9),e.attractor||(r.volume={center:e.center,radius:e.pixelsPerMetre*(2.8-i*.8),gain:r.volume?.gain??0},r.volumeTarget=.25+i*.3)}let a=e.lightning.target;if((t||n)&&a){let o=r.arc??=this.create(`arc`,761+e.id.length);n&&e.lightning.dischargeId!==r.dischargeId&&this.strike(o,e,a),t&&(o.simulation.setEmissionFrame(this.tether(e.center,a,i)),o.simulation.configure({strikesPerSecond:2+i*7,branching:.9+i*.5,intensity:.6+i*.5}),o.gain=i**1.4*.9)}if(e.electrified){let t=r.halo??=this.create(`halo`,919+e.id.length);t.simulation.configure({strikesPerSecond:8,intensity:.95}),this.radial(t,e,e.lengthM*.7,.9)}r.dischargeId=e.lightning.dischargeId}for(let[e,t]of this.vehicles)if(t.volume&&(t.volume.gain+=((t.volumeTarget??0)-t.volume.gain)*(1-Math.exp(-i*10)),t.volume.gain>.003&&this.volumes.push(t.volume)),this.elapsed-t.touched>2)this.release(e);else for(let e of[t.field,t.charge,t.arc,t.halo])e&&(e.simulation.step(i),e.simulation.stats.strokes>0&&this.visible.push(e))}writeInstances(e,t=0){let n=t,r=()=>n*10+10<=e.length;for(let t of this.volumes){if(!r())break;let i=this.cameraOrigin.x+t.center.x*this.cameraScale,a=this.cameraOrigin.y+t.center.y*this.cameraScale,o=n++*10;e.set([i,a,i+.01,a,t.radius*this.cameraScale,t.gain,+!!t.pull,5,0,1],o)}for(let t of this.strikes)for(let i=0;i<t.data.length&&r();i+=10){let r=n++*10;e.set(t.data.subarray(i,i+10),r);let a=(1-(t.data[i+8]+t.data[i+9])*.5)*.075,o=t.age-a,s=o<0?.1:t.age<.15?2.5:Math.exp(-(t.age-.15)*3.7)*1.8;e[r+5]*=s,e[r+4]*=o>=0&&o<.08?1.4:1,this.projectInstance(e,r)}for(let t of this.visible){let r=e.subarray(n*10,Math.min(e.length,(n+1200)*10)),i=t.simulation.writeInstances(r),a=t.pull&&i?r[6]:-1;for(let e=0;e<i;e++){let n=e*10;r[n+5]*=t.gain,t.pull&&(r[n+7]===2?r[n+5]*=.2:r[n+6]===a?(r[n+7]=0,r[n+5]*=1.2):(r[n+7]=3,r[n+4]*=3.8)),this.projectInstance(r,n)}n+=i}return n-t}projectInstance(e,t){for(let n of[0,2])e[t+n]=this.cameraOrigin.x+e[t+n]*this.cameraScale,e[t+n+1]=this.cameraOrigin.y+e[t+n+1]*this.cameraScale;e[t+4]*=this.cameraScale,e[t+8]*=this.cameraScale,e[t+9]*=this.cameraScale}draw(e,t,n,r,i,a,o=1,s=e=>e,c=1){if(!this.active||this.failed||o<=0)return;if(!this.gpu)try{this.gpu=new Dm}catch{this.failed=!0;return}this.cameraScale=c;let l=s({x:0,y:0});this.cameraOrigin=l,this.gpu.resize(t,n,r),this.gpu.render(this,i,{dark:a,exposure:a?1.05:1.2,...Om,noiseOrigin:[-l.x/c,-l.y/c],noiseScale:1/c}),this.cameraOrigin={x:0,y:0},this.cameraScale=1,e.save(),e.globalAlpha*=o,Ye(`composited megapixels`,this.gpu.canvas.width*this.gpu.canvas.height/1e6),e.drawImage(this.gpu.canvas,0,0,t,n),e.restore()}release(e){let t=this.vehicles.get(e);if(t){for(let e of[t.field,t.charge,t.arc,t.halo])e?.simulation.dispose();this.vehicles.delete(e)}}reset(){for(let e of this.vehicles.keys())this.release(e);this.visible.length=0,this.strikes.length=0,this.volumes.length=0,this.elapsed=0}dispose(){this.reset(),this.gpu?.dispose(),this.gpu=null}};function Pm(e){if(!e.detached)return e.ink;let t=Math.cos(e.angle),n=Math.sin(e.angle),r=e.ink.width/2,i=e.ink.height/2,a=e.ink.x+r-e.base.x-e.base.width/2,o=e.ink.y+i-e.base.y-e.base.height/2,s=e.base.x+e.base.width/2+e.offset.x+a*t-o*n,c=e.base.y+e.base.height/2+e.offset.y+a*n+o*t,l=Math.abs(t)*r+Math.abs(n)*i,u=Math.abs(n)*r+Math.abs(t)*i;return{x:s-l,y:c-u,width:2*l,height:2*u}}function Fm(e,t){let{ink:n}=e;if(!e.detached)return n.x<t.x+t.width&&n.x+n.width>t.x&&n.y<t.y+t.height&&n.y+n.height>t.y;let r=e.base.x+e.base.width/2,i=e.base.y+e.base.height/2,a=Math.max(Math.abs(n.x-r),Math.abs(n.x+n.width-r)),o=Math.max(Math.abs(n.y-i),Math.abs(n.y+n.height-i)),s=Math.sqrt(a*a+o*o),c=r+e.offset.x,l=i+e.offset.y;return c-s<t.x+t.width&&c+s>t.x&&l-s<t.y+t.height&&l+s>t.y}function Im(e,t,n,i){let a=E(t,r(e.velocity,-1));e.detached=!0,e.velocity=E(r(e.velocity,.35),E(r(a,.55),r(n,80+Math.min(220,u(a)*.3)))),e.spin=e.spin*.3+i,e.offset=E(e.offset,r(n,2)),e.impactCooldown=.12}function Lm(e,t){e.impactCooldown=Math.max(0,e.impactCooldown-t),e.detached&&(e.velocity=r(e.velocity,Math.exp(-(e.attractorInfluenced?.35:1.6)*t)),e.offset=E(e.offset,r(e.velocity,t)),e.angle+=e.spin*t,e.spin*=Math.exp(-1.25*t))}function Rm(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function zm(e,t,n){let r=-1/0,i=1/0,a={x:0,y:0};for(let o of[`x`,`y`]){let s=n[o],c=s+(o===`x`?n.width:n.height),l=e[o],u=t[o],d=l+(o===`x`?e.width:e.height),f=u+(o===`x`?t.width:t.height);for(let[e,t,n]of[[d-s,f-d,-1],[c-l,l-u,1]]){if(Math.abs(t)<1e-8){if(e<0)return null;continue}let s=-e/t;t>0&&s>r?(r=s,a=o===`x`?{x:n,y:0}:{x:0,y:n}):t<0&&(i=Math.min(i,s))}if(r>i)return null}return r>=0&&r<=1&&r<=i&&i>=0&&(a.x!==0||a.y!==0)?{time:r,normal:a}:null}function Bm(e,t){let n=Pm(e);if(!Rm(n,t))return null;let r=[{amount:t.x-n.x-n.width-.1,normal:{x:-1,y:0}},{amount:t.x+t.width-n.x+.1,normal:{x:1,y:0}},{amount:t.y-n.y-n.height-.1,normal:{x:0,y:-1}},{amount:t.y+t.height-n.y+.1,normal:{x:0,y:1}}].reduce((e,t)=>Math.abs(t.amount)<Math.abs(e.amount)?t:e);return r.normal.x?e.offset.x+=r.amount:e.offset.y+=r.amount,r.normal}function Vm(e,t){let n=e.velocity.x*t.x+e.velocity.y*t.y;n>=0||(e.velocity=E(r(e.velocity,.82),r(t,-n*1.1)),e.spin*=-.45)}function Hm(e,t,n){if(e.detached)for(let t of n){if(Rm(e.ink,t))continue;let n=Bm(e,t);n&&Vm(e,n)}if(!e.detached||n.length===0){Lm(e,t);return}let r=Pm(e);Lm(e,t);let i=Pm(e),a=null;for(let t of n){if(Rm(e.ink,t))continue;let n=zm(r,i,t);n&&(!a||n.time<a.time)&&(a={...n,wall:t})}if(a){let t=1-a.time;e.offset.x-=(i.x+i.width/2-r.x-r.width/2)*t,e.offset.y-=(i.y+i.height/2-r.y-r.height/2)*t,Bm(e,a.wall),Vm(e,a.normal)}for(let t=0;t<3;t++){let t=!1;for(let r of n){if(Rm(e.ink,r))continue;let n=Bm(e,r);n&&(Vm(e,n),t=!0)}if(!t)break}}function Um(e,t,n,i=!1){if(!t||t.radiusPx<=0||!e.detached&&!i)return e.attractorInfluenced=!1,!1;let a=Pm(e),o={x:a.x+a.width/2,y:a.y+a.height/2},s=c(o,t.center),l=u(s);if(l>t.radiusPx)return e.attractorInfluenced=!1,!1;e.detached||=!0,e.attractorInfluenced=!0;let d=r(s,-Math.min(1,300/Math.max(1,l*5))*5),f=c(t.velocity,e.velocity),p=E(d,r(f,.15));return e.velocity=E(e.velocity,r(p,Math.max(0,n))),e.spin*=Math.exp(-.7*Math.max(0,n)),!0}var Wm=class{camera;effects=new Nm;clock=0;constructor(e){this.camera=e}step(e,t,n,r,i){if(this.clock+=n,this.clock<1/60)return;let a=Math.min(.05,this.clock);this.clock=Math.max(0,this.clock-1/60);let o=[];for(let n of[e,...t]){let e=n.sim;if(e.mode!==`car`||e.car.explodedAt!==null||n.isGhost)continue;let t=n.weapons.lightning.visual,r=e.car.statusEffects.remaining(`electrified`)>0;if(!n.controls.attractor&&t.phase===`idle`&&!r)continue;let i=this.camera.screen(e.body.position),a=Math.max(7,M(e.car.preset,this.camera.width,this.camera.documentScale()))*this.camera.zoom;i.x<-a||i.x>this.camera.width+a||i.y<-a||i.y>this.camera.height+a||o.push({id:n.id,center:this.camera.documentPoint(e.body.position),angle:-e.body.angle,pixelsPerMetre:this.camera.documentScale(),lengthM:e.car.preset.geometry.lengthM,widthM:e.car.preset.geometry.widthM,attractor:!!n.controls.attractor&&!e.paused,attractorRadiusM:7,electrified:r,lightning:t})}this.effects.step(e.sim.paused?0:a,o,(e,t,n)=>r.electric(this.camera.particlePoint(this.camera.worldFromDocument(e)),this.camera.pixelSpace?t:P(t.x/this.camera.documentScale(),-t.y/this.camera.documentScale()),n),()=>i.trigger(`lightning`,1,performance.now()))}draw(e,t,n,r){this.effects.draw(e,this.camera.width,this.camera.height,this.camera.dpr,t/1e3,n,r,e=>this.camera.screen(this.camera.worldFromDocument(e)),this.camera.zoom/this.camera.documentScale())}reset(){this.clock=0,this.effects.reset()}dispose(){this.effects.dispose()}},Gm=class{overlay;canvasWorld;carVisualOffset(e){return this.vehicles.carVisualOffset(e)}get cameraLock(){return this.view.cameraLock}set cameraLock(e){this.view.cameraLock=e}get cameraSmoothing(){return this.view.cameraSmoothing}set cameraSmoothing(e){this.view.cameraSmoothing=e}get deadZone(){return this.view.deadZone}set deadZone(e){this.view.deadZone=e}get speedZoom(){return this.view.speedZoom}set speedZoom(e){this.view.speedZoom=e}get speedZoomMinimumScale(){return this.view.speedZoomMinimumScale}set speedZoomMinimumScale(e){this.view.speedZoomMinimumScale=e}screen(e){return this.view.screen(e)}world(e){return this.view.world(e)}vehicleViewportPosition(e){return this.view.vehicleViewportPosition(e)}sceneScroll(){return this.view.sceneScroll()}get documentProjection(){return this.view.documentProjection}virtualOffset(){return this.view.virtualOffset()}documentPoint(e){return this.view.documentPoint(e)}worldFromDocument(e){return this.view.worldFromDocument(e)}documentScale(){return this.view.documentScale()}viewportSize(){return this.view.viewportSize()}presentationScale(){return this.view.presentationScale()}setSlowMoZoom(e){this.view.slowMoZoom=e}setCanvasWorldScale(e,t=1.5){this.view.setCanvasWorldScale(e,t)}setCameraFrame(e){this.view.setCameraFrame(e)}setCameraLock(e){this.view.setCameraLock(e)}viewportFromDocument(e){return this.view.viewportFromDocument(e)}documentFromViewport(e){return this.view.documentFromViewport(e)}bounds(){return this.view.bounds()}vehicleMarkerAt(e){if(!this.showVehicleMarkers)return null;let t=this.view.documentFromViewport(e);return this.vehicles.markerAt(this.view.screen(this.view.worldFromDocument(t)))}revealVehicle(e){this.view.revealVehicle(e)}resumeFollow(){this.view.resumeFollow()}interruptFollow(){this.view.interruptFollow()}restorePage(e){this.view.restorePage(e)&&(this.lastFlowCenter=null,this.flowVelocity=P())}followDocument(e){return this.view.followDocument(e)}primaryVehicleVisible=!0;primaryVehicleOpacity=1;beginVehicleArrivalFade(){this.skidTracks.beginReveal(this.skidView(),this.darkSurface()),this.primaryVehicleOpacity=0}setVehicleArrivalOpacity(e){this.primaryVehicleOpacity=k(e,0,1),this.skidTracks.setRevealAlpha(this.primaryVehicleOpacity,this.skidView(),this.darkSurface())}view;surface;vehicles;debris=new s;get ctx(){return this.surface.context}nextHistoryPrune=0;trailClock=0;quality=`high`;fluidGovernor=new jt;vehicleLights=new sr;surfaceTones=new ja;vehicleLighting={...ge};setVehicleLighting(e){this.vehicleLighting=Be({...this.vehicleLighting,...e})}getVehicleLighting(){return{...this.vehicleLighting}}toggleVehicleLight(e){return this.setVehicleLighting({[e]:!this.vehicleLighting[e]}),this.getVehicleLighting()}surfaceTone=`auto`;trail=[];skidTracks=new rm;volumetrics;pointPuffs=[];objectGlint=null;showVehicleMarkers=!0;tireSmokeEnabled=!0;vehicleShadowsEnabled=!0;effectsFadeStartedAt=null;wallRects=[];combustion;ghostVehicles=new La;sparks=new Yf;electricity;liquidLayer;tireMarks=new Yp;seedGroundMarks(e){this.overlay&&this.tireMarks.seed(e,this.particleScale())}focusVehicle=null;activeVehicles=[];bindVehicle(e){this.focusVehicle=e}forgetVehicle(e){this.tireMarks.forgetVehicle(e),this.activeVehicles=this.activeVehicles.filter(t=>t.id!==e),this.focusVehicle?.id===e&&(this.focusVehicle=null)}get rocketFlightPosition(){let e=this.focusVehicle?.sim.body.position??P(),t=null,n=1/0;for(let r of this.activeVehicles){let i=r.weapons.rocket.projectile?.position;if(!i)continue;let a=u(c(i,e));a<n&&(t=i,n=a)}return t}screenShake=new om;exhaustBursts=[];queueExhaustPops(e){for(let t of e)t<.12||this.exhaustBursts.push({age:0,lifetime:.08+t*.11,intensity:.4+t*.6});this.exhaustBursts.length>6&&this.exhaustBursts.splice(0,this.exhaustBursts.length-6)}lastFlowCenter=null;flowVelocity=P();captureState(){let e=[],t=t=>(t&&e.push(()=>t.dispose()),t);try{let n=t(this.volumetrics.captureState()),r=t(this.combustion.captureState()),i=t(this.liquidLayer.captureState());return{at:performance.now(),data:j({primaryVehicleVisible:this.primaryVehicleVisible,primaryVehicleOpacity:this.primaryVehicleOpacity,nextHistoryPrune:this.nextHistoryPrune,trailClock:this.trailClock,quality:this.quality,fluidQualityLimit:this.fluidGovernor.limit,vehicleLighting:this.vehicleLighting,surfaceTone:this.surfaceTone,trail:this.trail,pointPuffs:this.pointPuffs,showVehicleMarkers:this.showVehicleMarkers,tireSmokeEnabled:this.tireSmokeEnabled,vehicleShadowsEnabled:this.vehicleShadowsEnabled,effectsFadeStartedAt:this.effectsFadeStartedAt,wallRects:this.wallRects,exhaustBursts:this.exhaustBursts,lastFlowCenter:this.lastFlowCenter,flowVelocity:this.flowVelocity,debugDrive:this.debugDrive,previewGroundFire:this.previewGroundFire,previewWallSmoke:this.previewWallSmoke,previewSparks:this.previewSparks,previewDamage:this.previewDamage,previewOil:this.previewOil,previewOilSplatter:this.previewOilSplatter,oilSplatterPreviewSeconds:this.oilSplatterPreviewSeconds,sparkPreviewClock:this.sparkPreviewClock,damagePreviewApplied:this.damagePreviewApplied,groundFirePreviewLit:this.groundFirePreviewLit,tourDebug:this.tourDebug,trailLifetime:this.trailLifetime,fallbackSurfaceTone:this.fallbackSurfaceTone}),camera:this.view.captureState(),diagnostics:this.diagnostics.captureState(),vehicles:this.vehicles.captureState(),volumetrics:n,combustion:r,liquids:i,debris:this.debris.captureState(),skidTracks:this.skidTracks.captureState(),tireMarks:this.tireMarks.captureState(),sparks:this.sparks.captureState(),screenShake:this.screenShake.captureState(),dispose:()=>e.forEach(e=>e())}}catch(t){throw e.forEach(e=>e()),t}}restoreState(e){let t=this.captureState();try{this.applyState(e)}catch(e){try{this.applyState(t)}catch(t){throw AggregateError([e,t],`Renderer checkpoint rollback failed`,{cause:t})}throw e}finally{t.dispose()}}applyState(e){this.clearEffects();let t=j(e.data);this.primaryVehicleVisible=t.primaryVehicleVisible,this.primaryVehicleOpacity=t.primaryVehicleOpacity,this.nextHistoryPrune=t.nextHistoryPrune,this.trailClock=t.trailClock,this.quality=t.quality,this.fluidGovernor.restoreLimit(t.fluidQualityLimit),this.vehicleLighting=t.vehicleLighting,this.surfaceTone=t.surfaceTone,this.trail=t.trail,this.pointPuffs=t.pointPuffs,this.showVehicleMarkers=t.showVehicleMarkers,this.tireSmokeEnabled=t.tireSmokeEnabled,this.vehicleShadowsEnabled=t.vehicleShadowsEnabled,this.effectsFadeStartedAt=t.effectsFadeStartedAt,this.wallRects=t.wallRects,this.exhaustBursts=t.exhaustBursts,this.lastFlowCenter=t.lastFlowCenter,this.flowVelocity=t.flowVelocity,this.debugDrive=t.debugDrive,this.previewGroundFire=t.previewGroundFire,this.previewWallSmoke=t.previewWallSmoke,this.previewSparks=t.previewSparks,this.previewDamage=t.previewDamage,this.previewOil=t.previewOil,this.previewOilSplatter=t.previewOilSplatter,this.oilSplatterPreviewSeconds=t.oilSplatterPreviewSeconds,this.sparkPreviewClock=t.sparkPreviewClock,this.damagePreviewApplied=t.damagePreviewApplied,this.groundFirePreviewLit=t.groundFirePreviewLit,this.tourDebug=t.tourDebug,this.trailLifetime=t.trailLifetime,this.fallbackSurfaceTone=t.fallbackSurfaceTone,this.view.restoreState(e.camera),this.diagnostics.restoreState(e.diagnostics),this.vehicles.restoreState(e.vehicles),this.volumetrics.setQuality(this.fluidGovernor.apply(this.quality)),this.volumetrics.restoreState(e.volumetrics),this.combustion.setQuality(this.fluidGovernor.apply(this.quality)),this.combustion.restoreState(e.combustion),this.liquidLayer.restoreState(e.liquids),e.debris&&this.debris.restoreState(e.debris),this.skidTracks.restoreState(e.skidTracks,this.skidView(),this.darkSurface()),this.tireMarks.restoreState(e.tireMarks),this.sparks.restoreState(e.sparks),this.screenShake.restoreState(e.screenShake),this.effectsFadeStartedAt!==null&&(this.effectsFadeStartedAt+=performance.now()-e.at),this.view.rebaseTime(performance.now()),this.ghostVehicles.clearMaterials(),this.view.restorePresentation()}get flamethrowerFiring(){return this.activeVehicles.some(e=>e.weapons.flamethrower.firing)}get managedMemoryGroups(){return[{label:`Tire marks`,bytes:this.skidTracks.managedBytes+this.activeVehicles.reduce((e,t)=>e+t.tirePaint.managedBytes,0)+this.tireMarks.managedBytes},{label:`Smoke`,bytes:this.volumetrics.smokeBytes},{label:`Ghost`,bytes:this.volumetrics.ghostBytes},{label:`Fire`,bytes:this.combustion.managedBytes},{label:`Liquids`,bytes:this.liquidLayer.managedBytes},{label:`Debris`,bytes:this.debris.managedBytes+rn().bytes},{label:`Tools`,bytes:this.activeVehicles.reduce((e,t)=>e+t.weapons.managedBytes,0)},{label:`Sparks`,bytes:this.sparks.count*112},{label:`Points`,bytes:this.pointPuffs.length*32},{label:`Vehicle trail`,bytes:this.trail.length*48}]}get managedBytes(){return this.managedMemoryGroups.reduce((e,t)=>e+t.bytes,0)}debugDrive=!1;previewGroundFire=!1;previewWallSmoke=!1;previewSparks=!1;previewDamage=!1;previewOil=!1;previewOilSplatter=!1;oilSplatterPreviewSeconds=0;sparkPreviewClock=0;damagePreviewApplied=!1;groundFirePreviewLit=!1;diagnostics=new tr;tourDebug=null;trailLifetime=12;constructor(e,t=!1,n=`high`,r=!1){this.overlay=t,this.canvasWorld=r,this.sparks.setElectricalPalette(Om),this.view=new Qn(t,r,()=>this.resize()),this.surface=new $n(e,this.view,t,r),this.combustion=new Df(this.view,n),this.volumetrics=new kf(this.view,n),this.electricity=new Wm(this.view),this.liquidLayer=new Up(this.view,n),this.vehicles=new An(this.view),this.quality=n,this.resize()}get pixelSpace(){return this.overlay||this.canvasWorld}prepareFire(){return this.sparks.prepare()?this.combustion.ensure():!1}setQuality(e){if(e===this.quality)return;this.quality=e;let t=this.fluidGovernor.apply(e);this.volumetrics.setQuality(t),this.liquidLayer.setQuality(e),this.combustion.setQuality(t)}applyFluidQuality(){let e=this.fluidGovernor.apply(this.quality);this.volumetrics.setQuality(e),this.combustion.setQuality(e)}setSmokeTint(e){this.volumetrics.setSmokeTint(e)}setTireSmokeEnabled(e){this.tireSmokeEnabled=e}setVehicleShadowsEnabled(e){this.vehicleShadowsEnabled=e}setViewportMode(e){this.surface.setViewportMode(e),this.liquidLayer.setViewportMode(e)}setGhostStyle(e){this.volumetrics.setGhostStyle(e)}setSparksEnabled(e){this.sparks.setEnabled(e)}setScreenShakeEnabled(e){this.screenShake.setEnabled(e)}setScreenShakeProfiles(e){this.screenShake.setProfiles(e)}emitCrashShake(e){if(this.effectsFadeStartedAt!==null)return;let t=am(e);t&&this.screenShake.trigger(t)}emitRocketExplosionShake(e=1){this.effectsFadeStartedAt===null&&this.screenShake.trigger(`rocketExplosion`,Math.sqrt(Math.max(0,e)))}emitCombustibleExplosion(e,t){if(this.effectsFadeStartedAt!==null)return;this.screenShake.trigger(`combustibleExplosion`);let n=this.particlePoint(this.worldFromDocument(e));this.sparks.emitExplosion(n,P(),this.particleScale(),1.2),this.combustion.queueBlast(n,t*this.particleScale()/Math.max(1,this.documentScale())),this.emitCombustibleBlast(e,t,0)}emitCombustibleBlast(e,t,n){if(this.effectsFadeStartedAt!==null||!this.combustion.activateBuoyancy())return;let i=this.particlePoint(this.worldFromDocument(e)),a=t*this.particleScale()/Math.max(1,this.documentScale()),o=Math.min(1,n/.34);for(let e=0;e<24;e++){let t=e*Math.PI*(3-Math.sqrt(5)),n=P(Math.cos(t),Math.sin(t));this.combustion.queueStamp({point:E(i,r(n,a*o*1.05)),radius:Math.max(4,a*(.29-o*.12)),flow:E(r(n,a*(2.6-o)),P(0,-a*.4)),progress:.28+o*.53,blast:!0})}}emitRocketExplosion(e,t,n=1){if(this.effectsFadeStartedAt!==null)return;let i=this.particlePoint(this.worldFromDocument(e)),a=this.particleVelocity(P(t.x/this.view.zoom,-t.y/this.view.zoom)),o=this.particleScale(),s=Math.sqrt(k(n,.5,2));this.combustion.ensure()&&(this.combustion.queueBlast(i,o*2.2*s),this.combustion.queueStamp({point:i,radius:o*.95*s,flow:P(0,-o*.7),progress:.24,strength:2.6,blast:!0}));for(let t=0;t<64;t++){let n=t*Math.PI*(3-Math.sqrt(5))+Math.atan2(a.y,a.x),c=o*Math.sqrt((t+.5)/64)*1.75*(.83+.17*Math.sin(t*11.8+e.x*.03))*s,l=P(Math.cos(n),Math.sin(n));this.combustion.available&&this.combustion.queueStamp({point:E(i,r(l,c)),radius:o*(.38+t%4*.065)*s,flow:E(r(l,o*2.5),P(0,-o*.5)),progress:.3+t%5*.06,strength:1.7+t%3*.28,blast:!0})}this.sparks.emitExplosion(i,a,o,n),this.sparks.emitFireAt(i,o*.5,.25,14)}setDeformEnabled(e){this.focusVehicle?.damage.setEnabled(e),e||(this.damagePreviewApplied=!1)}resetVehicleDamage(){this.focusVehicle?.damage.reset()}emitSparks(e){this.effectsFadeStartedAt===null&&this.sparks.emit(e)}emitVehicleBurn(e,t,n,i){let a=e.sim,o=this.documentScale(),s=E(this.documentPoint(a.body.position),this.carVisualOffset(a)),c=n.lengthM*o,l=n.widthM*o,u=P(Math.cos(a.body.angle),-Math.sin(a.body.angle)),d=P(-u.y,u.x),p=E(s,E(r(u,t.burnOriginLocal.x*o),r(d,t.burnOriginLocal.y*o))),m=this.combustion.alphaFor(n.alpha.solid);if(t.stage===`exploded`)return t.explosionStarted&&this.emitCombustibleExplosion(s,Math.max(78,c*.7)),t.blastAge<f.fireballSeconds&&this.emitSceneFire({key:t.key,alpha:m,pixelWidth:n.alpha.columns,pixelHeight:n.alpha.rows,x:s.x-c/2,y:s.y-l/2,width:c,height:l,angle:-a.body.angle,origin:s,farthest:Math.hypot(c,l),...ne(t.blastAge)},i),t.blastPulse&&this.emitCombustibleBlast(s,Math.max(78,c*.7),t.blastAge),t.explosionStarted?s:null;let h=b(t.health,t.maxHealth,c,l);return h&&this.emitSceneFire({key:t.key,alpha:m,pixelWidth:n.alpha.columns,pixelHeight:n.alpha.rows,x:s.x-c/2,y:s.y-l/2,width:c,height:l,angle:-a.body.angle,origin:p,farthest:Math.hypot(c,l),...h},i),null}sceneFireDue(e){return this.effectsFadeStartedAt===null&&this.combustion.sceneMasksDue(e)}emitSceneFire(e,t=1/60){this.effectsFadeStartedAt===null&&this.combustion.queueMask(e)}pourWorldLiquid(e,t,n,r,i){this.liquidLayer.pourWorldLiquid(e,t,n,r,i)}emitPaint(e,t,n,r,i){this.liquidLayer.emitPaint(e,t,n,r,i)}hasConductiveLiquidNear(e,t){return this.liquidLayer.hasConductiveCandidate(e,t)}conductLightning(e,t=0){return this.liquidLayer.conductLightning(e,t)}igniteLiquidAt(e,t){this.liquidLayer.igniteAt(e,t)}igniteConductedLiquids(e,t){this.liquidLayer.igniteConducted(e,t)}igniteLiquidsFromFire(e){this.liquidLayer.igniteFromFire(e)}burningLiquidSources(){return this.liquidLayer.burningSources()}hasLiquidContact(e,t){return this.liquidLayer.hasContact(e,t)}addLiquid(e,t){this.liquidLayer.add(e,t)}syncElementLiquids(e){return this.liquidLayer.syncElements(e)}ejectLiquid(e,t=`oil`,n){this.liquidLayer.pourVehicle(e,t,.65,n)}setInitialPuddles(e){this.liquidLayer.setInitialPuddles(e)}setSurfaceTone(e){this.surfaceTone=e}fallbackSurfaceTone={at:-1/0,dark:!1};darkSurface(){if(this.surfaceTone!==`auto`)return this.surfaceTone===`dark`;let e=document.documentElement.dataset.jrTheme;if(e===`light`||e===`dark`)return e===`dark`;let t=performance.now();if(t-this.fallbackSurfaceTone.at<80)return this.fallbackSurfaceTone.dark;let n=getComputedStyle(document.body).backgroundColor,r=lr(/rgba\([^)]*,\s*0(?:\.0+)?\s*\)/.test(n)||n===`transparent`?getComputedStyle(document.documentElement).backgroundColor:n);return this.fallbackSurfaceTone={at:t,dark:r},r}setDebugEnabled(e){this.debugDrive=e||!1}setTourDebugRoute(e,t=[]){this.tourDebug=e?{route:e,stops:t}:null}fadeEffects(){if(this.effectsFadeStartedAt!==null)return;this.effectsFadeStartedAt=performance.now(),this.liquidLayer.clearEffects(),this.liquidLayer.restoreInitialPuddles(),this.volumetrics.clearSmokeSources();let e=this.activeVehicles.length?this.activeVehicles:this.focusVehicle?[this.focusVehicle]:[];for(let t of e)t.weapons.reset(),t.tirePaint.reset(),t.damage.reset();this.screenShake.reset(),this.electricity.reset(),this.skidTracks.fade(),this.combustion.clearTireHistory(),this.exhaustBursts=[]}clearEffects(e=!0){this.debris.reset(),this.electricity.reset(),this.objectGlint?.dispose(),this.objectGlint=null,this.trail=[],this.skidTracks.clear(),this.volumetrics.reset(),this.pointPuffs=[];for(let e of this.activeVehicles.length?this.activeVehicles:this.focusVehicle?[this.focusVehicle]:[])e.weapons.rocket.reset(),e.weapons.machineGuns.reset(),e.weapons.flamethrower.reset();this.screenShake.reset(),this.combustion.reset(),this.exhaustBursts=[],this.sparks.reset(),e&&this.liquidLayer.clearEffects(),this.tireMarks.clear(),this.lastFlowCenter=null,this.flowVelocity=P(),this.trailClock=0,this.effectsFadeStartedAt=null}reset(){this.view.reset(),this.clearEffects(),this.liquidLayer.restoreInitialPuddles(),this.wallRects=[],this.groundFirePreviewLit=!1,this.sparkPreviewClock=0,this.damagePreviewApplied=!1,this.vehicles.reset(),this.tourDebug=null,this.surface.clear(),this.view.resetFollow()}dispose(){this.liquidLayer.dispose(),this.debris.clear(),this.electricity.dispose(),this.objectGlint?.dispose(),this.surface.dispose(),this.view.dispose(),this.skidTracks.clear(),this.tireMarks.clear(),this.volumetrics.dispose(),this.combustion.dispose(),this.sparks.dispose()}resize(){let e=this.surface.resize();this.liquidLayer.resize(),this.volumetrics.resize(e),this.combustion.resize(e)}rasterPixelRatio(){return this.canvasWorld?Math.min(2,Math.round(this.view.dpr/this.view.regionScale*100)/100):this.view.dpr}setShowVehicleMarkers(e){this.showVehicleMarkers=e}flashTargets(e){this.resize(),this.objectGlint??=new dm;let t=this.sceneScroll();this.objectGlint.trigger(this.view.width,this.view.height,this.view.dpr,n=>e(n,t))}particlePoint(e){return this.view.particlePoint(e)}particleScreen(e){return this.pixelSpace?c(e,this.sceneScroll()):this.screen(e)}particleVelocity(e){return this.pixelSpace?P(e.x*this.view.zoom,-e.y*this.view.zoom):{...e}}particleScale(){return this.view.particleScale()}emitPoints(e,t){t<=0||this.pointPuffs.push({point:this.particlePoint(this.worldFromDocument(e)),amount:t,age:0})}fluidView(){let e=this.sceneScroll();return this.pixelSpace?{origin:P(this.view.smokeMargin-e.x,this.view.smokeMargin-e.y),scaleX:1,scaleY:1}:{origin:P(this.view.width/2-this.view.camera.x*this.view.zoom,this.view.height/2+this.view.camera.y*this.view.zoom),scaleX:this.view.zoom,scaleY:-this.view.zoom}}flameView(){let e=this.fluidView();return this.pixelSpace?{...e,origin:P(e.origin.x-this.view.smokeMargin,e.origin.y-this.view.smokeMargin)}:e}clipFluidWalls(e){if(!this.overlay)return;let t=this.sceneScroll();for(let n of this.wallRects){let r=n.x-t.x,i=n.y-t.y;n.width<=0||n.height<=0||r>=this.view.width||i>=this.view.height||r+n.width<=0||i+n.height<=0||(e.beginPath(),e.rect(0,0,this.view.width,this.view.height),e.rect(r,i,n.width,n.height),e.clip(`evenodd`))}}stepVehicleWeapons(e,t,n,r,i,a,o,s,c){let l=e.sim;performance.now(),e.weapons.rocket.step(t,l,e=>{this.effectsFadeStartedAt===null&&this.volumetrics.emitSmoke({point:this.particlePoint(e.point),amount:e.amount,flow:this.particleVelocity(e.flow),radiusPx:e.radiusM*this.view.zoom,swirlPx:10})},n?(t,r,i)=>{let a=n(e,this.documentPoint(t),this.documentPoint(r),i*this.documentScale());return a?this.worldFromDocument(a):null}:void 0,e=>{this.effectsFadeStartedAt===null&&this.combustion.emitJet(e.from,e.to,e.flow,e.widthM,e.intensity,`rocket`)},o,s,void 0),e.weapons.machineGuns.step(t,l,r?(t,n,i)=>{let a=r(e,this.documentPoint(t),this.documentPoint(n),i*this.documentScale());return a?this.worldFromDocument(a):null}:void 0,i,(e,t)=>{this.effectsFadeStartedAt===null&&this.sparks.emitBulletImpact(this.particlePoint(e),this.particleVelocity(t)),c?.(e)}),e.weapons.flamethrower.step(t,l,e=>{this.effectsFadeStartedAt===null&&this.volumetrics.emitSmoke({point:this.particlePoint(e.point),amount:e.amount,flow:this.particleVelocity(e.flow),radiusPx:e.radiusM*this.view.zoom,swirlPx:10})},a?(t,n,r,i)=>{let o=a(e,this.documentPoint(t),this.documentPoint(n),r*this.documentScale(),i);return o?this.worldFromDocument(o):null}:void 0,(e,n,r,i,a)=>{if(this.effectsFadeStartedAt!==null)return;let o=this.particleScale();this.liquidLayer.igniteAlong(this.particlePoint(e),this.particlePoint(n),r*o*.5),a>.3&&this.sparks.emitFireAt(this.particlePoint(n),r*o*.4,t,3),this.combustion.queueStamp({point:this.particlePoint(n),radius:r*o,progress:a,flow:this.particleVelocity(i)})})}sprayTirePaint(e,t,n,r,i,a,o,s){this.liquidLayer.splatter(e,t,n,r,i,a,o,s)}advanceEffects(e,t,{walls:n=[],carMask:i,tirePaintSources:a=[],driven:o=!0,rocketCollision:s,bulletCollision:l,onGunshot:d,flameContact:f,onRocketLaunch:m,onRocketImpact:h,onBulletImpact:g,maskFor:_,companions:v=[]}={}){for(let e of this.pointPuffs)e.age+=t;this.pointPuffs=this.pointPuffs.filter(e=>e.age<.9),this.activeVehicles=[e,...v];let y=this.sceneScroll();this.debris.count&&this.debris.step(t,this.activeVehicles.filter(e=>e.sim.mode===`car`&&!e.isGhost&&e.sim.car.explodedAt===null).map(e=>{let t=this.particlePoint(e.sim.body.position),n=this.particleVelocity(e.sim.body.velocity),r=this.particleScale();return{x:t.x,y:t.y,vx:n.x,vy:n.y,angle:-e.sim.body.angle,length:e.sim.car.preset.geometry.lengthM*r,width:e.sim.car.preset.geometry.widthM*r}}),{x:y.x,y:y.y,width:this.view.width,height:this.view.height},n),this.volumetrics.stepGhost(t,this.activeVehicles,n,_,this.flameView(),e=>this.carVisualOffset(e.sim));let b=e.sim;if(this.wallRects=n,this.vehicles.updateCarPose(b,t),this.effectsFadeStartedAt===null){for(let e of this.activeVehicles)for(let n of e.liquidEmissions(t))this.liquidLayer.pourVehicle(e.sim,p(n.liquid),n.amount,void 0,e.id);this.previewOil&&!this.previewOilSplatter&&this.liquidLayer.pourVehicle(b,`oil`,t*6)}for(let n of[e,...v])this.stepVehicleWeapons(n,t,s,l,d,f,m,h,g);let{tires:x,companionTires:S}=this.liquidLayer.stepVehicles(e,v,t,o,a,this.effectsFadeStartedAt!==null,(e,t)=>this.emitSceneFire(e,t)),C=this.documentScale(),w=P(Math.cos(b.body.angle),-Math.sin(b.body.angle)),T=b.mode===`car`&&i&&!e.isGhost?{mask:i.alpha,shape:{center:E(this.documentPoint(b.body.position),this.carVisualOffset(b)),forward:w,side:P(-w.y,w.x),halfLength:i.lengthM*C/2,halfWidth:i.widthM*C/2}}:void 0;if(this.previewDamage&&!this.damagePreviewApplied&&T&&(this.damagePreviewApplied=e.damage.hit(E(T.shape.center,r(T.shape.forward,T.shape.halfLength)),r(T.shape.forward,-1),T.shape,20,C)),this.electricity.step(e,v,t,this.sparks,this.screenShake),performance.now(),b.mode===`car`&&u(b.body.velocity)>.15&&this.sparks.disturb(this.particlePoint(b.body.position),this.particleVelocity(b.body.velocity),this.particleScale()*2.8),this.sparks.step(t,{walls:n,car:T}),this.previewSparks&&b.mode===`car`&&(this.sparkPreviewClock+=t,this.sparkPreviewClock>.12)){this.sparkPreviewClock=0;let e=this.particlePoint(b.body.position),t=this.particleScale();this.emitSparks({point:E(e,P(t*1.9,0)),velocity:P(t*4,t*10),normal:P(-1,0),pixelsPerMeter:t})}let D=this.particleScale(),O=this.particlePoint(b.body.position),ee=this.lastFlowCenter?r(c(O,this.lastFlowCenter),1/Math.max(t,1e-4)):this.particleVelocity(b.body.velocity),te=u(ee),ne=te>40*D?r(ee,40*D/te):ee;this.flowVelocity=E(this.flowVelocity,r(c(ne,this.flowVelocity),1-Math.exp(-12*t))),this.lastFlowCenter=O;let k=this.pixelSpace?this.flowVelocity:P(this.flowVelocity.x*this.view.zoom,-this.flowVelocity.y*this.view.zoom),re=P(Math.cos(b.body.angle),-Math.sin(b.body.angle)),A=b.mode===`car`?{center:E(this.screen(b.body.position),P(this.view.smokeMargin,this.view.smokeMargin)),velocity:k,forward:re,halfLength:b.car.preset.geometry.lengthM*this.view.zoom*.46,halfWidth:b.car.preset.geometry.widthM*this.view.zoom*.39,spin:-b.body.spin}:null;if(this.effectsFadeStartedAt!==null){this.volumetrics.clearSmokeSources(),this.combustion.stepTire(t),this.combustion.step(t,this.view.timeSeconds,e.isGhost?null:A,this.wallRects,!0,this.flameView(),this.sparks),this.volumetrics.stepSmoke(t,A,this.wallRects,this.fluidView());return}if(this.previewWallSmoke&&this.overlay){let e=this.sceneScroll(),n=this.wallRects.filter(t=>t.x-e.x>48&&t.x-e.x<this.view.width-48&&t.y+t.height/2-e.y>30&&t.y+t.height/2-e.y<this.view.height-30),r=n.find(t=>t.x-e.x>this.view.width*.5)??n[0];r&&this.volumetrics.emitSmoke({point:P(r.x-25,r.y+r.height/2),amount:t*15,flow:P(210,0),radiusPx:17,swirlPx:25})}if(performance.now(),this.combustion.stepTire(t),this.combustion.step(t,this.view.timeSeconds,e.isGhost?null:A,this.wallRects,!1,this.flameView(),this.sparks),!this.pixelSpace){for(let e of this.trail)e.age+=t;if(this.trail=this.trail.filter(e=>e.age<this.trailLifetime),this.trailClock+=t,this.trailLifetime>0&&this.trailClock>=1/30){this.trailClock%=1/30;let e=this.trail.at(-1);(!e||u(c(e.point,b.body.position))>.04)&&this.trail.push({point:{...b.body.position},age:0,color:b.mode===`ship`?`#9bbcff`:b.mode===`brick`?`#f6bd79`:`#8ce6c5`}),this.trail.length>800&&this.trail.shift()}}if(b.mode!==`car`){this.volumetrics.stepSmoke(t,null,this.wallRects,this.fluidView()),this.skidTracks.stop(this.skidView(),this.darkSurface(),!0),this.combustion.clearTireHistory();return}if(e.isGhost){this.volumetrics.stepSmoke(t,null,this.wallRects,this.fluidView()),this.skidTracks.stop(this.skidView(),this.darkSurface()),this.combustion.clearTireHistory();return}let j=this.advanceVehicleTireEffects(e,t,x,S,k),ie=this.combustion.emberSource();ie&&this.sparks.emitFireAt(ie.point,ie.radius,t,20*ie.heat),performance.now(),this.volumetrics.stepSmoke(t,A,this.wallRects,this.fluidView());let ae=this.darkSurface();this.skidTracks.step(t,b,j,t=>!!e.tirePaint.coating(t),{pixelSpace:this.pixelSpace,scale:this.particleScale(),dark:ae,project:e=>this.particlePoint(e),roadAt:(e,t)=>!!this.overlay&&this.surfaceTones.at(e,this.viewportFromDocument(t),ae),view:this.skidView()})}advanceVehicleTireEffects(e,t,n,i,a){let o=e.sim,s=this.particleScale();if(this.previewGroundFire&&!this.groundFirePreviewLit){for(let e of o.car.tires.filter(e=>!e.front)){let t=o.body.world(e.local);this.combustion.igniteTire(this.particlePoint(o.body.world(E(e.local,P(-2.4)))),this.particlePoint(t),o.car.preset.geometry.tireWidthM*s,18,.2*s)}this.groundFirePreviewLit=!0}let c=u(o.body.velocity),l=c>.1?r(o.body.velocity,-1/c):Ee(P(-1),o.body.angle);this.previewOilSplatter&&(c>.5?this.oilSplatterPreviewSeconds=0:c<.2&&(this.oilSplatterPreviewSeconds+=t),this.oilSplatterPreviewSeconds<2.25&&this.liquidLayer.pourOilPreview(n[0].point,t));let d={zoom:this.view.zoom,particlePoint:e=>this.particlePoint(e),particleVelocity:e=>this.particleVelocity(e),spray:(...e)=>this.sprayTirePaint(...e),smoke:this.tireSmokeEnabled?e=>this.volumetrics.emitSmoke(e):void 0};um(e,n,0,t,l,a,d,this.previewOilSplatter&&c<.2&&this.oilSplatterPreviewSeconds>1&&this.oilSplatterPreviewSeconds<2.25);let f=n.length;for(let{vehicle:e,tires:n}of i){if(!e.isGhost){let i=e.sim,a=u(i.body.velocity),o=a>.1?r(i.body.velocity,-1/a):Ee(P(-1),i.body.angle);um(e,n,f,t,o,this.particleVelocity(i.body.velocity),d)}f+=n.length}(e.isGhost||o.car.preset.sound.electric)&&(this.exhaustBursts=[]);for(let e of this.exhaustBursts){e.age+=t;let n=e.intensity*Math.max(0,1-e.age/e.lifetime);if(n<=0)continue;let i=Ee(P(-1,0),o.body.angle),a=E(r(i,4+5*n),r(o.body.velocity,.12));for(let e of this.vehicles.exhaustOutlets(o)){let s=o.body.world(e);if(this.combustion.emitJet(s,s,a,.13,n*.8,`exhaust`),n>.55){let e=E(s,r(i,1.45));this.volumetrics.emitSmoke({point:this.particlePoint(e),amount:t*n*.2,flow:this.particleVelocity(r(a,.48)),radiusPx:.13*this.particleScale(),swirlPx:7})}}}this.exhaustBursts=this.exhaustBursts.filter(e=>e.age<e.lifetime);let p=o.car.boostActive&&!e.isGhost;return p?this.combustion.stepBoostFire(o,t,e=>this.liquidLayer.igniteAtLocal(e)):this.combustion.clearTireHistory(),p}skidView(){return{pixelSpace:this.pixelSpace,zoom:this.view.zoom,width:this.view.width,height:this.view.height,screen:e=>this.particleScreen(e)}}vehicleLightInput(e,t,n){let r=be(e.sim.car.preset),i=e=>[-1,1].map(t=>P(e.xM*this.view.zoom,t*e.yM*this.view.zoom)),a=e.sim,o=this.vehicles.imageFor(a.car.preset)??void 0,s=o?un(a.car.preset,o.naturalWidth,o.naturalHeight):null,c=a.body.velocity.x*Math.cos(a.body.angle)+a.body.velocity.y*Math.sin(a.body.angle),l=a.lastInput,u=Math.max(l.brake??0,+!!l.action,+(l.throttle<0&&c>.5||l.throttle>0&&c<-.5));return{center:E(this.screen(a.body.position),this.carVisualOffset(a)),angle:-a.body.angle,width:(s?.lengthM??a.car.preset.geometry.lengthM)*this.view.zoom,height:(s?.widthM??a.car.preset.geometry.widthM)*this.view.zoom,mounts:{headlights:i(r.headlights),taillights:i(r.taillights)},image:o,source:s?.source,dark:e.appearance===`auto`?this.overlay?this.surfaceTones.at(e,this.viewportFromDocument(this.documentPoint(a.body.position)),t):t:e.appearance===`dark`,braking:u,options:this.vehicleLighting,opacity:n}}drawVehicleAndWeapons(e,t,n){performance.now(),Ye(`vehicle render passes`);let r=e.sim,{rocket:i,machineGuns:a,flamethrower:o}=e.weapons,s=this.ctx;if(e.isGhost){this.ghostVehicles.draw(e,s,{imageFor:e=>this.vehicles.imageFor(e),screen:e=>this.screen(e),visualOffset:e=>this.carVisualOffset(e),zoom:this.view.zoom,width:this.view.width,height:this.view.height,pixelSpace:this.pixelSpace,walls:this.wallRects,scroll:this.sceneScroll(),dark:this.darkSurface(),styleName:this.volumetrics.style}),i.drawFlight(s,e=>this.screen(e),r.car.preset,this.view.zoom,t),a.drawProjectiles(s,e=>this.screen(e),this.view.zoom,t);return}let c=this.carVisualOffset(r);if(s.save(),s.translate(c.x,c.y),r.car.explodedAt===null){this.vehicles.car(this.ctx,r.body,r,e.damage,Math.max(o.openAmount,a.openAmount));let i=n??this.vehicleLightInput(e,this.darkSurface(),t);this.vehicleLights.glints(s,{...i,center:this.screen(r.body.position)})}let l;if(i.state!==`idle`||o.state!==`closed`||a.state!==`closed`){let t=this.vehicles.imageFor(r.car.preset);if(t){let n=un(r.car.preset,t.naturalWidth,t.naturalHeight),i=e.damage.spriteFor(t,n);l={image:i??t,source:i?{x:0,y:0,width:i.width,height:i.height}:n.source,lengthM:n.lengthM,widthM:n.widthM}}}r.car.explodedAt===null&&i.drawMount(s,this.screen(r.body.position),r.body.angle,r.car.preset,this.view.zoom,t,l),r.car.explodedAt===null&&o.state!==`closed`?o.drawMount(s,this.screen(r.body.position),r.body.angle,r.car.preset,this.view.zoom,t,l):r.car.explodedAt===null&&a.drawMount(s,this.screen(r.body.position),r.body.angle,r.car.preset,this.view.zoom,t,l),s.restore(),s.save(),this.clipFluidWalls(s),s.translate(c.x,c.y),r.car.explodedAt===null&&this.vehicles.exhaust(this.ctx,r),s.restore(),i.drawFlight(s,e=>this.screen(e),r.car.preset,this.view.zoom,t),a.drawProjectiles(s,e=>this.screen(e),this.view.zoom,t)}drawGroundLayers(e,t,n,r){let i=t.sim;if(!this.pixelSpace){let{left:e,right:t,bottom:n,top:r}=this.bounds();for(let i=Math.floor(e/5)*5;i<=t;i+=5)this.vehicles.line(this.ctx,P(i,n),P(i,r),`#293c46`);for(let i=Math.floor(n/5)*5;i<=r;i+=5)this.vehicles.line(this.ctx,P(e,i),P(t,i),`#293c46`)}for(let t of this.trail){let n=this.screen(t.point),i=1-t.age/this.trailLifetime;e.globalAlpha=.6*i*i*r,e.fillStyle=t.color,e.beginPath(),e.arc(n.x,n.y,.8+1.4*i,0,Math.PI*2),e.fill()}e.globalAlpha=1,e.save(),e.lineCap=`round`,e.lineJoin=`round`;let a=this.sceneScroll(),o=this.pixelSpace?{left:a.x,right:a.x+this.view.width,bottom:a.y,top:a.y+this.view.height}:{left:this.world(P(0,0)).x,right:this.world(P(this.view.width,0)).x,bottom:this.world(P(0,this.view.height)).y,top:this.world(P(0,0)).y},s=this.darkSurface();performance.now(),this.skidTracks.draw(e,{pixelSpace:this.pixelSpace,scroll:a,width:this.view.width,height:this.view.height,ratio:this.rasterPixelRatio(),dark:s,alpha:r,visible:o,view:this.skidView()}),performance.now();let c={pixelSpace:this.pixelSpace,scroll:a,width:this.view.width,height:this.view.height,particleScale:this.particleScale(),rasterRatio:this.rasterPixelRatio(),zoom:this.view.zoom,effectsAlpha:r,screen:e=>this.particleScreen(e)};return this.tireMarks.draw(e,[t,...n],!1,c),e.restore(),this.liquidLayer.draw(e,1),performance.now(),this.tireMarks.draw(e,[t,...n],!0,c),i.barrier&&!this.overlay&&(e.strokeStyle=`#d4ab71`,e.lineWidth=2,e.strokeRect(3,3,this.view.width-6,this.view.height-6)),{scroll:a,darkSurface:s}}render(e,t,n,r,i=[]){let a=e.sim;performance.now(),this.resize();let o=cm(this.effectsFadeStartedAt,t);if(this.effectsFadeStartedAt!==null&&o===0&&(this.clearEffects(!1),o=0),this.view.cameraStep(a,t),this.canvasWorld&&t>=this.nextHistoryPrune){this.nextHistoryPrune=t+2e3;let e=this.documentPoint(a.body.position),n=2800,r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};this.skidTracks.pruneOutside(r),this.tireMarks.pruneOutside(r),this.liquidLayer.pruneOutside(r)}let s=this.ctx;this.surface.clear();let c=this.screenShake.sample(t);s.save(),(c.x||c.y)&&s.translate(c.x,c.y),r?.drawGround?.(s,this.sceneScroll(),{width:this.view.width,height:this.view.height});let{scroll:l,darkSurface:u}=this.drawGroundLayers(s,e,i,o),d=new Map((this.primaryVehicleVisible?[e,...i]:i).filter(e=>e.sim.mode===`car`&&e.sim.car.explodedAt===null&&!e.isGhost).map(t=>[t,this.vehicleLightInput(t,u,o*(t===e?this.primaryVehicleOpacity:1))])),f=[...d.values()].flatMap(e=>this.vehicleLights.smokeLights(e)),p=f.map(e=>({...e,point:{x:e.point.x+l.x,y:e.point.y+l.y}}));this.pixelSpace&&(s.save(),s.translate(-l.x,-l.y),cn(s,this.debris.particles,{x:l.x,y:l.y,width:this.view.width,height:this.view.height},u,`ground`,p),s.restore());for(let t of this.primaryVehicleVisible?[e,...i]:i)t.sim.mode!==`car`||t.sim.car.explodedAt!==null||t.isGhost||t===e&&this.primaryVehicleOpacity<=0||(s.save(),t===e&&(s.globalAlpha*=this.primaryVehicleOpacity),this.vehicles.carGround(this.ctx,t.sim,t.damage,this.rasterPixelRatio(),this.vehicleShadowsEnabled),s.restore());for(let e of d.values())this.vehicleLights.ground(s,e);if(s.save(),performance.now(),this.clipFluidWalls(s),s.globalAlpha=o,s.save(),s.translate(-this.view.smokeMargin,-this.view.smokeMargin),this.volumetrics.drawSmoke(s,this.fluidView(),f.map(e=>({...e,point:E(e.point,P(this.view.smokeMargin,this.view.smokeMargin))})),u),s.restore(),s.restore(),s.globalAlpha=1,r?.draw(s,l,{width:this.view.width,height:this.view.height}),this.debugDrive&&a.mode===`car`&&a.car.explodedAt===null&&!e.isGhost){let e=this.screen(a.body.position);s.save(),s.beginPath(),s.arc(e.x,e.y,M(a.car.preset,this.view.width,this.documentScale())*this.view.zoom,0,Math.PI*2),s.strokeStyle=u?`#92cfff88`:`#12528e88`,s.lineWidth=1,s.setLineDash([5,6]),s.stroke(),s.fillStyle=u?`#b7ddff`:`#12528e`,s.font=`10px ui-monospace, monospace`,s.fillText(`Lightning influence`,e.x+8,e.y-M(a.car.preset,this.view.width,this.documentScale())*this.view.zoom+14),s.restore()}this.volumetrics.ghostAvailable&&(s.save(),s.globalAlpha=o,this.volumetrics.drawGhost(s,this.flameView(),u),s.restore()),this.overlay&&this.debugDrive&&this.tourDebug&&sm(s,this.tourDebug.route,this.tourDebug.stops,{x:l.x,y:l.y,width:this.view.width,height:this.view.height}),this.primaryVehicleVisible&&a.mode===`car`&&(s.save(),s.globalAlpha*=this.primaryVehicleOpacity,this.drawVehicleAndWeapons(e,o,d.get(e)),s.restore(),this.debugDrive&&(r?.drawDebug?.(s,a,this,e.damage),this.diagnostics.draw(s,a,t,e=>this.screen(e),{width:this.view.width,rocketState:e.weapons.rocket.state,gunState:e.weapons.machineGuns.state,bulletCount:e.weapons.machineGuns.projectileCount,fluidEngine:this.volumetrics.smokeResolution.engine,quality:this.quality,fluidCols:this.volumetrics.smokeResolution.cols,fluidRows:this.volumetrics.smokeResolution.rows,fireCols:this.combustion.resolution?.cols??0,fireRows:this.combustion.resolution?.rows??0,groundedFireCount:this.combustion.count}))),this.primaryVehicleVisible&&a.mode===`ship`&&this.vehicles.ship(this.ctx,a.body,a),this.primaryVehicleVisible&&a.mode===`brick`&&this.vehicles.brick(this.ctx,a.body);for(let e of i){let t=e.sim;if(t.mode!==`car`||(this.drawVehicleAndWeapons(e,o,d.get(e)),t.car.explodedAt!==null))continue;let n=this.screen(t.body.position);s.save(),s.font=`600 10px ui-monospace, monospace`,s.textAlign=`center`;let r=e.label||`AI`,i=Math.max(30,Math.ceil(s.measureText(r).width)+14);s.fillStyle=`rgba(24, 27, 30, 0.88)`,s.fillRect(n.x-i/2,n.y-37,i,16),s.fillStyle=`#f5f2ec`,s.fillText(r,n.x,n.y-25),s.restore()}if(this.pixelSpace&&(s.save(),s.translate(-l.x,-l.y),cn(s,this.debris.particles,{x:l.x,y:l.y,width:this.view.width,height:this.view.height},u,`air`,p),s.restore()),s.save(),this.clipFluidWalls(s),performance.now(),this.combustion.draw(s,this.flameView(),u,f),s.restore(),this.electricity.draw(s,t,u,o),performance.now(),this.sparks.draw(s,e=>this.particleScreen(e),o,{width:this.view.width,height:this.view.height},this.view.dpr,this.canvasWorld?void 0:this.surface.canvas),this.pointPuffs.length){s.save(),s.font=`700 13px ui-monospace, monospace`,s.textAlign=`center`,s.textBaseline=`middle`;for(let e of this.pointPuffs){let t=this.particleScreen(e.point),n=e.age/.9;s.globalAlpha=(1-n)*o,s.fillStyle=`#f8f4e9`,s.strokeStyle=`rgba(22, 24, 26, 0.85)`,s.lineWidth=3;let r=`+${e.amount}`,i=t.y-16-n*26;s.strokeText(r,t.x,i),s.fillText(r,t.x,i)}s.restore()}if(r?.drawForeground?.(s,l,{width:this.view.width,height:this.view.height}),performance.now(),r?.drawHealthBars?.(s,l,{width:this.view.width,height:this.view.height},e,this,i),n){let e=this.screen(n.from),t=this.screen(n.to);s.strokeStyle=`#ffdf93`,s.lineWidth=2,s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.stroke()}s.restore(),this.objectGlint?.draw(s,this.view.width,this.view.height,this.darkSurface()),this.vehicles.drawVehicleMarkers(this.ctx,this.primaryVehicleVisible?[e,...i]:i,this.showVehicleMarkers),this.surface.presentLockedCamera(),this.liquidLayer.drawTextVehicles([e,...i].filter(t=>(t!==e||this.primaryVehicleVisible)&&t.sim.mode===`car`&&!t.isGhost&&t.sim.car.explodedAt===null).map(e=>({point:this.screen(e.sim.body.position),radius:Math.hypot(e.sim.car.preset.geometry.lengthM,e.sim.car.preset.geometry.widthM)*this.view.zoom/2+12})),c,t=>{for(let n of[e,...i]){if(n===e&&!this.primaryVehicleVisible||n.sim.mode!==`car`||n.isGhost||n.sim.car.explodedAt!==null)continue;let r=this.carVisualOffset(n.sim);t.save(),t.translate(r.x,r.y),this.vehicles.car(t,n.sim.body,n.sim,n.damage,Math.max(n.weapons.flamethrower.openAmount,n.weapons.machineGuns.openAmount)),t.restore()}}),this.governFluidQuality(t)}governFluidQuality(e){let t=performance.now()-e;if(!(t>=0&&t<1e3))return;let n=this.volumetrics.running||this.combustion.running;this.fluidGovernor.sample(e,t,n,this.quality)&&(Ye(`fluid quality limit ${this.fluidGovernor.limit}`),this.applyFluidQuality())}},Km=Object.freeze({speedFactor:.5,rampMs:300,zoomFactor:0,curve:`ease-in-out`}),qm={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e*e*(3-2*e)},Jm={linear:e=>e*e/2,"ease-in":e=>e*e*e/3,"ease-out":e=>e*e-e*e*e/3,"ease-in-out":e=>e*e*e-e*e*e*e/2},Ym=class{settings={...Km};enabled=!1;speed=1;zoom=1;fromSpeed=1;fromZoom=1;elapsed=0;constructor(e={}){this.configure(e)}get options(){return{...this.settings}}get active(){return this.enabled}get speedFactor(){return this.speed}get zoomFactor(){return this.zoom}configure(e){let t={...this.settings,...e};if(!Number.isFinite(t.speedFactor)||t.speedFactor<=0||t.speedFactor>1)throw RangeError(`Slow-mo speedFactor must be greater than zero and at most one.`);if(!Number.isFinite(t.rampMs)||t.rampMs<0)throw RangeError(`Slow-mo rampMs must be a nonnegative number.`);if(!Number.isFinite(t.zoomFactor)||t.zoomFactor<0||t.zoomFactor>4)throw RangeError(`Slow-mo zoomFactor must be between 0 and 4.`);if(!Object.hasOwn(qm,t.curve))throw TypeError(`Unknown slow-mo curve.`);this.settings=t,this.beginRamp()}setActive(e){this.enabled!==e&&(this.enabled=e,this.beginRamp())}start(){this.setActive(!0)}stop(){this.setActive(!1)}beginRamp(){this.fromSpeed=this.speed,this.fromZoom=this.zoom,this.elapsed=0,this.settings.rampMs||this.advance(0)}advance(e){if(!Number.isFinite(e)||e<0)throw RangeError(`Slow-mo elapsed time must be a nonnegative number.`);let t=this.enabled?this.settings.speedFactor:1,n=this.enabled&&this.settings.zoomFactor||1,r=this.settings.rampMs/1e3;if(!r||this.elapsed>=r)return this.speed=t,this.zoom=n,e*t;let i=this.elapsed/r,a=Math.min(e,r-this.elapsed);this.elapsed+=a;let o=Math.min(1,this.elapsed/r),s=qm[this.settings.curve](o);this.speed=this.fromSpeed+(t-this.fromSpeed)*s,this.zoom=this.fromZoom+(n-this.fromZoom)*s;let c=Jm[this.settings.curve](o)-Jm[this.settings.curve](i);return a*this.fromSpeed+r*(t-this.fromSpeed)*c+(e-a)*t}reset(){this.enabled=!1,this.speed=this.zoom=this.fromSpeed=this.fromZoom=1,this.elapsed=0}captureState(){return{options:{...this.settings},active:this.enabled,speed:this.speed,zoom:this.zoom,fromSpeed:this.fromSpeed,fromZoom:this.fromZoom,elapsed:this.elapsed}}restoreState(e){this.settings={...e.options},this.enabled=e.active,this.speed=e.speed,this.zoom=e.zoom,this.fromSpeed=e.fromSpeed,this.fromZoom=e.fromZoom,this.elapsed=e.elapsed}},Xm=new WeakMap;function Zm(e){let t=Xm.get(e);return!t&&typeof e.createConstantSource==`function`&&(t=e.createConstantSource(),t.offset.value=0,t.start(),Xm.set(e,t)),t}function Qm(e,t){let n=Zm(e);if(!n)return;let r=1200*Math.log2(Number.isFinite(t)&&t>0?Math.min(1,t):1),i=e.currentTime;n.offset.cancelScheduledValues(i),n.offset.setValueAtTime(n.offset.value,i),n.offset.linearRampToValueAtTime(r,i+1/120)}function $m(e){let t=Xm.get(e);t&&(t.stop(),t.disconnect(),Xm.delete(e))}function W(e){if(!e.detune||!e.context)return e;let t=Zm(e.context);return t&&(t.connect(e.detune),e.addEventListener(`ended`,()=>{try{t.disconnect(e.detune)}catch{}},{once:!0})),e}var eh=`data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0UAAAAOAAADTGF2ZjYzLjEuMTAyAAAAAAAA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AhB7LkB7PkB7PkB7HjB65RB7FTB7NVB7RWB7RXB7NXB7ENCLAKCLAKCK9PCK9UCLFWCLNYCLNZCLRbCLVdCLZeCLheCLlcCLpaCLtXCLxUCL9TCMBSCMBSCL1RCLkIB7kKB7oMB7oPB7kzB7s0B8A0B8M1B8Q1B8Q2B8M3B8A4B7w6B7k7B7ZNB7VOB7VMB7RLB7RJB7NIB7PjCLLjCLTjCLTjCLTjCLGvB7GuB7GuB7BTB7NVB7VXB7VYB7VZB7RaB7NbB7JbB7BbB69bB65bB65bB65cB61fB6thB6xkB6xwB6xvB6xwB6txB6h1CKh1CKl0CKpzCKpyCKpxCKo8B6s8B6s7B6o6B6l2CKd3CKReB6NeB6VdB6ddB6biCKXiCKTMCKTLCKPKCKLICJ+PCJyNCJyMCJq2CJ21CJ60CJ60CJ2zCJqyCJexCJPNCI+sBpCtBpCuBo6vBouxBoeyBoKzBnvMCHjKCHfJCHbHCHXHCHPHCHDJCGzLCGaYCGOZCGCZCFvZCFjbCFTbCE8KCUoJCUMJCTsJCTEKCSSwCBc=`;function lh(e){let t=e;return()=>(t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)/2147483648-1)}var uh={"collision-soft":{level:.11,decay:.085,strikes:[[.006,1],[.029,.26]]},"collision-medium":{level:.16,decay:.14,strikes:[[.007,1],[.026,.42],[.057,.2]]},"collision-hard":{level:.22,decay:.2,strikes:[[.008,1],[.024,.47],[.048,.32],[.081,.18]]}};function dh(e,t,n){let r=uh[n],i=[570,1010,1690,2680,4230],a=[.48,.4,.3,.2,.12],o=[.2,1.7,3.1,4.6,5.8],s=i.map(()=>0),c=r.strikes,l=0,u=0,d=0,f=lh(n===`collision-soft`?403364:n===`collision-medium`?581137:1011779);for(let n=0;n<e.length;n++){let p=n/t;for(;l<c.length&&p>=c[l][0];){let e=c[l][1];for(let t=0;t<s.length;t++)s[t]+=e;u+=e,l++}let m=0;for(let e=0;e<s.length;e++){let n=r.decay*(1-e*.14);s[e]*=Math.exp(-1/(t*n));let c=1+.018*Math.exp(-p/.035);o[e]+=2*Math.PI*i[e]*c/t,m+=Math.sin(o[e])*s[e]*a[e]}let h=f();d+=(h-d)*.29,u*=Math.exp(-1/(t*.022)),e[n]+=r.level*(m*.63+(h-d)*u*.22)}}function fh(e,t){let n=[[.004,1],[.012,.75],[.023,.55],[.035,.28]],r=[[.029,1],[.065,.38]],i=lh(504037),a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=1-Math.exp(-2*Math.PI*5200/t);for(let _=0;_<e.length;_++){let v=_/t;for(;d<n.length&&v>=n[d][0];)s+=n[d][1],c+=n[d][1],d++;for(;f<r.length&&v>=r[f][0];)l+=r[f][1],f++;let y=i();a+=(y-a)*.09,o+=(y-o)*.32,u+=(i()-u)*.006,s*=Math.exp(-1/(t*.0045)),c*=Math.exp(-1/(t*.018)),l*=Math.exp(-1/(t*.052));let b=o-a,x=(y-o)*.27+b*.55,S=(a*1.05+b*.18)*(.85+u*.5),C=2.3*(e[_]*.17+x*s*.65+b*c*.15+S*l*1.2);p+=(C-p)*g,m+=(p-m)*g,h+=(m-h)*g,e[_]=h}}function ph(e,t,n){if(n===`crush`)fh(e,t);else if(n===`collision-soft`||n===`collision-medium`||n===`collision-hard`)dh(e,t,n);else return;for(let t=0;t<e.length;t++){let n=Math.abs(e[t]);n>.8&&(e[t]=Math.sign(e[t])*(.8+.18*Math.tanh((n-.8)/.18)))}}function mh(e){let t=0;for(let n of e)t+=n*n;return Math.sqrt(t/e.length)}function hh(e,t){let n=mh(e),r=lh(989808),i=[[.31,.45],[.52,.7],[.79,.5],[1.04,.8],[1.28,.55]],a=0,o=0,s=0,c=0,l=1-Math.exp(-2*Math.PI*170/t),u=1-Math.exp(-2*Math.PI*1500/t),d=Math.exp(-1/(t*.006));for(let n=0;n<e.length;n++){let f=n/t;for(;c<i.length&&f>=i[c][0];)s+=i[c][1],c++;let p=e[n];a+=(p-a)*l,o+=(p-o)*u,s*=d,e[n]=a*.55+(o-a)*.5+(p-o)*.42+r()*s*.04}let f=n/Math.max(1e-6,mh(e))*.9;for(let t=0;t<e.length;t++)e[t]*=f}function gh(e,t){let[n,r]=t.tracks;if(!n||!r)return;let i=t.sampleRate,a=lh(466480),o=[110,145].map(e=>Math.exp(-Math.PI*e/i)),s=[n.frequency[0],r.frequency[0]],c=[0,0],l=[0,0],u=1-Math.exp(-1/(i*.025)),d=0,f=0,p=0,m=0,h=0,g=1-Math.exp(-2*Math.PI*650/i);for(let _=0;_<e.length;_++){let v=Math.min(t.frames-2,Math.floor(_/t.hop)),y=(_-v*t.hop)/t.hop,b=10**((t.envelope[Math.min(t.envelope.length-1,Math.floor(_/t.envelopeHop))]*90/255-90)/20);h+=(b-h)*u,d+=(a()-d)*.003;let x=[n,r],S=0;for(let e=0;e<2;e++){let t=x[e].frequency[v]*(1-y)+x[e].frequency[v+1]*y;s[e]+=(t-s[e])*u;let n=s[e]*(1+d*.03),r=o[e],f=a()*(e===0?.008:.011),p=2*r*Math.cos(2*Math.PI*n/i)*c[e]-r*r*l[e]+f;l[e]=c[e],c[e]=p,S+=p*(e===0?1.15:.9)}let C=Math.min(1.6,h/.18);f+=(e[_]-f)*.11;let w=(e[_]-f)*.65+S*C*1.25;p+=(w-p)*g;let T=w-p;m+=(T-m)*g,e[_]=(T-m)*1.15}}function _h(e,t){if(t.id===`burning-fire`)hh(e,t.sampleRate);else if(t.id===`tire-screech`)gh(e,t);else return;for(let t=0;t<e.length;t++){let n=Math.abs(e[t]);n>.8&&(e[t]=Math.sign(e[t])*(.8+.18*Math.tanh((n-.8)/.18)))}}var vh=[60,90,130,190,270,380,530,730,1e3,1400,1950,2700,3700,5100,7e3,9600,13200,15600],yh=1024,bh=Float32Array.from({length:yh},(e,t)=>.5-.5*Math.cos(2*Math.PI*t/1023)),xh=bh.reduce((e,t)=>e+t,0),Sh=Float32Array.from({length:256},(e,t)=>10**((t*90/255-90)/20));function Ch(e){let t=new DataView(e),n=0,r=()=>t.getUint8(n++),i=()=>{let e=t.getUint16(n,!0);return n+=2,e},a=()=>{let e=t.getUint32(n,!0);return n+=4,e};if(String.fromCharCode(r(),r(),r(),r())!==`JRSM`||r()!==1)throw Error(`Unsupported spectral model format.`);let o=r();if(o!==vh.length)throw Error(`Unexpected spectral band count.`);let s=i(),c=i(),l=i(),u=r(),d=new Map;for(let t=0;t<u;t++){let t=r(),u=new TextDecoder().decode(new Uint8Array(e,n,t));n+=t;let f=a(),p=i(),m=i(),h=r(),g=new Uint8Array(e,n,p*o);n+=g.length;let _=new Uint8Array(e,n,m);n+=_.length;let v=[];for(let e=0;e<h;e++){let e=new Uint16Array(p),t=new Uint8Array(p);for(let n=0;n<p;n++)e[n]=i(),t[n]=r();v.push({frequency:e,amplitude:t})}d.set(u,{id:u,sampleRate:s,hop:c,envelopeHop:l,samples:f,frames:p,bands:g,envelope:_,tracks:v})}if(n!==e.byteLength)throw Error(`Spectral model contains unexpected trailing data.`);return d}function wh(e,t){let n=e.length;for(let r=1,i=0;r<n;r++){let a=n>>1;for(;i&a;)i^=a,a>>=1;i^=a,r<i&&([e[r],e[i]]=[e[i],e[r]],[t[r],t[i]]=[t[i],t[r]])}for(let r=2;r<=n;r*=2){let i=r/2,a=2*Math.PI/r;for(let o=0;o<n;o+=r)for(let n=0;n<i;n++){let r=n*a,s=Math.cos(r),c=Math.sin(r),l=o+n,u=l+i,d=s*e[u]-c*t[u],f=s*t[u]+c*e[u];e[u]=e[l]-d,t[u]=t[l]-f,e[l]+=d,t[l]+=f}}for(let t=0;t<n;t++)e[t]/=n}function Th(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t>>>0}function*Eh(e){let t=new Float32Array(e.samples),n=new Float32Array(e.samples),r=new Float32Array(yh),i=new Float32Array(yh),a=vh.length,o=Th(e.id),s=()=>(o^=o<<13,o^=o>>>17,o^=o<<5,(o>>>0)/4294967296),c=Array.from({length:513},(t,n)=>{let r=n*e.sampleRate/yh,i=vh.findIndex(e=>e>=r);i<0&&(i=vh.length-1);let a=Math.max(0,i-1),o=a===i?0:Math.max(0,Math.min(1,Math.log(r/vh[a])/Math.log(vh[i]/vh[a])));return{left:a,right:i,fraction:o}});for(let o=0;o<e.frames;o++){o%16==0&&(yield),r.fill(0),i.fill(0);let l=o*a;for(let t=1;t<yh/2;t++){let{left:n,right:a,fraction:u}=c[t],d=Sh[e.bands[l+n]],f=Sh[e.bands[l+a]],p=Math.exp(Math.log(d)*(1-u)+Math.log(f)*u)*xh/2;for(let n of e.tracks)Math.abs(t*e.sampleRate/yh-n.frequency[o])<42&&(p*=.62);let m=s()*2*Math.PI;r[t]=p*Math.cos(m),i[t]=p*Math.sin(m),r[yh-t]=r[t],i[yh-t]=-i[t]}wh(r,i);let u=o*e.hop-yh/2;for(let e=0;e<yh;e++){let i=u+e;i<0||i>=t.length||(t[i]+=r[e]*bh[e],n[i]+=bh[e]*bh[e])}}for(let e=0;e<t.length;e++)t[e]/=Math.max(.05,n[e]);for(let n of e.tracks){let r=0;for(let i=0;i<t.length;i++){i%8192==0&&(yield);let a=Math.min(e.frames-2,Math.floor(i/e.hop)),o=(i-a*e.hop)/e.hop,s=n.frequency[a]*(1-o)+n.frequency[a+1]*o,c=Sh[n.amplitude[a]]*(1-o)+Sh[n.amplitude[a+1]]*o;r+=2*Math.PI*s/e.sampleRate,t[i]+=Math.sin(r)*c*.42}}e.id===`crush`&&ph(t,e.sampleRate,e.id);let l=new Float32Array(e.envelope.length);for(let n=0;n<l.length;n++){let r=n*e.envelopeHop,i=Math.min(t.length,r+e.envelopeHop),a=0;for(let e=r;e<i;e++)a+=t[e]**2;let o=Math.sqrt(a/Math.max(1,i-r));l[n]=Math.min(8,Sh[e.envelope[n]]/Math.max(1e-4,o))}for(let n=0;n<t.length;n++){n%8192==0&&(yield);let r=Math.min(l.length-2,Math.floor(n/e.envelopeHop)),i=Math.min(1,(n-r*e.envelopeHop)/e.envelopeHop);t[n]*=l[r]*(1-i)+l[r+1]*i;let a=Math.abs(t[n]);a>.8&&(t[n]=Math.sign(t[n])*(.8+.18*Math.tanh((a-.8)/.18)))}return e.id!==`crush`&&ph(t,e.sampleRate,e.id),_h(t,e),t}var Dh=new WeakMap,Oh=new WeakMap,kh=new WeakMap;function Ah(e,t){let n=kh.get(e);n||(n=new Map,kh.set(e,n));let r=n.get(t);if(r)return r;let i=Dh.get(t);if(!i){let e=Eh(t),n=e.next();for(;!n.done;)n=e.next();i=n.value,Dh.set(t,i)}let a=e.createBuffer(1,i.length,t.sampleRate);return a.getChannelData(0).set(i),n.set(t,a),a}async function jh(e,t,n){if(n?.throwIfAborted(),!Dh.has(t)){let e=Oh.get(t);e||(e=(async()=>{let e=Eh(t),n=e.next();for(;!n.done;)await new Promise(e=>setTimeout(e,0)),n=e.next();Dh.set(t,n.value)})().then(()=>Dh.get(t)),Oh.set(t,e),e.finally(()=>Oh.delete(t)).catch(()=>{})),await e}return n?.throwIfAborted(),Ah(e,t)}var Mh={"electric-charge":.8,"electric-bolt":.68,"ghost-mode":1,attractor:.8},Nh={"electric-charge":4310822,"electric-bolt":7516190,"ghost-mode":6882682,attractor:4880300};function Ph(e,t){if(!Number.isFinite(t)||t<8e3)throw RangeError(`Invalid sample rate`);let n=Math.round(Mh[e]*t),r=new Float32Array(n),i=lh(Nh[e]),a=()=>(i()+1)*.5,o=0,s=0,c=0;for(let i=0;i<n;i++){let l=i/t,u=i/n,d=a()*2-1;o+=(d-o)*.055;let f=d-o,p=f-s;if(s=f,e===`electric-charge`){let e=.56+.44*Math.sin(2*Math.PI*5*l)**2;a()<.0017&&(c=1),c*=.985;let t=Math.sin(2*Math.PI*90*l+.8*Math.sin(2*Math.PI*5*l))*.18+Math.sin(2*Math.PI*270*l)*.09;r[i]=(t+f*.22+p*c*.27)*e}else if(e===`electric-bolt`){let e=Math.exp(-l*125),t=Math.exp(-l*14),n=Math.exp(-l*5.5),a=Math.exp(-Math.max(0,l-.052)*100)*+(l>=.052)*.32+Math.exp(-Math.max(0,l-.11)*90)*+(l>=.11)*.15;r[i]=p*(.58*e+a)+o*2.2*t+f*.1*n+Math.sin(2*Math.PI*(165*l+950*l*l))*.12*t}else if(e===`ghost-mode`){let e=Math.sin(2*Math.PI*2*u),t=.6+.4*e*e;r[i]=(Math.sin(2*Math.PI*80*l+1.8*e)*.12+Math.sin(2*Math.PI*160*l-1.1*e)*.075+o*.7+f*.075)*t}else{let e=.65+.35*Math.sin(2*Math.PI*5*u)**2;r[i]=(Math.sin(2*Math.PI*100*l+.2*Math.sin(2*Math.PI*5*l))*.19+Math.sin(2*Math.PI*300*l)*.09+Math.sin(2*Math.PI*700*l)*.035+o*.6+f*.12)*e}}for(let e=0;e<n;e++)r[e]=.98*Math.tanh(r[e]/.98);if(e!==`electric-bolt`){let e=Math.round(t*.06),i=new Float32Array(n-e);i.set(r.subarray(e));for(let t=0;t<e;t++){let a=t/(e-1)*(Math.PI/2);i[i.length-e+t]=r[n-e+t]*Math.cos(a)+r[t]*Math.sin(a)}let a=i[0]-i[i.length-1],o=Math.round(t*.003);for(let e=0;e<o;e++)i[i.length-o+e]+=a*(e/(o-1));return i}{let e=Math.round(t*.04);for(let t=0;t<e;t++)r[n-e+t]*=1-t/e}return r}function Fh(e,t){let n=Ph(t,e.sampleRate),r=e.createBuffer(1,n.length,e.sampleRate);return r.getChannelData(0).set(n),r}var Ih={"collision-soft":{kind:`recording`,url:eh},"collision-medium":{kind:`recording`,url:th},"collision-hard":{kind:`recording`,url:nh},crush:{kind:`recording`,url:rh},"burning-fire":{kind:`recording`,url:ih},"tire-screech":{kind:`recording`,url:ah},"starter-light":{kind:`recording`,url:oh},"starter-heavy":{kind:`recording`,url:sh},"machine-gun":{kind:`synthetic`,model:`machine-gun`},"bullet-ricochet-1":{kind:`synthetic`,model:`bullet-ricochet-1`},"bullet-ricochet-2":{kind:`synthetic`,model:`bullet-ricochet-2`},"bullet-ricochet-3":{kind:`synthetic`,model:`bullet-ricochet-3`},"rocket-launch":{kind:`synthetic`,model:`rocket-launch`},"rocket-explosion":{kind:`synthetic`,model:`rocket-explosion`},"combustible-explosion":{kind:`synthetic`,model:`combustible-explosion`},"electric-charge":{kind:`procedural`,effect:`electric-charge`},"electric-bolt":{kind:`procedural`,effect:`electric-bolt`},"ghost-mode":{kind:`procedural`,effect:`ghost-mode`},attractor:{kind:`procedural`,effect:`attractor`}};async function Lh(e,t){if(e.startsWith(`data:`)){let t=atob(e.slice(e.indexOf(`,`)+1));return Uint8Array.from(t,e=>e.charCodeAt(0)).buffer}let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`Audio asset HTTP ${n.status}`);return n.arrayBuffer()}var Rh;function zh(){return Rh??=Lh(ch).then(Ch).catch(e=>{throw Rh=void 0,e}),Rh}var Bh=class{context;buffers=new Map;abort=new AbortController;disposed=!1;constructor(e){this.context=e}async initialize(){return Promise.allSettled(Object.keys(Ih).filter(e=>Ih[e].kind!==`procedural`).map(e=>this.load(e)))}load(e){let t=Ih[e];return this.prepare(e,async()=>{if(t.kind===`recording`)return this.decode(t.url);if(t.kind===`procedural`)return Fh(this.context,t.effect);let e=(await zh()).get(t.model);if(!e)throw Error(`Missing sound model: ${t.model}`);return this.assertLive(),jh(this.context,e,this.abort.signal)})}loadUri(e){return this.prepare(e,()=>this.decode(e))}async decode(e){let t=await Lh(e,this.abort.signal);return this.assertLive(),this.context.decodeAudioData(t)}prepare(e,t){if(this.disposed)return Promise.reject(Error(`Sound bank is disposed.`));let n=this.buffers.get(e);if(n)return n;let r=t().then(e=>(this.assertLive(),e)).catch(t=>{throw this.buffers.delete(e),t});return this.buffers.set(e,r),r}assertLive(){this.abort.signal.throwIfAborted()}dispose(){this.disposed=!0,this.abort.abort(),this.buffers.clear()}},Vh=new WeakMap;function Hh(e){let t=Vh.get(e);return t||(t=new Bh(e),Vh.set(e,t)),t}function Uh(e){Vh.get(e)?.dispose(),Vh.delete(e)}function Wh(e,t){let n=Hh(e);return Object.hasOwn(Ih,t)?n.load(t):n.loadUri(t)}var Gh={engine:-9.9,starter:-8.4,tire:-19.2,horn:-20,boost:-24.4,flamethrower:-20.9,rocketFlight:-6.9,collision:-15.4,crush:-14,machineGun:-17.7,ricochet:-15.4,rocketLaunch:-12.8,rocketExplosion:-17.1,combustibleExplosion:-17.1,burningFire:-15.9,electricCharge:-20,electricBolt:-12,ghostMode:-23,attractor:-21},Kh=e=>10**(e/20),qh={pitchShiftSemitones:-3,pitchDynamics:1.8},Jh=(e,t=0,n=1)=>Math.max(t,Math.min(n,e)),Yh=e=>{let t=Jh(e);return t*t*(3-2*t)},Xh={start:.981,end:1.4505,crossfade:.04};function Zh(e,t){let{sampleRate:n}=t,r=Math.round(Xh.start*n),i=Math.round(Xh.end*n),a=Math.round(Xh.crossfade*n);if(t.length<i)throw Error(`Tire recording is shorter than its loop region.`);let o=i-r-a,s=e.createBuffer(t.numberOfChannels,o,n);for(let e=0;e<t.numberOfChannels;e++){let n=t.getChannelData(e),c=s.getChannelData(e),l=0;for(let e=r;e<i;e++)l+=n[e];l/=i-r;let u=0,d=0,f=0;for(let e=0;e<a;e++){let t=n[r+e]-l,o=n[i-a+e]-l;u+=t*t,d+=o*o,f+=t*o}let p=Jh(f/Math.sqrt(u*d||1),0,1);for(let e=0;e<o-a;e++)c[e]=n[r+a+e]-l;for(let e=0;e<a;e++){let t=e/(a-1)*Math.PI*.5,s=Math.cos(t),u=Math.sin(t),d=Math.sqrt(1+2*p*s*u);c[o-a+e]=((n[i-a+e]-l)*s+(n[r+e]-l)*u)/d}}return s}function Qh({car:e,body:t},n){return e.tires.map((r,i)=>{let a=t.velocityAt(t.world(r.local)),o=t.angle+r.angle,s=Math.abs(a.x*Math.cos(o)+a.y*Math.sin(o)),c=r.spinning?Math.abs(r.wheelSurfaceSpeedMps)||s+r.slipSpeedMps:n&&!r.front?s*.35:s;return{skidding:r.skidding,slipMps:r.slipSpeedMps,speedMps:Math.hypot(a.x,a.y),wheelSpeedMps:c,loadN:t.mass*9.81*(r.front?e.frontLoadFraction:1-e.frontLoadFraction)*.5,heat:r.heat,grip:e.statusEffects.factor(`grip`,i)}})}var $h=class{context;ready;output;highpass;voices=new Set;config;clip=null;disposed=!1;constructor(e,t=e.destination,n={}){this.context=e,this.config={...qh,...n},this.output=e.createGain(),this.output.gain.value=Kh(Gh.tire),this.highpass=e.createBiquadFilter(),this.highpass.type=`highpass`,this.highpass.frequency.value=380,this.highpass.Q.value=.55,this.output.connect(this.highpass).connect(t),this.ready=this.load()}async load(){try{let e=await Hh(this.context).load(`tire-screech`);this.disposed||(this.clip=Zh(this.context,e))}catch(e){this.disposed||console.warn(`Joy Ride tire sound could not load.`,e)}}startVoice(e,t,n){if(!this.clip)return null;let r=W(this.context.createBufferSource()),i=this.context.createBiquadFilter(),a=this.context.createGain();r.buffer=this.clip,r.loop=!0,r.playbackRate.value=t,i.type=`lowpass`,i.frequency.value=n,i.Q.value=.55,a.gain.value=0,r.connect(i).connect(a).connect(this.output);let o={index:e,source:r,filter:i,gain:a,level:0,travel:e*.37,stopping:!1};return this.voices.add(o),r.onended=()=>{r.disconnect(),i.disconnect(),a.disconnect(),this.voices.delete(o),this.disposed&&!this.voices.size&&this.disconnect()},r.start(this.context.currentTime,e*.271%1*this.clip.duration),o}update(e,t,n){if(this.disposed)return;let r=this.context.currentTime,i=Jh(e,0,.1),a=Jh((1200/Math.max(200,n))**.12,.86,1.12),o=[...this.voices].filter(e=>!e.stopping);for(let e=0;e<Math.max(4,t.length);e++){let n=t[e],s=o.find(t=>t.index===e),c=Math.max(0,n?.slipMps??0),l=Math.sqrt(1-Math.exp(-c/5)),u=Math.sqrt(Math.max(0,n?.speedMps??0)/(12+Math.max(0,n?.speedMps??0))),d=Math.max(0,n?.wheelSpeedMps??0),f=Jh(n?.heat??0),p=Math.sqrt(Jh((n?.loadN??0)/2943,0,2.5)),m=Math.sqrt(Jh(n?.grip??1,0,1.3)),h=n?.skidding?.38*Yh((c-.7)/1.1)*l*(.42+u*.58)*p*m*(.72+f*.28):0,g=.8+l*.3+Math.tanh(d/28)*.16-f*.045,_=2**(this.config.pitchShiftSemitones/12)*g**this.config.pitchDynamics*a*(1+(e-1.5)*.009),v=Math.min(this.context.sampleRate*.45,2200+l*2400+u*1500-f*550);if(!s&&h>.004&&(s=this.startVoice(e,_,v)??void 0),!s)continue;s.travel+=(d+c)*i;let y=Math.sin(s.travel*3.7+e)*.6+Math.sin(s.travel*7.13)*.4,b=h*(1+y*.035),x=b>s.level?.055:.14;s.level+=(b-s.level)*(1-Math.exp(-i/x)),s.gain.gain.setTargetAtTime(b,r,x),s.source.playbackRate.setTargetAtTime(_*(1+y*.008),r,.09),s.filter.frequency.setTargetAtTime(v,r,.11),h===0&&s.level<5e-4&&this.releaseVoice(s)}}releaseVoice(e){e.stopping||(e.stopping=!0,e.gain.gain.setTargetAtTime(0,this.context.currentTime,.008),e.source.stop(this.context.currentTime+.06))}silence(){for(let e of this.voices)this.releaseVoice(e)}disconnect(){this.output.disconnect(),this.highpass.disconnect()}dispose(){this.disposed||(this.disposed=!0,this.clip=null,this.silence(),this.voices.size||this.disconnect())}};function eg(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function tg(e,t,n){if(n)return 1;let r=(e.x-t.width/2)/Math.max(1,t.width),i=(e.y-t.height/2)/Math.max(1,t.height);return eg(1-Math.hypot(r,i))}function ng(e,t,n){return tg({x:e.x-t.x,y:e.y-t.y},n,!1)}var rg={radiusPx:92,coreRadiusPx:25,damage:100,impulse:1,ignite:!0};function ig(e=1){let t=Number.isFinite(e)?Math.max(.1,Math.min(3,e)):1;return{radiusPx:Math.max(40,rg.radiusPx*t),coreRadiusPx:rg.coreRadiusPx*t,damage:rg.damage*t,impulse:rg.impulse*t,ignite:rg.ignite}}function ag(e,t,n,r){if(r.width<=0||r.height<=0)return null;let i=0,a=1;for(let o of[`x`,`y`]){let s=t[o]-e[o],c=r[o]-n,l=c+(o===`x`?r.width:r.height)+n*2;if(Math.abs(s)<1e-8){if(e[o]<c||e[o]>l)return null;continue}let u=(c-e[o])/s,d=(l-e[o])/s;if(i=Math.max(i,Math.min(u,d)),a=Math.min(a,Math.max(u,d)),i>a)return null}return i<=1&&a>=0?i:null}var og=new WeakMap;function sg(e){let t=og.get(e);if(t)return t;let n=[],{columns:r,rows:i,solid:a}=e;for(let e=0;e<i;e++)for(let t=0;t<r;t++){let o=e*r+t;a[o]&&(t!==0&&t!==r-1&&e!==0&&e!==i-1&&a[o-1]&&a[o+1]&&a[o-r]&&a[o+r]||n.push(P(2*(t+.5)/r-1,2*(e+.5)/i-1)))}return og.set(e,n),n}function cg(e,t){for(let[n,i]of[[e,t],[t,e]]){let e=n.shape;for(let t of sg(n.mask.alpha)){let n=E(e.center,E(r(e.forward,t.x*e.halfLength),r(e.side,t.y*e.halfWidth)));if(gn(i.mask.alpha,i.shape,n))return!0}}return!1}function lg(e,t){let n=c(e.center,t.center),i=1/0,a=P(1);for(let o of[e.forward,e.side,t.forward,t.side]){let s=e.halfLength*Math.abs(A(o,e.forward))+e.halfWidth*Math.abs(A(o,e.side)),c=t.halfLength*Math.abs(A(o,t.forward))+t.halfWidth*Math.abs(A(o,t.side)),l=A(n,o),u=s+c-Math.abs(l);if(u<=0)return null;u<i&&(i=u,a=r(o,l<0?-1:1))}return{normal:a,depth:i}}function ug(e,t,n){let{sim:r}=e,i=t.documentScale(),a=P(Math.cos(r.body.angle),-Math.sin(r.body.angle));return{center:E(t.documentPoint(r.body.position),t.carVisualOffset(r)),forward:a,side:P(-a.y,a.x),halfLength:n.lengthM*i/2,halfWidth:n.widthM*i/2}}function dg(e,t,n,i,a,o){if(e.sim.mode!==`car`||e.sim.car.explodedAt!==null||e.isGhost)return null;let s=ug(e,t,n),l=ag(i,a,o,fn(n.alpha,s));if(l===null)return null;let u=c(a,i),d=Math.min(256,Math.max(1,Math.ceil(Math.hypot(u.x,u.y)/Math.max(2,o)))),f=Math.max(0,Math.floor(l*d)-1),p=o>0?[P(),P(o,0),P(-o,0),P(0,o),P(0,-o)]:[P()];for(let e=f;e<=d;e++){let t=E(i,r(u,e/d));if(p.some(e=>gn(n.alpha,s,E(t,e))))return t}return null}function fg(e,t,n,i){if(e.length<2)return;let a=t.documentScale(),s=e.filter(e=>e.sim.mode===`car`&&e.sim.car.explodedAt===null&&!e.isGhost).map(e=>{let r=n(e);return{entity:e,mask:r,shape:ug(e,t,r)}});for(let e=0;e<s.length;e++)for(let n=e+1;n<s.length;n++){let l=s[e],u=s[n],d=lg(l.shape,u.shape);if(!d||!cg(l,u))continue;let f=d.normal,p=P(f.x,-f.y),m=pn(l.mask.alpha,l.shape,r(f,-1)),h=pn(u.mask.alpha,u.shape,f),g=r(E(m,h),.5),_=t.worldFromDocument(g),v=l.entity.sim.body,y=u.entity.sim.body,b=l.shape,x=u.shape,S=c(_,v.position),C=c(_,y.position),w=A(c(v.velocityAt(_),y.velocityAt(_)),p),T=1/v.mass,D=1/y.mass,O=T+D,ee=(d.depth+.5)/a;if(v.position=E(v.position,r(p,ee*T/O)),y.position=c(y.position,r(p,ee*D/O)),l.shape={...l.shape,center:E(l.shape.center,r(f,(d.depth+.5)*T/O))},u.shape={...u.shape,center:c(u.shape.center,r(f,(d.depth+.5)*D/O))},w>=0)continue;let te=o(S,p),ne=o(C,p),k=O+te**2/v.inertia+ne**2/y.inertia,re=-(1+(w<-.8?.24:0))*w/k,j=r(p,re);v.impulse(j,_),y.impulse(r(j,-1),_);let ie=P(-p.y,p.x),ae=c(v.velocityAt(_),y.velocityAt(_)),oe=o(S,ie),se=o(C,ie),ce=O+oe**2/v.inertia+se**2/y.inertia,le=Math.max(-re*.38,Math.min(re*.38,-A(ae,ie)/ce)),ue=r(ie,le);v.impulse(ue,_),y.impulse(r(ue,-1),_);let de=-w;de<=.8||(l.entity.sim.car.takeImpact(de,v.local(_)),u.entity.sim.car.takeImpact(de,y.local(_)),l.entity.damage.hit(g,f,b,de,a),u.entity.damage.hit(g,r(f,-1),x,de,a),i?.({speedMps:de,point:g,velocity:r(c(v.velocity,y.velocity),a),normal:f,carNormal:vn(l.mask.alpha,b,m),pixelsPerMeter:a}))}}function pg(e){if(e.kind===`impact`||e.kind===`scrape`){let{element:t,...n}=e.impact,{element:r,...i}=e;return{...j({...i,impact:n}),element:r,impact:{...j(n),element:t}}}let{element:t,...n}=e;return{...j(n),element:t}}var mg=class{onObserverError;pending=[];listeners=new Set;draining=!1;constructor(e=e=>console.error(`Joy Ride event observer failed.`,e)){this.onObserverError=e}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}captureState(){return this.pending.map(pg)}restoreState(e){this.pending=e.map(pg)}emit(e){this.pending.push(e)}drain(e){if(this.draining||!this.pending.length)return;let t=this.pending;this.pending=[],this.draining=!0;try{for(let n of t){e(n);for(let e of[...this.listeners])if(this.listeners.has(e))try{e(n)}catch(e){try{this.onObserverError(e)}catch(e){console.error(`Joy Ride event observer error reporting failed.`,e)}}}}finally{this.draining=!1}}clear(){this.pending.length=0}},hg=.15,gg=class{renderer;id=`liquid`;sampleIntervalSeconds=hg;receivesOwnSources=!1;elapsed=0;constructor(e){this.renderer=e}sources(){return this.renderer.burningLiquidSources?.()??[]}expose(e,t){e.length?(this.elapsed+=t,!(this.elapsed<hg)&&(this.renderer.igniteLiquidsFromFire?.(e),this.elapsed%=hg)):this.elapsed=0}captureState(){return this.elapsed}restoreState(e){if(typeof e!=`number`||!Number.isFinite(e)||e<0)throw Error(`Invalid liquid heat checkpoint`);this.elapsed=e}reset(){this.elapsed=0}},_g=class{domains;conductiveDomains;heatClocks=new Map;constructor(e,t){this.domains=[{id:`scene`,sampleIntervalSeconds:1/15,canReceive:()=>e.hasFireTargets?.()??!0,receivesOwnSources:!0,sources:()=>e.burningFireSources?.()??[],expose:(t,n)=>e.exposeToFire?.(t,n)},new gg(t)],this.conductiveDomains=[{id:`liquid`,conduct:(e,n)=>t.hasConductiveLiquidNear?.(e,n)===!1?null:t.conductLightning?.(e,n)??null,ignite:(e,n)=>t.igniteConductedLiquids?.(e,n)}]}registerHeatDomain(e){if(this.domains.some(t=>t.id===e.id))throw Error(`Heat domain already registered: ${e.id}`);if(!!e.captureState!=!!e.restoreState)throw Error(`Heat domain checkpoint methods must be paired: ${e.id}`);return this.domains.push(e),this.heatClocks.set(e.id,0),()=>{let t=this.domains.indexOf(e);t>=0&&this.domains.splice(t,1),this.heatClocks.delete(e.id)}}registerConductiveDomain(e){if(this.conductiveDomains.some(t=>t.id===e.id))throw Error(`Conductive domain already registered: ${e.id}`);if(!!e.captureState!=!!e.restoreState)throw Error(`Conductive domain checkpoint methods must be paired: ${e.id}`);return this.conductiveDomains.push(e),()=>{let t=this.conductiveDomains.indexOf(e);t>=0&&this.conductiveDomains.splice(t,1)}}captureState(){let e=e=>e.map(e=>({id:e.id,state:j(e.captureState?.())}));return{heat:e(this.domains),heatClocks:this.domains.map(e=>({id:e.id,elapsed:this.heatClocks.get(e.id)??0})),conductive:e(this.conductiveDomains)}}validateState(e){let t=(e,t)=>e.length===t.length&&e.every((e,n)=>e.id===t[n].id);if(!t(e.heat,this.domains)||!t(e.heatClocks,this.domains)||!t(e.conductive,this.conductiveDomains))throw Error(`Material domain registry changed since the checkpoint`)}restoreState(e){this.validateState(e),this.domains.forEach((t,n)=>t.restoreState?.(j(e.heat[n].state))),this.heatClocks.clear();for(let{id:t,elapsed:n}of e.heatClocks)this.heatClocks.set(t,n);this.conductiveDomains.forEach((t,n)=>t.restoreState?.(j(e.conductive[n].state)))}reset(){this.heatClocks.clear();for(let e of this.domains)e.reset?.();for(let e of this.conductiveDomains)e.reset?.()}conduct(e,t){let n=[],r=new Set(e.map(e=>`${e.x}:${e.y}`)),i=new Set,a=e.map(e=>({point:e,origin:null,owner:null}));for(let e=0;e<8&&a.length;e++){let e=[];for(let o of this.conductiveDomains){let s=a.filter(e=>e.origin!==o.id);if(!s.length)continue;let c=o.conduct(s.map(e=>e.point),t);if(!c?.points.length)continue;let l=s.filter(e=>c.contains(e.point,t)),u={path:c,bridges:(l.length?l:s).map(({point:e,owner:t})=>({point:e,owner:t}))},d=!1;for(let t of c.points){let n=`${t.x}:${t.y}`;r.has(n)||(r.add(n),e.push({point:t,origin:o.id,owner:u}),d=!0)}(d||!i.has(o.id))&&n.push(u),i.add(o.id)}a=e}return{points:n.flatMap(({path:e})=>e.points),contains:(e,t=0)=>n.some(({path:n})=>n.contains(e,t)),intersects:(e,t=0)=>n.some(({path:n})=>n.intersects(e,t)),pathTo:(t,r=0)=>{let i=n.map(e=>({entry:e,local:e.path.pathTo(t,r)})).filter(({local:e})=>e.length).sort((e,n)=>{let r=e.local[e.local.length-1],i=n.local[n.local.length-1];return Math.hypot(r.x-t.x,r.y-t.y)-Math.hypot(i.x-t.x,i.y-t.y)})[0];if(!i)return[];let a=[...i.local],o=i.entry;for(;;){let e=o.bridges.filter(e=>e.owner).sort((e,t)=>Math.hypot(e.point.x-a[0].x,e.point.y-a[0].y)-Math.hypot(t.point.x-a[0].x,t.point.y-a[0].y))[0];if(!e?.owner)break;let t=e.owner.path.pathTo(e.point,r);(!a.length||Math.hypot(a[0].x-e.point.x,a[0].y-e.point.y)>1e-6)&&a.unshift(e.point),a=[...t,...a],o=e.owner}let s=e.reduce((e,t)=>!e||Math.hypot(t.x-a[0].x,t.y-a[0].y)<Math.hypot(e.x-a[0].x,e.y-a[0].y)?t:e,null);return s&&Math.hypot(s.x-a[0].x,s.y-a[0].y)>1e-6&&a.unshift(s),a.filter((e,t)=>t===0||Math.hypot(e.x-a[t-1].x,e.y-a[t-1].y)>1e-6)}}}igniteConducted(e,t){for(let n of this.conductiveDomains)n.ignite?.(e,t)}stepFire(e){let t=[...this.domains],n=t.map(t=>{let n=(this.heatClocks.get(t.id)??0)+e,r=t.sampleIntervalSeconds??0;return r>0&&n+1e-9<r?(this.heatClocks.set(t.id,n),0):(this.heatClocks.set(t.id,r>0?n%r:0),n)}),r=n.map((e,n)=>e>0&&t[n].canReceive?.()!==!1);if(!r.some(Boolean))return;let i=t.map((e,n)=>r.some((e,r)=>e&&(r!==n||t[r].receivesOwnSources))?e.sources().map(Zf):[]);t.forEach((e,t)=>{if(!r[t])return;let a=i.flatMap((n,r)=>t===r&&!e.receivesOwnSources?[]:n);e.expose(a,n[t])})}},vg={throttle:0,steer:0,action:!1,boost:!1},yg=class{world;state;version=3;disposed=!1;constructor(e,t){this.world=e,this.state=t}get available(){return!this.disposed}restore(){this.world.restoreState(this)}dispose(){this.disposed||(this.disposed=!0,this.state.renderer.dispose(),this.world.releaseCheckpoint(this))}},bg=class{renderer;odometer;sound;overlay;rocketBlastStrength;stateParticipants=new Map;registerStateParticipant(e,t){if(this.stateParticipants.has(e))throw Error(`State participant already registered: ${e}`);return this.stateParticipants.set(e,t),()=>this.stateParticipants.delete(e)}slowMo=new Ym;events=new mg;vehicleRegistry=new Map;drivers=new Map;driveTasks=new Map;tourFactory=null;driverTargets=new Map;cameraVehicleId=null;collisions;materialInteractions;checkpoints=new Set;flameDamageThisStep=new Map;stepSeconds=1/120;destructionPoints=0;disposed=!1;constructor(e,t,n,r,i,a,o=new wn,s={}){this.renderer=t,this.odometer=n,this.sound=r,this.overlay=i,this.rocketBlastStrength=a;let c=se(s);this.vehicleDestructible=c.vehicleDestructible,this.weaponsEnabled=c.weaponsEnabled,this.enabledTools=[...c.enabledTools],e&&this.spawnVehicle({id:`player`,sim:e,control:{kind:`player`}}),this.collisions=o,this.materialInteractions=new _g(o,t),o.setEvents(this.events),o.setAutoPaint?.(s.autoPaint??!1)}get playerVehicle(){return[...this.vehicleRegistry.values()].find(e=>!this.drivers.has(e.id))}get focusVehicle(){return this.playerVehicle??this.vehicleRegistry.values().next().value}get primaryVehicle(){let e=this.focusVehicle;if(!e)throw Error(`Game world has no vehicles`);return e}get sim(){return this.primaryVehicle.sim}get damage(){return this.primaryVehicle.damage}getVehicle(e){return this.vehicleRegistry.get(e)}get cameraVehicle(){return this.cameraVehicleId&&this.getVehicle(this.cameraVehicleId)||this.focusVehicle}watchVehicle(e,t=!0){return e!==null&&!this.vehicleRegistry.has(e)?!1:(this.cameraVehicleId=e,t&&(this.renderer.resumeFollow(),this.overlay&&this.cameraVehicle&&this.renderer.followDocument(this.cameraVehicle.sim)),!0)}get companionVehicles(){let e=this.focusVehicle;return[...this.vehicleRegistry.values()].filter(t=>t!==e)}get vehicles(){return[...this.vehicleRegistry.values()]}registerHeatDomain(e){return this.materialInteractions.registerHeatDomain(e)}registerConductiveDomain(e){return this.materialInteractions.registerConductiveDomain(e)}configureVehicle(e,t){let n=this.getVehicle(e);if(!n)return!1;if(t.appearance!==void 0&&![`auto`,`light`,`dark`].includes(t.appearance))throw TypeError(`Unknown vehicle appearance`);let r=t.slots===void 0?void 0:D(t.slots);return t.control?.kind===`player`&&this.playerVehicle&&this.playerVehicle!==n?!1:(t.preset&&this.collisions.prepare(t.preset),t.control&&this.setVehicleControl(e,t.control),t.preset&&t.preset!==n.sim.car.preset&&n.setPreset(t.preset),t.appearance!==void 0&&(n.appearance=t.appearance),r!==void 0&&(n.slots=r),n===this.focusVehicle&&this.projectFocusVehicle(!!t.preset),!0)}projectedSound;projectedPreset;projectFocusVehicle(e=!1){let t=this.focusVehicle;if(!t)return;let n=this.sound(),r=t.sim.car.preset;(n!==this.projectedSound||r!==this.projectedPreset)&&(n.setPreset(r),this.collisions.prepare(r),this.projectedSound=n,this.projectedPreset=r),e&&this.renderer.resetVehicleDamage()}resetEffects(){this.renderer.reset(),this.materialInteractions.reset()}fadeEffects(){this.materialInteractions.reset(),this.renderer.fadeEffects()}resetScene(){this.destructionPoints=0,this.events.clear(),this.collisions.reset?.(),this.fadeEffects();for(let e of this.vehicleRegistry.values())e.restoreHealth()}deformationEnabled=!0;weaponCooldownEnabled=!1;vehicleDestructible=!0;weaponsEnabled=!0;enabledTools=n.map(e=>e.id);setEnabledTools(e){this.enabledTools=[...new Set(e)];for(let e of this.vehicleRegistry.values())e.weapons.reset()}setVehicleDestructible(e){this.vehicleDestructible=e;for(let t of this.vehicleRegistry.values())t.sim.car.destructible=e,e||t.restoreHealth()}setWeaponsEnabled(e){if(this.weaponsEnabled=e,!e)for(let e of this.vehicleRegistry.values())e.weapons.reset()}setWeaponCooldownEnabled(e){this.weaponCooldownEnabled=e;for(let t of this.vehicleRegistry.values())e||t.weaponReserves.reset(),t.weaponReserves.enabled=e}setDeformationEnabled(e){this.deformationEnabled=e;for(let t of this.vehicleRegistry.values())t.damage.setEnabled(e)}spawnVehicle({id:e,sim:t,control:n,label:r=``}){if(this.vehicleRegistry.has(e))throw Error(`Vehicle ${e} already exists`);if(n.kind===`player`&&this.playerVehicle)throw Error(`Game world already has a player vehicle`);let i=new me(e,t);return t.car.destructible=this.vehicleDestructible,this.vehicleDestructible||i.restoreHealth(),i.weaponReserves.enabled=this.weaponCooldownEnabled,this.bindTourCommands(i),i.damage.setEnabled(this.deformationEnabled),i.label=r,i.controlSource=n.kind===`player`?`player`:`scripted`,this.vehicleRegistry.set(e,i),n.kind===`ai`&&(this.drivers.set(e,n.driver),n.targetId&&this.driverTargets.set(e,n.targetId)),this.focusVehicle===i&&this.renderer.bindVehicle(i),i}setVehicleControl(e,t){let n=this.vehicleRegistry.get(e);if(!n)return!1;if(t.kind===`player`){let t=this.playerVehicle;if(t&&t!==n)return!1;this.drivers.delete(e),this.driverTargets.delete(e)}else this.drivers.set(e,t.driver),t.targetId&&this.driverTargets.set(e,t.targetId);return n.controlSource=t.kind===`player`?`player`:`scripted`,this.focusVehicle===n&&this.renderer.bindVehicle(n),!0}removeVehicle(e){let t=this.vehicleRegistry.get(e);if(!t)return!1;this.stopVehicleTour(e),t.bindTourCommands(void 0),this.drivers.delete(e),this.driverTargets.delete(e),this.vehicleRegistry.delete(e),this.cameraVehicleId===e&&(this.cameraVehicleId=null),this.collisions.forgetVehicle(e),this.renderer.forgetVehicle(e),t.dispose();let n=this.focusVehicle;return n&&this.renderer.bindVehicle(n),!0}setVehicleTarget(e,t){return this.drivers.has(e)?(t?this.driverTargets.set(e,t):this.driverTargets.delete(e),!0):!1}getVehicleTarget(e){if(!this.drivers.has(e))return null;let t=this.driverTargets.get(e),n=t?this.vehicleRegistry.get(t)??null:this.vehicleRegistry.get(e)===this.focusVehicle?null:this.focusVehicle??null;return n?.id===e?null:n}bindTourCommands(e){e.bindTourCommands(this.tourFactory?{start:(t,n)=>this.startVehicleTour(e.id,t,n),stop:()=>this.stopVehicleTour(e.id)}:void 0)}setVehicleTourFactory(e){this.tourFactory=e;for(let e of this.vehicleRegistry.values())this.bindTourCommands(e)}startVehicleTour(e,t,n){let r=this.vehicleRegistry.get(e);if(!r||!this.tourFactory||!t.length)return!1;let i=this.tourFactory(r,t,n);return i?(this.stopVehicleTour(e),i.activate?.(),this.driveTasks.set(e,i),!0):!1}stopVehicleTour(e){let t=this.driveTasks.get(e);return t?(this.driveTasks.delete(e),t.cancel(),!0):!1}getVehicleTour(e){return this.driveTasks.get(e)??null}consumeEvent=e=>{let t=this.sound();switch(e.kind){case`impact`:t.playCrash(e.impact.speedMps),this.renderer.emitSparks(e.impact),this.renderer.emitCrashShake(e.impact.speedMps);break;case`scrape`:this.renderer.emitSparks(e.impact);break;case`crush`:t.playCrush(),this.awardPoints(e.point,e.points);break;case`combustionExplosion`:this.awardPoints(e.point,e.points),t.playCombustibleExplosion(this.overlay?ng(e.point,this.renderer.sceneScroll(),this.renderer.viewportSize()):1);break;case`destructibleDestroyed`:this.awardPoints(e.point,e.points)}};awardPoints(e,t){t<=0||(this.destructionPoints+=t,this.renderer.emitPoints(e,t))}get points(){return this.destructionPoints}get totalPoints(){return this.collisions.totalPoints}vehicleProjectileHit(e,t,n,r){let i=null;for(let a of this.vehicleRegistry.values()){if(a===e)continue;let o=dg(a,this.renderer,this.collisions.vehicleMask(a.sim.car.preset,a.damage),t,n,r);if(!o)continue;let s=u(c(o,t));(!i||s<i.distance)&&(i={vehicle:a,point:o,distance:s})}return i}nearestProjectileTarget(e,t,n,r){let i=this.vehicleProjectileHit(e,t,n,r),a=this.collisions.projectileHit(t,n,r);return i&&(!a||i.distance<u(c(a.point,t)))?{vehicle:i.vehicle,point:i.point,object:null}:a?{vehicle:null,point:a.point,object:a}:null}rocketCollision=(e,t,n,r)=>{this.collisions.setSourceVehicle?.(e.id);let i=this.rocketBlastStrength(),a=this.nearestProjectileTarget(e,t,n,r);if(!a)return null;let o=a.vehicle?a.point:this.collisions.rocketImpact(t,n,r,i,a.object??void 0);if(o){let r=ig(i),s=r.radiusPx;a.vehicle&&this.collisions.applyAreaImpact?.(o,r),r.ignite&&this.renderer.igniteLiquidAt?.(o,this.renderer.documentScale()*2.2);for(let t of this.vehicleRegistry.values()){if(t===e||t.sim.car.explodedAt!==null||t.isGhost)continue;let n=this.renderer.documentPoint(t.sim.body.position),i=u(c(n,o)),l=t===a.vehicle;if(!l&&i>s)continue;let d=l?1:Math.max(.2,1-i/s*.7);t.sim.car.damage(g(`rocket`,e.sim.car.preset)*d*r.damage/100),t.synchronizeLifecycle()}this.renderer.emitRocketExplosionShake(i),this.renderer.emitRocketExplosion(o,c(n,t),i)}return o};bulletCollision=(e,t,n,r)=>{this.collisions.setSourceVehicle?.(e.id);let i=this.nearestProjectileTarget(e,t,n,r);return i?i.vehicle?(i.vehicle.sim.car.damage(g(`bullet`,e.sim.car.preset)),i.vehicle.synchronizeLifecycle(),i.point):this.collisions.bulletImpact(t,n,r,i.object??void 0):null};stepLightning(){let{renderer:e,collisions:t}=this,n=e.documentScale();for(let r of this.vehicleRegistry.values()){let i=r.weapons.lightning,a=i.takeDischarge();if(!i.charging&&!a||r.sim.mode!==`car`||r.isGhost||r.lifecycleState!==`drivable`)continue;let o=Ve(r.sim.car.preset),s=e.documentPoint(r.sim.body.position),l=M(r.sim.car.preset,e.viewportSize?.().width,n)*n,d=[...this.vehicleRegistry.values()].filter(e=>e!==r&&e.sim.mode===`car`&&!e.isGhost&&e.lifecycleState===`drivable`),f=[...t.arcTargets?.(s,l)??[],...d.map(t=>({key:t,point:e.documentPoint(t.sim.body.position)}))].map(e=>({...e,distance:u(c(e.point,s)),score:_e(s,e.point,r.sim.body.angle,o.forwardBias)})).filter(e=>e.distance<=l).sort((e,t)=>e.score-t.score||e.distance-t.distance)[0];if(i.target=f?{...f.point}:null,!a)continue;let p=o.impactRadiusM*n,m={radiusPx:p,coreRadiusPx:p*.35,damage:o.damage,impulse:o.impulse,ignite:o.ignite},h=new Set,g=[],_=[],v=(e,t)=>{if(e.length<2||_.length>=8)return;let n=Math.max(1,Math.ceil(e.length/24)),r=e.filter((e,t)=>t%n===0);t?r.push(t):r.push(e[e.length-1]),_.push(r)},y=(n,i=!0)=>{t.setSourceVehicle?.(r.id);let a=c(n,s),l=u(a);t.applyAreaImpact?.(n,{...m,impulseDirection:l>.001?{x:a.x/l,y:a.y/l}:{x:Math.cos(r.sim.body.angle),y:-Math.sin(r.sim.body.angle)}},h),o.ignite&&e.igniteLiquidAt?.(n,p),i&&g.push({...n})};f&&y(f.point);let b=this.materialInteractions.conduct(f?[s,f.point]:[s],n*.4);if(b?.points.length){o.ignite&&this.materialInteractions.igniteConducted(b.points,n*.7);let e=l;for(let t of b.points)e=Math.max(e,u(c(t,s))+n);for(let r of t.arcTargets?.(s,e)??[]){let e=r.bounds&&b.intersects?b.intersects(r.bounds,n*.7):b.contains(r.point,n*.7);if(h.has(r.key)||!e)continue;y(r.point,!1);let t=r.bounds;if(v(b.pathTo(t?{x:t.x+t.width/2,y:t.y+t.height/2}:r.point,t?Math.hypot(t.width,t.height)/2+n*.7:n*.7),r.point),h.size>=64)break}_.length||v(b.pathTo(b.points[b.points.length-1]))}for(let t of d){let r=e.documentPoint(t.sim.body.position);if(u(c(r,s))>l&&!b?.contains(r,n*(.7+t.sim.car.preset.geometry.widthM*.5)))continue;let i=t.sim.car.statusEffects;i.remaining(`electrified`)<=0&&(t.sim.body.velocity.x*=o.speedFactor,t.sim.body.velocity.y*=o.speedFactor),i.apply(`electrified`,{lifetime:{unit:`seconds`,amount:o.statusSeconds},modifiers:{speed:o.speedFactor,driveForce:o.speedFactor},intensity:`constant`}),u(c(r,s))<=l?g.push(r):b&&v(b.pathTo(r,n*(.7+t.sim.car.preset.geometry.widthM*.5)),r)}i.discharge(g,_),this.sound().playElectricBolt(r===this.focusVehicle?1:.55)}}flameContact=(e,t,n,r,i)=>{this.collisions.setSourceVehicle?.(e.id);let a=this.nearestProjectileTarget(e,t,n,r);if(a?.vehicle){let t=this.flameDamageThisStep.get(a.vehicle.id)??0,n=Math.min(g(`flame`,e.sim.car.preset,i),Math.max(0,f.damagePerSecond*this.stepSeconds-t));return a.vehicle.sim.car.damage(n),this.flameDamageThisStep.set(a.vehicle.id,t+n),a.vehicle.synchronizeLifecycle(),a.point}return this.collisions.flameContact(t,n,r,i,ve(e.sim.car.preset))};gunshot=()=>this.sound().playGunshot();rocketLaunch=e=>this.sound().playRocketLaunch(this.overlay?tg(this.renderer.vehicleViewportPosition(e),this.renderer.viewportSize(),!1):1);rocketImpact=e=>this.sound().playRocketExplosion(this.overlay?tg(this.renderer.vehicleViewportPosition(e),this.renderer.viewportSize(),!1):1);bulletImpact=e=>this.sound().playBulletImpact(this.overlay?tg(this.renderer.vehicleViewportPosition(e),this.renderer.viewportSize(),!1):1);step(e={},t){let n=this.focusVehicle;if(!n)return;this.stepSeconds=t,this.flameDamageThisStep.clear(),performance.now();let{renderer:r,collisions:i}=this,a=n.sim,o=this.playerVehicle,s=this.drivers.size?r.worldFromDocument({x:0,y:0}):null,l=this.drivers.size?1/r.documentScale():0,d=this.drivers.size?{walls:i.wallRects().map(e=>{let t=s.x+e.x*l,n=s.y-e.y*l||0;return{left:t,right:t+e.width*l,bottom:n-e.height*l,top:n}}),vehicles:[...this.vehicleRegistry.values()].map(e=>({id:e.id,position:{...e.sim.body.position},velocity:{...e.sim.body.velocity},radiusM:Math.hypot(e.sim.car.preset.geometry.lengthM,e.sim.car.preset.geometry.widthM)/2}))}:void 0,f={...a.body.position},p=new Map,m={enabledTools:this.enabledTools,weaponsEnabled:this.weaponsEnabled};for(let n of this.vehicleRegistry.values()){p.set(n,{...n.sim.body.position}),n.synchronizeLifecycle(),n===o&&e.userDriven&&e.controls&&(e.controls.throttle!==0||e.controls.steer!==0||e.controls.brake||e.controls.action||e.controls.boost||e.controls.ghost)&&this.stopVehicleTour(n.id);let r=this.driveTasks.get(n.id),i=this.drivers.get(n.id);r?n.setControls(r.next(n,t),`scripted`,m):i?n.setControls(i(this.getVehicleTarget(n.id),n,t,d),`scripted`,m):n.setControls(e.controls??vg,e.userDriven?`player`:`scripted`,m),n.step(t,n===o?this.sound().rpm:null,n===o&&e.manualMoved),r?.afterPhysics(n,t),r?.complete&&this.driveTasks.delete(n.id)}o&&e.userDriven&&a.mode===`car`&&this.odometer.add(u(c(a.body.position,f)),r.documentScale()),e.afterPhysics?.();let h=this.cameraVehicle?.sim??a,g=this.overlay&&(e.allowFollow?.()??!0)&&u(h.body.velocity)>.1&&r.followDocument(h);if(a.barrier&&!this.overlay){let e={...a.body.velocity};a.contain(r.bounds());let t=u(c(e,a.body.velocity));a.mode===`car`&&a.car.takeImpact(t),this.sound().playCrash(t),r.emitCrashShake(t)}performance.now(),i.beginStep(r,t),performance.now();for(let e of this.vehicleRegistry.values()){let n=e.advanceBurn(t);if(n){let a=r.emitVehicleBurn(e,n,i.vehicleMask(e.sim.car.preset,e.damage),t);a&&this.events.emit({kind:`combustionExplosion`,point:a,points:0})}let a=p.get(e)??e.sim.body.position,o={...e.sim.body.position},s=c(o,a),l=Math.max(.25,e.sim.car.preset.geometry.widthM*.35),d=Math.min(16,Math.max(1,Math.ceil(u(s)/l)));d>1&&(e.sim.body.position={...a});for(let t=1;t<=d;t++){let n={x:a.x+s.x*t/d,y:a.y+s.y*t/d};if(e.sim.body.position={...n},i.stepVehicle(e.sim,r,e===this.cameraVehicle&&e.sim.barrier&&g,e.damage,e.id,e.isGhost),u(c(e.sim.body.position,n))>.02)break}e.synchronizeLifecycle()}let _=a.mode===`car`&&a.car.explodedAt===null&&n.controls.attractor&&!n.isGhost?{center:r.documentPoint(a.body.position),velocity:{x:a.body.velocity.x*r.documentScale(),y:-a.body.velocity.y*r.documentScale()},radiusPx:7*r.documentScale()}:null;if(i.endStep(t,_),performance.now(),this.vehicleRegistry.size>1){fg(this.vehicles,r,e=>i.vehicleMask(e.sim.car.preset,e.damage),e=>this.events.emit({kind:`impact`,impact:e}));for(let e of this.vehicleRegistry.values())e.synchronizeLifecycle()}this.stepLightning(),this.events.drain(this.consumeEvent),performance.now(),i.stepElementLiquids?.(r,e.manualMoved?this.companionVehicles:[n,...this.companionVehicles],t),r.advanceEffects(n,t,{walls:i.wallRects(),carMask:i.vehicleMask(a.car.preset,n.damage),tirePaintSources:e=>i.tirePaintAt(e),driven:!e.manualMoved,rocketCollision:this.rocketCollision,bulletCollision:this.bulletCollision,onGunshot:this.gunshot,flameContact:this.flameContact,onRocketLaunch:this.rocketLaunch,onRocketImpact:this.rocketImpact,onBulletImpact:this.bulletImpact,maskFor:e=>i.vehicleMask(e.sim.car.preset,e.damage),companions:this.companionVehicles}),performance.now(),this.materialInteractions.stepFire(t);let v=r.rocketFlightPosition,y=this.sound();y.setRocketFlightProximity(v?this.overlay?tg(r.vehicleViewportPosition(v),r.viewportSize(),!1):1:0),y.setBurningFireProximity(Math.max(i.burningProximity(r.documentPoint(a.body.position)),a.mode===`car`&&a.car.explodedAt===null?w(a.car.health,a.car.maxHealth):0)),this.events.drain(this.consumeEvent)}advanceTime(e){let t=this.slowMo.advance(e);return this.renderer.setSlowMoZoom(this.slowMo.zoomFactor),this.sound().setTimeScale?.(this.slowMo.speedFactor),t}present(e,t,n,r,i,a,o){let s=this.focusVehicle;if(!s)return;let{renderer:c}=this,l=s.sim;this.projectFocusVehicle();let d=this.playerVehicle?{...n,boost:l.lastInput.boost}:{...s.controls,boost:l.lastInput.boost};if(!document.hidden){let e=this.sound(),n=l.paused?0:u(l.body.velocity),o=l.mode===`car`&&!l.paused&&!s.isGhost?Qh(l,l.lastInput.action):[];e.setActive(l.mode===`car`&&i),s.isGhost&&e.silenceTires(),e.setGhostMode(!l.paused&&s.isGhost),e.setAttractor(!l.paused&&!!s.controls.attractor&&!s.isGhost);let f=0;!l.paused&&!s.isGhost&&(s.weapons.lightning.charging?f=.3+s.weapons.lightning.charge*.7:l.car.statusEffects.remaining(`electrified`)>0&&(f=.35)),e.setElectricCharge(f),e.setFlamethrowerFiring(!l.paused&&c.flamethrowerFiring),e.setBoosting(!l.paused&&l.car.boostActive);let p=d.throttle!==0||d.steer!==0||d.action||r;e.setProximity(this.overlay?tg(c.vehicleViewportPosition(l.body.position),c.viewportSize(),p):1),e.setMasterVolume(eg(a)),performance.now(),e.update(t*this.slowMo.speedFactor,d,n,0,0,l.mode===`car`?l.car.boostCharge:0,o);let m=e.takeExhaustPops();!l.paused&&l.mode===`car`&&c.queueExhaustPops(m)}c.render(s,e,o,this.collisions,this.companionVehicles)}snapshot(){let{sim:e}=this;return{mode:e.mode,presetId:e.car.preset.id,position:{...e.body.position},speed:u(e.body.velocity),angle:e.body.angle,spin:e.body.spin,paused:e.paused,health:e.car.health,maxHealth:e.car.maxHealth,burnStage:e.car.stage,points:this.destructionPoints}}saveState(){if(this.disposed)throw Error(`Game world has been disposed`);let e=[...this.vehicleRegistry.values()].map(e=>e.captureState()),t=this.collisions.captureState(),n=this.odometer.captureState(),r=this.events.captureState(),i=this.renderer.captureState(),a;try{a=new yg(this,{extensions:new Map([...this.stateParticipants].map(([e,t])=>[e,j(t.captureState())])),vehicles:e,drivers:new Map(this.drivers),driveTasks:new Map(this.driveTasks),driveTaskStates:new Map([...this.driveTasks].map(([e,t])=>[e,j(t.captureState())])),driverStates:new Map([...this.drivers].flatMap(([e,t])=>t.captureState?[[e,j(t.captureState())]]:[])),driverTargets:new Map(this.driverTargets),cameraVehicleId:this.cameraVehicleId,deformationEnabled:this.deformationEnabled,weaponCooldownEnabled:this.weaponCooldownEnabled,vehicleDestructible:this.vehicleDestructible,weaponsEnabled:this.weaponsEnabled,enabledTools:[...this.enabledTools],slowMo:this.slowMo.captureState(),collisions:t,odometer:n,events:r,points:this.destructionPoints,renderer:i,materialInteractions:this.materialInteractions.captureState()})}catch(e){throw i.dispose(),e}return this.checkpoints.add(a),a}restoreState(e){if(this.disposed||e.world!==this||!e.available)throw Error(`Checkpoint is unavailable for this game world`);let t=e.state;if(t.vehicles.length!==this.vehicleRegistry.size||t.vehicles.some(e=>!this.vehicleRegistry.has(e.id)))throw Error(`Checkpoint vehicle registry does not match`);this.materialInteractions.validateState(t.materialInteractions),this.drivers.clear(),this.driveTasks.clear(),this.driverTargets.clear(),this.deformationEnabled=t.deformationEnabled,this.weaponCooldownEnabled=t.weaponCooldownEnabled,this.vehicleDestructible=t.vehicleDestructible,this.weaponsEnabled=t.weaponsEnabled,this.enabledTools=[...t.enabledTools],this.slowMo.restoreState(t.slowMo),this.sound().setTimeScale?.(this.slowMo.speedFactor),this.destructionPoints=t.points,this.cameraVehicleId=t.cameraVehicleId;for(let[e,n]of t.drivers)this.drivers.set(e,n);for(let[e,n]of t.driveTasks)this.driveTasks.set(e,n);for(let[e,n]of t.driveTaskStates)this.driveTasks.get(e)?.restoreState(j(n));for(let[e,n]of t.driverStates)this.drivers.get(e)?.restoreState?.(j(n));for(let[e,n]of t.driverTargets)this.driverTargets.set(e,n);let n=this.focusVehicle;n&&this.renderer.bindVehicle(n),this.renderer.restoreState(t.renderer),this.materialInteractions.restoreState(t.materialInteractions);for(let e of t.vehicles){let t=this.vehicleRegistry.get(e.id);if(!t)throw Error(`Checkpoint vehicle is unavailable`);t.restoreState(e)}n&&this.collisions.prepare(n.sim.car.preset),this.collisions.restoreState(t.collisions),this.odometer.restoreState(t.odometer),this.events.restoreState(t.events);for(let[e,n]of t.extensions){let t=this.stateParticipants.get(e);if(!t)throw Error(`Checkpoint state participant is unavailable: ${e}`);t.restoreState(j(n))}}releaseCheckpoint(e){this.checkpoints.delete(e)}dispose(){if(!this.disposed){this.disposed=!0;for(let e of[...this.checkpoints])e.dispose();this.slowMo.reset(),this.sound().setTimeScale?.(1),this.events.clear(),this.collisions.destroy(),this.renderer.dispose();for(let e of this.vehicleRegistry.values())e.dispose();this.vehicleRegistry.clear(),this.drivers.clear(),this.driveTasks.clear(),this.stateParticipants.clear()}}},xg=10,Sg=class{active;step;render;stepSeconds;maxSteps;onError;simulationElapsed;frameId=0;running=!1;lastTime=null;accumulator=0;failure=null;constructor(e,t,n,r=1/120,i=12,a=e=>console.error(`Joy Ride stopped after a runtime failure.`,e),o=e=>e){this.active=e,this.step=t,this.render=n,this.stepSeconds=r,this.maxSteps=i,this.onError=a,this.simulationElapsed=o}get status(){return this.failure?`failed`:this.running?`running`:`stopped`}get error(){return this.failure?.error}reset(){this.lastTime=null,this.accumulator=0}advance(e){Pn();let t=this.lastTime===null?0:Math.max(0,(e-this.lastTime)/1e3),n=Math.min(t,.1);if(this.lastTime=e,this.active()){t>n&&this.simulationElapsed(t-n),this.simulationElapsed(0),this.accumulator+=n;let e=0,r=this.stepSeconds*1e-9,i=performance.now();for(;this.accumulator+r>=this.stepSeconds&&e<this.maxSteps&&(this.step(this.simulationElapsed(this.stepSeconds)),this.accumulator=Math.max(0,this.accumulator-this.stepSeconds),e++,!(e>=2&&performance.now()-i>xg)););if(this.accumulator+r>=this.stepSeconds){let e=this.accumulator-this.accumulator%this.stepSeconds;this.simulationElapsed(e),this.accumulator-=e}}else this.accumulator=0;this.render(e,n)}start(){this.running||(this.failure=null,this.running=!0,this.frameId=requestAnimationFrame(this.onFrame))}stop(){this.running=!1,this.frameId&&cancelAnimationFrame(this.frameId),this.frameId=0,this.reset()}onFrame=e=>{this.frameId=0;try{this.advance(e)}catch(e){this.stop(),this.failure={error:e},this.onError(e);return}this.running&&(this.frameId=requestAnimationFrame(this.onFrame))}};function Cg(e,t,...n){try{return t?.(...n)}catch(t){try{e(t)}catch(e){console.error(`Joy Ride host callback error reporting failed.`,e)}return}}function wg(e,t=0,n=1){let r=Math.max(0,Math.min(1,(e-t)/(n-t)));return 1-r*r*(3-2*r)}var Tg=(e,t,n)=>{let r=Math.max(0,Math.min(1,(n-e)/(t-e)));return r*r*(3-2*r)},Eg=class{sprites=new WeakMap;colors=new Map;colorCanvas=null;nextPhase=0;get(e,t,n,r,i=!1){if(t>=1)return e;let[a,o,s]=this.rgb(n),c=this.sprites.get(e);if(!c||c.canvas.width!==e.width||c.canvas.height!==e.height){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height,c={canvas:t,revision:-1,tint:-1,radialStep:-1,phase:this.nextPhase},this.nextPhase=(this.nextPhase+.61803398875)%1,this.sprites.set(e,c)}let l=Math.max(0,Math.min(1,Math.round(t*32+c.phase-.5)/32)),u=Math.round(a*l),d=Math.round(o*l),f=Math.round(s*l),p=u<<16|d<<8|f;if(i||c.revision!==r||c.tint!==p){Ye(`burn sprite recolors`);let t=c.canvas.getContext(`2d`);t&&(t.clearRect(0,0,e.width,e.height),t.globalCompositeOperation=`source-over`,t.drawImage(e,0,0),t.globalCompositeOperation=`source-in`,t.fillStyle=`rgb(${u} ${d} ${f})`,t.fillRect(0,0,e.width,e.height),t.globalCompositeOperation=`source-over`,c.revision=r,c.tint=p,c.radialStep=-1)}return c.canvas}getRadialBurn(e,t,n){let r=this.sprites.get(e);if(!r||r.canvas.width!==e.width||r.canvas.height!==e.height){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height,r={canvas:t,revision:-1,tint:-1,radialStep:-1,phase:0},this.sprites.set(e,r)}let i=Math.round(t.age*30);if(r.revision===n&&r.radialStep===i)return r.canvas;let a=r.canvas.getContext(`2d`);if(!a)return e;a.save(),a.clearRect(0,0,e.width,e.height),a.drawImage(e,0,0);let o=e=>{let n=a.createRadialGradient(t.originX,t.originY,0,t.originX,t.originY,Math.max(1,t.farthest));for(let r=0;r<=16;r++){let i=r/16,a=(t.age-i*t.spreadSeconds)/Math.max(.01,t.burnSeconds);n.addColorStop(i,`rgba(0, 0, 0, ${e(a)})`)}return n};return a.globalCompositeOperation=`source-atop`,a.fillStyle=o(e=>Tg(.12,.72,e)*.95),a.fillRect(0,0,e.width,e.height),a.globalCompositeOperation=`destination-out`,a.fillStyle=o(e=>1-wg(e,.78,1.02)),a.fillRect(0,0,e.width,e.height),a.restore(),r.revision=n,r.radialStep=i,r.tint=-1,r.canvas}bytesFor(e){let t=e&&this.sprites.get(e)?.canvas;return t?t.width*t.height*4:0}clear(){this.sprites=new WeakMap,this.colors.clear(),this.colorCanvas=null,this.nextPhase=0}rgb(e){let t=this.colors.get(e);if(t)return t;let n=this.colorCanvas??=document.createElement(`canvas`);n.width=n.height=1;let r=n.getContext(`2d`,{willReadFrequently:!0});if(!r)return[255,255,255];r.clearRect(0,0,1,1),r.fillStyle=e,r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data,a=[i[0],i[1],i[2]];return this.colors.set(e,a),a}};function Dg(e,t,n,r,i){if(!(r.speedMps>.8))return!1;let a=r.pixelsPerMeter,o=c(r.point,n.center);return e.car.takeImpact(r.speedMps,P(A(o,n.forward)/a,A(o,n.side)/a)),t?.hit(r.point,r.normal,n,r.speedMps,a),i(),!0}var Og=class{sources;cells=new Map;largeSources=[];cellSize=64;constructor(e){this.sources=e;for(let t of e){let e=t.bounds??{x:t.point.x,y:t.point.y,width:0,height:0},n=Math.floor((e.x-t.radiusPx)/this.cellSize),r=Math.floor((e.x+e.width+t.radiusPx)/this.cellSize),i=Math.floor((e.y-t.radiusPx)/this.cellSize),a=Math.floor((e.y+e.height+t.radiusPx)/this.cellSize);if((r-n+1)*(a-i+1)>256)this.largeSources.push(t);else for(let e=i;e<=a;e++)for(let i=n;i<=r;i++){let n=`${i}:${e}`,r=this.cells.get(n)??[];r.push(t),this.cells.set(n,r)}}}*near(e){let t=Math.floor(e.x/this.cellSize),n=Math.floor((e.x+e.width)/this.cellSize),r=Math.floor(e.y/this.cellSize),i=Math.floor((e.y+e.height)/this.cellSize);if((n-t+1)*(i-r+1)>256){for(let t of this.sources)this.overlaps(t,e)&&(yield t);return}let a=new Set;for(let e=r;e<=i;e++)for(let r=t;r<=n;r++)for(let t of this.cells.get(`${r}:${e}`)??[])a.has(t)||(a.add(t),yield t);for(let t of this.largeSources)this.overlaps(t,e)&&(yield t)}overlaps(e,t){let n=e.bounds??{x:e.point.x,y:e.point.y,width:0,height:0},r=e.radiusPx;return n.x-r<=t.x+t.width&&n.x+n.width+r>=t.x&&n.y-r<=t.y+t.height&&n.y+n.height+r>=t.y}},kg=343,Ag={vtwin:{label:`V-twin 90° 1.2`,cylinders:2,firingOrder:[1,2],banks:[[1],[2]],pinOffsets:{2:-90},idleRpm:1150,redlineRpm:9500,peakTorque:125,peakTorqueRpm:8e3,gears:6,engineInertia:.055,gasTempFactor:1.34,pulse:{attack:40,decay:6.5,hardness:.72,jitter:2},exhaust:{bank:.95,bankB:1.1,collector:.55,reflection:.5,damping:.34,muffler:[.16,.11,.075]},intake:{helmholtz:165,q:6,level:.4},voice:.92},i3:{label:`Inline-3 1.0`,cylinders:3,firingOrder:[1,2,3],banks:[[1,2,3]],idleRpm:850,redlineRpm:6500,peakTorque:200,peakTorqueRpm:2200,gears:5,engineInertia:.16,gasTempFactor:1.3,pulse:{attack:34,decay:5.5,hardness:.62,jitter:1.6},exhaust:{bank:1.45,collector:1.1,reflection:.55,damping:.42,muffler:[.32,.21,.14]},intake:{helmholtz:105,q:5.5,level:.34},voice:1},rotary2:{label:`Rotary 1.3 twin-rotor`,cylinders:4,firingOrder:[1,2,3,4],banks:[[1,2,3,4]],idleRpm:900,redlineRpm:9e3,peakTorque:220,peakTorqueRpm:5500,gears:5,engineInertia:.14,gasTempFactor:1.4,pulse:{attack:18,decay:3,hardness:.7,jitter:1.2},exhaust:{bank:1.05,collector:.8,reflection:.52,damping:.3,muffler:[.2,.13,.09]},intake:{helmholtz:145,q:6.6,level:.46},voice:.94},i4:{label:`Inline-4 2.0`,cylinders:4,firingOrder:[1,3,4,2],banks:[[1,2,3,4]],idleRpm:800,redlineRpm:7200,peakTorque:240,peakTorqueRpm:3900,gears:6,engineInertia:.19,gasTempFactor:1.28,pulse:{attack:38,decay:6.2,hardness:.66,jitter:1.1},exhaust:{bank:1.3,collector:1.05,reflection:.52,damping:.44,muffler:[.3,.19,.12]},intake:{helmholtz:118,q:6,level:.32},voice:.96},boxer4:{label:`Flat-4 boxer (unequal headers)`,cylinders:4,firingOrder:[1,3,2,4],banks:[[1,3],[2,4]],pinOffsets:{3:6,4:-6},idleRpm:800,redlineRpm:6800,peakTorque:300,peakTorqueRpm:3200,gears:6,engineInertia:.2,gasTempFactor:1.27,pulse:{attack:32,decay:5.4,hardness:.6,jitter:2.2},exhaust:{bank:1.62,bankB:.98,collector:1.15,reflection:.58,damping:.4,muffler:[.34,.22,.15]},intake:{helmholtz:100,q:5.2,level:.36},voice:1},i5:{label:`Inline-5 2.5`,cylinders:5,firingOrder:[1,2,4,5,3],banks:[[1,2,3,4,5]],idleRpm:820,redlineRpm:7e3,peakTorque:360,peakTorqueRpm:3200,gears:6,engineInertia:.24,gasTempFactor:1.29,pulse:{attack:33,decay:5.6,hardness:.64,jitter:1.5},exhaust:{bank:1.38,collector:1.08,reflection:.56,damping:.41,muffler:[.31,.2,.13]},intake:{helmholtz:108,q:5.6,level:.34},voice:1},i6:{label:`Inline-6 3.0`,cylinders:6,firingOrder:[1,5,3,6,2,4],banks:[[1,2,3,4,5,6]],idleRpm:750,redlineRpm:7e3,peakTorque:420,peakTorqueRpm:3e3,gears:7,engineInertia:.27,gasTempFactor:1.28,pulse:{attack:30,decay:5,hardness:.58,jitter:.7},exhaust:{bank:1.55,collector:1.2,reflection:.54,damping:.38,muffler:[.33,.21,.14]},intake:{helmholtz:95,q:6.4,level:.33},voice:.98},i6diesel:{label:`Inline-6 diesel 6.7`,cylinders:6,firingOrder:[1,5,3,6,2,4],banks:[[1,2,3,4,5,6]],idleRpm:640,redlineRpm:4600,peakTorque:950,peakTorqueRpm:1900,gears:8,engineInertia:.62,gasTempFactor:1.16,pulse:{attack:68,decay:9.5,hardness:.88,jitter:1.4},exhaust:{bank:1.35,collector:1.65,reflection:.52,damping:.6,muffler:[.46,.3,.2]},intake:{helmholtz:88,q:4.6,level:.24},voice:1.02},v6:{label:`V6 60°`,cylinders:6,firingOrder:[1,4,2,5,3,6],banks:[[1,2,3],[4,5,6]],idleRpm:780,redlineRpm:6800,peakTorque:380,peakTorqueRpm:3600,gears:6,engineInertia:.26,gasTempFactor:1.28,pulse:{attack:31,decay:5.2,hardness:.61,jitter:1.3},exhaust:{bank:1.2,collector:1.05,reflection:.56,damping:.4,muffler:[.3,.2,.13]},intake:{helmholtz:102,q:5.8,level:.33},voice:.98},v6tt:{label:`V6 3.8 twin-turbo build`,cylinders:6,firingOrder:[1,4,2,5,3,6],banks:[[1,2,3],[4,5,6]],idleRpm:750,redlineRpm:7100,peakTorque:640,peakTorqueRpm:3600,gears:7,engineInertia:.29,gasTempFactor:1.22,pulse:{attack:29,decay:5,hardness:.6,jitter:1.2},exhaust:{bank:.95,collector:1.3,reflection:.5,damping:.52,muffler:[.34,.23,.15]},intake:{helmholtz:112,q:5.4,level:.3},voice:.98},flat6:{label:`Flat-6 3.8`,cylinders:6,firingOrder:[1,6,2,4,3,5],banks:[[1,2,3],[4,5,6]],idleRpm:800,redlineRpm:8500,peakTorque:420,peakTorqueRpm:5e3,gears:7,engineInertia:.22,gasTempFactor:1.31,pulse:{attack:44,decay:7,hardness:.74,jitter:.9},exhaust:{bank:.85,collector:.72,reflection:.48,damping:.3,muffler:[.22,.15,.1]},intake:{helmholtz:138,q:7.2,level:.42},voice:1},v8cross:{label:`V8 cross-plane 5.0`,cylinders:8,firingOrder:[1,8,7,3,6,5,4,2],banks:[[1,2,3,4],[5,6,7,8]],idleRpm:700,redlineRpm:7e3,peakTorque:540,peakTorqueRpm:4200,gears:6,engineInertia:.38,gasTempFactor:1.26,pulse:{attack:26,decay:4.4,hardness:.55,jitter:2.6},exhaust:{bank:1.75,collector:1.35,reflection:.63,damping:.34,muffler:[.4,.26,.17]},intake:{helmholtz:78,q:5,level:.3},voice:1.06},v8tt:{label:`V8 4.0 twin-turbo build`,cylinders:8,firingOrder:[1,8,7,3,6,5,4,2],banks:[[1,2,3,4],[5,6,7,8]],idleRpm:660,redlineRpm:6800,peakTorque:800,peakTorqueRpm:3e3,gears:8,engineInertia:.42,gasTempFactor:1.21,pulse:{attack:24,decay:4.2,hardness:.54,jitter:2.4},exhaust:{bank:1.1,collector:1.55,reflection:.58,damping:.55,muffler:[.42,.28,.18]},intake:{helmholtz:74,q:4.8,level:.28},voice:1.05},v8flat:{label:`V8 flat-plane 4.5`,cylinders:8,firingOrder:[1,5,3,7,4,8,2,6],banks:[[1,2,3,4],[5,6,7,8]],idleRpm:900,redlineRpm:9e3,peakTorque:460,peakTorqueRpm:6e3,gears:7,engineInertia:.25,gasTempFactor:1.33,pulse:{attack:52,decay:8.4,hardness:.82,jitter:.6},exhaust:{bank:.78,collector:.62,reflection:.44,damping:.26,muffler:[.18,.12,.08]},intake:{helmholtz:155,q:7.8,level:.44},voice:1},v10:{label:`V10 5.2`,cylinders:10,firingOrder:[1,6,5,10,2,7,3,8,4,9],banks:[[1,2,3,4,5],[6,7,8,9,10]],idleRpm:900,redlineRpm:8700,peakTorque:560,peakTorqueRpm:6500,gears:7,engineInertia:.3,gasTempFactor:1.32,pulse:{attack:48,decay:7.8,hardness:.8,jitter:.8},exhaust:{bank:.82,collector:.66,reflection:.46,damping:.27,muffler:[.19,.13,.09]},intake:{helmholtz:148,q:7.4,level:.45},voice:1.02},v12:{label:`V12 6.5`,cylinders:12,firingOrder:[1,7,5,11,3,9,6,12,2,8,4,10],banks:[[1,2,3,4,5,6],[7,8,9,10,11,12]],idleRpm:850,redlineRpm:8500,peakTorque:690,peakTorqueRpm:5800,gears:8,engineInertia:.36,gasTempFactor:1.31,pulse:{attack:46,decay:7.4,hardness:.78,jitter:.5},exhaust:{bank:.9,collector:.7,reflection:.47,damping:.28,muffler:[.2,.14,.09]},intake:{helmholtz:142,q:7,level:.44},voice:1.04}};function jg(e){let t=720/e.cylinders,n=new Map;return e.firingOrder.forEach((r,i)=>{let a=e.pinOffsets&&e.pinOffsets[r]||0;n.set(r,(i*t+a+720)%720)}),n}function Mg(e,t){let n=jg(e);return e.banks[t].map(e=>n.get(e)).sort((e,t)=>e-t)}function Ng(e,t=1){return kg*t/(4*Math.max(.05,e))}function Pg(e,t=1){return 2*Math.max(.05,e)/(kg*t)}var Fg={hatch:{label:`Hot hatch`,mass:1320,wheelRadius:.31,finalDrive:4.05,gearRatios:[3.31,2.13,1.48,1.14,.95,.82],dragArea:.68,rollingResistance:.014,brakeForce:9500,gearbox:`manual`,shiftTimeMs:130,gearTeeth:[37,31,27,24,22,20]},sports:{label:`Sports car`,mass:1450,wheelRadius:.33,finalDrive:3.73,gearRatios:[3.55,2.05,1.39,1,.82,.67],dragArea:.62,rollingResistance:.013,brakeForce:12e3,gearbox:`manual`,shiftTimeMs:95,gearTeeth:[39,33,28,25,22,19]},supercar:{label:`Supercar (dual-clutch)`,mass:1560,wheelRadius:.34,finalDrive:3.9,gearRatios:[3.08,2.19,1.63,1.29,1.03,.84,.69],dragArea:.6,rollingResistance:.012,brakeForce:15e3,gearbox:`dct`,shiftTimeMs:45,gearTeeth:[41,35,30,26,23,20,18]},muscle:{label:`Muscle car`,mass:1720,wheelRadius:.35,finalDrive:3.55,gearRatios:[2.97,2.07,1.43,1,.71],dragArea:.78,rollingResistance:.016,brakeForce:11e3,gearbox:`manual`,shiftTimeMs:150,gearTeeth:[35,30,26,23,20]},truck:{label:`Pickup (automatic)`,mass:2400,wheelRadius:.38,finalDrive:3.73,gearRatios:[4.17,2.34,1.52,1.14,.87,.69],dragArea:1.05,rollingResistance:.018,brakeForce:13e3,gearbox:`auto`,shiftTimeMs:190,gearTeeth:[43,36,31,27,24,21]}},Ig={stiffness:5200,dampingRatio:.22,damping:13,backlash:.035,clutchTorqueCapacity:900,clutchStiffness:3.2},Lg=(e,t,n)=>e<t?t:e>n?n:e,Rg=(e,t)=>typeof e==`number`&&isFinite(e)?e:t,zg=Object.freeze({mix:Object.freeze({exhaust:1,intake:.75,transmission:.45,turbo:.4,transients:.42,sub:.25}),tone:Object.freeze({rumble:1,brightness:1,punch:1}),eq:Object.freeze([0,0,0,0,0]),fx:Object.freeze({reverbMix:.14,reverbSize:.32,reverbDamping:4200,width:.35,popDepth:1.05,dynamics:1}),turbo:Object.freeze({enabled:0,inertia:.42,maxBoost:1.1,whineOrder:52,boostRpm:3500,valve:1,bov:.4,surge:1,flutterHz:13,screamer:0,antiLag:0}),position:0,volume:.7}),Bg=Object.freeze([{path:`engine.idleRpm`,label:`Idle`,min:400,max:2500,step:10,unit:`rpm`,group:`engine`,rebuild:!1},{path:`engine.redlineRpm`,label:`Redline`,min:3e3,max:12e3,step:100,unit:`rpm`,group:`engine`,rebuild:!1},{path:`engine.peakTorque`,label:`Peak torque`,min:40,max:1400,step:5,unit:`N·m`,group:`engine`,rebuild:!1},{path:`engine.peakTorqueRpm`,label:`Torque peak at`,min:1200,max:9e3,step:100,unit:`rpm`,group:`engine`,rebuild:!1},{path:`engine.gears`,label:`Gears`,min:3,max:10,step:1,unit:``,group:`engine`,rebuild:!0},{path:`engine.engineInertia`,label:`Rotating inertia`,min:.02,max:1.2,step:.005,unit:`kg·m²`,group:`engine`,rebuild:!1},{path:`engine.gasTempFactor`,label:`Gas temperature`,min:.8,max:1.8,step:.01,unit:`×c`,group:`engine`,rebuild:!0},{path:`engine.voice`,label:`Voice level`,min:.2,max:2,step:.01,unit:`%`,group:`engine`,rebuild:!1},{path:`engine.pulse.attack`,label:`Blowdown attack`,min:5,max:90,step:1,unit:``,group:`pulse`,rebuild:!0},{path:`engine.pulse.decay`,label:`Blowdown decay`,min:1,max:14,step:.1,unit:``,group:`pulse`,rebuild:!0},{path:`engine.pulse.hardness`,label:`Load hardening`,min:0,max:1.5,step:.01,unit:``,group:`pulse`,rebuild:!0},{path:`engine.pulse.jitter`,label:`Cylinder jitter`,min:0,max:6,step:.1,unit:``,group:`pulse`,rebuild:!0},{path:`engine.exhaust.bank`,label:`Header length`,min:.2,max:2.5,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.collector`,label:`Collector length`,min:.2,max:3,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.reflection`,label:`End reflection`,min:.05,max:.9,step:.01,unit:``,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.damping`,label:`Pipe damping`,min:.1,max:1.5,step:.01,unit:``,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.muffler.0`,label:`Muffler stage 1`,min:0,max:.8,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.muffler.1`,label:`Muffler stage 2`,min:0,max:.8,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.muffler.2`,label:`Muffler stage 3`,min:0,max:.8,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.intake.helmholtz`,label:`Plenum resonance`,min:40,max:400,step:1,unit:`Hz`,group:`intake`,rebuild:!0},{path:`engine.intake.q`,label:`Plenum Q`,min:.5,max:14,step:.1,unit:``,group:`intake`,rebuild:!0},{path:`engine.intake.level`,label:`Induction level`,min:0,max:1.5,step:.01,unit:`%`,group:`intake`,rebuild:!0},{path:`turbo.enabled`,label:`Turbo`,min:0,max:1,step:1,unit:`bool`,group:`turbo`,rebuild:!1},{path:`turbo.inertia`,label:`Turbo inertia`,min:.05,max:2,step:.01,unit:`s`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.boostRpm`,label:`Boost onset`,min:1200,max:7e3,step:100,unit:`rpm`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.maxBoost`,label:`Max boost`,min:.2,max:3,step:.05,unit:`bar`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.whineOrder`,label:`Blade order`,min:10,max:120,step:1,unit:``,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.valve`,label:`Blow-off valve`,min:0,max:2,step:1,unit:`enum`,options:[`None`,`Atmos`,`Recirc`],group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.bov`,label:`Valve size`,min:0,max:1,step:.01,unit:`%`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.surge`,label:`Flutter trim`,min:0,max:2,step:.01,unit:`%`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.flutterHz`,label:`Flutter rate`,min:5,max:25,step:.5,unit:`Hz`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.screamer`,label:`Screamer pipe`,min:0,max:1,step:1,unit:`bool`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.antiLag`,label:`Anti-lag`,min:0,max:1,step:1,unit:`bool`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`mix.exhaust`,label:`Exhaust`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.intake`,label:`Intake`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.transmission`,label:`Gearbox`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.turbo`,label:`Turbo`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.transients`,label:`Pops`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.sub`,label:`Sub`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`tone.rumble`,label:`Rumble`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`tone.brightness`,label:`Brightness`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`tone.punch`,label:`Bass punch`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`fx.popDepth`,label:`Pop depth`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`fx.dynamics`,label:`Compression`,min:0,max:1,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`fx.reverbMix`,label:`Reverb mix`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`fx.reverbSize`,label:`Reverb size`,min:.05,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`fx.reverbDamping`,label:`Reverb damping`,min:800,max:12e3,step:100,unit:`Hz`,group:`fx`,rebuild:!1},{path:`fx.width`,label:`Stereo width`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`position`,label:`Listener position`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`volume`,label:`Volume`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`eq.0`,label:`Sub 60`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.1`,label:`Body 200`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.2`,label:`Honk 800`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.3`,label:`Rasp 2.5k`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.4`,label:`Air 8k`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1}]),Vg=Object.freeze([{id:`engine`,label:`Engine`,note:`The machine itself. Torque and inertia drive the physics; gas temperature sets the speed of sound in the pipes.`},{id:`pulse`,label:`Combustion pulse`,note:`The shape of one cylinder blowing down. Attack is the crack, decay is the tail, hardening is how much both sharpen under load.`},{id:`exhaust`,label:`Exhaust`,note:`Waveguide geometry in metres. Header and collector lengths set the resonances; reflection and damping set how many survive.`},{id:`intake`,label:`Intake`,note:`Airbox Helmholtz resonance. It does not track rpm — what tracks rpm is how hard it is excited.`},{id:`turbo`,label:`Turbo`,note:`Bolts onto any engine. Inertia is lag. No blow-off valve = full "stu-stu-stu"; an atmospheric valve goes "pssh", a recirculating one is quiet — the bigger the valve, the less is left to flutter. A screamer pipe vents the wastegate to air; anti-lag keeps the turbo spooled off-throttle, with bangs.`},{id:`mix`,label:`Voice mix`,note:`Balance between the voices.`},{id:`tone`,label:`Tone`,note:`The fixed-frequency part of the response, plus how hard the compressor works.`},{id:`fx`,label:`Space`,note:`Reverb, width, where the listener is, and output level.`},{id:`eq`,label:`EQ`,note:`Five bands, ±18 dB.`}]);function Hg(e,t){let n=e;for(let e of t.split(`.`)){if(n==null)return;n=n[e]}return n}function Ug(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e++)(i[r[e]]==null||typeof i[r[e]]!=`object`)&&(i[r[e]]={}),i=i[r[e]];return i[r[r.length-1]]=n,e}function Wg(e){return Bg.find(t=>t.path===e)}function Gg(e){if(Array.isArray(e))return e.map(Gg);if(e&&typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=Gg(e[n]);return t}return e}function Kg(e){let t=Ag[e];return t?Jg({version:3,id:e,label:t.label,engine:Gg(t),...Gg(zg)}):null}function qg(){let e={};for(let t of Object.keys(Ag))e[t]=Kg(t);return e}function Jg(e){let t=e&&typeof e==`object`?e:{},n=Ag[t.id]||Ag.v8cross,r={version:3,id:typeof t.id==`string`&&t.id?t.id:`custom`,label:typeof t.label==`string`&&t.label?t.label:n.label,engine:{},mix:{},tone:{},eq:[],fx:{},turbo:{},position:0,volume:.7},i=t.engine&&typeof t.engine==`object`?t.engine:n,a=Lg(Math.round(Rg(i.cylinders,n.cylinders)),1,16);r.engine.cylinders=a;let o=Array.isArray(i.firingOrder)?i.firingOrder.slice(0,a):null,s=o&&o.length===a&&o.every(e=>Number.isInteger(e)&&e>=1&&e<=a)&&new Set(o).size===a;r.engine.firingOrder=s?o:n.cylinders===a?Gg(n.firingOrder):Array.from({length:a},(e,t)=>t+1);let c=Array.isArray(i.banks)?i.banks.filter(Array.isArray):null,l=c?c.flat():[],u=c&&c.length>0&&l.length===a&&l.every(e=>r.engine.firingOrder.includes(e));if(r.engine.banks=u?Gg(c):n.cylinders===a?Gg(n.banks):[r.engine.firingOrder.slice()],i.pinOffsets&&typeof i.pinOffsets==`object`){let e={};for(let[t,n]of Object.entries(i.pinOffsets)){let r=Number(t);Number.isInteger(r)&&r>=1&&r<=a&&(e[r]=Lg(Rg(n,0),-360,360))}Object.keys(e).length&&(r.engine.pinOffsets=e)}let d=Rg(i.exhaust&&i.exhaust.bankB,NaN);r.engine.exhaust={},isFinite(d)&&r.engine.banks.length>1&&(r.engine.exhaust.bankB=Lg(d,.2,2.5));let f=!(t.turbo&&typeof t.turbo==`object`)&&i.turbo&&typeof i.turbo==`object`?{...i.turbo,enabled:1}:null,p=f?{...t,turbo:f}:t,m={engine:n,...zg};for(let e of Bg){let t=Hg(p,e.path);isFinite(Number(t))||(t=Hg(m,e.path)),isFinite(Number(t))||(t=e.min);let n=Lg(Number(t),e.min,e.max);Ug(r,e.path,e.unit===`bool`||e.unit===`enum`?Math.round(n):n)}let h=r.engine.exhaust.muffler;return r.engine.exhaust.muffler=[0,1,2].map(e=>Lg(Rg(h&&h[e],.2),0,.8)),r.eq=[0,1,2,3,4].map(e=>Lg(Rg(r.eq[e],0),-18,18)),r}function Yg(e){return JSON.stringify(Jg(e),null,2).replace(/\[\s+((?:-?[\d.]+,?\s+)+)\]/g,(e,t)=>`[`+t.trim().replace(/,\s+/g,`, `)+`]`)}function Xg(e){let t;try{t=JSON.parse(String(e))}catch(e){return{preset:null,error:`not valid JSON: `+e.message}}return!t||typeof t!=`object`?{preset:null,error:`not an object`}:{preset:Jg(t),error:null}}var Zg=8192,Qg=1024;function $g(e,t){let n=e.length;for(let r=1,i=0;r<n;r++){let a=n>>1;for(;i&a;a>>=1)i^=a;if(i^=a,r<i){let n=e[r];e[r]=e[i],e[i]=n,n=t[r],t[r]=t[i],t[i]=n}}for(let r=2;r<=n;r<<=1){let i=-2*Math.PI/r,a=Math.cos(i),o=Math.sin(i);for(let i=0;i<n;i+=r){let n=1,s=0;for(let c=0;c<r/2;c++){let l=e[i+c],u=t[i+c],d=e[i+c+r/2]*n-t[i+c+r/2]*s,f=e[i+c+r/2]*s+t[i+c+r/2]*n;e[i+c]=l+d,t[i+c]=u+f,e[i+c+r/2]=l-d,t[i+c+r/2]=u-f;let p=n*a-s*o;s=n*o+s*a,n=p}}}}function e_(e){let t=e>>>0||1;return()=>(t^=t<<13,t>>>=0,t^=t>>17,t^=t<<5,t>>>=0,t/4294967296)}function t_(e,t,n){return e<0||e>1?0:(1-Math.exp(-t*e))*Math.exp(-n*e)}function n_(e,t,n,r=0){let i=e.pulse,a=Math.max(0,Math.min(1.5,typeof i.hardness==`number`&&isFinite(i.hardness)?i.hardness:.65))/.65,o=i.attack*(.55+.85*a*n),s=i.decay*(1.25-.35*a*n),c=new Float64Array(Zg),l=e_(e.cylinders*2654435761+Math.round(i.attack*97)),u=(i.jitter||0)/100;for(let e of t){let t=1+(l()*2-1)*u*2.5,n=(l()*2-1)*u*6,i=1+(l()*2-1)*u*1.5,a=((e+r+n)%720+720)%720/720;for(let e=0;e<Zg;e++){let n=e/Zg-a;n<0&&(n+=1),c[e]+=t*t_(n,o,s*i)}}return c}function r_(e){let t=e.length,n=new Float64Array(t);for(let r=0;r<t;r++)n[r]=e[(r+1)%t]-e[r];let r=0;for(let e=0;e<t;e++)r+=n[e];r/=t;for(let e=0;e<t;e++)n[e]-=r;return n}var i_=24;function a_(e,t=Qg,n=i_){let r=e.length,i=new Float64Array(r),a=new Float64Array(r);i.set(e),$g(i,a);let o=Math.min(t,r/2),s=new Float32Array(o),c=new Float32Array(o),l=n>0?2*n:0;for(let e=1;e<o;e++){let t=l?1/(1+e/l):1;s[e]=2*i[e]/r*t,c[e]=-2*a[e]/r*t}return s[0]=0,c[0]=0,{real:s,imag:c}}function o_(e,t=.25){let n=0;for(let t=1;t<e.real.length;t++)n+=.5*(e.real[t]**2+e.imag[t]**2);let r=t/(Math.sqrt(n)||1);for(let t=0;t<e.real.length;t++)e.real[t]*=r,e.imag[t]*=r;return e}function s_(e,t,n){let r={disableNormalization:!0},i=(n,i,a)=>{let o=o_(a_(r_(n_(t,n,i,a))));return e.createPeriodicWave(o.real,o.imag,r)},a=t.banks.map((e,r)=>{let a=n(t,r);return{soft:i(a,0,0),hard:i(a,1,0)}}),o=t.banks.flat().map((e,n)=>n*720/t.cylinders);return{banks:a,intake:{soft:i(o,0,360),hard:i(o,1,360)}}}function c_(e,t,n){let r=Math.max(.02,Number(e.engineInertia)||.25),i=Math.max(1,e.cylinders||4),a=Math.max(40,(Number(t)||0)*Math.PI/30),o=.3*((Number(e.peakTorque)||300)*(.12+.88*Math.max(0,Math.min(1,n))))*(4*Math.PI/i)/(r*a*a);return Math.max(0,Math.min(.12,o))}function l_(e,t){let n=e.pulse,r=(n.jitter||0)/100,i=e_(e.cylinders*2654435761+Math.round(n.attack*97)+7),a=[],o=e.banks.length,s=[];for(let n=0;n<o;n++)for(let o of t(e,n)){let e=1+(i()*2-1)*r*2.5,t=(i()*2-1)*r*6,c=1+(i()*2-1)*r*1.5,l=((o+t)%720+720)%720/720;a.push({out:n,angle:l,ampTrim:e,decayTrim:c}),s.push({angle:o+t+360,ampTrim:e,decayTrim:c})}for(let e of s)a.push({out:o,angle:(e.angle%720+720)%720/720,ampTrim:e.ampTrim,decayTrim:e.decayTrim});let c=Math.max(0,Math.min(1.5,typeof n.hardness==`number`&&isFinite(n.hardness)?n.hardness:.65))/.65,l=Zg,u=1-Math.exp(-2*Math.PI*48/l),d=[];for(let e=0;e<=o;e++){let t=[];for(let r=0;r<=4;r++){let i=r/4*c,o=n.attack*(.55+.85*i),s=n.decay*(1.25-.35*i),d=new Float64Array(l);for(let t of a)if(t.out===e)for(let e=0;e<l;e++){let n=e/l-t.angle;n<0&&(n+=1),d[e]+=t.ampTrim*t_(n,o,s*t.decayTrim)}let f=0,p=0;for(let e=0;e<2;e++)for(let t=0;t<l;t++){let n=(d[t]-d[(t+l-1)%l])*l;f+=u*(n-f),e&&(p+=f*f)}let m=Math.sqrt(p/l)||1;t.push(.25/m)}d.push(t)}return{events:a.sort((e,t)=>e.angle-t.angle),outputs:o+1,attack:n.attack,decay:n.decay,hardness:c,ccv:typeof n.ccv==`number`?n.ccv:.012+.012*(n.jitter||1),jitterDeg:typeof n.jitterDeg==`number`?n.jitterDeg:.4+.5*(n.jitter||1),gains:d,seed:e.cylinders*40503+Math.round(n.attack*131)>>>0}}var u_=1.02,d_=10,f_=2e4,p_=.92,m_=.02,h_=.09,G=(e,t,n)=>e<t?t:e>n?n:e;function K(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function g_(e,t,n,r=m_){let i=K(t,0),a=K(n,0);e.setTargetAtTime(i,a<0?0:a,r>0?r:m_)}function __(e,t,n,r){let i=2*Math.PI*G(t,1,.49*r)/r,a=Math.cos(i),o=Math.sin(i)/(2*Math.max(1e-4,n)),s=1+o,c=(1-a)/2/s,l=(1-a)/s,u=c,d=-2*a/s,f=(1-o)/s,p=2*Math.PI*G(e,.01,.49*r)/r,m=Math.cos(p),h=Math.sin(p),g=Math.cos(2*p),_=Math.sin(2*p),v=c+l*m+u*g,y=-(l*h+u*_),b=1+d*m+f*g,x=-(d*h+f*_),S=Math.atan2(y,v)-Math.atan2(x,b);return Number.isFinite(S)?S:0}function v_(e,t,n,r){let i=2*Math.PI*e;if(!(i>0))return 0;let a=__(e,t,n,r),o=(Math.PI+a)/i;return o>0&&Number.isFinite(o)?o:1/(2*e)}var y_=new Map;function b_(e,t,n=4096,r=x_()){let i=e+`:`+t+`:`+n+`:`+r,a=y_.get(i);if(a)return a;let o=1/Math.max(.2,e/3.2)*1.05,s=1/Math.max(.2,t/3.2)*.85,c=new Float32Array(n);for(let e=0;e<n;e++){let t=r*(e/(n-1)*2-1);c[e]=t>=0?o*Math.tanh(t/o):s*Math.tanh(t/s)}return y_.set(i,c),c}var x_=()=>6,S_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1;let r=t&&t.exhaust||{};this.length=G(K(n.length,K(r.bank,1)),.05,12),this.gasTemp=G(K(n.gasTempFactor,K(t&&t.gasTempFactor,1)),.5,2.5),this.reflection=G(K(n.reflection,K(r.reflection,.5)),0,p_),this.damping=G(K(n.damping,K(r.damping,.4)),.05,2),this.thermalSpan=G(K(n.thermalSpan,.05),0,.25),this.thermalBias=.35,this.sampleRate=K(e&&e.sampleRate,48e3),this.minLoopDelay=128/this.sampleRate,this.nominalDelay=Pg(this.length,this.gasTemp),this.frequency=Ng(this.length,this.gasTemp),this.lpBase=G(this.frequency*(1.8/this.damping),150,12e3),this.loopQ=.5;let i=.49*this.sampleRate;if(this.fMax=Math.min(f_,i),this.tunedDelay=this._tunedDelay(this.frequency,this.lpBase),this.phaseCompensation=this.tunedDelay/this.nominalDelay,this.maxHeatScale=1+this.thermalSpan*(1-this.thermalBias),this.shortestDelay=this._tunedDelay(this.frequency*this.maxHeatScale,this.lpBase*this.maxHeatScale*1.35),this.mode=this.shortestDelay>=this.minLoopDelay*u_?`delay`:`bandpass`,this.inGain=e.createGain(),this.inGain.gain.value=1,this.out=e.createGain(),this.out.gain.value=1,this.dryGain=e.createGain(),this.dryGain.gain.value=G(K(n.dry,.3),0,4),this.inGain.connect(this.dryGain),this.dryGain.connect(this.out),this.wetGain=e.createGain(),this.wetGain.gain.value=G(K(n.wet,.9),0,4),this.wetGain.connect(this.out),this.mode===`delay`){let t=Math.max(.01,this.nominalDelay/(1-this.thermalSpan)*1.25);this.maxDelayTime=t,this.sum=e.createGain(),this.sum.gain.value=1,this.delay=e.createDelay(t),this.delay.delayTime.value=G(this.tunedDelay,this.minLoopDelay,t),this.loopLP=e.createBiquadFilter(),this.loopLP.type=`lowpass`,this.loopLP.frequency.value=this._f(this.lpBase),this.loopLP.Q.value=this.loopQ,this.fb=e.createGain(),this.fb.gain.value=-this._fbMag(0),this.inGain.connect(this.sum),this.sum.connect(this.delay),this.delay.connect(this.loopLP),this.loopLP.connect(this.fb),this.fb.connect(this.sum),this.loopLP.connect(this.wetGain)}else{let t=this._fbMag(0);this.fallbackQ=G(Math.PI/(2*Math.max(.02,1-t)),.7,24);let r=G(Math.round(K(n.maxModes,3)),1,6);this.modes=[];let i=0,a=[];for(let e=0;e<r;e++){let t=this.frequency*(2*e+1);if(t>this.fMax*.95)break;let n=1/Math.sqrt(1+t/this.lpBase*(t/this.lpBase)),r=(1/(2*e+1))**.7*n;a.push(r),i+=r}a.length||(a.push(1),i=1);let o=.6/Math.max(.08,1-t);for(let t=0;t<a.length;t++){let n=e.createBiquadFilter();n.type=`bandpass`,n.frequency.value=this._f(this.frequency*(2*t+1)),n.Q.value=this.fallbackQ;let r=e.createGain();r.gain.value=a[t]/i*o,this.inGain.connect(n),n.connect(r),r.connect(this.wetGain),this.modes.push({bp:n,g:r,order:2*t+1})}}this._nodeCount=this._countNodes()}get input(){return this.inGain}get output(){return this.out}_f(e){return G(K(e,d_),d_,this.fMax)}_tunedDelay(e,t){return v_(G(K(e,d_),d_,this.fMax),G(K(t,150),20,.49*this.sampleRate),this.loopQ,this.sampleRate)}_fbMag(e){return G(this.reflection*(.92+.08*G(e,0,1)),0,p_)}_heatScale(e){let t=G(K(e&&e.load,0),0,1),n=G(K(e&&e.rpmNorm,0),0,1),r=G(.6*t+.4*n,0,1);return 1+this.thermalSpan*(r-this.thermalBias)}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=this._heatScale(e);if(this.mode===`delay`){let e=G(this.nominalDelay/r,this.minLoopDelay,this.maxDelayTime);g_(this.delay.delayTime,e,t,h_),g_(this.loopLP.frequency,this._f(this.lpBase*r*(1+.35*n)),t,m_),g_(this.fb.gain,-this._fbMag(n),t,m_)}else for(let e=0;e<this.modes.length;e++){let n=this.modes[e];g_(n.bp.frequency,this._f(this.frequency*n.order*r),t,h_)}}_countNodes(){let e=4;return this.mode===`delay`?e+=4:e+=this.modes.length*2,e}dispose(){if(this.disposed)return;this.disposed=!0;let e=[this.inGain,this.out,this.dryGain,this.wetGain,this.sum,this.delay,this.loopLP,this.fb];if(this.modes)for(let t of this.modes)e.push(t.bp,t.g);for(let t of e)t&&t.disconnect&&t.disconnect()}},C_=class e{constructor(t,n,r={}){this.ctx=t,this.profile=n,this.disposed=!1;let i=n&&n.exhaust||{},a=Array.isArray(r.chambers)?r.chambers:Array.isArray(i.muffler)?i.muffler:[.3,.2,.13];this.chambers=a.map(e=>G(K(e,.2),.02,3)),this.gasTemp=G(K(r.gasTempFactor,K(n&&n.gasTempFactor,1)),.5,2.5),this.sampleRate=K(t&&t.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.thermalSpan=G(K(r.thermalSpan,.025),0,.2),this.thermalBias=.35;let o=this.chambers.map(e=>Pg(e,this.gasTemp));this.spread=G(K(r.spread,.06),0,.25);let s=r.decorrelate!==!1,c=e.peakCoincidence(o);this.delays=s?e._decorrelate(o,this.spread):o.slice();let l=e.peakCoincidence(this.delays);this.coincidence={before:c,after:l},this.notches=this.delays.map(e=>1/(2*e));let u=G(K(i.reflection,.5),0,1);this.branchGain=G(K(r.branchGain,.55+.3*u),.05,.9);let d=G(K(r.packingOctaves,7),1,40);this.packingBase=G(Ng(Math.max(...this.chambers),this.gasTemp)*d,500,11e3),this.inGain=t.createGain(),this.inGain.gain.value=1,this.out=t.createGain(),this.out.gain.value=1,this.stages=[];let f=this.inGain;for(let e=0;e<this.delays.length;e++){let n=this.delays[e],r=t.createGain();r.gain.value=1;let i=t.createGain();i.gain.value=1;let a=Math.max(.005,n/(1-this.thermalSpan)*1.5),o=t.createDelay(a);o.delayTime.value=G(n,0,a);let s=t.createGain();s.gain.value=this.branchGain*.92**e,f.connect(i),i.connect(r),f.connect(o),o.connect(s),s.connect(r),this.stages.push({sum:r,thru:i,delay:o,branch:s,T:n,maxT:a,taper:.92**e}),f=r}this.packing=t.createBiquadFilter(),this.packing.type=`lowpass`,this.packing.frequency.value=G(this.packingBase,d_,this.fMax),this.packing.Q.value=.6;let p=1;for(let e of this.stages)p*=1+e.branch.gain.value;this.trim=t.createGain(),this.trim.gain.value=1/Math.max(1,p*.72),f.connect(this.packing),this.packing.connect(this.trim),this.trim.connect(this.out),this._nodeCount=4+this.stages.length*4}get input(){return this.inGain}get output(){return this.out}static peakCoincidence(e,t=6,n=45){let r=0;for(let i=0;i<e.length;i++)for(let a=i+1;a<e.length;a++)for(let o=1;o<=t;o++)for(let s=1;s<=t;s++){let t=o/e[i],c=s/e[a];if(t>8e3||c>8e3)continue;let l=(t-c)/n;r+=Math.exp(-l*l)/(o*s)}return r}static _decorrelate(t,n){let r=t.slice();for(let i=1;i<r.length;i++){let a=r[i],o=1/0;for(let s=0;s<41;s++){let c=1+n*(2*s/40-1),l=r.slice(0,i+1);l[i]=t[i]*c;let u=e.peakCoincidence(l);u<o-1e-12&&(o=u,a=t[i]*c)}r[i]=a}return r}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.rpmNorm,0),0,1),i=G(.6*n+.4*r,0,1),a=1+this.thermalSpan*(i-this.thermalBias);for(let r=0;r<this.stages.length;r++){let i=this.stages[r];g_(i.delay.delayTime,G(i.T/a,0,i.maxT),t,h_);let o=G(K(e&&e.valve,0),0,1);g_(i.branch.gain,G(this.branchGain*i.taper*(1-.12*n)*(1-.65*o),0,.95),t,m_)}let o=G(K(e&&e.valve,0),0,1);g_(this.packing.frequency,G(this.packingBase*(1+.3*n)*(1+1.1*o)*a,d_,this.fMax),t,m_)}dispose(){if(this.disposed)return;this.disposed=!0;let e=[this.inGain,this.out,this.packing,this.trim];for(let t of this.stages)e.push(t.sum,t.thru,t.delay,t.branch);for(let t of e)t&&t.disconnect&&t.disconnect()}},w_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1;let r=t&&t.intake||{};this.f0=G(K(n.helmholtz,K(r.helmholtz,110)),d_,2e3),this.q0=G(K(n.q,K(r.q,6)),.3,30),this.level=G(K(n.level,K(r.level,.33)),0,4),this.sampleRate=K(e&&e.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.out=e.createGain(),this.out.gain.value=this.level,this.inGain=e.createGain(),this.inGain.gain.value=1,this.helm=e.createBiquadFilter(),this.helm.type=`bandpass`,this.helm.frequency.value=this._f(this.f0),this.helm.Q.value=this.q0,this.helmGain=e.createGain(),this.helmGain.gain.value=0,this.inGain.connect(this.helm),this.helm.connect(this.helmGain),this.helmGain.connect(this.out),this.directLP=e.createBiquadFilter(),this.directLP.type=`lowpass`,this.directLP.frequency.value=this._f(this.f0*4),this.directLP.Q.value=.7,this.directGain=e.createGain(),this.directGain.gain.value=0,this.inGain.connect(this.directLP),this.directLP.connect(this.directGain),this.directGain.connect(this.out),this.noiseBuf=this._makeNoise(e,2),this.noiseSrc=W(e.createBufferSource()),this.noiseSrc.buffer=this.noiseBuf,this.noiseSrc.loop=!0,this.noiseHP=e.createBiquadFilter(),this.noiseHP.type=`highpass`,this.noiseHP.frequency.value=this._f(this.f0*.8),this.noiseHP.Q.value=.7,this.noiseBP=e.createBiquadFilter(),this.noiseBP.type=`bandpass`,this.noiseBP.frequency.value=this._f(this.f0*3),this.noiseBP.Q.value=.9,this.noiseGain=e.createGain(),this.noiseGain.gain.value=0,this.noiseSrc.connect(this.noiseHP),this.noiseHP.connect(this.noiseBP),this.noiseBP.connect(this.noiseGain),this.noiseGain.connect(this.out),this.noiseToHelm=e.createGain(),this.noiseToHelm.gain.value=0,this.noiseHP.connect(this.noiseToHelm),this.noiseToHelm.connect(this.helm),this.started=!1,this._nodeCount=10}get input(){return this.inGain}get output(){return this.out}_f(e){return G(K(e,d_),d_,this.fMax)}_makeNoise(e,t){let n=Math.max(1,Math.floor(K(e&&e.sampleRate,48e3)*t)),r=e.createBuffer(1,n,K(e&&e.sampleRate,48e3)),i=r.getChannelData(0),a=2654435769,o=0,s=0;for(let e=0;e<n;e++){a^=a<<13,a>>>=0,a^=a>>17,a^=a<<5,a>>>=0;let t=a/4294967296*2-1;o=.997*o+t*.0555179,s=.985*s+t*.3104856,i[e]=G((o+s+t*.1848)*.32,-1,1)}return r}start(e){if(!(this.started||this.disposed)){this.started=!0;try{this.noiseSrc.start(K(e,0))}catch{}}}update(e){if(this.disposed)return;this.started||this.start(K(e&&e.now,0));let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.throttle,0),0,1),i=G(K(e&&e.rpmNorm,0),0,1),a=G(K(e&&e.overrun,0),0,1),o=Math.max(n,.001)**.7,s=G(r*(.25+.75*i),0,1),c=G(a*(.15+.85*i),0,1);g_(this.helm.Q,G(this.q0*(.55+.45*r),.3,30),t,.05),g_(this.helm.frequency,this._f(this.f0),t,.1),g_(this.helmGain.gain,G((.12+.88*o)*(.35+.65*i),0,4),t,m_),g_(this.directGain.gain,G(.3*(.2+.8*o),0,4),t,m_),g_(this.noiseBP.frequency,this._f(this.f0*(3+9*s)*(1+.6*c)),t,m_),g_(this.noiseBP.Q,G(.9+.7*s,.3,6),t,.05),g_(this.noiseGain.gain,G(.42*s**1.2+.16*c,0,4),t,m_),g_(this.noiseToHelm.gain,G(.2*s+.05*c,0,2),t,m_),g_(this.out.gain,G(this.level,0,4),t,.1)}dispose(){if(this.disposed)return;this.disposed=!0;try{this.started&&this.noiseSrc.stop()}catch{}let e=[this.inGain,this.out,this.helm,this.helmGain,this.directLP,this.directGain,this.noiseSrc,this.noiseHP,this.noiseBP,this.noiseGain,this.noiseToHelm];for(let t of e)t&&t.disconnect&&t.disconnect()}},T_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1,this.maxDrive=G(K(n.maxDrive,4.5),1,40),this.idleDrive=G(K(n.idleDrive,1),.1,10);let r=G(K(n.kp,3.2),.5,12),i=G(K(n.kn,2),.5,12);this.sampleRate=K(e&&e.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.drive=e.createGain(),this.drive.gain.value=this.idleDrive,this.shaper=e.createWaveShaper(),this.shaper.curve=b_(r,i,4096),this.shaper.oversample=`4x`,this.span=e.createGain(),this.span.gain.value=1/x_(),this.dcBlock=e.createBiquadFilter(),this.dcBlock.type=`highpass`,this.dcBlock.frequency.value=G(22,d_,this.fMax),this.dcBlock.Q.value=.7,this.makeup=e.createGain(),this.makeup.gain.value=this._makeupFor(this.idleDrive),this.out=e.createGain(),this.out.gain.value=1,this.drive.connect(this.span),this.span.connect(this.shaper),this.shaper.connect(this.dcBlock),this.dcBlock.connect(this.makeup),this.makeup.connect(this.out),this._nodeCount=6}get input(){return this.drive}get output(){return this.out}_makeupFor(e){return G(1/Math.max(.05,e)**.7,.05,4)}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.rpmNorm,0),0,1),i=G(K(e&&e.boost,0),0,1),a=G(K(e&&e.overrun,0),0,1),o=G(n**1.5*(.55+.45*r)+.55*i*n,0,1.4),s=.25*a*(.3+.7*r)+.22*G(K(e&&e.valve,0),0,1)*(.4+.6*n),c=G(this.idleDrive+(this.maxDrive-this.idleDrive)*G(o+s,0,1),.1,this.maxDrive);g_(this.drive.gain,c,t,m_),g_(this.makeup.gain,this._makeupFor(c),t,m_)}dispose(){if(!this.disposed){this.disposed=!0;for(let e of[this.drive,this.span,this.shaper,this.dcBlock,this.makeup,this.out])e&&e.disconnect&&e.disconnect()}}},E_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1,this.sampleRate=K(e&&e.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.boomHz=G(K(n.boomHz,62),20,300),this.panelHz=G(K(n.panelHz,155),40,800),this.extLP=G(K(n.exteriorLP,17e3),1e3,this.fMax),this.intLP=G(K(n.interiorLP,1050),120,8e3),this.intBoomDb=G(K(n.boomDb,6.5),0,18),this.intPanelDb=G(K(n.panelDb,3.5),0,18),this.intShelfDb=G(K(n.shelfDb,-11),-40,0),this.shelfHz=G(K(n.shelfHz,3200),500,this.fMax),this.position=G(K(n.position,0),0,1),this.target=this.position,this.inGain=e.createGain(),this.inGain.gain.value=1,this.boom=e.createBiquadFilter(),this.boom.type=`peaking`,this.boom.frequency.value=G(this.boomHz,d_,this.fMax),this.boom.Q.value=G(K(n.boomQ,3.2),.3,20),this.boom.gain.value=0,this.panel=e.createBiquadFilter(),this.panel.type=`peaking`,this.panel.frequency.value=G(this.panelHz,d_,this.fMax),this.panel.Q.value=G(K(n.panelQ,2.4),.3,20),this.panel.gain.value=0,this.lp=e.createBiquadFilter(),this.lp.type=`lowpass`,this.lp.frequency.value=G(this.extLP,d_,this.fMax),this.lp.Q.value=.6,this.shelf=e.createBiquadFilter(),this.shelf.type=`highshelf`,this.shelf.frequency.value=G(this.shelfHz,d_,this.fMax),this.shelf.gain.value=0,this.trim=e.createGain(),this.trim.gain.value=1,this.out=e.createGain(),this.out.gain.value=1,this.inGain.connect(this.boom),this.boom.connect(this.panel),this.panel.connect(this.lp),this.lp.connect(this.shelf),this.shelf.connect(this.trim),this.trim.connect(this.out),this._nodeCount=7,this._write(K(e.currentTime,0),.001)}get input(){return this.inGain}get output(){return this.out}setPerspective(e){return e===`interior`?this.setPosition(1):e===`exterior`&&this.setPosition(0),this}setPosition(e){return this.target=G(K(e,0),0,1),this.disposed||this._write(K(this.ctx.currentTime,0),.05),this}get perspective(){return this.target>=.5?`interior`:`exterior`}_write(e,t){let n=this.target,r=this.extLP*(this.intLP/this.extLP)**+n;g_(this.lp.frequency,G(r,d_,this.fMax),e,t),g_(this.boom.gain,this.intBoomDb*n,e,t),g_(this.panel.gain,this.intPanelDb*n,e,t),g_(this.shelf.gain,this.intShelfDb*n,e,t),g_(this.trim.gain,G(10**(-4.5*n/20),.05,1),e,t)}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0));this._write(t,.05),this.position=this.target}dispose(){if(!this.disposed){this.disposed=!0;for(let e of[this.inGain,this.boom,this.panel,this.lp,this.shelf,this.trim,this.out])e&&e.disconnect&&e.disconnect()}}},D_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1;let r=t&&t.exhaust||{},i=t&&Array.isArray(t.banks)&&t.banks.length?t.banks:[[1]];t&&t.gasTempFactor,this.sampleRate=K(e&&e.sampleRate,48e3),this.bankLengths=i.map((e,t)=>t===1&&Number.isFinite(r.bankB)?r.bankB:K(r.bank,1.2)),this.collectorNode=e.createGain(),this.collectorNode.gain.value=1/Math.sqrt(i.length);let a=n.transit!==!1;this.banks=[],this.transits=[],this.inputs=[];for(let r=0;r<i.length;r++){let i=new S_(e,t,Object.assign({length:this.bankLengths[r]},n.bankOpts));if(this.banks.push(i),this.inputs.push(i.input),a){let t=i.nominalDelay/2,n=Math.max(.005,t*2),r=e.createDelay(n);r.delayTime.value=G(t,0,n),i.output.connect(r),r.connect(this.collectorNode),this.transits.push({d:r,t,maxT:n})}else i.output.connect(this.collectorNode),this.transits.push(null)}this.collector=new S_(e,t,Object.assign({length:K(r.collector,1),reflection:G(K(r.reflection,.5)*.7,0,p_),damping:G(K(r.damping,.4)*1.5,.05,2)},n.collectorOpts)),this.collectorNode.connect(this.collector.input),this.muffler=new C_(e,t,n.mufflerOpts),this.collector.output.connect(this.muffler.input),this.useNonlinearity=n.nonlinearity!==!1,this.out=e.createGain(),this.out.gain.value=1,this.useNonlinearity?(this.nonlinearity=new T_(e,t,n.nonlinearityOpts),this.muffler.output.connect(this.nonlinearity.input),this.nonlinearity.output.connect(this.out)):(this.nonlinearity=null,this.muffler.output.connect(this.out)),this._thermalSpan=this.banks.length?this.banks[0].thermalSpan:.05,this._thermalBias=this.banks.length?this.banks[0].thermalBias:.35,this.report={bankLengths:this.bankLengths.slice(),bankFrequencies:this.banks.map(e=>e.frequency),bankModes:this.banks.map(e=>e.mode),collectorFrequency:this.collector.frequency,collectorMode:this.collector.mode,mufflerNotches:this.muffler.notches.slice(),transitSkewMs:this.transits[0]&&this.transits[1]?Math.abs(this.transits[0].t-this.transits[1].t)*1e3:0},this._nodeCount=this._countNodes()}get input(){return this.inputs[0]}get output(){return this.out}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.rpmNorm,0),0,1),i=G(.6*n+.4*r,0,1),a=1+this._thermalSpan*(i-this._thermalBias);for(let n=0;n<this.banks.length;n++){this.banks[n].update(e);let r=this.transits[n];r&&g_(r.d.delayTime,G(r.t/a,0,r.maxT),t,h_)}this.collector.update(e),this.muffler.update(e),this.nonlinearity&&this.nonlinearity.update(e)}_countNodes(){let e=2;for(let t of this.banks)e+=t._nodeCount;for(let t of this.transits)t&&(e+=1);return e+=this.collector._nodeCount+this.muffler._nodeCount,this.nonlinearity&&(e+=this.nonlinearity._nodeCount),e}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.banks)e.dispose();for(let e of this.transits)e&&e.d.disconnect&&e.d.disconnect();this.collector.dispose(),this.muffler.dispose(),this.nonlinearity&&this.nonlinearity.dispose();for(let e of[this.collectorNode,this.out])e&&e.disconnect&&e.disconnect()}}},O_=3800,k_=-5.5,A_=1150,j_=.02,M_=10,N_=2e4,P_=.004;function q(e,t,n){return e<t?t:e>n?n:e}function J(e,t){return typeof e==`number`&&isFinite(e)?e:t}function F_(e,t){return q(J(e,t),M_,N_)}function I_(e,t,n,r){e.setTargetAtTime(J(t,0),J(n,0),r>0?r:j_)}function L_(e,t,n,r,i){e.setTargetAtTime(F_(t,i===void 0?M_:i),J(n,0),r>0?r:j_)}function R_(e){let t=e>>>0||1;return function(){return t^=t<<13,t>>>=0,t^=t>>17,t^=t<<5,t>>>=0,t/4294967296}}var z_=new WeakMap;function B_(e,t){let n=z_.get(e);if(n||(n={},z_.set(e,n)),n[t])return n[t];let r=J(e.sampleRate,48e3),i=Math.max(1024,Math.floor(r*2)),a=e.createBuffer(1,i,r),o=a.getChannelData(0),s=R_(t===`pink`?2654435769:2246822507);if(t===`pink`){let e=0,t=0,n=0,r=0,a=0,c=0,l=0;for(let u=0;u<i;u++){let i=s()*2-1;e=.99886*e+i*.0555179,t=.99332*t+i*.0750759,n=.969*n+i*.153852,r=.8665*r+i*.3104856,a=.55*a+i*.5329522,c=-.7616*c-i*.016898,o[u]=(e+t+n+r+a+c+l+i*.5362)*.11,l=i*.115926}}else for(let e=0;e<i;e++)o[e]=s()*2-1;let c=Math.min(2048,i>>2);for(let e=0;e<c;e++){let t=e/c;o[e]=o[e]*t+o[i-c+e]*(1-t)}return n[t]=a,a}function V_(e,t,n){let r=W(e.createBufferSource());r.buffer=B_(e,t),r.loop=!0;try{r.start(0,J(n,0)),r.__started=!0}catch{}return r}function H_(e,t,n,r){let i=e.createGain();return i.gain.value=n,t.connect(i),i.connect(r),i}function U_(e,t){let n=J(t,0);for(let t=0;t<e.length;t++){let r=e[t];if(r&&!r.__started)try{r.start(n),r.__started=!0}catch{}}}function W_(e,t){for(let n=0;n<e.length;n++){try{e[n].stop(J(t,0))}catch{}try{e[n].disconnect()}catch{}}}function G_(e){for(let t=0;t<e.length;t++)try{e[t].disconnect()}catch{}}var K_=class{constructor(e,t,n){this.ctx=e,this.profile=t;let r=n||{};this.level=J(r.level,1),this.gearCut=r.gearCut===`straight`?`straight`:`helical`,this.driveshaftScale=typeof r.driveshaftScale==`number`&&isFinite(r.driveshaftScale)?r.driveshaftScale:`auto`,this._scale=0,this._srcs=[],this._nodes=[];let i=e=>(this._nodes.push(e),e);this.out=i(e.createGain()),this.out.gain.value=this.level;let a=V_(e,`white`,.71),o=V_(e,`pink`,1.31);this._srcs.push(a,o),this.meshOsc1=W(e.createOscillator()),this.meshOsc1.type=`sine`,this.meshOsc1.frequency.value=500,this.meshOsc2=W(e.createOscillator()),this.meshOsc2.type=`sine`,this.meshOsc2.frequency.value=1e3,this.runoutOsc=W(e.createOscillator()),this.runoutOsc.type=`sine`,this.runoutOsc.frequency.value=20,this._srcs.push(this.meshOsc1,this.meshOsc2,this.runoutOsc),this.meshH2=i(e.createGain()),this.meshH2.gain.value=this.gearCut===`straight`?.55:.2,this.meshBP=i(e.createBiquadFilter()),this.meshBP.type=`bandpass`,this.meshBP.frequency.value=500,this.meshBP.Q.value=this.gearCut===`straight`?9:3.5,this.meshNoiseG=i(e.createGain()),this.meshNoiseG.gain.value=this.gearCut===`straight`?.22:.6,this.meshAM=i(e.createGain()),this.meshAM.gain.value=.85,i(H_(e,this.runoutOsc,.15,this.meshAM.gain)),this.meshGain=i(e.createGain()),this.meshGain.gain.value=0,this.meshOsc1.connect(this.meshAM),this.meshOsc2.connect(this.meshH2),this.meshH2.connect(this.meshAM),a.connect(this.meshBP),this.meshBP.connect(this.meshNoiseG),this.meshNoiseG.connect(this.meshAM),this.meshAM.connect(this.meshGain),this.meshGain.connect(this.out),this.ratBP1=i(e.createBiquadFilter()),this.ratBP1.type=`bandpass`,this.ratBP1.frequency.value=1800,this.ratBP1.Q.value=2,this.ratBP2=i(e.createBiquadFilter()),this.ratBP2.type=`bandpass`,this.ratBP2.frequency.value=3600,this.ratBP2.Q.value=2.5,this.ratH2=i(e.createGain()),this.ratH2.gain.value=.5,this.ratAM=i(e.createGain()),this.ratAM.gain.value=.4,this.torsOsc=W(e.createOscillator()),this.torsOsc.type=`sawtooth`,this.torsOsc.frequency.value=60,this._srcs.push(this.torsOsc),i(H_(e,this.torsOsc,.6,this.ratAM.gain)),this.ratGain=i(e.createGain()),this.ratGain.gain.value=0,o.connect(this.ratBP1),o.connect(this.ratBP2),this.ratBP1.connect(this.ratAM),this.ratBP2.connect(this.ratH2),this.ratH2.connect(this.ratAM),this.ratAM.connect(this.ratGain),this.ratGain.connect(this.out),this.setVehicle(r.vehicle,r.gearTeeth,r.finalDrive),this.setProfile(t)}get input(){return null}get output(){return this.out}setVehicle(e,t,n){let r=e||null,i=t||r&&r.gearTeeth||null;this.teeth=i&&i.length?i:[37,31,27,24,22,20],this.finalDrive=q(J(n,J(r&&r.finalDrive,3.9)),1,12),this._scale=0}setProfile(e){this.profile=e,this.cyl=q(J(e&&e.cylinders,4),1,16),this.idleRpm=J(e&&e.idleRpm,800)}_shaftRpm(e){let t=Math.abs(J(e.wheelRpm,0));if(this.driveshaftScale!==`auto`)return t*this.driveshaftScale;if(this._scale===0){let n=J(e.gearRatio,0),r=J(e.rpm,0);if(n>.05&&t>50&&r>200&&J(e.clutchEngaged,0)>.9){let e=r/t,i=Math.abs(e-n),a=Math.abs(e-n/this.finalDrive);this._scale=i<a?this.finalDrive:1}}return t*(this._scale||1)}meshFrequency(e,t){let n=Math.round(J(e,0))-1;return n<0||n>=this.teeth.length?0:Math.abs(J(t,0))/60*J(this.teeth[n],0)}update(e){let t=J(e.now,0),n=Math.round(J(e.gear,0)),r=q(J(e.load,0),0,1),i=Math.max(0,J(e.rpm,0)),a=J(e.f0,i/120),o=q(J(e.clutchEngaged,0),0,1),s=e.shiftPhase||``,c=this._shaftRpm(e),l=this.meshFrequency(n,c),u=0;if(l>0){let e=1/(1+(l/1800)**2.4);u=q((l-30)/40,0,1)*e}let d=J(e.torqueSign,1)>=0?.22+.85*r:.34,f=+(n>0&&Math.abs(J(e.gearRatio,0))>.001),p=s===`open`||s===`sync`||s===`cut`?.05:1,m=.45+.55*q(c/2500,0,1),h=.065*(this.gearCut===`straight`?1:.42)*f*o*p*d*u*m;L_(this.meshOsc1.frequency,l,t,j_,500),L_(this.meshOsc2.frequency,l*2,t,j_,1e3);let g=this.gearCut===`straight`?.55:.2;I_(this.meshH2.gain,g/(1+(l*2/2600)**2.4),t,j_),L_(this.meshBP.frequency,l,t,j_,500),L_(this.runoutOsc.frequency,c/60*2,t,j_,M_),I_(this.meshGain.gain,h,t,j_);let _=q(Math.abs(J(e.dRpm,0))/4e3,0,1),v=q(Math.abs(J(e.clutchSlip,0))/800,0,1),y=o*q(1-(i-this.idleRpm)/Math.max(200,this.idleRpm*1.6),0,1)*(1-.7*r)*(f?.4:1),b=1-.65*r*f,x=q(.5*y+.75*_+.7*v,0,1)*b;L_(this.torsOsc.frequency,this.cyl*a,t,j_,M_),I_(this.ratGain.gain,.09*x*q(i/Math.max(1,this.idleRpm*.6),0,1),t,j_)}start(e){U_(this._srcs,e)}dispose(){let e=J(this.ctx.currentTime,0);W_(this._srcs,e),G_(this._nodes),this._srcs.length=0}},q_=e=>e<.1,J_=class e{static supports(e){return!!(e&&e.turbo)}constructor(t,n,r){this.ctx=t;let i=r||{};this.level=J(i.level,1),this.maxTurboRpm=J(i.maxTurboRpm,15e4),this.flutterMode=i.flutter!==!1,this.surgeLevel=q(J(i.surgeLevel,1),0,3),this.spool=0,this.boost=0,this.boostBar=0,this.turboRpm=0,this._vent=0,this._surge=0,this._climb=0,this._liftRate=13,this._liftPitch=1,this._liftTau=.26,this._lastBov=-1e9,this._prevThrottle=0,this._prevShifting=!1,this._rnd=R_(1374496523),this._srcs=[],this._nodes=[];let a=e=>(this._nodes.push(e),e);if(this.out=a(t.createGain()),this.out.gain.value=this.level,this._graphBuilt=!1,this.setProfile(n),!e.supports(n))return;this.bus=a(t.createGain()),this.airLP=a(t.createBiquadFilter()),this.airLP.type=`lowpass`,this.airLP.frequency.value=O_,this.airLP.Q.value=-3.01,this.airShelf=a(t.createBiquadFilter()),this.airShelf.type=`highshelf`,this.airShelf.frequency.value=2600,this.airShelf.gain.value=k_,this.bus.connect(this.airLP),this.airLP.connect(this.airShelf),this.airShelf.connect(this.out);let o=V_(t,`white`,1.07);this._srcs.push(o),this.whineOsc=W(t.createOscillator()),this.whineOsc.setPeriodicWave(X_(t)),this.whineOsc.frequency.value=1200,this._srcs.push(this.whineOsc),this.whineBP=a(t.createBiquadFilter()),this.whineBP.type=`bandpass`,this.whineBP.frequency.value=1500,this.whineBP.Q.value=1.5,this.whineGain=a(t.createGain()),this.whineGain.gain.value=0,this.whineDrive=a(t.createGain()),this.whineDrive.gain.value=1,this.whineShaper=a(t.createWaveShaper()),this.whineShaper.curve=Z_(1024,.55),this.whineShaper.oversample=`4x`,this.whineOsc.connect(this.whineDrive),this.whineDrive.connect(this.whineShaper),this.whineShaper.connect(this.whineBP),this.whineBP.connect(this.whineGain),this.whineGain.connect(this.bus);let s=V_(t,`pink`,.29);this._srcs.push(s),this.grainBP=a(t.createBiquadFilter()),this.grainBP.type=`bandpass`,this.grainBP.frequency.value=55,this.grainBP.Q.value=.6,this.grainDepth=a(t.createGain()),this.grainDepth.gain.value=0,s.connect(this.grainBP),this.grainBP.connect(this.grainDepth),this.grainDepth.connect(this.whineGain.gain),this.wander1=W(t.createOscillator()),this.wander1.type=`sine`,this.wander1.frequency.value=.31,this.wander2=W(t.createOscillator()),this.wander2.type=`sine`,this.wander2.frequency.value=2.17,this._srcs.push(this.wander1,this.wander2),this.wanderDepth1=a(H_(t,this.wander1,0,this.whineOsc.detune)),this.wanderDepth2=a(H_(t,this.wander2,0,this.whineOsc.detune)),this.shaftOsc=W(t.createOscillator()),this.shaftOsc.type=`sine`,this.shaftOsc.frequency.value=180,this._srcs.push(this.shaftOsc),this.shaftDepth=a(t.createGain()),this.shaftDepth.gain.value=0,this.shaftOsc.connect(this.shaftDepth),this.shaftDepth.connect(this.whineGain.gain),this.hissBP=a(t.createBiquadFilter()),this.hissBP.type=`bandpass`,this.hissBP.frequency.value=2e3,this.hissBP.Q.value=.8,this.hissGain=a(t.createGain()),this.hissGain.gain.value=0,o.connect(this.hissBP),this.hissBP.connect(this.hissGain),this.hissGain.connect(this.bus),this.hissGrain=a(t.createGain()),this.hissGrain.gain.value=0,this.grainBP.connect(this.hissGrain),this.hissGrain.connect(this.hissGain.gain),this.whineNoiseBP=a(t.createBiquadFilter()),this.whineNoiseBP.type=`bandpass`,this.whineNoiseBP.frequency.value=800,this.whineNoiseBP.Q.value=6,this.whineNoiseGain=a(t.createGain()),this.whineNoiseGain.gain.value=0,o.connect(this.whineNoiseBP),this.whineNoiseBP.connect(this.whineNoiseGain),this.whineNoiseGain.connect(this.bus);let c=V_(t,`pink`,1.31);this._srcs.push(c),this.airflowHP=a(t.createBiquadFilter()),this.airflowHP.type=`highpass`,this.airflowHP.frequency.value=280,this.airflowHP.Q.value=.5,this.airflowLP=a(t.createBiquadFilter()),this.airflowLP.type=`lowpass`,this.airflowLP.frequency.value=1400,this.airflowLP.Q.value=.5,this.airflowGain=a(t.createGain()),this.airflowGain.gain.value=0,c.connect(this.airflowHP),this.airflowHP.connect(this.airflowLP),this.airflowLP.connect(this.airflowGain),this.airflowGain.connect(this.bus),this.bovBP=a(t.createBiquadFilter()),this.bovBP.type=`bandpass`,this.bovBP.frequency.value=2400,this.bovBP.Q.value=7,this.bovGain=a(t.createGain()),this.bovGain.gain.value=0,o.connect(this.bovBP),this.bovBP.connect(this.bovGain),this.bovGain.connect(this.bus),this.wgBP=a(t.createBiquadFilter()),this.wgBP.type=`bandpass`,this.wgBP.frequency.value=1500,this.wgBP.Q.value=.6,this.wgLevel=a(t.createGain()),this.wgLevel.gain.value=0,this.wgOsc=W(t.createOscillator()),this.wgOsc.type=`sawtooth`,this.wgOsc.frequency.value=24,this._srcs.push(this.wgOsc),this.wgShaper=a(t.createWaveShaper()),this.wgShaper.curve=Q_(1024),this.wgShaper.oversample=`2x`,this.wgAM=a(t.createGain()),this.wgAM.gain.value=.05,this.wgOsc.connect(this.wgShaper),this.wgShaper.connect(this.wgAM.gain),o.connect(this.wgBP),this.wgBP.connect(this.wgAM),this.wgAM.connect(this.wgLevel),this.wgLevel.connect(this.bus),this.wgJitter=a(t.createGain()),this.wgJitter.gain.value=6,this.grainBP.connect(this.wgJitter),this.wgJitter.connect(this.wgOsc.frequency),this.wgGrain=a(t.createGain()),this.wgGrain.gain.value=0,this.grainBP.connect(this.wgGrain),this.wgGrain.connect(this.wgLevel.gain),this.hiOsc=W(t.createOscillator()),this.hiOsc.type=`sine`,this.hiOsc.frequency.value=6e3,this._srcs.push(this.hiOsc),this.hiGain=a(t.createGain()),this.hiGain.gain.value=0,this.hiOsc.connect(this.hiGain),this.hiGain.connect(this.out),this.hiGrain=a(t.createGain()),this.hiGrain.gain.value=0,this.grainBP.connect(this.hiGrain),this.hiGrain.connect(this.hiGain.gain),this.hiWander=a(H_(t,this.wander2,0,this.hiOsc.detune)),this.buzzOsc=W(t.createOscillator()),this.buzzOsc.type=`sawtooth`,this.buzzOsc.frequency.value=60,this._srcs.push(this.buzzOsc),this.buzzBP=a(t.createBiquadFilter()),this.buzzBP.type=`bandpass`,this.buzzBP.frequency.value=1500,this.buzzBP.Q.value=1.2,this.buzzGain=a(t.createGain()),this.buzzGain.gain.value=0,this.buzzOsc.connect(this.buzzBP),this.buzzBP.connect(this.buzzGain),this.buzzGain.connect(this.bus),this.bovHissHP=a(t.createBiquadFilter()),this.bovHissHP.type=`highpass`,this.bovHissHP.frequency.value=1800,this.bovHissHP.Q.value=-3.01,this.bovHissGain=a(t.createGain()),this.bovHissGain.gain.value=0,o.connect(this.bovHissHP),this.bovHissHP.connect(this.bovHissGain),this.bovHissGain.connect(this.bus),this.surgeOsc=W(t.createOscillator()),this.surgeOsc.type=`sawtooth`,this.surgeOsc.frequency.value=16,this._srcs.push(this.surgeOsc),this.surgeShaper=a(t.createWaveShaper()),this.surgeShaper.curve=Q_(1024),this.surgeShaper.oversample=`2x`,this.surgeOsc.connect(this.surgeShaper),this.surgeBus=a(t.createGain()),this.surgeBus.gain.value=.7,this.surgeLP=a(t.createBiquadFilter()),this.surgeLP.type=`lowpass`,this.surgeLP.frequency.value=6500,this.surgeLP.Q.value=-3.01,this.surgeBus.connect(this.surgeLP),this.surgeLP.connect(this.out),this.whooshBP=a(t.createBiquadFilter()),this.whooshBP.type=`bandpass`,this.whooshBP.frequency.value=5e3,this.whooshBP.Q.value=.7,this.whooshGain=a(t.createGain()),this.whooshGain.gain.value=0,o.connect(this.whooshBP),this.whooshBP.connect(this.whooshGain),this.whooshGain.connect(this.surgeLP),this.whooshGrain=a(t.createGain()),this.whooshGrain.gain.value=0,this.grainBP.connect(this.whooshGrain),this.whooshGrain.connect(this.whooshGain.gain),this.surgeSend=a(t.createGain()),this.surgeSend.gain.value=.55,this.surgeJitter=a(t.createGain()),this.surgeJitter.gain.value=0,this.grainBP.connect(this.surgeJitter),this.surgeJitter.connect(this.surgeOsc.frequency),this.surgeBody=a(t.createBiquadFilter()),this.surgeBody.type=`bandpass`,this.surgeBody.frequency.value=3e3,this.surgeBody.Q.value=1.1,this.surgeBodyAM=a(t.createGain()),this.surgeBodyAM.gain.value=0,this.surgeBodyLvl=a(t.createGain()),this.surgeBodyLvl.gain.value=0,o.connect(this.surgeBody),this.surgeBody.connect(this.surgeBodyAM),this.surgeBodyAM.connect(this.surgeBodyLvl),this.surgeBodyLvl.connect(this.surgeBus),this.surgeBodyLvl.connect(this.surgeSend),this.surgeBodyDepth=a(t.createGain()),this.surgeBodyDepth.gain.value=1,this.surgeShaper.connect(this.surgeBodyDepth),this.surgeBodyDepth.connect(this.surgeBodyAM.gain),this.surgeChirp=a(t.createGain()),this.surgeChirp.gain.value=0,this.surgeShaper.connect(this.surgeChirp),this.fwOsc=W(t.createOscillator()),this.fwOsc.type=`sine`,this.fwOsc.frequency.value=7e3,this._srcs.push(this.fwOsc),this.fwBP=a(t.createBiquadFilter()),this.fwBP.type=`bandpass`,this.fwBP.frequency.value=7e3,this.fwBP.Q.value=3,this.fwNoise=a(t.createGain()),this.fwNoise.gain.value=3.2,this.fwTone=a(t.createGain()),this.fwTone.gain.value=.2,o.connect(this.fwBP),this.fwBP.connect(this.fwNoise),this.hiSurgeAM=a(t.createGain()),this.hiSurgeAM.gain.value=0,this.hiSurgeLvl=a(t.createGain()),this.hiSurgeLvl.gain.value=0,this.fwOsc.connect(this.fwTone),this.fwTone.connect(this.hiSurgeAM),this.fwNoise.connect(this.hiSurgeAM),this.hiSurgeAM.connect(this.hiSurgeLvl),this.hiSurgeLvl.connect(this.out),this.surgeShaper.connect(this.hiSurgeAM.gain),this.hiChirp=a(t.createGain()),this.hiChirp.gain.value=0,this.surgeShaper.connect(this.hiChirp),this.hiChirp.connect(this.fwOsc.frequency),this.hiChirpN=a(t.createGain()),this.hiChirpN.gain.value=0,this.surgeShaper.connect(this.hiChirpN),this.hiChirpN.connect(this.fwBP.frequency),this.surgeChirp.connect(this.surgeBody.frequency),this.surgeEdge=a(t.createBiquadFilter()),this.surgeEdge.type=`bandpass`,this.surgeEdge.frequency.value=5200,this.surgeEdge.Q.value=.8,this.surgeEdgeAM=a(t.createGain()),this.surgeEdgeAM.gain.value=0,this.surgeEdgeLvl=a(t.createGain()),this.surgeEdgeLvl.gain.value=0,o.connect(this.surgeEdge),this.surgeEdge.connect(this.surgeEdgeAM),this.surgeEdgeAM.connect(this.surgeEdgeLvl),this.surgeEdgeLvl.connect(this.surgeBus),this.surgeEdgeDepth=a(t.createGain()),this.surgeEdgeDepth.gain.value=1,this.surgeShaper.connect(this.surgeEdgeDepth),this.surgeEdgeDepth.connect(this.surgeEdgeAM.gain),this._graphBuilt=!0,this.enabled=!0}get input(){return null}get output(){return this.out}get state(){return{spool:this.spool,boost:this.boost,boostBar:this.boostBar,turboRpm:this.turboRpm,surge:this._surge}}setProfile(e){this.profile=e;let t=e&&e.turbo||null;this.turbo=t,this.enabled=!!t&&this._graphBuilt===!0,this.inertia=q(J(t&&t.inertia,.4),.05,3),this.maxBoost=q(J(t&&t.maxBoost,1),0,5),this.bovLevel=q(J(t&&t.bov,.5),0,2),this.surgeTrim=q(J(t&&t.surge,1),0,3),this.valve=Math.round(q(J(t&&t.valve,1),0,2)),this.flutterHz=q(J(t&&t.flutterHz,13),3,30),this.screamer=J(t&&t.screamer,0)>=.5,this.antiLag=J(t&&t.antiLag,0)>=.5;let n=J(e&&e.redlineRpm,7e3);this.boostRpm=Math.min(q(J(t&&t.boostRpm,3500),800,9e3),.65*n);let r=.5*J(t&&t.whineOrder,70);this.whineRef=q(n/120*r,200,A_)}update(e){if(!this.enabled)return;let t=J(e.now,0),n=q(J(e.dt,1/60),0,.25),r=q(J(e.load,0),0,1),i=q(J(e.throttle,0),0,1),a=q(J(e.rpmNorm,0),0,1),o=!!e.shifting;this._als=this.antiLag&&i<.12&&a>.15;let s=J(e.rpm,0),c=Math.max(.6*J(this.profile&&this.profile.redlineRpm,7e3),this.boostRpm+1500),l=q((s-this.boostRpm)/(c-this.boostRpm),0,1),u=e.limiter?Math.max(r,.95*i):r,d=this._als?.7*(.3+.7*a):q(u*(.08+.92*l),0,1),f=i<.12,p=q((d-this.spool)*3,0,1);this._climb+=(p-this._climb)*Math.min(1,n/.08);let m=d>this.spool?this.inertia*1.1:this.inertia*(f?.45:1.3),h=n>0?1-Math.exp(-n/Math.max(.001,m)):0;this.spool+=(d-this.spool)*h;let g=.04+.07*a;this.spool<g&&(this.spool=g),this.spool=q(J(this.spool,g),0,1),this._vent>0&&(this._vent*=Math.exp(-n/.18),this._vent<.001&&(this._vent=0));let _=this.spool*this.spool;this.boost=q(_*(1-.92*this._vent),0,1),this.boostBar=this.boost*this.maxBoost,this.turboRpm=this.spool*this.maxTurboRpm;let v=Math.max(120,this.whineRef*Math.max(.05,this.spool)**1.55);L_(this.whineOsc.frequency,v,t,j_,1e3),L_(this.whineBP.frequency,v*1.25,t,j_,1600),L_(this.whineNoiseBP.frequency,v,t,j_,800);let y=this.spool**2,b=q(Math.max(r,i*.7),0,1),x=.085*y*(.62+.38*b);I_(this.whineGain.gain,x,t,j_),I_(this.whineNoiseGain.gain,.3*y*(.5+.5*b),t,j_),I_(this.airflowGain.gain,.2*(.15+.85*this.spool)*this.spool*(.25+.75*b),t,.05),L_(this.airflowLP.frequency,900+1300*this.spool,t,j_,1400);let S=26*(1-.75*this.spool);I_(this.wanderDepth1.gain,S,t,.08),I_(this.wanderDepth2.gain,S*.4,t,.08);let C=.55-.3*this.spool;I_(this.grainDepth.gain,x*C,t,.05),I_(this.whineDrive.gain,.8+.9*this.spool,t,j_),L_(this.grainBP.frequency,28+120*this.spool,t,j_,55),L_(this.shaftOsc.frequency,q(v/11,4,400),t,j_,180),I_(this.shaftDepth.gain,x*(.52-.28*this.spool),t,j_);let w=q((this.spool-.4)/.3,0,1)*q((a-.4)/.3,0,1),T=w*i*(this.screamer?1.3:.7);L_(this.wgOsc.frequency,18+12*w+8*a,t,.05,24),L_(this.wgBP.frequency,(this.screamer?900:1400)+1300*this.spool,t,j_,1500),I_(this.wgLevel.gain,T,t,.05),I_(this.wgGrain.gain,T*.5,t,.05);let E=.1*y*(.45+.55*b);I_(this.hissGain.gain,E,t,j_),I_(this.hissGrain.gain,E*.65,t,.05),L_(this.hissBP.frequency,q(v*2.2,900,4200),t,j_,2e3);let D=.18*(q((this.boost-.12)/.45,0,1)*i*(1-.75*a)+.6*this._climb*Math.sqrt(this.spool));I_(this.whooshGain.gain,D,t,.04),I_(this.whooshGrain.gain,D*.6,t,.05),L_(this.whooshBP.frequency,q(4e3+3500*this.spool,3e3,8e3),t,j_,5e3);let O=.08*q((this.spool-.62)/.25,0,1)*b;L_(this.buzzOsc.frequency,q(v/11,20,400),t,j_,60),L_(this.buzzBP.frequency,q(v*1.5,400,6e3),t,j_,1500),I_(this.buzzGain.gain,O,t,j_),L_(this.hiOsc.frequency,q(5e3+8e3*this.spool**1.4,3e3,15e3),t,j_,6e3);let ee=.022*y*(.55+.45*b);I_(this.hiGain.gain,ee,t,j_),I_(this.hiGrain.gain,ee*.4,t,.05),I_(this.hiWander.gain,12*(1-.6*this.spool),t,.08);let te=q(J(e.evBov,0),0,1);te>0&&this._fireBov(t,te),this._stepSurge(t,n,i,a,o,e),this._prevLimiter=!!e.limiter,this._prevThrottle=i,this._prevShifting=o}_stepSurge(e,t,n,r,i,a){this._surge*=Math.exp(-t/this._liftTau),this._closedT=q_(n)?(this._closedT||0)+t:0,this._surge<.001&&(this._surge=0);let o=n<.1,s=o&&this._prevThrottle>=.25,c=this._prevThrottle-n>.2&&n<.5,l=i&&!this._prevShifting,u=this.flutterMode===!1||this.antiLag?0:1,d=q((this.spool-.12)/.28,0,1)*(this.valve===0?1:q(1-.9*this.bovLevel,.15,1))*u,f=a.gearbox===`dct`?.35:a.gearbox===`auto`?.15:1,p=s||c?d:l?d*f:0;if(p>0){if(this._surge<.1){let e=()=>this._rnd();this._liftRate=this.flutterHz*(.7+.45*r+.35*this.boost)*(.85+.3*e()),this._liftPitch=(.85+.25*r)*(.92+.16*e()),this._liftTau=.1+.1*e()+.04*this.boost}this._surge=Math.max(this._surge,p)}o&&d>.06&&this._closedT<.15&&(this._surge=Math.max(this._surge,d*.8));let m=n>.5||n>this._prevThrottle+.05;!o&&!i&&m&&(this._surge*=Math.exp(-t/.11));let h=q(this._surge,0,1),g=this._liftRate*(.7+.45*h);L_(this.surgeOsc.frequency,g,e,.03,16),L_(this.surgeBody.frequency,(2400+700*h+500*r)*this._liftPitch,e,.04,3e3),L_(this.surgeEdge.frequency,(4600+600*h+600*r)*this._liftPitch,e,.04,5200),I_(this.surgeChirp.gain,600*h,e,.04),I_(this.surgeJitter.gain,18*h,e,.04);let _=q(J(a.overrun,0),0,1),v=(.6+.4*r)*(.8+.3*_),y=this.surgeLevel*this.surgeTrim;I_(this.surgeBodyLvl.gain,6.5*y*h*v,e,.03),I_(this.surgeEdgeLvl.gain,.25*y*h*h*v,e,.03);let b=q(5500+3500*this.spool,4500,9500);L_(this.fwOsc.frequency,b,e,.03,7e3),L_(this.fwBP.frequency,b,e,.03,7e3),I_(this.hiSurgeLvl.gain,1.6*y*h*v,e,.03),I_(this.hiChirp.gain,900*h,e,.04),I_(this.hiChirpN.gain,900*h,e,.04)}release(){let e=J(this.ctx.currentTime,0);this.enabled=!1,this.out.gain.setTargetAtTime(0,e,.07),this.surgeSend.gain.setTargetAtTime(0,e,.07);for(let t of this._srcs)try{t.stop(e+.5)}catch{}this._srcs.length=0}_fireBov(e,t){if(this.valve===0)return;let n=this.valve===2,r=q(this.boost,0,1),i=q(this.bovLevel*1.35*t*(.15+.85*r)*(n?.3:1),5e-4,2.5),a=q(.11+.26*r,.05,.5),o=J(e,0)+P_,s=this.bovBP.frequency;s.cancelScheduledValues(o),s.setValueAtTime(F_((n?1300:2600)+1800*r,2800),o),s.exponentialRampToValueAtTime(F_((n?300:520)+180*r,620),o+a*.8);let c=this.bovBP.Q;c.cancelScheduledValues(o),c.setValueAtTime(n?1.5:4.5,o),c.linearRampToValueAtTime(n?3:11,o+a*.6);let l=this.bovHissGain.gain;l.cancelScheduledValues(o),n||(l.setValueAtTime(4e-4,o),l.linearRampToValueAtTime(i*.45,o+.008),l.exponentialRampToValueAtTime(4e-4,o+a*.9),l.setValueAtTime(0,o+a));let u=this.bovGain.gain;u.cancelScheduledValues(o),u.setValueAtTime(4e-4,o),u.linearRampToValueAtTime(i,o+.012),u.exponentialRampToValueAtTime(4e-4,o+a),u.setValueAtTime(0,o+a+.005),this._vent=q(this.bovLevel,.15,1),this.spool*=.97,this._lastBov=J(e,0)}start(e){U_(this._srcs,e)}dispose(){let e=J(this.ctx.currentTime,0);W_(this._srcs,e),G_(this._nodes),this._srcs.length=0,this.enabled=!1}},Y_=new WeakMap;function X_(e){let t=Y_.get(e);if(t)return t;let n=new Float32Array(11),r=new Float32Array(11);for(let e=1;e<=10;e++){let t=e%2?1.25:.8;r[e]=1/e**1.4*t}let i=e.createPeriodicWave(n,r,{disableNormalization:!1});return Y_.set(e,i),i}function Z_(e=1024,t=.55){let n=new Float32Array(e);for(let r=0;r<e;r++){let i=r/(e-1)*2-1,a=i>=0?2.4*(1+t):2.4*(1-t);n[r]=Math.tanh(a*i)/Math.tanh(a)}return n}function Q_(e=1024){let t=new Float32Array(e),n=.24;for(let r=0;r<e;r++){let i=r/(e-1),a=i<n?.5-.5*Math.cos(Math.PI*i/n):1;t[r]=a*Math.exp(-4.5*Math.max(0,i-n))}return t}var $_=Object.freeze({bang:Object.freeze({bus:`combustion`,fA:112,qA:1.6,fB:680,qB:2,mixB:.58,atk:.005,dec:.19,lvl:1}),crackle:Object.freeze({bus:`combustion`,fA:700,qA:3,fB:1850,qB:3.6,mixB:.62,atk:.003,dec:.055,lvl:.5}),clunk:Object.freeze({bus:`mechanical`,fA:330,qA:7,fB:1250,qB:6,mixB:.45,atk:.0035,dec:.075,lvl:.62}),thump:Object.freeze({bus:`mechanical`,fA:95,qA:2.2,fB:320,qB:3,mixB:.35,atk:.004,dec:.13,lvl:.8}),click:Object.freeze({bus:`mechanical`,fA:1500,qA:5,fB:2800,qB:6,mixB:.4,atk:.0018,dec:.02,lvl:.16})}),ev=class{constructor(e,t,n){this.ctx=e;let r=n||{};this.level=J(r.level,1),this.lookahead=q(J(r.lookahead,P_),0,.05),this.overrunCrackle=r.overrunCrackle!==!1,this.maxPerFrame=q(Math.round(J(r.maxPerFrame,18)),1,48),this.stolen=0,this.fired=0,this.pops=[],this._next=0,this._nextPop=0,this._prevPhase=``,this._syncClicks=0,this._rnd=R_(625341585),this._srcs=[],this._nodes=[];let i=e=>(this._nodes.push(e),e);this.out=i(e.createGain()),this.combOut=i(e.createGain()),this.makeup=q(J(r.makeup,9),1,40),this.out.gain.value=this.level*this.makeup,this.combOut.gain.value=this.level*this.makeup;let a=q(Math.round(J(r.voices,16)),2,40),o=Math.max(1,Math.round(a*.62));this.voices=Array(a),this.pools={combustion:[],mechanical:[]},this._cursor={combustion:0,mechanical:0};for(let t=0;t<a;t++){let n=V_(e,`white`,t*.137%1.9);this._srcs.push(n);let r=i(e.createBiquadFilter());r.type=`bandpass`,r.frequency.value=1e3,r.Q.value=6;let a=i(e.createBiquadFilter());a.type=`bandpass`,a.frequency.value=3e3,a.Q.value=8;let s=i(e.createGain());s.gain.value=.5;let c=i(e.createGain());c.gain.value=0;let l=t<o?`combustion`:`mechanical`;n.connect(r),n.connect(a),r.connect(c),a.connect(s),s.connect(c),c.connect(l===`combustion`?this.combOut:this.out);let u={bpA:r,bpB:a,mixB:s,gain:c,busyUntil:-1,bus:l};this.voices[t]=u,this.pools[l].push(u)}this.setProfile(t)}get input(){return null}get output(){return this.out}get combustionOutput(){return this.combOut}setProfile(e){this.profile=e;let t=q(J(e&&e.cylinders,6),1,16);this.cyl=t,this.idleRpm=J(e&&e.idleRpm,800),this.sizeF=(6/t)**.35,this.sizeA=(t/6)**.3,this.burstCount=q(1+Math.round(t/5),1,3)}trigger(e,t,n,r,i){let a=$_[e]||$_.click,o=J(this.ctx.currentTime,0),s=Math.max(J(t,o),o+this.lookahead),c=q(J(n,0)*a.lvl,8e-4,4),l=q(J(r,1),.2,5),u=q(a.dec*q(J(i,1),.2,6),.004,1.5),d=s+a.atk+u+.002,f=a.bus===`combustion`?`combustion`:`mechanical`,p=this.pools[f],m=p.length,h=-1;for(let e=0;e<m;e++){let t=(this._cursor[f]+e)%m;if(p[t].busyUntil<=s){h=t;break}}if(h<0){let e=0;for(let t=1;t<m;t++)p[t].busyUntil<p[e].busyUntil&&(e=t);h=e,this.stolen++}this._cursor[f]=(h+1)%m;let g=p[h];g.bpA.frequency.cancelScheduledValues(s),g.bpA.frequency.setValueAtTime(F_(a.fA*l,1e3),s),g.bpA.Q.setValueAtTime(J(a.qA,4),s),g.bpB.frequency.cancelScheduledValues(s),g.bpB.frequency.setValueAtTime(F_(a.fB*l,3e3),s),g.bpB.Q.setValueAtTime(J(a.qB,6),s),g.mixB.gain.cancelScheduledValues(s),g.mixB.gain.setValueAtTime(J(a.mixB,.5),s);let _=g.gain.gain;return _.cancelScheduledValues(s),_.setValueAtTime(4e-4,s),_.linearRampToValueAtTime(c,s+a.atk),_.exponentialRampToValueAtTime(4e-4,s+a.atk+u),_.setValueAtTime(0,d),g.busyUntil=d,this.fired++,f===`combustion`&&this.pops.length<64&&this.pops.push({time:s,amp:q(J(n,0),0,1)}),h}update(e){let t=J(e.now,0),n=Math.max(0,J(e.rpm,0)),r=q(J(e.rpmNorm,0),0,1),i=this._rnd,a=this.maxPerFrame,o=q(J(e.evCut,0),0,1);if(o>0&&a>0){let e=Math.min(a,this.burstCount),n=t+this.lookahead+i()*.008;for(let t=0;t<e;t++){let e=.72**t*(.55+.65*i()),s=q(.55*o*this.sizeA*e*(.5+.7*r),.001,1),c=t===0||i()<.45?`bang`:`crackle`;this.trigger(c,n,s,this.sizeF*(.75+.6*i()),.7+.8*i()),n+=.012+i()*.048,a--}}let s=q(J(e.evPop,0),0,1);if(s>0&&a>0){let e=i(),n=.5*s+.5*r,o;o=e<.34-.16*n?`crack`:e<.8-.1*n?`double`:`stutter`;let c=q(Math.round((1+6/Math.max(3,this.cyl))*(.6+.7*i())),2,3),l=Math.min(a,o===`crack`?1:o===`double`?2:c),u=o===`crack`?2.6:o===`double`?2:1.6,d=.42+1.05*i()*i(),f=t+this.lookahead+i()*.006;for(let e=0;e<l;e++){let t=.86**e*(.6+.8*i()),n=q(u*d*s*this.sizeA*t*(.5+.65*r),.001,2),c=e===0||i()<.5?`bang`:`crackle`,l=this.sizeF*(.62+.7*i())*(1-.22*s);this.trigger(c,f,n,l,.7+.9*i());let p=o===`stutter`?.55:1;f+=(.055+i()*.16)*(.6+4/Math.max(3,this.cyl))*p,a--}}let c=q(J(e.evLash,0),0,1);if(c>0&&a>0){let e=t+this.lookahead;this.trigger(`clunk`,e,q(.5*c,.001,1),.9+.25*i(),.8+.5*c),a--,c>.35&&a>0&&(this.trigger(`clunk`,e+.018+i()*.012,q(.16*c,.001,1),1.3,.5),a--)}let l=q(J(e.evEngage,0),0,1);l>0&&a>0&&(this.trigger(`thump`,t+this.lookahead,q(.45*l,.001,1),1,.8+.6*l),a--);let u=e.shiftPhase||``;u===`sync`?(this._prevPhase!==`sync`&&(this._syncClicks=0,this._syncNext=t),this._syncClicks<1&&t>=J(this._syncNext,t)&&a>0&&(this.trigger(`click`,t+this.lookahead,.3+.22*i(),.85+.4*i(),1),this._syncClicks++,this._syncNext=t+.035+i()*.03,a--)):this._prevPhase===`sync`&&(this._syncClicks=0),this._prevPhase=u;let d=q(J(e.overrun,0),0,1),f=e.popIntensity==null?d*.55:q(J(e.popIntensity,0),0,1);if(!(this.overrunCrackle&&f>.3&&n>this.idleRpm*1.5&&!e.shifting)){this._nextPop=t;return}this._nextPop<t&&(this._nextPop=t+.01+i()*.04);let p=t+.12,m=.35+1.2*f*(.35+.65*r)*(this.cyl/6);for(;this._nextPop<p&&a>0;){let e=Math.max(this._nextPop,t+this.lookahead),n=q(.3*f*this.sizeA*(.25+1.5*i()*i())*(.45+.55*r),.001,1);this.trigger(i()<.4?`bang`:`crackle`,e,n,this.sizeF*(.7+.9*i()),.6+.9*i()),this._nextPop=e+(.25+2.2*i()*i())/Math.max(.4,m),a--}this._nextPop<t&&(this._nextPop=t)}start(e){U_(this._srcs,e)}dispose(){let e=J(this.ctx.currentTime,0);W_(this._srcs,e),G_(this._nodes),this._srcs.length=0,this.voices.length=0}},tv=(e,t,n)=>e<t?t:e>n?n:e,nv=(e,t=0)=>typeof e==`number`&&isFinite(e)?e:t,rv=.02;function iv(e,t,n,r=rv){if(!e)return;let i=nv(t,0);e.setTargetAtTime(i,Math.max(0,nv(n,0)),r>0?r:rv)}function av(e,t,n){let r=Math.max(1,Math.floor(e.sampleRate*t)),i=e.createBuffer(1,r,e.sampleRate),a=i.getChannelData(0),o=0;for(let e=0;e<r;e++){let t=Math.random()*2-1;n?(o=(o+.02*t)/1.02,a[e]=o*3.5):a[e]=t}let s=Math.min(2048,r>>2);for(let e=0;e<s;e++){let t=e/s;a[e]=a[e]*t+a[r-s+e]*(1-t)}return i}var ov=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.cyl=t.cylinders,this.pulseOrder=Math.max(.5,this.cyl/2/Math.max(1,t.banks.length)),this.src=W(e.createBufferSource()),this.src.buffer=av(e,2.7,!1),this.src.loop=!0,this.hp=e.createBiquadFilter(),this.hp.type=`highpass`,this.hp.frequency.value=55,this.body=e.createBiquadFilter(),this.body.type=`lowpass`,this.body.frequency.value=900,this.body.Q.value=.9,this.peak=e.createBiquadFilter(),this.peak.type=`peaking`,this.peak.frequency.value=140,this.peak.Q.value=1.4,this.peak.gain.value=7,this.level=e.createGain(),this.level.gain.value=0,this.pulse=W(e.createOscillator()),this.pulse.type=`sawtooth`,this.pulse.frequency.value=40,this.pulseDepth=e.createGain(),this.pulseDepth.gain.value=0,this.out=e.createGain(),this.out.gain.value=1,this.src.connect(this.hp),this.hp.connect(this.peak),this.peak.connect(this.body),this.body.connect(this.level),this.level.connect(this.out),this.pulse.connect(this.pulseDepth),this.pulseDepth.connect(this.level.gain),this.gain=tv(nv(n.gain,1),0,4),this.started=!1}get input(){return null}get output(){return this.out}start(e){if(!this.started){this.started=!0;try{this.src.start(e)}catch{}try{this.pulse.start(e)}catch{}}}stop(e){try{this.src.stop(e)}catch{}try{this.pulse.stop(e)}catch{}this.started=!1}update(e){let t=nv(e.now,0),n=tv(nv(e.rpmNorm,0),0,1),r=tv(nv(e.load,0),0,1),i=tv(nv(e.overrun,0),0,1),a=tv(tv(nv(e.f0,10),.05,4e3)*this.pulseOrder*2,10,6e3),o=.3+.7*r,s=this.gain*.28*o*(.25+.75*n)*(1+.35*i);iv(this.level.gain,s,t),iv(this.pulse.frequency,a,t),iv(this.pulseDepth.gain,Math.min(s*.85,s*(1.1-.7*n)),t),iv(this.peak.frequency,tv(a,30,2e3),t),iv(this.body.frequency,tv(450+2600*r+1800*n,120,9e3),t),iv(this.hp.frequency,tv(40+30*n,20,400),t)}dispose(){for(let e of[this.src,this.hp,this.peak,this.body,this.level,this.pulse,this.pulseDepth,this.out])e&&e.disconnect&&e.disconnect()}},sv=class{constructor(e,t,n={}){this.ctx=e,this.profile=t;let r=Math.max(.5,t.cylinders/4),i=(t.idleRpm+t.redlineRpm)/2/120;for(;r*i<38&&r<8;)r*=2;for(;r*i>85&&r>.5;)r/=2;this.order=r,this.subHz=r*i,this.osc=W(e.createOscillator()),this.osc.type=`sine`,this.osc.frequency.value=40,this.shaper=e.createWaveShaper(),this.shaper.curve=this._curve(),this.shaper.oversample=`2x`,this.tone=e.createBiquadFilter(),this.tone.type=`lowpass`,this.tone.frequency.value=220,this.tone.Q.value=.7,this.level=e.createGain(),this.level.gain.value=0,this.out=e.createGain(),this.out.gain.value=tv(nv(n.gain,1),0,4),this.osc.connect(this.shaper),this.shaper.connect(this.tone),this.tone.connect(this.level),this.level.connect(this.out),this.started=!1}_curve(e=2048){let t=new Float32Array(e);for(let n=0;n<e;n++){let r=n/(e-1)*2-1;t[n]=Math.tanh(1.8*r)*.92+.08*Math.tanh(2.6*r*r*Math.sign(r))}return t}get input(){return null}get output(){return this.out}start(e){if(!this.started){this.started=!0;try{this.osc.start(e)}catch{}}}stop(e){try{this.osc.stop(e)}catch{}this.started=!1}update(e){let t=nv(e.now,0),n=tv(nv(e.f0,10),.05,4e3),r=tv(nv(e.load,0),0,1),i=tv(nv(e.rpmNorm,0),0,1),a=tv(nv(e.overrun,0),0,1);iv(this.osc.frequency,tv(n*this.order,12,400),t);let o=.34*(.18+.82*r**.75)*(1-.45*i)*(1-.6*a);iv(this.level.gain,o,t),iv(this.tone.frequency,tv(150+260*r,80,800),t)}dispose(){for(let e of[this.osc,this.shaper,this.tone,this.level,this.out])e&&e.disconnect&&e.disconnect()}},cv=class{constructor(e,t,n={}){this.ctx=e,this.depthCents=tv(nv(n.detuneCents,7),0,60),this.depthGain=tv(nv(n.tremolo,.1),0,.6);let r=[.237,1.703,5.317];this.lfos=r.map(t=>{let n=W(e.createOscillator());n.type=`sine`,n.frequency.value=t;let i=e.createGain();return i.gain.value=1/r.length,n.connect(i),{osc:n,gain:i}}),this.rough=W(e.createBufferSource()),this.rough.buffer=av(e,3.1,!0),this.rough.loop=!0,this.roughLP=e.createBiquadFilter(),this.roughLP.type=`lowpass`,this.roughLP.frequency.value=22,this.roughGain=e.createGain(),this.roughGain.gain.value=.9,this.rough.connect(this.roughLP),this.roughLP.connect(this.roughGain),this.bus=e.createGain(),this.bus.gain.value=1;for(let e of this.lfos)e.gain.connect(this.bus);this.roughGain.connect(this.bus),this.detune=e.createGain(),this.detune.gain.value=0,this.tremolo=e.createGain(),this.tremolo.gain.value=0,this.bus.connect(this.detune),this.bus.connect(this.tremolo),this.started=!1}get input(){return null}get output(){return this.bus}setEventSource(e){this._event=e}start(e){if(!this.started){this.started=!0;for(let t of this.lfos)try{t.osc.start(e)}catch{}try{this.rough.start(e)}catch{}}}stop(e){for(let t of this.lfos)try{t.osc.stop(e)}catch{}try{this.rough.stop(e)}catch{}this.started=!1}update(e){let t=nv(e.now,0),n=tv(nv(e.rpmNorm,0),0,1),r=tv(nv(e.load,0),0,1),i=(1-n)*(1-.55*r),a=tv(nv(e.rough,0),0,1),o=+!this._event;iv(this.detune.gain,o*this.depthCents*(.25+.75*i)*(1+2.5*a),t,.08),iv(this.tremolo.gain,(this._event?.2:1)*this.depthGain*(.2+.8*i)*(1+1.5*a),t,.08),iv(this.roughLP.frequency,tv(8+40*n,4,200),t,.1)}dispose(){for(let e of this.lfos)e.osc.disconnect(),e.gain.disconnect();for(let e of[this.rough,this.roughLP,this.roughGain,this.bus,this.detune,this.tremolo])e&&e.disconnect&&e.disconnect()}},lv=Object.freeze([{id:`strain`,label:`Strain`,default:0,note:`Engine working against something — a climb, a trailer, a heavy car. More rumble, harder combustion, more growl, at the same throttle.`},{id:`aggression`,label:`Exhaust valve`,default:0,note:`Active exhaust bypass. Opens the muffler: shallower chambers, brighter packing, more rasp and more level.`},{id:`roughness`,label:`Roughness`,default:0,note:`Engine health. Cycle-to-cycle variation and random misfires — a skipped combustion event in the pipe.`},{id:`distance`,label:`Distance`,default:0,note:`Listener distance. Air absorption takes the top off, level falls, and the room takes over.`},{id:`environment`,label:`Enclosure`,default:0,note:`Open road → tunnel. Hard parallel walls: dense fluttering reflections and a longer tail.`}]),uv=Object.freeze(Object.fromEntries(lv.map(e=>[e.id,e.default]))),dv=(e,t,n)=>e<t?t:e>n?n:e,fv=60/(2*Math.PI),pv={manual:{cutF:.3,openF:.3,syncF:.15,engageF:.35,cutMin:.03,openMin:.035,syncMin:.018,engageMin:.05,openClutch:0,engageStart:0,cutDepth:1,cutBang:.85,blip:.85,blipTolRpm:130,lashMax:.17,shuffle:.36,openStretch:2.6},dct:{cutF:.3,openF:.25,syncF:.15,engageF:.6,cutMin:.012,openMin:.01,syncMin:.008,engageMin:.028,openClutch:.1,engageStart:.4,cutDepth:1,cutBang:1,blip:1,blipTolRpm:60,lashMax:.09,shuffle:.26,openStretch:2},auto:{cutF:.2,openF:.25,syncF:.18,engageF:.9,cutMin:.02,openMin:.025,syncMin:.018,engageMin:.09,openClutch:0,engageStart:.12,cutDepth:.55,cutBang:.15,blip:.35,blipTolRpm:220,lashMax:.2,shuffle:.42,openStretch:1.6}},mv=class{constructor(e={}){this.type=e.type in pv?e.type:`manual`,this.k=pv[this.type],this.S=Math.max(.02,(e.shiftTimeMs||120)/1e3),this.gearCount=e.gearCount||6,this.idleRpm=e.idleRpm||800,this.redlineRpm=e.redlineRpm||7e3,this.revMatch=e.revMatch!==!1,this.autoShift=e.autoShift!==!1,this.upFracLow=.55,this.upFracHigh=.936,this.downFracLow=.28,this.downFracHigh=.44,this.kickdownThrottle=.85,this.minShiftInterval=.35,this.tCut=0,this.tOpen=0,this.tSync=0,this.tEngage=0,this.reset()}reset(){this.phase=``,this.t=0,this.from=0,this.to=0,this.isDown=!1,this.revTargetW=0,this.sinceShift=999,this.contactSeen=!1,this.blipHeld=!1}get shifting(){let e=this.phase;return e===`cut`||e===`open`||e===`sync`||e===`engage`}get busy(){return this.phase!==``}request(e,t,n=!1){if(t=Math.round(t),this.shifting||t<0||t>this.gearCount||t===e.gear||!n&&this.sinceShift<this.minShiftInterval||this.wouldOverRev(e,t))return!1;this.from=e.gear,this.to=t,this.isDown=t!==0&&(e.gear===0||t<e.gear),this.contactSeen=!1,this.blipHeld=!1;let r=this.k,i=this.S;this.tCut=Math.max(r.cutMin,r.cutF*i),this.tOpen=Math.max(r.openMin,r.openF*i),this.tSync=Math.max(r.syncMin,r.syncF*i),this.tEngage=Math.max(r.engageMin,r.engageF*i),this.revTargetW=this.isDown&&this.revMatch&&t>0?dv(e.gearedRpm(t),this.idleRpm,this.redlineRpm*.97)/fv:0,this.phase=`cut`,this.t=0;let a=dv(((typeof e.egt==`number`?e.egt:1)-.45)/.35,0,1),o=r.cutBang*(.25+.75*e.throttle)*r.cutDepth*a,s=dv((.12+.55*a)*r.cutBang,0,.9);return o>.04&&Math.random()<s&&e.fireEvent(`cut`,dv(o,0,1)),!0}wouldOverRev(e,t){return t<=0?!1:e.gearedRpm(t)>this.redlineRpm}upshiftRpm(e){let t=this.upFracLow+(this.upFracHigh-this.upFracLow)*dv(e,0,1);return Math.max(this.idleRpm*1.6,this.redlineRpm*t)}downshiftRpm(e){let t=this.downFracLow+(this.downFracHigh-this.downFracLow)*dv(e,0,1);return Math.max(this.idleRpm*1.15,this.redlineRpm*t)}auto(e){if(!this.autoShift||this.busy||e.gear===0||this.sinceShift<this.minShiftInterval)return;let t=e.throttle,n=e.rpm,r=this.upshiftRpm(t);if(n>=r&&e.gear<this.gearCount&&t>.05){this.request(e,e.gear+1);return}let i=typeof e.wotTorque==`function`?t=>e.wotTorque(t)*t:null;if(i&&t>=this.kickdownThrottle&&e.gear<this.gearCount&&n>this.redlineRpm*.6){let t=e.gearedRpm(e.gear+1);if(t>this.idleRpm*1.5&&i(t)>=i(n)){this.request(e,e.gear+1);return}}if(e.gear>1){let a=e.gear-1,o=e.gearedRpm(a);if(o>=r)return;if(n<=this.downshiftRpm(t)){this.request(e,a);return}t>=this.kickdownThrottle&&n<this.redlineRpm*.55&&o<this.redlineRpm*.92&&(!i||i(o)>i(n))&&this.request(e,a)}}step(e,t){if(t.gearboxNeutral=!1,t.syncing=!1,t.fuelCut=0,t.throttleOverride=null,t.clutchCmd=null,t.clutchRate=0,!this.busy&&(this.sinceShift+=e,this.auto(t),!this.busy)){t.shiftPhase=``,t.shifting=!1;return}this.t+=e;let n=this.k;switch(this.phase){case`cut`:t.fuelCut=n.cutDepth,t.clutchCmd=1,this.t>=this.tCut&&this._enter(`open`,t);break;case`open`:if(t.gearboxNeutral=!0,t.clutchCmd=n.openClutch,t.clutchRate=60,this.isDown&&this.revTargetW>0){let e=this.revTargetW-t.we,r=n.blipTolRpm/fv;e>r?this.blipHeld=!0:e<0&&(this.blipHeld=!1),t.throttleOverride=this.blipHeld?n.blip:0;let i=Math.abs(e)<=r;(this.t>=this.tOpen&&i||this.t>=this.tOpen*n.openStretch)&&this._enter(`sync`,t)}else t.fuelCut=n.cutDepth,n.cutDepth>=1&&(t.throttleOverride=0),this.t>=this.tOpen&&this._enter(`sync`,t);break;case`sync`:{t.gearboxNeutral=!0,t.clutchCmd=n.openClutch,t.fuelCut=n.cutDepth,n.cutDepth>=1&&(t.throttleOverride=0),this.to>0&&(t.syncing=!0,t.syncTargetW=t.inputShaftTargetW(this.to));let e=this.to===0||Math.abs(t.wg-t.syncTargetW)<3;(this.t>=this.tSync&&e||this.t>=this.tSync*3)&&this._enter(`engage`,t);break}case`engage`:{let e=dv(this.t/this.tEngage,0,1),r=e*e*(3-2*e);t.clutchCmd=n.engageStart+(1-n.engageStart)*r,t.clutchRate=4/this.tEngage,this.to===0&&(t.clutchCmd=0),t.lashContactedSince&&(this.contactSeen=!0),this.t>=this.tEngage&&this._enter(`lash`,t);break}case`lash`:t.clutchCmd=this.to===0?0:1,t.lashContactedSince&&(this.contactSeen=!0),(this.contactSeen||this.t>=n.lashMax||this.to===0)&&this._enter(`shuffle`,t);break;case`shuffle`:t.clutchCmd=this.to===0?0:null,this.t>=n.shuffle&&(this.phase=``,this.t=0,this.sinceShift=0,t.clutchCmd=null)}t.shiftPhase=this.phase,t.shifting=this.shifting}_enter(e,t){if(this.phase,this.phase=e,this.t=0,e===`sync`&&(t.selectGear(this.to),this.to>0&&(t.syncTargetW=t.inputShaftTargetW(this.to))),e===`engage`){t.gearboxNeutral=!1;let e=Math.abs(t.we-t.wg)*fv;t.fireEvent(`engage`,dv(.15+e/1800,0,1)),t.lashContactedSince=!1,this.contactSeen=!1}e===`lash`&&t.fireEvent(`shiftDone`,1)}},hv=60/(2*Math.PI),gv=2*Math.PI/60,_v=1.225,vv=9.81,Y=(e,t,n)=>e<t?t:e>n?n:e,yv=2e3,bv=240,xv=.03,Sv=.02,Cv=52,wv=.2,Tv=15,Ev=1.5,Dv=.055,Ov=.55,kv=2.4,Av=.85,jv=.45,Mv=class{constructor(e,t,n={}){this.engine=e,this.vehicle=t,this.dl=Object.assign({},Ig,n.driveline),this.eff=n.driveEfficiency==null?.92:n.driveEfficiency,this.Je=Math.max(.02,e.engineInertia),this.Jin=n.inputInertia==null?xv:n.inputInertia,this.Jout=n.outputInertia==null?Sv:n.outputInertia,this.r=t.wheelRadius,this.fd=t.finalDrive,this.ratios=t.gearRatios,this.gearCount=this.ratios.length,this.Jv=t.mass*this.r*this.r+Cv*this.r*this.r,this.subStep=n.subStep||5e-4,this.launchFlareRpm=n.launchFlareRpm==null?2400:n.launchFlareRpm,this.launchRateOverride=n.launchRate==null?null:n.launchRate,this.launchRate=this.launchRateFor(1),this.shift=n.shiftController||new mv({type:t.gearbox,shiftTimeMs:t.shiftTimeMs,gearCount:this.gearCount,idleRpm:e.idleRpm,redlineRpm:e.redlineRpm,autoShift:n.autoShift!==!1,revMatch:n.revMatch!==!1}),this.isAuto=t.gearbox===`auto`,this.throttle=0,this.brake=0,this.we=e.idleRpm*gv,this.wg=this.we,this.wo=0,this.ww=0,this.twist=0,this.dtwist=0,this.lash=0,this.contact=0,this.clutch=0,this.boost=0,this.gear=1,this.Tp=0,this.Te=0,this.Tc=0,this.load=0,this.overrun=0,this.limiterCut=0,this.limiterActive=!1,this.lashTimer=0,this.lashContactedSince=!1,this.launchArmed=!0,this.launchI=0,this.launchT=0,this.launchRef=0,this.lockup=0,this.bovArm=0,this.boostDump=0,this.turboSpeed=0,this.egt=0,this.dfco=0,this.dfcoEdge=0,this.prevDfco=0,this.popCharge=0,this.prevOverride=0,this.thrPeak=0,this.cutRpmN=0,this.popRefractory=0,this.lashHeat=0,this.prevLimiter=!1,this.limiterBark=0,this.prevRpm=this.we*hv,this.gearboxNeutral=!1,this.syncing=!1,this.syncTargetW=0,this.clutchCmd=null,this.burnoutClutchOverride=null,this.clutchRate=0,this.fuelCut=0,this.throttleOverride=null,this.shiftPhase=``,this.shifting=!1,this.ev={cut:0,lash:0,engage:0,bov:0,shiftDone:0,pop:0},this.params={now:0,dt:0,rpm:0,f0:0,rpmNorm:0,dRpm:0,throttle:0,load:0,overrun:0,torqueSign:1,gear:1,gearRatio:0,speed:0,wheelRpm:0,clutchSlip:0,clutchEngaged:0,boost:0,shifting:!1,shiftPhase:``,evCut:0,evLash:0,evEngage:0,evBov:0,evShiftDone:0,evPop:0},this.clutch=0,this._writeParams(0,0)}setThrottle(e){this.throttle=Y(Number(e)||0,0,1)}setBrake(e){this.brake=Y(Number(e)||0,0,1)}setEngine(e){this.engine=e,this.Je=Math.max(.02,e.engineInertia),this.launchRate=this.launchRateFor(1),this.shift.idleRpm=e.idleRpm,this.shift.redlineRpm=e.redlineRpm;let t=Y(this.we*hv,e.idleRpm,e.redlineRpm);this.we=t*gv,this.prevRpm=t,this.boost=0,this.limiterCut=0,this.limiterActive=!1}setVehicle(e){let t=this.speed;this.vehicle=e,this.r=e.wheelRadius,this.fd=e.finalDrive,this.ratios=e.gearRatios,this.gearCount=this.ratios.length,this.Jv=e.mass*this.r*this.r+Cv*this.r*this.r,this.isAuto=e.gearbox===`auto`,this.shift.type=e.gearbox,this.shift.gearCount=this.gearCount,this.shift.setTiming&&this.shift.setTiming(e.shiftTimeMs),this.shift.reset(),this.launchRate=this.launchRateFor(1),this.gear=Y(Math.round(this.gear),0,this.gearCount),this.ww=t/this.r,this.wo=this.ww*this.fd,this.twist=0,this.dtwist=0,this.contact=0}setAutoShift(e){this.shift.autoShift=!!e}shiftUp(){return this.gear>=this.gearCount?!1:this.shift.request(this,this.gear+1,!0)}shiftDown(){return this.gear<=1?!1:this.shift.request(this,this.gear-1,!0)}setGear(e){return this.shift.request(this,e,!0)}get rpm(){return this.we*hv}get speed(){return this.ww*this.r}get gearRatio(){return this.gear>0?this.ratios[this.gear-1]:0}get totalRatio(){return this.gear>0?this.ratios[this.gear-1]*this.fd:0}gearedRpm(e){return e<=0||e>this.gearCount?0:Math.abs(this.ww)*this.fd*this.ratios[e-1]*hv}launchRateFor(e){if(this.launchRateOverride!=null)return this.launchRateOverride;let t=Y(Math.round(e),1,this.gearCount)-1,n=Math.abs(this.ratios[t]*this.fd)||1;return Y(this.engine.peakTorque*n*this.eff/this.r/Math.max(1,this.vehicle.mass)/this.r*n*hv*.55,400,12e3)}inputShaftTargetW(e){return e<=0||e>this.gearCount?0:this.ww*this.fd*this.ratios[e-1]}selectGear(e){this.gear=Y(Math.round(e),0,this.gearCount)}fireEvent(e,t){t>this.ev[e]&&(e===`pop`&&this.we*hv<yv||(this.ev[e]=t>1?1:t))}_JoutSide(e,t=!0){if(e<=0)return this.Jout;let n=this.ratios[e-1];return(t?this.Je+this.Jin:this.Jin)*n*n+this.Jout}_JvehOut(){return this.Jv/(this.fd*this.fd)}modeW(e,t=!0){let n=this._JoutSide(e,t),r=this._JvehOut();return Math.sqrt(this.dl.stiffness*(1/n+1/r))}modeHz(e,t=!0){return this.modeW(e,t)/(2*Math.PI)}modeZeta(e,t=!0){if(this.dl.dampingRatio!=null)return this.dl.dampingRatio;let n=this._Jred(e,t);return this.dl.damping/(2*Math.sqrt(this.dl.stiffness*n))}_Jred(e,t=!0){let n=this._JoutSide(e,t),r=this._JvehOut();return 1/(1/n+1/r)}_dampCoeff(){if(this.dl.dampingRatio==null)return this.dl.damping;let e=this.clutch>.5&&!this.gearboxNeutral,t=this._Jred(this.gear>0?this.gear:1,e);return Y(2*this.dl.dampingRatio*Math.sqrt(this.dl.stiffness*Math.max(1e-4,t)),1,400)}stabilityReport(){let e=0,t=``;for(let n=1;n<=this.gearCount;n++)for(let r of[!0,!1]){let i=this.modeW(n,r);i>e&&(e=i,t=`gear ${n} clutch ${r?`locked`:`open`}`)}let n=Math.sqrt(this.dl.stiffness/this.Jout);n>e&&(e=n,t=`gearbox neutral (output shaft alone)`);let r=this.dl.damping/this.Jout;return{subStep:this.subStep,worstModeRadS:e,worstModeHz:e/(2*Math.PI),worstModeWhere:t,stableBelowSpring:2/e,stableBelowDamper:2/r,phasePerStepRad:e*this.subStep,marginSpring:2/e/this.subStep,marginDamper:2/r/this.subStep}}getState(){return{rpm:this.rpm,speed:this.speed,speedKmh:this.speed*3.6,gear:this.gear,throttle:this.throttle,brake:this.brake,twist:this.twist,contact:this.contact,clutch:this.clutch,Tp:this.Tp,boost:this.boost,phase:this.shiftPhase,shifting:this.shifting,limiter:this.limiterActive,gearCount:this.gearCount,redline:this.engine.redlineRpm,idle:this.engine.idleRpm}}torqueFactor(e){let t=(e-this.engine.peakTorqueRpm)/(this.engine.redlineRpm*.75);return Y(1-.85*t*t,.3,1)}wotTorque(e){return this.engine.peakTorque*this.torqueFactor(e)*this._boostMult()-this.frictionTorque(e,1)}frictionTorque(e,t){return(18+.012*e+22e-7*e*e)*(1-.62*t)}step(e,t=0){let n=Number(e)||0;if(n<=0)return this.params.now=t,this.params.dt=0,this.params.evCut=this.params.evLash=this.params.evEngage=0,this.params.evBov=this.params.evShiftDone=0,this.params;n=Math.min(n,.1);let r=Math.min(bv,Math.max(1,Math.ceil(n/this.subStep))),i=n/r;for(let e=0;e<r;e++)this._substep(i);return this._writeParams(n,t),this.params}_substep(e){let t=this.engine;this.vehicle;let n=this.dl;this.lashContactedSince=!1,this.shift.step(e,this);let r=this.gear>0&&!this.gearboxNeutral,i=this.gear>0?this.ratios[this.gear-1]:0;this.limiterCut>0?(this.limiterCut-=e,this.limiterCut<=0&&this.rpm>t.redlineRpm-200&&(this.limiterCut=.012)):this.rpm>=t.redlineRpm&&(this.limiterCut=.05),this.limiterActive=this.limiterCut>0;let a=this.throttleOverride==null?this.throttle:this.throttleOverride;a*=1-Y(this.fuelCut,0,1),this.limiterActive&&(a=0),this.thrEff=a,this._stepTurbo(e,a),this._stepExhaustThermal(e,a);let o=this.we*hv,s=a*t.peakTorque*this.torqueFactor(o)*this._boostMult()-this.frictionTorque(o,a);if(this.throttle<.06&&o<t.idleRpm*1.25&&!this.limiterActive){let e=this.frictionTorque(t.idleRpm,0)+(t.idleRpm-o)*.55;e>s&&(s=e)}this.Te=s;let c=n.backlash,l=this._dampCoeff(),u=0;this.twist>c?(u=n.stiffness*(this.twist-c)+l*this.dtwist,u<0&&(u=0)):this.twist<-c&&(u=n.stiffness*(this.twist+c)+l*this.dtwist,u>0&&(u=0)),this.Tp=u,this._stepClutch(e,r,i);let d=0,f=0;if(this.isAuto){let e=this._converter(this.we,this.wg);d=e.pump,f=e.turbine}let p=r?this.Jin+this.Jout/(i*i):this.Jin,m=-this._gearboxDrag(this.wg);if(r&&(m-=u/i),this.syncing){let e=this.syncTargetW-this.wg;m+=Y(e*this.Jin/.008,-400,400)}m+=f;let h=s-d,g=m,_=this.Je*p/(this.Je+p),v=n.clutchTorqueCapacity*this.clutch*this._stallGuard(),y=_*((this.we-this.wg)/e+h/this.Je-g/p);y>v?y=v:y<-v&&(y=-v),this.Tc=y,this.we+=e*(h-y)/this.Je,this.wg+=e*(g+y)/p;let b=t.idleRpm*.42*gv,x=t.redlineRpm*1.015*gv;this.we<b&&(this.we=b),this.we>x&&(this.we=x),r?this.wo=this.wg/i:this.wo+=e*(-u-this._gearboxDrag(this.wo)*.5)/this.Jout,this._stepVehicle(e,u),this.dtwist=this.wo-this.ww*this.fd,this.twist+=e*this.dtwist,Math.abs(this.twist)<3||(this.twist=Y(this.twist||0,-3,3)),this.lash=Y(this.twist,-c,c),this._detectLash(e,c)}_gearboxDrag(e){return .006*e+(e>.5?.4:e<-.5?-.4:0)}_stallGuard(){let e=this.engine.idleRpm*gv;return Y((this.we-e*.92)/(e*.55),0,1)}_stepClutch(e,t,n){let r=this.burnoutClutchOverride??this.clutchCmd,i=this.burnoutClutchOverride==null?this.clutchRate:18;r??(this.isAuto?(r=t&&this.gear>=2&&this.gearedRpm(this.gear)>this.engine.idleRpm*1.35&&this.throttle<.85?1:0,i=2.5):r=this._launchClutch(e,t)),i>0||(i=this.dl.clutchStiffness*12),this.clutch+=(Y(r,0,1)-this.clutch)*Math.min(1,e*i),this.clutch=Y(this.clutch,0,1)}_launchClutch(e,t){let n=this.engine.idleRpm,r=this.gearedRpm(this.gear);if(!t||this.gear===0)return this.launchI=0,this.launchT=0,this.launchRef=0,this.launchArmed=!0,0;let i=Y(n*1.05+this.throttle*this.launchFlareRpm,n,this.engine.redlineRpm*.9);if(this.launchArmed&&this.clutch>.985&&r>i*.75?this.launchArmed=!1:!this.launchArmed&&r<n*.95&&(this.launchArmed=!0),!this.launchArmed)return this.launchI=0,this.launchT=0,this.launchRef=0,1;if(this.throttle<.05&&r<n*.5)return this.launchT=0,this.launchRef=0,this.launchI=Math.max(0,this.launchI-e/.2),Y(this.launchI,0,.22);this.launchT=Math.min(4,(this.launchT||0)+e);let a=this.launchRateFor(this.gear),o=Math.max(300,i-n),s=r+o*(1-Y(r/Math.max(1,o*1.8),0,1));this.launchRef>0||(this.launchRef=Math.max(n*1.05,this.rpm));let c=s-this.launchRef,l=c>0?Math.min(a,c/jv):c/jv;this.launchRef+=l*e;let u=Math.max(s,n*1.05);this.launchRef=Math.min(this.launchRef,u,this.rpm+o*.5),this.launchRef=Math.max(this.launchRef,n*1.05),this.rpm>this.launchRef&&(this.launchRef=Math.min(this.rpm,u));let d=this.launchRef,f=this.dl.clutchTorqueCapacity*this._stallGuard(),p=this.Te-this.Je*l*gv,m=f>1?Y(p/f,0,1):0,h=(this.rpm-d)/d;this.launchI=Y(this.launchI*(1-Math.min(1,e/.6))+8*h*e,-.4,.5);let g=Y(m+this.launchI+1.5*h,0,1),_=Y((this.launchT-.9)/1.2,0,1);return Math.max(g,Math.min(_,m))}_converter(e,t){if(e>t+.5){let n=Y(t/Math.max(e,.001),0,1),r=Y(.008*e*e*(1-n*n),0,4*this.engine.peakTorque);return{pump:r,turbine:r*(1+1*(1-n)**1.2)}}if(t>e+.5){let n=Y(e/Math.max(t,.001),0,1),r=Y(.0048*t*t*(1-n*n),0,4*this.engine.peakTorque);return{pump:-r,turbine:-r}}return{pump:0,turbine:0}}_stepVehicle(e,t){let n=this.vehicle,r=this.ww*this.r,i=t>0?t*this.fd*this.eff:t*this.fd,a=.5*_v*n.dragArea*r*r,o=r>0?a*this.r:0,s=(n.rollingResistance*n.mass*vv+this.brake*n.brakeForce)*this.r,c=i-o;if(this.ww>1e-6){let t=this.ww+e*(c-s)/this.Jv;this.ww=t<0&&c<s?0:Math.max(0,t)}else this.ww=c>s?e*(c-s)/this.Jv:0}_detectLash(e,t){this.lashTimer+=e,this.lashHeat=Math.max(0,this.lashHeat-e/Ov);let n=this.twist>t?1:this.twist<-t?-1:0;if(n===0){Math.abs(this.twist)<t*Av&&(this.contact=0);return}if(n===this.contact)return;let r=Math.abs(this.dtwist);if(this.contact=n,r<wv||this.lashTimer<Dv)return;this.lashTimer=0,this.lashContactedSince=!0;let i=1/(1+kv*this.lashHeat);this.lashHeat=Math.min(3,this.lashHeat+1);let a=Y((r/Tv)**+Ev*i,.001,1);a<.05||this.fireEvent(`lash`,a)}_stepExhaustThermal(e,t){let n=this.we*hv,r=Y((n-this.engine.idleRpm)/Math.max(1,this.engine.redlineRpm-this.engine.idleRpm),0,1),i=Y(.12+.88*t**.6*(.35+.65*r),0,1),a=i>this.egt?5:26;this.egt+=(i-this.egt)*Math.min(1,e/a);let o=this.throttle,s=o<.06&&n>this.engine.idleRpm*1.5&&!this.gearboxNeutral;if(this.dfco=+!!s,this.thrPeak=Math.max(o,this.thrPeak-e/.7),this.popRefractory=Math.max(0,this.popRefractory-e),this.limiterBark=Math.max(0,this.limiterBark-e),this.limiterActive&&!this.prevLimiter&&this.egt>.5&&this.limiterBark<=0&&(this.limiterBark=.34,this.fireEvent(`pop`,Y(.16+.14*Math.random(),0,1))),this.prevLimiter=this.limiterActive,this.dfco!==this.prevDfco){if(this.dfcoEdge=1,this.dfco){let e=Y(this.thrPeak,0,1),t=r**1.7;this.cutRpmN=r;let n=.55+Math.random()*.95;this.popCharge=Y(this.popCharge+(.5+2.1*t)*(.4+.6*e)*n,0,3.4);let i=Y((this.egt-.42)/.34,0,1)*(.18+.82*t)*(.45+.55*e);this.egt>.42&&this.popRefractory<=0&&Math.random()<i&&(this.popRefractory=.45,this.fireEvent(`pop`,Y((this.egt-.35)*1.25*(.1+1.3*t)*(.35+.65*e)*n,0,1)))}else this.popCharge=Y(this.popCharge+.35,0,3.4)}this.prevDfco=this.dfco,this.dfcoEdge=Math.max(0,this.dfcoEdge-e/.85);let c=this.throttleOverride;if(this.prevOverride>.3&&!(c>.3)){this.popCharge=Y(this.popCharge+1.1+.5*r,0,2.6);let e=Y((this.egt-.32)/.3,0,1)*(.35+.65*r);this.egt>.32&&this.popRefractory<=0&&Math.random()<e&&(this.popRefractory=.45,this.fireEvent(`pop`,Y((this.egt-.25)*1.45*(.5+.5*r),0,1)))}this.prevOverride=c??0,this.popCharge=Math.max(0,this.popCharge-e*(.22+.55*(1-this.dfco)))}_stepTurbo(e,t){let n=this.engine.turbo;if(!n){this.boost=0;return}let r=this.we*hv,i=Math.min(Y(Number(n.boostRpm)||3500,800,9e3),.65*this.engine.redlineRpm),a=Math.max(.6*this.engine.redlineRpm,i+1500),o=Y((r-i)/(a-i),0,1),s=n.antiLag>=.5&&t<.12&&r>.3*this.engine.redlineRpm,c=s?.7*o:Y(t,0,1)*o;s&&(this._alsT=(this._alsT||0)-e,this._alsT<=0&&(this._alsT=.06+.16*Math.random(),this.fireEvent(`pop`,.35+.45*Math.random())));let l=this.boostDump>0?.05:c>this.boost?.25+n.inertia*.9:.18+n.inertia*.4;this.boost+=(c-this.boost)*Math.min(1,e/l),this.boost=Y(this.boost,0,1),this.boostDump>0&&(this.boostDump-=e);let u=r>900?.12+.2*o:0,d=Y(Math.max(u,c),0,1),f=d>this.turboSpeed?.22+n.inertia*.85:.42+n.inertia*.55;this.turboSpeed+=(d-this.turboSpeed)*Math.min(1,e/f),this.turboSpeed=Y(this.turboSpeed,0,1),t>.45?this.bovArm=1:this.bovArm>0&&t<.12&&this.boost>.18&&!this.limiterActive&&n.valve>=.5&&!s&&(this.bovArm=0,this.boostDump=.12,this.fireEvent(`bov`,Y(this.boost*(.4+.6*n.bov),.1,1)))}_boostMult(){let e=this.engine.turbo;return e?1+.55*this.boost*e.maxBoost:1}_writeParams(e,t){let n=this.params,r=this.engine,i=this.we*hv;n.now=t,n.dt=e,n.rpm=i,n.f0=i/120,n.rpmNorm=Y((i-r.idleRpm)/(r.redlineRpm-r.idleRpm),0,1),n.dRpm=e>0?(i-this.prevRpm)/e:0,this.prevRpm=i,n.throttle=this.throttle,n.limiter=(this.limiterActive||i>r.redlineRpm-120)&&this.throttle>.5?1:0;let a=Y(this.thrEff||0,0,1),o=e>0?Y(e*12,0,1):1;this.load+=(a-this.load)*o,n.load=Y(this.load,0,1);let s=+(this.thrEff<.05&&i>r.idleRpm*1.7&&this.gear>0&&this.Tp<-2);this.overrun+=(s-this.overrun)*(e>0?Y(e*8,0,1):1),n.overrun=Y(this.overrun,0,1),n.torqueSign=this.Tp>1?1:this.Tp<-1?-1:this.Te>=0?1:-1,n.gear=this.gear,n.gearRatio=this.totalRatio,n.speed=this.ww*this.r,n.wheelRpm=this.ww*this.fd*hv,n.clutchSlip=(this.we-this.wg)*hv,n.clutchEngaged=this.clutch,n.boost=this.boost,n.shifting=this.shifting,n.gearbox=this.vehicle.gearbox,n.shiftPhase=this.shiftPhase;let c=this.ev;return n.evCut=c.cut,n.evLash=c.lash,n.evEngage=c.engage,n.evBov=c.bov,n.evShiftDone=c.shiftDone,n.evPop=c.pop,c.cut=c.lash=c.engage=c.bov=c.shiftDone=c.pop=0,n.turboSpeed=this.turboSpeed,n.egt=this.egt,n.dfco=this.dfco,n.cutRpmN=this.cutRpmN,n.popIntensity=Y(Math.max(0,this.egt-.45)/.55*Y(this.popCharge,0,1)*(.12+.88*this.dfcoEdge)*(.45+.55*this.cutRpmN),0,1)*+(i>=yv),n}},Nv=1.225,Pv=9.81,Fv=60/(2*Math.PI),Iv=.8,Lv=(e,t,n)=>e<t?t:e>n?n:e;function Rv(e,t,n=1){let r=(t-e.peakTorqueRpm)/(e.redlineRpm*.75),i=Lv(1-.85*r*r,.3,1),a=e.turbo,o=a?1+.55*n*a.maxBoost:1,s=(18+.012*t+22e-7*t*t)*.38;return e.peakTorque*i*o-s}function zv(e){let t={rpm:e.redlineRpm,power:0,torque:0};for(let n=e.idleRpm;n<=e.redlineRpm;n+=25){let r=Rv(e,n),i=r*n/Fv;i>t.power&&(t.power=i,t.rpm=n),r>t.torque&&(t.torque=r)}return t}function Bv(e){return[2.6+.4*(e-4),3.8+.8*(e-4)]}function Vv(e,t,n={}){let r=Math.round(Lv(n.gears||e.gears||t.gearRatios&&t.gearRatios.length||6,3,10)),i=t.gravity||Pv,a=n.efficiency||.92,o=t.wheelRadius,s=t.finalDrive,c=t.mass,l=e=>.5*Nv*t.dragArea*e*e+t.rollingResistance*c*i,u=zv(e),d=Math.min(u.rpm*1.04,e.redlineRpm*.9),f=a*Rv(e,d)*d/Fv,p=0,m=200;for(let e=0;e<60;e++){let e=.5*(p+m);l(e)*e<f?p=e:m=e}let h=p,g=d/Fv*o/Math.max(h,1),_=.6*c*i*o/(Math.max(1,u.torque)*a),[v,y]=Bv(r),b=Lv(_/g,v,y),x=[];for(let e=1;e<=r;e++){let t=((r-e)/(r-1))**1.15;x.push(+(Iv*g*b**+t/s).toFixed(3))}return{gearRatios:x,gearTeeth:x.map(e=>Math.round(Lv(16+6.5*e,17,46))),topSpeed:h}}function Hv(e,t,n){let r=Vv(e,t,n);return{...t,gearRatios:r.gearRatios,gearTeeth:r.gearTeeth}}var Uv=(e,t,n)=>e<t?t:e>n?n:e,Wv=(e,t=0)=>typeof e==`number`&&isFinite(e)?e:t,Gv=class e{static BANDS=[{f:60,type:`lowshelf`,label:`sub`},{f:200,type:`peaking`,q:.9,label:`body`},{f:800,type:`peaking`,q:1,label:`honk`},{f:2500,type:`peaking`,q:.9,label:`rasp`},{f:8e3,type:`highshelf`,label:`air`}];constructor(t,n={}){this.ctx=t,this.inGain=t.createGain(),this.out=t.createGain(),this.bands=e.BANDS.map(e=>{let n=t.createBiquadFilter();return n.type=e.type,n.frequency.value=e.f,e.q&&(n.Q.value=e.q),n.gain.value=0,n});let r=this.inGain;for(let e of this.bands)r.connect(e),r=e;r.connect(this.out),n.gains&&this.setGains(n.gains)}get input(){return this.inGain}get output(){return this.out}setGains(e){let t=this.ctx.currentTime;for(let n=0;n<this.bands.length&&n<e.length;n++)this.bands[n].gain.setTargetAtTime(Uv(Wv(e[n],0),-18,18),t,.03)}setBand(e,t){e<0||e>=this.bands.length||this.bands[e].gain.setTargetAtTime(Uv(Wv(t,0),-18,18),this.ctx.currentTime,.03)}getGains(){return this.bands.map(e=>e.gain.value)}reset(){this.setGains(this.bands.map(()=>0))}update(){}dispose(){for(let e of[this.inGain,this.out,...this.bands])e.disconnect()}},Kv=class{constructor(e,t={}){this.ctx=e,this.inGain=e.createGain(),this.out=e.createGain(),this.dry=e.createGain(),this.wet=e.createGain(),this.conv=e.createConvolver(),this.conv.normalize=!0,this.damp=e.createBiquadFilter(),this.damp.type=`lowpass`,this.damp.frequency.value=4200,this.damp.Q.value=.7,this.hp=e.createBiquadFilter(),this.hp.type=`highpass`,this.hp.frequency.value=110,this.inGain.connect(this.dry),this.dry.connect(this.out),this.inGain.connect(this.hp),this.hp.connect(this.conv),this.conv.connect(this.damp),this.damp.connect(this.wet),this.wet.connect(this.out),this._size=Uv(Wv(t.size,.35),.05,1),this._mix=Uv(Wv(t.mix,.16),0,1),this.setSize(this._size),this.setMix(this._mix)}get input(){return this.inGain}get output(){return this.out}_buildIR(e){let t=this.ctx,n=.15+2.05*Uv(e,0,1),r=Math.max(64,Math.floor(t.sampleRate*n)),i=t.createBuffer(2,r,t.sampleRate),a=2.6+3.4*(1-e);for(let e=0;e<2;e++){let n=i.getChannelData(e);for(let e=0;e<r;e++){let t=e/r;n[e]=(Math.random()*2-1)*(1-t)**a}for(let e=0;e<7;e++){let i=Math.floor((.004+.055*Math.random())*t.sampleRate);i<r&&(n[i]+=(Math.random()*2-1)*.55*(1-e/7))}}return i}setSize(e){return this._size=Uv(Wv(e,.35),.05,1),this.conv.buffer=this._buildIR(this._size),this._size}setMix(e){return this._mix=Uv(Wv(e,0),0,1),this._writeMix(.03),this._mix}setExtra(e){let t=Uv(Wv(e,0),0,1);Math.abs(t-(this._extra||0))<.001||(this._extra=t,this._writeMix(.08))}_writeMix(e){let t=Uv(this._mix+(this._extra||0)*(1-this._mix),0,1),n=this.ctx.currentTime;this.dry.gain.setTargetAtTime(Math.cos(t*Math.PI/2),n,e),this.wet.gain.setTargetAtTime(Math.sin(t*Math.PI/2)*1.4,n,e)}setDamping(e){this.damp.frequency.setTargetAtTime(Uv(Wv(e,4200),400,18e3),this.ctx.currentTime,.05)}getState(){return{size:this._size,mix:this._mix,damping:this.damp.frequency.value}}update(){}dispose(){for(let e of[this.inGain,this.out,this.dry,this.wet,this.conv,this.damp,this.hp])e.disconnect()}},qv=class{constructor(e,t={}){this.ctx=e,this.inGain=e.createGain(),this.merger=e.createChannelMerger(2),this.out=e.createGain(),this.delay=e.createDelay(.08),this.delay.delayTime.value=.016,this.tilt=e.createBiquadFilter(),this.tilt.type=`highshelf`,this.tilt.frequency.value=1800,this.tilt.gain.value=-3,this.plus=e.createGain(),this.minus=e.createGain(),this.plus.gain.value=0,this.minus.gain.value=0,this.inGain.connect(this.merger,0,0),this.inGain.connect(this.merger,0,1),this.inGain.connect(this.delay),this.delay.connect(this.tilt),this.tilt.connect(this.plus),this.tilt.connect(this.minus),this.plus.connect(this.merger,0,0),this.minus.connect(this.merger,0,1),this.merger.connect(this.out),this.setWidth(Wv(t.width,.35))}get input(){return this.inGain}get output(){return this.out}setWidth(e){this._width=Uv(Wv(e,0),0,1);let t=this.ctx.currentTime,n=this._width*.85;return this.plus.gain.setTargetAtTime(n,t,.03),this.minus.gain.setTargetAtTime(-n,t,.03),this.delay.delayTime.setTargetAtTime(.008+.018*this._width,t,.05),this._width}getWidth(){return this._width}update(){}dispose(){for(let e of[this.inGain,this.merger,this.out,this.delay,this.tilt,this.plus,this.minus])e.disconnect()}},Jv=class e{static BANDS=[{name:`low`,f:220,threshold:-16,ratio:2.6,attack:.018,release:.26,knee:10,makeup:1.1},{name:`mid`,f:2e3,threshold:-18,ratio:2,attack:.022,release:.2,knee:14,makeup:2.12},{name:`high`,f:0,threshold:-24,ratio:3,attack:.003,release:.12,knee:8,makeup:.9}];constructor(t,n={}){this.ctx=t,this._amount=Uv(Wv(n.amount,1),0,1),this.inGain=t.createGain(),this.out=t.createGain(),this.out.gain.value=Uv(Wv(n.makeup,1),0,4);let r=(e,n)=>{let r=t.createBiquadFilter();return r.type=e,r.frequency.value=Uv(n,20,2e4),r.Q.value=-3.0103,r};this.bands=[];let[i,a]=e.BANDS;for(let n of e.BANDS){let e=t.createDynamicsCompressor();e.threshold.value=n.threshold,e.ratio.value=n.ratio,e.attack.value=n.attack,e.release.value=n.release,e.knee.value=n.knee;let o=t.createGain();o.gain.value=n.makeup;let s=[];n.name===`low`?s.push(r(`lowpass`,i.f),r(`lowpass`,i.f)):n.name===`mid`?s.push(r(`highpass`,i.f),r(`highpass`,i.f),r(`lowpass`,a.f),r(`lowpass`,a.f)):s.push(r(`highpass`,a.f),r(`highpass`,a.f));let c=this.inGain;for(let e of s)c.connect(e),c=e;c.connect(e),e.connect(o),o.connect(this.out),this.bands.push({spec:n,comp:e,makeup:o,chain:s})}this.setAmount(this._amount)}get input(){return this.inGain}get output(){return this.out}setAmount(e){this._amount=Uv(Wv(e,1),0,1);let t=Wv(this.ctx.currentTime,0);for(let e of this.bands){let n=Uv(e.spec.threshold*this._amount,-100,0);e.comp.threshold.setTargetAtTime(n,t,.05);let r=1+(e.spec.makeup-1)*this._amount,i=Yv(n,e.spec.ratio,e.spec.knee);e.makeup.gain.setTargetAtTime(r*10**(-i/20),t,.05)}return this._amount}getAmount(){return this._amount}getReduction(){let e={};for(let t of this.bands)e[t.spec.name]=Wv(t.comp.reduction,0);return e}update(){}dispose(){for(let e of this.bands){for(let t of e.chain)t.disconnect();e.comp.disconnect(),e.makeup.disconnect()}this.inGain.disconnect(),this.out.disconnect()}};function Yv(e,t,n=0){let r=Math.min(0,Wv(e,0))+Math.max(0,Wv(n,0))/2,i=Math.max(1,Wv(t,1));return Math.max(0,-.6*Math.min(0,r)*(1-1/i))}var Xv=class{constructor(e){this.ctx=e,this.pre=e.createGain(),this.pre.gain.value=1/4,this.shaper=e.createWaveShaper();let t=8193,n=new Float32Array(t),r=.6,i=.39;for(let e=0;e<t;e++){let t=4*(e/8192*2-1),a=Math.abs(t),o=a<=r?a:r+i*Math.tanh((a-r)/i);n[e]=Math.sign(t)*o}this.shaper.curve=n,this.shaper.oversample=`2x`,this.pre.connect(this.shaper)}get input(){return this.pre}get output(){return this.shaper}dispose(){this.pre.disconnect(),this.shaper.disconnect()}},Zv=class{constructor(e,t={}){this.ctx=e;let n=-3.0103,r=(t,n,r)=>{let i=e.createBiquadFilter();return i.type=t,i.frequency.value=n,i.Q.value=r,i};this.inGain=e.createGain(),this.lp1=r(`lowpass`,140,n),this.lp2=r(`lowpass`,140,n),this.drive=e.createGain(),this.drive.gain.value=2.2,this.span=e.createGain(),this.span.gain.value=1/4,this.shaper=e.createWaveShaper();let i=4097,a=new Float32Array(i);for(let e=0;e<i;e++){let t=4*(e/4096*2-1),n=Math.tanh(t);a[e]=n+.45*n*n}this.shaper.curve=a,this.shaper.oversample=`2x`,this.hp=r(`highpass`,90,.7),this.lp3=r(`lowpass`,420,.6),this.amount=e.createGain(),this.amount.gain.value=Uv(Wv(t.amount,.15),0,2),this.inGain.connect(this.lp1),this.lp1.connect(this.lp2),this.lp2.connect(this.drive),this.drive.connect(this.span),this.span.connect(this.shaper),this.shaper.connect(this.hp),this.hp.connect(this.lp3),this.lp3.connect(this.amount)}get input(){return this.inGain}get output(){return this.amount}setAmount(e){this.amount.gain.setTargetAtTime(Uv(Wv(e,0),0,2),this.ctx.currentTime,.05)}dispose(){for(let e of[this.inGain,this.lp1,this.lp2,this.drive,this.span,this.shaper,this.hp,this.lp3,this.amount])e.disconnect()}},Qv=class{constructor(e){this.ctx=e,this.inGain=e.createGain(),this.out=e.createGain(),this.inGain.connect(this.out),this.loops=[.037,.061].map((t,n)=>{let r=e.createGain(),i=e.createDelay(.2);i.delayTime.value=t;let a=e.createBiquadFilter();a.type=`lowpass`,a.frequency.value=n?1900:2600,a.Q.value=.5;let o=e.createBiquadFilter();o.type=`highpass`,o.frequency.value=70,o.Q.value=.5;let s=e.createGain();s.gain.value=0;let c=e.createGain();return c.gain.value=0,this.inGain.connect(r),r.connect(i),i.connect(a),a.connect(o),o.connect(s),s.connect(r),o.connect(c),c.connect(this.out),{sum:r,d:i,lp:a,hp:o,fb:s,wet:c}}),this._env=-1}get input(){return this.inGain}get output(){return this.out}setEnvironment(e){if(e=Uv(Wv(e,0),0,1),Math.abs(e-this._env)<.001)return;this._env=e;let t=this.ctx.currentTime;this.loops.forEach((n,r)=>{n.fb.gain.setTargetAtTime(.52*e,t,.08),n.wet.gain.setTargetAtTime((r?.3:.38)*e,t,.08)})}dispose(){this.inGain.disconnect(),this.out.disconnect();for(let e of this.loops)for(let t of Object.values(e))t.disconnect()}},$v=`/**
|
|
1010
|
+
}`,Dm=class{canvas;gl;program;buffer;vao;data=new Float32Array(81920);width=1;height=1;lost=!1;disposed=!1;onLost=e=>{e.preventDefault(),this.lost=!0};onRestored=()=>{this.disposed||(this.initialize(),this.lost=!1)};constructor(e=document.createElement(`canvas`)){this.canvas=e;let t=e.getContext(`webgl2`,{alpha:!0,premultipliedAlpha:!0,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1});if(!t)throw Error(`WebGL2 is required for electricity`);this.gl=t,this.initialize(),e.addEventListener(`webglcontextlost`,this.onLost),e.addEventListener(`webglcontextrestored`,this.onRestored)}initialize(){let e=this.gl,t=nf(e,Tm,Em,`Electricity`),n=e.createBuffer(),r=e.createVertexArray();if(!n||!r)throw uf(e,t),e.deleteBuffer(n),e.deleteVertexArray(r),Error(`Unable to allocate electricity renderer`);this.program=t,this.buffer=n,this.vao=r,e.bindVertexArray(r),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,this.data.byteLength,e.DYNAMIC_DRAW),cf(e,t,{aStart:{buffer:n,numComponents:2,stride:40,offset:0,divisor:1},aEnd:{buffer:n,numComponents:2,stride:40,offset:8,divisor:1},aStyle:{buffer:n,numComponents:4,stride:40,offset:16,divisor:1},aDistance:{buffer:n,numComponents:2,stride:40,offset:32,divisor:1}}),e.bindVertexArray(null)}resize(e,t,n=1){if(this.disposed)return;this.width=Math.max(1,Number.isFinite(e)?e:1),this.height=Math.max(1,Number.isFinite(t)?t:1);let r=Math.min(2,Math.max(.25,Number.isFinite(n)?n:1),Math.sqrt(3e6/(this.width*this.height)),4096/this.width,4096/this.height),i=Math.ceil(this.width*r),a=Math.ceil(this.height*r);this.canvas.width!==i&&(this.canvas.width=i),this.canvas.height!==a&&(this.canvas.height=a)}render(e,t,n={}){if(this.lost||this.disposed)return 0;let r=this.gl;r.viewport(0,0,this.canvas.width,this.canvas.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT);let i=0;if(Array.isArray(e))for(let t of e)i+=t.writeInstances(this.data,i);else i=e.writeInstances(this.data);return i?(r.useProgram(this.program),r.bindVertexArray(this.vao),r.bindBuffer(r.ARRAY_BUFFER,this.buffer),r.bufferSubData(r.ARRAY_BUFFER,0,this.data,0,i*10),sf(this.program,{uViewport:[this.width,this.height],uTime:t,uNoiseOrigin:n.noiseOrigin??[0,0],uNoiseScale:n.noiseScale??1,uDark:n.dark===!1?0:1,uExposure:n.exposure??.95,uColor:n.color??[.14,.64,1],uCorona:n.corona??[.28,.13,1]}),r.enable(r.BLEND),r.blendFunc(r.ONE,n.dark===!1?r.ONE_MINUS_SRC_ALPHA:r.ONE),r.drawArraysInstanced(r.TRIANGLES,0,6,i),r.bindVertexArray(null),i):0}dispose(){this.disposed||(this.disposed=!0,this.canvas.removeEventListener(`webglcontextlost`,this.onLost),this.canvas.removeEventListener(`webglcontextrestored`,this.onRestored),this.gl.deleteBuffer(this.buffer),uf(this.gl,this.program),this.gl.deleteVertexArray(this.vao))}},Om={color:[.58,.81,1],corona:[.25,.48,.9]},km=(e,t,n)=>Math.max(t,Math.min(n,e)),Am=(e,t)=>({x:Math.cos(e)*t,y:Math.sin(e)*t});function jm(){return{shape:{kind:`point`,center:{x:0,y:0},radius:154},sources:Array.from({length:12},(e,t)=>Am(t/12*Math.PI*2,126)),targets:Array.from({length:17},(e,t)=>Am(t/17*Math.PI*2+.8,102))}}function Mm(e){let t=e|0,n=()=>(t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)/4294967296),r=[{x:0,y:0},{x:300,y:0}];for(let e=0;e<5;e++){let t=[r[0]],i=82*.54**e;for(let e=1;e<r.length;e++){let a=r[e-1],o=r[e];t.push({x:(a.x+o.x)/2,y:(a.y+o.y)/2+(n()-.5)*i*2},o)}r=t}return{shape:{kind:`path`,points:r,width:82},sources:[{x:0,y:0}],targets:[{x:300,y:0}]}}var Nm=class{vehicles=new Map;visible=[];strikes=[];volumes=[];scratch=new Float32Array(12e3);gpu=null;elapsed=0;emit;failed=!1;cameraOrigin={x:0,y:0};cameraScale=1;get active(){return this.visible.length>0||this.strikes.length>0||this.volumes.length>0}get stats(){let e=[...this.vehicles.values()].flatMap(e=>[e.field,e.charge,e.arc,e.halo]);return{vehicles:this.vehicles.size,fields:e.filter(Boolean).length,nodes:e.reduce((e,t)=>e+(t?.simulation.stats.nodes??0),0),visible:this.visible.length+this.strikes.length+this.volumes.length}}create(e,t){let n=new wm(e===`arc`?Mm(t):e===`field`?{...jm(),targets:[{x:0,y:0}]}:jm(),{seed:t,spacing:e===`field`?13:11,maxNodes:e===`arc`?640:e===`field`?520:330,strikesPerSecond:0,branching:.65,corona:e===`field`?.5:0,nearbyTargets:!1}),r={simulation:n,gain:1,pull:e===`field`};return n.onEmission=e=>{this.emit?.(e.point,e.direction,e.strength*(r.pull?.5:.8))},r}radial(e,t,n,r){let i=t.pixelsPerMetre*n/160;e.simulation.setEmissionFrame({x:t.center.x,y:t.center.y,angle:0,scaleX:i,scaleY:i,width:km(i,.65,2)}),e.gain=r}tether(e,t,n){return{x:e.x,y:e.y,angle:Math.atan2(t.y-e.y,t.x-e.x),scaleX:Math.max(.001,Math.hypot(t.x-e.x,t.y-e.y)/300),scaleY:km(Math.hypot(t.x-e.x,t.y-e.y)/300,.6,3)*(.95-n*.25),width:.75+n*.45}}strike(e,t,n){let r=e.simulation;r.reset(),r.setEmissionFrame(),r.configure({strikesPerSecond:0,branching:1.8,intensity:1.8});let i=r.onEmission;r.onEmission=void 0,r.discharge(1);for(let e=0;e<24;e++)r.step(1/60);r.onEmission=i;let a=r.writeInstances(this.scratch),o=this.scratch.slice(0,a*10),s=[],c=(e,t,n=!1)=>{if(e.length<2)return;let r=[0];for(let t=1;t<e.length;t++)r.push(r[t-1]+Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y));let i=r[r.length-1];for(let c=0;c<a&&s.length<22e3;c++){let a=c*10;for(let t of[0,2]){let c=km(o[a+t]/300,0,1)*i,l=1;for(;l<r.length-1&&r[l]<c;)l++;let u=e[l-1],d=e[l],f=Math.max(.001,r[l]-r[l-1]),p=km((c-r[l-1])/f,0,1),m=n?Math.min(.15,i/300*.1):Math.min(3,Math.max(.65,i/300*.85)),h=o[a+t+1]*m;s.push(u.x+(d.x-u.x)*p-(d.y-u.y)/f*h,u.y+(d.y-u.y)*p+(d.x-u.x)/f*h)}s.push(o[a+4]*t,o[a+5],o[a+6],o[a+7],km(o[a]/300,0,1),km(o[a+2]/300,0,1))}};c([t.center,n],1.25);for(let e of t.lightning.branches.filter(e=>Math.hypot(e.x-n.x,e.y-n.y)>8).slice(0,4))c([n,e],.8),this.emit?.(e,{x:e.x-n.x,y:e.y-n.y},1.2);for(let e of t.lightning.paths?.slice(0,4)??[])c(e,.85,!0),e.length&&this.emit?.(e[e.length-1],{x:0,y:-1},1.2);this.strikes.push({data:new Float32Array(s),age:0,source:{...t.center},target:{...n},shook:!1}),this.strikes.length>4&&this.strikes.shift(),this.emit?.(n,{x:n.x-t.center.x,y:n.y-t.center.y},2.8),this.emit?.(t.center,{x:t.center.x-n.x,y:t.center.y-n.y},1.8),r.reset()}step(e,t,n,r){let i=km(e,0,.05);this.elapsed+=i,this.emit=n,this.visible.length=0,this.volumes.length=0;for(let e=this.strikes.length-1;e>=0;e--){let t=this.strikes[e],a=t.age;t.age+=i,!t.shook&&t.age>=.075&&(t.shook=!0,r?.(t.target),n?.(t.source,{x:0,y:-1},2.4));for(let e=0;e<t.data.length;e+=80){let r=(1-t.data[e+8])*.075;a<=r&&t.age>r&&a<.08&&n?.({x:t.data[e],y:t.data[e+1]},{x:t.data[e+3]-t.data[e+1],y:t.data[e]-t.data[e+2]},.6)}t.age>1.5&&this.strikes.splice(e,1)}for(let e of this.vehicles.values()){e.volumeTarget=0;for(let t of[e.field,e.charge,e.arc,e.halo])t?.simulation.configure({strikesPerSecond:0})}for(let e of t.slice(0,6)){let t=e.lightning.phase===`charging`,n=e.lightning.phase===`discharged`;if(!e.attractor&&!t&&!n&&!e.electrified)continue;let r=this.vehicles.get(e.id);r||(this.vehicles.size>=8&&this.release(this.vehicles.keys().next().value),r={touched:this.elapsed,dischargeId:-1},this.vehicles.set(e.id,r)),r.touched=this.elapsed;let i=km(e.lightning.charge,0,1);if(e.attractor){let t=r.field??=this.create(`field`,131+e.id.length);t.simulation.configure({strikesPerSecond:5,intensity:.95,corona:.6,branching:.35}),this.radial(t,e,e.attractorRadiusM,.9),r.volume={center:e.center,radius:e.attractorRadiusM*e.pixelsPerMetre,pull:!0,gain:r.volume?.gain??0},r.volumeTarget=1.3}if(t){let t=r.charge??=this.create(`field`,431+e.id.length);t.simulation.configure({strikesPerSecond:5+i*6,intensity:1+i*.7}),this.radial(t,e,2.8-i*.8,.9),e.attractor||(r.volume={center:e.center,radius:e.pixelsPerMetre*(2.8-i*.8),gain:r.volume?.gain??0},r.volumeTarget=.25+i*.3)}let a=e.lightning.target;if((t||n)&&a){let o=r.arc??=this.create(`arc`,761+e.id.length);n&&e.lightning.dischargeId!==r.dischargeId&&this.strike(o,e,a),t&&(o.simulation.setEmissionFrame(this.tether(e.center,a,i)),o.simulation.configure({strikesPerSecond:2+i*7,branching:.9+i*.5,intensity:.6+i*.5}),o.gain=i**1.4*.9)}if(e.electrified){let t=r.halo??=this.create(`halo`,919+e.id.length);t.simulation.configure({strikesPerSecond:8,intensity:.95}),this.radial(t,e,e.lengthM*.7,.9)}r.dischargeId=e.lightning.dischargeId}for(let[e,t]of this.vehicles)if(t.volume&&(t.volume.gain+=((t.volumeTarget??0)-t.volume.gain)*(1-Math.exp(-i*10)),t.volume.gain>.003&&this.volumes.push(t.volume)),this.elapsed-t.touched>2)this.release(e);else for(let e of[t.field,t.charge,t.arc,t.halo])e&&(e.simulation.step(i),e.simulation.stats.strokes>0&&this.visible.push(e))}writeInstances(e,t=0){let n=t,r=()=>n*10+10<=e.length;for(let t of this.volumes){if(!r())break;let i=this.cameraOrigin.x+t.center.x*this.cameraScale,a=this.cameraOrigin.y+t.center.y*this.cameraScale,o=n++*10;e.set([i,a,i+.01,a,t.radius*this.cameraScale,t.gain,+!!t.pull,5,0,1],o)}for(let t of this.strikes)for(let i=0;i<t.data.length&&r();i+=10){let r=n++*10;e.set(t.data.subarray(i,i+10),r);let a=(1-(t.data[i+8]+t.data[i+9])*.5)*.075,o=t.age-a,s=o<0?.1:t.age<.15?2.5:Math.exp(-(t.age-.15)*3.7)*1.8;e[r+5]*=s,e[r+4]*=o>=0&&o<.08?1.4:1,this.projectInstance(e,r)}for(let t of this.visible){let r=e.subarray(n*10,Math.min(e.length,(n+1200)*10)),i=t.simulation.writeInstances(r),a=t.pull&&i?r[6]:-1;for(let e=0;e<i;e++){let n=e*10;r[n+5]*=t.gain,t.pull&&(r[n+7]===2?r[n+5]*=.2:r[n+6]===a?(r[n+7]=0,r[n+5]*=1.2):(r[n+7]=3,r[n+4]*=3.8)),this.projectInstance(r,n)}n+=i}return n-t}projectInstance(e,t){for(let n of[0,2])e[t+n]=this.cameraOrigin.x+e[t+n]*this.cameraScale,e[t+n+1]=this.cameraOrigin.y+e[t+n+1]*this.cameraScale;e[t+4]*=this.cameraScale,e[t+8]*=this.cameraScale,e[t+9]*=this.cameraScale}draw(e,t,n,r,i,a,o=1,s=e=>e,c=1){if(!this.active||this.failed||o<=0)return;if(!this.gpu)try{this.gpu=new Dm}catch{this.failed=!0;return}this.cameraScale=c;let l=s({x:0,y:0});this.cameraOrigin=l,this.gpu.resize(t,n,r),this.gpu.render(this,i,{dark:a,exposure:a?1.05:1.2,...Om,noiseOrigin:[-l.x/c,-l.y/c],noiseScale:1/c}),this.cameraOrigin={x:0,y:0},this.cameraScale=1,e.save(),e.globalAlpha*=o,Ye(`composited megapixels`,this.gpu.canvas.width*this.gpu.canvas.height/1e6),e.drawImage(this.gpu.canvas,0,0,t,n),e.restore()}release(e){let t=this.vehicles.get(e);if(t){for(let e of[t.field,t.charge,t.arc,t.halo])e?.simulation.dispose();this.vehicles.delete(e)}}reset(){for(let e of this.vehicles.keys())this.release(e);this.visible.length=0,this.strikes.length=0,this.volumes.length=0,this.elapsed=0}dispose(){this.reset(),this.gpu?.dispose(),this.gpu=null}};function Pm(e){if(!e.detached)return e.ink;let t=Math.cos(e.angle),n=Math.sin(e.angle),r=e.ink.width/2,i=e.ink.height/2,a=e.ink.x+r-e.base.x-e.base.width/2,o=e.ink.y+i-e.base.y-e.base.height/2,s=e.base.x+e.base.width/2+e.offset.x+a*t-o*n,c=e.base.y+e.base.height/2+e.offset.y+a*n+o*t,l=Math.abs(t)*r+Math.abs(n)*i,u=Math.abs(n)*r+Math.abs(t)*i;return{x:s-l,y:c-u,width:2*l,height:2*u}}function Fm(e,t){let{ink:n}=e;if(!e.detached)return n.x<t.x+t.width&&n.x+n.width>t.x&&n.y<t.y+t.height&&n.y+n.height>t.y;let r=e.base.x+e.base.width/2,i=e.base.y+e.base.height/2,a=Math.max(Math.abs(n.x-r),Math.abs(n.x+n.width-r)),o=Math.max(Math.abs(n.y-i),Math.abs(n.y+n.height-i)),s=Math.sqrt(a*a+o*o),c=r+e.offset.x,l=i+e.offset.y;return c-s<t.x+t.width&&c+s>t.x&&l-s<t.y+t.height&&l+s>t.y}function Im(e,t,n,i){let a=E(t,r(e.velocity,-1));e.detached=!0,e.velocity=E(r(e.velocity,.35),E(r(a,.55),r(n,80+Math.min(220,u(a)*.3)))),e.spin=e.spin*.3+i,e.offset=E(e.offset,r(n,2)),e.impactCooldown=.12}function Lm(e,t){e.impactCooldown=Math.max(0,e.impactCooldown-t),e.detached&&(e.velocity=r(e.velocity,Math.exp(-(e.attractorInfluenced?.35:1.6)*t)),e.offset=E(e.offset,r(e.velocity,t)),e.angle+=e.spin*t,e.spin*=Math.exp(-1.25*t))}function Rm(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function zm(e,t,n){let r=-1/0,i=1/0,a={x:0,y:0};for(let o of[`x`,`y`]){let s=n[o],c=s+(o===`x`?n.width:n.height),l=e[o],u=t[o],d=l+(o===`x`?e.width:e.height),f=u+(o===`x`?t.width:t.height);for(let[e,t,n]of[[d-s,f-d,-1],[c-l,l-u,1]]){if(Math.abs(t)<1e-8){if(e<0)return null;continue}let s=-e/t;t>0&&s>r?(r=s,a=o===`x`?{x:n,y:0}:{x:0,y:n}):t<0&&(i=Math.min(i,s))}if(r>i)return null}return r>=0&&r<=1&&r<=i&&i>=0&&(a.x!==0||a.y!==0)?{time:r,normal:a}:null}function Bm(e,t){let n=Pm(e);if(!Rm(n,t))return null;let r=[{amount:t.x-n.x-n.width-.1,normal:{x:-1,y:0}},{amount:t.x+t.width-n.x+.1,normal:{x:1,y:0}},{amount:t.y-n.y-n.height-.1,normal:{x:0,y:-1}},{amount:t.y+t.height-n.y+.1,normal:{x:0,y:1}}].reduce((e,t)=>Math.abs(t.amount)<Math.abs(e.amount)?t:e);return r.normal.x?e.offset.x+=r.amount:e.offset.y+=r.amount,r.normal}function Vm(e,t){let n=e.velocity.x*t.x+e.velocity.y*t.y;n>=0||(e.velocity=E(r(e.velocity,.82),r(t,-n*1.1)),e.spin*=-.45)}function Hm(e,t,n){if(e.detached)for(let t of n){if(Rm(e.ink,t))continue;let n=Bm(e,t);n&&Vm(e,n)}if(!e.detached||n.length===0){Lm(e,t);return}let r=Pm(e);Lm(e,t);let i=Pm(e),a=null;for(let t of n){if(Rm(e.ink,t))continue;let n=zm(r,i,t);n&&(!a||n.time<a.time)&&(a={...n,wall:t})}if(a){let t=1-a.time;e.offset.x-=(i.x+i.width/2-r.x-r.width/2)*t,e.offset.y-=(i.y+i.height/2-r.y-r.height/2)*t,Bm(e,a.wall),Vm(e,a.normal)}for(let t=0;t<3;t++){let t=!1;for(let r of n){if(Rm(e.ink,r))continue;let n=Bm(e,r);n&&(Vm(e,n),t=!0)}if(!t)break}}function Um(e,t,n,i=!1){if(!t||t.radiusPx<=0||!e.detached&&!i)return e.attractorInfluenced=!1,!1;let a=Pm(e),o={x:a.x+a.width/2,y:a.y+a.height/2},s=c(o,t.center),l=u(s);if(l>t.radiusPx)return e.attractorInfluenced=!1,!1;e.detached||=!0,e.attractorInfluenced=!0;let d=r(s,-Math.min(1,300/Math.max(1,l*5))*5),f=c(t.velocity,e.velocity),p=E(d,r(f,.15));return e.velocity=E(e.velocity,r(p,Math.max(0,n))),e.spin*=Math.exp(-.7*Math.max(0,n)),!0}var Wm=class{camera;effects=new Nm;clock=0;constructor(e){this.camera=e}step(e,t,n,r,i){if(this.clock+=n,this.clock<1/60)return;let a=Math.min(.05,this.clock);this.clock=Math.max(0,this.clock-1/60);let o=[];for(let n of[e,...t]){let e=n.sim;if(e.mode!==`car`||e.car.explodedAt!==null||n.isGhost)continue;let t=n.weapons.lightning.visual,r=e.car.statusEffects.remaining(`electrified`)>0;if(!n.controls.attractor&&t.phase===`idle`&&!r)continue;let i=this.camera.screen(e.body.position),a=Math.max(7,M(e.car.preset,this.camera.width,this.camera.documentScale()))*this.camera.zoom;i.x<-a||i.x>this.camera.width+a||i.y<-a||i.y>this.camera.height+a||o.push({id:n.id,center:this.camera.documentPoint(e.body.position),angle:-e.body.angle,pixelsPerMetre:this.camera.documentScale(),lengthM:e.car.preset.geometry.lengthM,widthM:e.car.preset.geometry.widthM,attractor:!!n.controls.attractor&&!e.paused,attractorRadiusM:7,electrified:r,lightning:t})}this.effects.step(e.sim.paused?0:a,o,(e,t,n)=>r.electric(this.camera.particlePoint(this.camera.worldFromDocument(e)),this.camera.pixelSpace?t:P(t.x/this.camera.documentScale(),-t.y/this.camera.documentScale()),n),()=>i.trigger(`lightning`,1,performance.now()))}draw(e,t,n,r){this.effects.draw(e,this.camera.width,this.camera.height,this.camera.dpr,t/1e3,n,r,e=>this.camera.screen(this.camera.worldFromDocument(e)),this.camera.zoom/this.camera.documentScale())}reset(){this.clock=0,this.effects.reset()}dispose(){this.effects.dispose()}},Gm=class{overlay;canvasWorld;carVisualOffset(e){return this.vehicles.carVisualOffset(e)}get cameraLock(){return this.view.cameraLock}set cameraLock(e){this.view.cameraLock=e}get cameraSmoothing(){return this.view.cameraSmoothing}set cameraSmoothing(e){this.view.cameraSmoothing=e}get deadZone(){return this.view.deadZone}set deadZone(e){this.view.deadZone=e}get speedZoom(){return this.view.speedZoom}set speedZoom(e){this.view.speedZoom=e}get speedZoomMinimumScale(){return this.view.speedZoomMinimumScale}set speedZoomMinimumScale(e){this.view.speedZoomMinimumScale=e}screen(e){return this.view.screen(e)}world(e){return this.view.world(e)}vehicleViewportPosition(e){return this.view.vehicleViewportPosition(e)}sceneScroll(){return this.view.sceneScroll()}get documentProjection(){return this.view.documentProjection}virtualOffset(){return this.view.virtualOffset()}documentPoint(e){return this.view.documentPoint(e)}worldFromDocument(e){return this.view.worldFromDocument(e)}documentScale(){return this.view.documentScale()}viewportSize(){return this.view.viewportSize()}presentationScale(){return this.view.presentationScale()}setSlowMoZoom(e){this.view.slowMoZoom=e}setCanvasWorldScale(e,t=1.5){this.view.setCanvasWorldScale(e,t)}setCameraFrame(e){this.view.setCameraFrame(e)}setCameraLock(e){this.view.setCameraLock(e)}viewportFromDocument(e){return this.view.viewportFromDocument(e)}documentFromViewport(e){return this.view.documentFromViewport(e)}bounds(){return this.view.bounds()}vehicleMarkerAt(e){if(!this.showVehicleMarkers)return null;let t=this.view.documentFromViewport(e);return this.vehicles.markerAt(this.view.screen(this.view.worldFromDocument(t)))}revealVehicle(e){this.view.revealVehicle(e)}resumeFollow(){this.view.resumeFollow()}interruptFollow(){this.view.interruptFollow()}restorePage(e){this.view.restorePage(e)&&(this.lastFlowCenter=null,this.flowVelocity=P())}followDocument(e){return this.view.followDocument(e)}primaryVehicleVisible=!0;primaryVehicleOpacity=1;beginVehicleArrivalFade(){this.skidTracks.beginReveal(this.skidView(),this.darkSurface()),this.primaryVehicleOpacity=0}setVehicleArrivalOpacity(e){this.primaryVehicleOpacity=k(e,0,1),this.skidTracks.setRevealAlpha(this.primaryVehicleOpacity,this.skidView(),this.darkSurface())}view;surface;vehicles;debris=new s;get ctx(){return this.surface.context}nextHistoryPrune=0;trailClock=0;quality=`high`;fluidGovernor=new jt;vehicleLights=new sr;surfaceTones=new ja;vehicleLighting={...ge};setVehicleLighting(e){this.vehicleLighting=Be({...this.vehicleLighting,...e})}getVehicleLighting(){return{...this.vehicleLighting}}toggleVehicleLight(e){return this.setVehicleLighting({[e]:!this.vehicleLighting[e]}),this.getVehicleLighting()}surfaceTone=`auto`;trail=[];skidTracks=new rm;volumetrics;pointPuffs=[];objectGlint=null;showVehicleMarkers=!0;tireSmokeEnabled=!0;vehicleShadowsEnabled=!0;effectsFadeStartedAt=null;wallRects=[];combustion;ghostVehicles=new La;sparks=new Yf;electricity;liquidLayer;tireMarks=new Yp;seedGroundMarks(e){this.overlay&&this.tireMarks.seed(e,this.particleScale())}focusVehicle=null;activeVehicles=[];bindVehicle(e){this.focusVehicle=e}forgetVehicle(e){this.tireMarks.forgetVehicle(e),this.activeVehicles=this.activeVehicles.filter(t=>t.id!==e),this.focusVehicle?.id===e&&(this.focusVehicle=null)}get rocketFlightPosition(){let e=this.focusVehicle?.sim.body.position??P(),t=null,n=1/0;for(let r of this.activeVehicles){let i=r.weapons.rocket.projectile?.position;if(!i)continue;let a=u(c(i,e));a<n&&(t=i,n=a)}return t}screenShake=new om;exhaustBursts=[];queueExhaustPops(e){for(let t of e)t<.12||this.exhaustBursts.push({age:0,lifetime:.08+t*.11,intensity:.4+t*.6});this.exhaustBursts.length>6&&this.exhaustBursts.splice(0,this.exhaustBursts.length-6)}lastFlowCenter=null;flowVelocity=P();captureState(){let e=[],t=t=>(t&&e.push(()=>t.dispose()),t);try{let n=t(this.volumetrics.captureState()),r=t(this.combustion.captureState()),i=t(this.liquidLayer.captureState());return{at:performance.now(),data:j({primaryVehicleVisible:this.primaryVehicleVisible,primaryVehicleOpacity:this.primaryVehicleOpacity,nextHistoryPrune:this.nextHistoryPrune,trailClock:this.trailClock,quality:this.quality,fluidQualityLimit:this.fluidGovernor.limit,vehicleLighting:this.vehicleLighting,surfaceTone:this.surfaceTone,trail:this.trail,pointPuffs:this.pointPuffs,showVehicleMarkers:this.showVehicleMarkers,tireSmokeEnabled:this.tireSmokeEnabled,vehicleShadowsEnabled:this.vehicleShadowsEnabled,effectsFadeStartedAt:this.effectsFadeStartedAt,wallRects:this.wallRects,exhaustBursts:this.exhaustBursts,lastFlowCenter:this.lastFlowCenter,flowVelocity:this.flowVelocity,debugDrive:this.debugDrive,previewGroundFire:this.previewGroundFire,previewWallSmoke:this.previewWallSmoke,previewSparks:this.previewSparks,previewDamage:this.previewDamage,previewOil:this.previewOil,previewOilSplatter:this.previewOilSplatter,oilSplatterPreviewSeconds:this.oilSplatterPreviewSeconds,sparkPreviewClock:this.sparkPreviewClock,damagePreviewApplied:this.damagePreviewApplied,groundFirePreviewLit:this.groundFirePreviewLit,tourDebug:this.tourDebug,trailLifetime:this.trailLifetime,fallbackSurfaceTone:this.fallbackSurfaceTone}),camera:this.view.captureState(),diagnostics:this.diagnostics.captureState(),vehicles:this.vehicles.captureState(),volumetrics:n,combustion:r,liquids:i,debris:this.debris.captureState(),skidTracks:this.skidTracks.captureState(),tireMarks:this.tireMarks.captureState(),sparks:this.sparks.captureState(),screenShake:this.screenShake.captureState(),dispose:()=>e.forEach(e=>e())}}catch(t){throw e.forEach(e=>e()),t}}restoreState(e){let t=this.captureState();try{this.applyState(e)}catch(e){try{this.applyState(t)}catch(t){throw AggregateError([e,t],`Renderer checkpoint rollback failed`,{cause:t})}throw e}finally{t.dispose()}}applyState(e){this.clearEffects();let t=j(e.data);this.primaryVehicleVisible=t.primaryVehicleVisible,this.primaryVehicleOpacity=t.primaryVehicleOpacity,this.nextHistoryPrune=t.nextHistoryPrune,this.trailClock=t.trailClock,this.quality=t.quality,this.fluidGovernor.restoreLimit(t.fluidQualityLimit),this.vehicleLighting=t.vehicleLighting,this.surfaceTone=t.surfaceTone,this.trail=t.trail,this.pointPuffs=t.pointPuffs,this.showVehicleMarkers=t.showVehicleMarkers,this.tireSmokeEnabled=t.tireSmokeEnabled,this.vehicleShadowsEnabled=t.vehicleShadowsEnabled,this.effectsFadeStartedAt=t.effectsFadeStartedAt,this.wallRects=t.wallRects,this.exhaustBursts=t.exhaustBursts,this.lastFlowCenter=t.lastFlowCenter,this.flowVelocity=t.flowVelocity,this.debugDrive=t.debugDrive,this.previewGroundFire=t.previewGroundFire,this.previewWallSmoke=t.previewWallSmoke,this.previewSparks=t.previewSparks,this.previewDamage=t.previewDamage,this.previewOil=t.previewOil,this.previewOilSplatter=t.previewOilSplatter,this.oilSplatterPreviewSeconds=t.oilSplatterPreviewSeconds,this.sparkPreviewClock=t.sparkPreviewClock,this.damagePreviewApplied=t.damagePreviewApplied,this.groundFirePreviewLit=t.groundFirePreviewLit,this.tourDebug=t.tourDebug,this.trailLifetime=t.trailLifetime,this.fallbackSurfaceTone=t.fallbackSurfaceTone,this.view.restoreState(e.camera),this.diagnostics.restoreState(e.diagnostics),this.vehicles.restoreState(e.vehicles),this.volumetrics.setQuality(this.fluidGovernor.apply(this.quality)),this.volumetrics.restoreState(e.volumetrics),this.combustion.setQuality(this.fluidGovernor.apply(this.quality)),this.combustion.restoreState(e.combustion),this.liquidLayer.restoreState(e.liquids),e.debris&&this.debris.restoreState(e.debris),this.skidTracks.restoreState(e.skidTracks,this.skidView(),this.darkSurface()),this.tireMarks.restoreState(e.tireMarks),this.sparks.restoreState(e.sparks),this.screenShake.restoreState(e.screenShake),this.effectsFadeStartedAt!==null&&(this.effectsFadeStartedAt+=performance.now()-e.at),this.view.rebaseTime(performance.now()),this.ghostVehicles.clearMaterials(),this.view.restorePresentation()}get flamethrowerFiring(){return this.activeVehicles.some(e=>e.weapons.flamethrower.firing)}get managedMemoryGroups(){return[{label:`Tire marks`,bytes:this.skidTracks.managedBytes+this.activeVehicles.reduce((e,t)=>e+t.tirePaint.managedBytes,0)+this.tireMarks.managedBytes},{label:`Smoke`,bytes:this.volumetrics.smokeBytes},{label:`Ghost`,bytes:this.volumetrics.ghostBytes},{label:`Fire`,bytes:this.combustion.managedBytes},{label:`Liquids`,bytes:this.liquidLayer.managedBytes},{label:`Debris`,bytes:this.debris.managedBytes+rn().bytes},{label:`Tools`,bytes:this.activeVehicles.reduce((e,t)=>e+t.weapons.managedBytes,0)},{label:`Sparks`,bytes:this.sparks.count*112},{label:`Points`,bytes:this.pointPuffs.length*32},{label:`Vehicle trail`,bytes:this.trail.length*48}]}get managedBytes(){return this.managedMemoryGroups.reduce((e,t)=>e+t.bytes,0)}debugDrive=!1;previewGroundFire=!1;previewWallSmoke=!1;previewSparks=!1;previewDamage=!1;previewOil=!1;previewOilSplatter=!1;oilSplatterPreviewSeconds=0;sparkPreviewClock=0;damagePreviewApplied=!1;groundFirePreviewLit=!1;diagnostics=new tr;tourDebug=null;trailLifetime=12;constructor(e,t=!1,n=`high`,r=!1){this.overlay=t,this.canvasWorld=r,this.sparks.setElectricalPalette(Om),this.view=new Qn(t,r,()=>this.resize()),this.surface=new $n(e,this.view,t,r),this.combustion=new Df(this.view,n),this.volumetrics=new kf(this.view,n),this.electricity=new Wm(this.view),this.liquidLayer=new Up(this.view,n),this.vehicles=new An(this.view),this.quality=n,this.resize()}get pixelSpace(){return this.overlay||this.canvasWorld}prepareFire(){return this.sparks.prepare()?this.combustion.ensure():!1}setQuality(e){if(e===this.quality)return;this.quality=e;let t=this.fluidGovernor.apply(e);this.volumetrics.setQuality(t),this.liquidLayer.setQuality(e),this.combustion.setQuality(t)}applyFluidQuality(){let e=this.fluidGovernor.apply(this.quality);this.volumetrics.setQuality(e),this.combustion.setQuality(e)}setSmokeTint(e){this.volumetrics.setSmokeTint(e)}setTireSmokeEnabled(e){this.tireSmokeEnabled=e}setVehicleShadowsEnabled(e){this.vehicleShadowsEnabled=e}setViewportMode(e){this.surface.setViewportMode(e),this.liquidLayer.setViewportMode(e)}setGhostStyle(e){this.volumetrics.setGhostStyle(e)}setSparksEnabled(e){this.sparks.setEnabled(e)}setScreenShakeEnabled(e){this.screenShake.setEnabled(e)}setScreenShakeProfiles(e){this.screenShake.setProfiles(e)}emitCrashShake(e){if(this.effectsFadeStartedAt!==null)return;let t=am(e);t&&this.screenShake.trigger(t)}emitRocketExplosionShake(e=1){this.effectsFadeStartedAt===null&&this.screenShake.trigger(`rocketExplosion`,Math.sqrt(Math.max(0,e)))}emitCombustibleExplosion(e,t){if(this.effectsFadeStartedAt!==null)return;this.screenShake.trigger(`combustibleExplosion`);let n=this.particlePoint(this.worldFromDocument(e));this.sparks.emitExplosion(n,P(),this.particleScale(),1.2),this.combustion.queueBlast(n,t*this.particleScale()/Math.max(1,this.documentScale())),this.emitCombustibleBlast(e,t,0)}emitCombustibleBlast(e,t,n){if(this.effectsFadeStartedAt!==null||!this.combustion.activateBuoyancy())return;let i=this.particlePoint(this.worldFromDocument(e)),a=t*this.particleScale()/Math.max(1,this.documentScale()),o=Math.min(1,n/.34);for(let e=0;e<24;e++){let t=e*Math.PI*(3-Math.sqrt(5)),n=P(Math.cos(t),Math.sin(t));this.combustion.queueStamp({point:E(i,r(n,a*o*1.05)),radius:Math.max(4,a*(.29-o*.12)),flow:E(r(n,a*(2.6-o)),P(0,-a*.4)),progress:.28+o*.53,blast:!0})}}emitRocketExplosion(e,t,n=1){if(this.effectsFadeStartedAt!==null)return;let i=this.particlePoint(this.worldFromDocument(e)),a=this.particleVelocity(P(t.x/this.view.zoom,-t.y/this.view.zoom)),o=this.particleScale(),s=Math.sqrt(k(n,.5,2));this.combustion.ensure()&&(this.combustion.queueBlast(i,o*2.2*s),this.combustion.queueStamp({point:i,radius:o*.95*s,flow:P(0,-o*.7),progress:.24,strength:2.6,blast:!0}));for(let t=0;t<64;t++){let n=t*Math.PI*(3-Math.sqrt(5))+Math.atan2(a.y,a.x),c=o*Math.sqrt((t+.5)/64)*1.75*(.83+.17*Math.sin(t*11.8+e.x*.03))*s,l=P(Math.cos(n),Math.sin(n));this.combustion.available&&this.combustion.queueStamp({point:E(i,r(l,c)),radius:o*(.38+t%4*.065)*s,flow:E(r(l,o*2.5),P(0,-o*.5)),progress:.3+t%5*.06,strength:1.7+t%3*.28,blast:!0})}this.sparks.emitExplosion(i,a,o,n),this.sparks.emitFireAt(i,o*.5,.25,14)}setDeformEnabled(e){this.focusVehicle?.damage.setEnabled(e),e||(this.damagePreviewApplied=!1)}resetVehicleDamage(){this.focusVehicle?.damage.reset()}emitSparks(e){this.effectsFadeStartedAt===null&&this.sparks.emit(e)}emitVehicleBurn(e,t,n,i){let a=e.sim,o=this.documentScale(),s=E(this.documentPoint(a.body.position),this.carVisualOffset(a)),c=n.lengthM*o,l=n.widthM*o,u=P(Math.cos(a.body.angle),-Math.sin(a.body.angle)),d=P(-u.y,u.x),p=E(s,E(r(u,t.burnOriginLocal.x*o),r(d,t.burnOriginLocal.y*o))),m=this.combustion.alphaFor(n.alpha.solid);if(t.stage===`exploded`)return t.explosionStarted&&this.emitCombustibleExplosion(s,Math.max(78,c*.7)),t.blastAge<f.fireballSeconds&&this.emitSceneFire({key:t.key,alpha:m,pixelWidth:n.alpha.columns,pixelHeight:n.alpha.rows,x:s.x-c/2,y:s.y-l/2,width:c,height:l,angle:-a.body.angle,origin:s,farthest:Math.hypot(c,l),...ne(t.blastAge)},i),t.blastPulse&&this.emitCombustibleBlast(s,Math.max(78,c*.7),t.blastAge),t.explosionStarted?s:null;let h=b(t.health,t.maxHealth,c,l);return h&&this.emitSceneFire({key:t.key,alpha:m,pixelWidth:n.alpha.columns,pixelHeight:n.alpha.rows,x:s.x-c/2,y:s.y-l/2,width:c,height:l,angle:-a.body.angle,origin:p,farthest:Math.hypot(c,l),...h},i),null}sceneFireDue(e){return this.effectsFadeStartedAt===null&&this.combustion.sceneMasksDue(e)}emitSceneFire(e,t=1/60){this.effectsFadeStartedAt===null&&this.combustion.queueMask(e)}pourWorldLiquid(e,t,n,r,i){this.liquidLayer.pourWorldLiquid(e,t,n,r,i)}emitPaint(e,t,n,r,i){this.liquidLayer.emitPaint(e,t,n,r,i)}hasConductiveLiquidNear(e,t){return this.liquidLayer.hasConductiveCandidate(e,t)}conductLightning(e,t=0){return this.liquidLayer.conductLightning(e,t)}igniteLiquidAt(e,t){this.liquidLayer.igniteAt(e,t)}igniteConductedLiquids(e,t){this.liquidLayer.igniteConducted(e,t)}igniteLiquidsFromFire(e){this.liquidLayer.igniteFromFire(e)}burningLiquidSources(){return this.liquidLayer.burningSources()}hasLiquidContact(e,t){return this.liquidLayer.hasContact(e,t)}addLiquid(e,t){this.liquidLayer.add(e,t)}syncElementLiquids(e){return this.liquidLayer.syncElements(e)}ejectLiquid(e,t=`oil`,n){this.liquidLayer.pourVehicle(e,t,.65,n)}setInitialPuddles(e){this.liquidLayer.setInitialPuddles(e)}setSurfaceTone(e){this.surfaceTone=e}fallbackSurfaceTone={at:-1/0,dark:!1};darkSurface(){if(this.surfaceTone!==`auto`)return this.surfaceTone===`dark`;let e=document.documentElement.dataset.jrTheme;if(e===`light`||e===`dark`)return e===`dark`;let t=performance.now();if(t-this.fallbackSurfaceTone.at<80)return this.fallbackSurfaceTone.dark;let n=getComputedStyle(document.body).backgroundColor,r=lr(/rgba\([^)]*,\s*0(?:\.0+)?\s*\)/.test(n)||n===`transparent`?getComputedStyle(document.documentElement).backgroundColor:n);return this.fallbackSurfaceTone={at:t,dark:r},r}setDebugEnabled(e){this.debugDrive=e||!1}setTourDebugRoute(e,t=[]){this.tourDebug=e?{route:e,stops:t}:null}fadeEffects(){if(this.effectsFadeStartedAt!==null)return;this.effectsFadeStartedAt=performance.now(),this.liquidLayer.clearEffects(),this.liquidLayer.restoreInitialPuddles(),this.volumetrics.clearSmokeSources();let e=this.activeVehicles.length?this.activeVehicles:this.focusVehicle?[this.focusVehicle]:[];for(let t of e)t.weapons.reset(),t.tirePaint.reset(),t.damage.reset();this.screenShake.reset(),this.electricity.reset(),this.skidTracks.fade(),this.combustion.clearTireHistory(),this.exhaustBursts=[]}clearEffects(e=!0){this.debris.reset(),this.electricity.reset(),this.objectGlint?.dispose(),this.objectGlint=null,this.trail=[],this.skidTracks.clear(),this.volumetrics.reset(),this.pointPuffs=[];for(let e of this.activeVehicles.length?this.activeVehicles:this.focusVehicle?[this.focusVehicle]:[])e.weapons.rocket.reset(),e.weapons.machineGuns.reset(),e.weapons.flamethrower.reset();this.screenShake.reset(),this.combustion.reset(),this.exhaustBursts=[],this.sparks.reset(),e&&this.liquidLayer.clearEffects(),this.tireMarks.clear(),this.lastFlowCenter=null,this.flowVelocity=P(),this.trailClock=0,this.effectsFadeStartedAt=null}reset(){this.view.reset(),this.clearEffects(),this.liquidLayer.restoreInitialPuddles(),this.wallRects=[],this.groundFirePreviewLit=!1,this.sparkPreviewClock=0,this.damagePreviewApplied=!1,this.vehicles.reset(),this.tourDebug=null,this.surface.clear(),this.view.resetFollow()}dispose(){this.liquidLayer.dispose(),this.debris.clear(),this.electricity.dispose(),this.objectGlint?.dispose(),this.surface.dispose(),this.view.dispose(),this.skidTracks.clear(),this.tireMarks.clear(),this.volumetrics.dispose(),this.combustion.dispose(),this.sparks.dispose()}resize(){let e=this.surface.resize();this.liquidLayer.resize(),this.volumetrics.resize(e),this.combustion.resize(e)}rasterPixelRatio(){return this.canvasWorld?Math.min(2,Math.round(this.view.dpr/this.view.regionScale*100)/100):this.view.dpr}setShowVehicleMarkers(e){this.showVehicleMarkers=e}flashTargets(e){this.resize(),this.objectGlint??=new dm;let t=this.sceneScroll();this.objectGlint.trigger(this.view.width,this.view.height,this.view.dpr,n=>e(n,t))}particlePoint(e){return this.view.particlePoint(e)}particleScreen(e){return this.pixelSpace?c(e,this.sceneScroll()):this.screen(e)}particleVelocity(e){return this.pixelSpace?P(e.x*this.view.zoom,-e.y*this.view.zoom):{...e}}particleScale(){return this.view.particleScale()}emitPoints(e,t){t<=0||this.pointPuffs.push({point:this.particlePoint(this.worldFromDocument(e)),amount:t,age:0})}fluidView(){let e=this.sceneScroll();return this.pixelSpace?{origin:P(this.view.smokeMargin-e.x,this.view.smokeMargin-e.y),scaleX:1,scaleY:1}:{origin:P(this.view.width/2-this.view.camera.x*this.view.zoom,this.view.height/2+this.view.camera.y*this.view.zoom),scaleX:this.view.zoom,scaleY:-this.view.zoom}}flameView(){let e=this.fluidView();return this.pixelSpace?{...e,origin:P(e.origin.x-this.view.smokeMargin,e.origin.y-this.view.smokeMargin)}:e}clipFluidWalls(e){if(!this.overlay)return;let t=this.sceneScroll();for(let n of this.wallRects){let r=n.x-t.x,i=n.y-t.y;n.width<=0||n.height<=0||r>=this.view.width||i>=this.view.height||r+n.width<=0||i+n.height<=0||(e.beginPath(),e.rect(0,0,this.view.width,this.view.height),e.rect(r,i,n.width,n.height),e.clip(`evenodd`))}}stepVehicleWeapons(e,t,n,r,i,a,o,s,c){let l=e.sim;performance.now(),e.weapons.rocket.step(t,l,e=>{this.effectsFadeStartedAt===null&&this.volumetrics.emitSmoke({point:this.particlePoint(e.point),amount:e.amount,flow:this.particleVelocity(e.flow),radiusPx:e.radiusM*this.view.zoom,swirlPx:10})},n?(t,r,i)=>{let a=n(e,this.documentPoint(t),this.documentPoint(r),i*this.documentScale());return a?this.worldFromDocument(a):null}:void 0,e=>{this.effectsFadeStartedAt===null&&this.combustion.emitJet(e.from,e.to,e.flow,e.widthM,e.intensity,`rocket`)},o,s,void 0),e.weapons.machineGuns.step(t,l,r?(t,n,i)=>{let a=r(e,this.documentPoint(t),this.documentPoint(n),i*this.documentScale());return a?this.worldFromDocument(a):null}:void 0,i,(e,t)=>{this.effectsFadeStartedAt===null&&this.sparks.emitBulletImpact(this.particlePoint(e),this.particleVelocity(t)),c?.(e)}),e.weapons.flamethrower.step(t,l,e=>{this.effectsFadeStartedAt===null&&this.volumetrics.emitSmoke({point:this.particlePoint(e.point),amount:e.amount,flow:this.particleVelocity(e.flow),radiusPx:e.radiusM*this.view.zoom,swirlPx:10})},a?(t,n,r,i)=>{let o=a(e,this.documentPoint(t),this.documentPoint(n),r*this.documentScale(),i);return o?this.worldFromDocument(o):null}:void 0,(e,n,r,i,a)=>{if(this.effectsFadeStartedAt!==null)return;let o=this.particleScale();this.liquidLayer.igniteAlong(this.particlePoint(e),this.particlePoint(n),r*o*.5),a>.3&&this.sparks.emitFireAt(this.particlePoint(n),r*o*.4,t,3),this.combustion.queueStamp({point:this.particlePoint(n),radius:r*o,progress:a,flow:this.particleVelocity(i)})})}sprayTirePaint(e,t,n,r,i,a,o,s){return this.liquidLayer.splatter(e,t,n,r,i,a,o,s)}advanceEffects(e,t,{walls:n=[],carMask:i,tirePaintSources:a=[],driven:o=!0,rocketCollision:s,bulletCollision:l,onGunshot:d,flameContact:f,onRocketLaunch:m,onRocketImpact:h,onBulletImpact:g,maskFor:_,companions:v=[]}={}){for(let e of this.pointPuffs)e.age+=t;this.pointPuffs=this.pointPuffs.filter(e=>e.age<.9),this.activeVehicles=[e,...v];let y=this.sceneScroll();this.debris.count&&this.debris.step(t,this.activeVehicles.filter(e=>e.sim.mode===`car`&&!e.isGhost&&e.sim.car.explodedAt===null).map(e=>{let t=this.particlePoint(e.sim.body.position),n=this.particleVelocity(e.sim.body.velocity),r=this.particleScale();return{x:t.x,y:t.y,vx:n.x,vy:n.y,angle:-e.sim.body.angle,length:e.sim.car.preset.geometry.lengthM*r,width:e.sim.car.preset.geometry.widthM*r}}),{x:y.x,y:y.y,width:this.view.width,height:this.view.height},n),this.volumetrics.stepGhost(t,this.activeVehicles,n,_,this.flameView(),e=>this.carVisualOffset(e.sim));let b=e.sim;if(this.wallRects=n,this.vehicles.updateCarPose(b,t),this.effectsFadeStartedAt===null){for(let e of this.activeVehicles)for(let n of e.liquidEmissions(t))this.liquidLayer.pourVehicle(e.sim,p(n.liquid),n.amount,void 0,e.id);this.previewOil&&!this.previewOilSplatter&&this.liquidLayer.pourVehicle(b,`oil`,t*6)}for(let n of[e,...v])this.stepVehicleWeapons(n,t,s,l,d,f,m,h,g);let{tires:x,companionTires:S}=this.liquidLayer.stepVehicles(e,v,t,o,a,this.effectsFadeStartedAt!==null,(e,t)=>this.emitSceneFire(e,t)),C=this.documentScale(),w=P(Math.cos(b.body.angle),-Math.sin(b.body.angle)),T=b.mode===`car`&&i&&!e.isGhost?{mask:i.alpha,shape:{center:E(this.documentPoint(b.body.position),this.carVisualOffset(b)),forward:w,side:P(-w.y,w.x),halfLength:i.lengthM*C/2,halfWidth:i.widthM*C/2}}:void 0;if(this.previewDamage&&!this.damagePreviewApplied&&T&&(this.damagePreviewApplied=e.damage.hit(E(T.shape.center,r(T.shape.forward,T.shape.halfLength)),r(T.shape.forward,-1),T.shape,20,C)),this.electricity.step(e,v,t,this.sparks,this.screenShake),performance.now(),b.mode===`car`&&u(b.body.velocity)>.15&&this.sparks.disturb(this.particlePoint(b.body.position),this.particleVelocity(b.body.velocity),this.particleScale()*2.8),this.sparks.step(t,{walls:n,car:T}),this.previewSparks&&b.mode===`car`&&(this.sparkPreviewClock+=t,this.sparkPreviewClock>.12)){this.sparkPreviewClock=0;let e=this.particlePoint(b.body.position),t=this.particleScale();this.emitSparks({point:E(e,P(t*1.9,0)),velocity:P(t*4,t*10),normal:P(-1,0),pixelsPerMeter:t})}let D=this.particleScale(),O=this.particlePoint(b.body.position),ee=this.lastFlowCenter?r(c(O,this.lastFlowCenter),1/Math.max(t,1e-4)):this.particleVelocity(b.body.velocity),te=u(ee),ne=te>40*D?r(ee,40*D/te):ee;this.flowVelocity=E(this.flowVelocity,r(c(ne,this.flowVelocity),1-Math.exp(-12*t))),this.lastFlowCenter=O;let k=this.pixelSpace?this.flowVelocity:P(this.flowVelocity.x*this.view.zoom,-this.flowVelocity.y*this.view.zoom),re=P(Math.cos(b.body.angle),-Math.sin(b.body.angle)),A=b.mode===`car`?{center:E(this.screen(b.body.position),P(this.view.smokeMargin,this.view.smokeMargin)),velocity:k,forward:re,halfLength:b.car.preset.geometry.lengthM*this.view.zoom*.46,halfWidth:b.car.preset.geometry.widthM*this.view.zoom*.39,spin:-b.body.spin}:null;if(this.effectsFadeStartedAt!==null){this.volumetrics.clearSmokeSources(),this.combustion.stepTire(t),this.combustion.step(t,this.view.timeSeconds,e.isGhost?null:A,this.wallRects,!0,this.flameView(),this.sparks),this.volumetrics.stepSmoke(t,A,this.wallRects,this.fluidView());return}if(this.previewWallSmoke&&this.overlay){let e=this.sceneScroll(),n=this.wallRects.filter(t=>t.x-e.x>48&&t.x-e.x<this.view.width-48&&t.y+t.height/2-e.y>30&&t.y+t.height/2-e.y<this.view.height-30),r=n.find(t=>t.x-e.x>this.view.width*.5)??n[0];r&&this.volumetrics.emitSmoke({point:P(r.x-25,r.y+r.height/2),amount:t*15,flow:P(210,0),radiusPx:17,swirlPx:25})}if(performance.now(),this.combustion.stepTire(t),this.combustion.step(t,this.view.timeSeconds,e.isGhost?null:A,this.wallRects,!1,this.flameView(),this.sparks),!this.pixelSpace){for(let e of this.trail)e.age+=t;if(this.trail=this.trail.filter(e=>e.age<this.trailLifetime),this.trailClock+=t,this.trailLifetime>0&&this.trailClock>=1/30){this.trailClock%=1/30;let e=this.trail.at(-1);(!e||u(c(e.point,b.body.position))>.04)&&this.trail.push({point:{...b.body.position},age:0,color:b.mode===`ship`?`#9bbcff`:b.mode===`brick`?`#f6bd79`:`#8ce6c5`}),this.trail.length>800&&this.trail.shift()}}if(b.mode!==`car`){this.volumetrics.stepSmoke(t,null,this.wallRects,this.fluidView()),this.skidTracks.stop(this.skidView(),this.darkSurface(),!0),this.combustion.clearTireHistory();return}if(e.isGhost){this.volumetrics.stepSmoke(t,null,this.wallRects,this.fluidView()),this.skidTracks.stop(this.skidView(),this.darkSurface()),this.combustion.clearTireHistory();return}let j=this.advanceVehicleTireEffects(e,t,x,S,k),ie=this.combustion.emberSource();ie&&this.sparks.emitFireAt(ie.point,ie.radius,t,20*ie.heat),performance.now(),this.volumetrics.stepSmoke(t,A,this.wallRects,this.fluidView());let ae=this.darkSurface();this.skidTracks.step(t,b,j,t=>!!e.tirePaint.coating(t),{pixelSpace:this.pixelSpace,scale:this.particleScale(),dark:ae,project:e=>this.particlePoint(e),roadAt:(e,t)=>!!this.overlay&&this.surfaceTones.at(e,this.viewportFromDocument(t),ae),view:this.skidView()})}advanceVehicleTireEffects(e,t,n,i,a){let o=e.sim,s=this.particleScale();if(this.previewGroundFire&&!this.groundFirePreviewLit){for(let e of o.car.tires.filter(e=>!e.front)){let t=o.body.world(e.local);this.combustion.igniteTire(this.particlePoint(o.body.world(E(e.local,P(-2.4)))),this.particlePoint(t),o.car.preset.geometry.tireWidthM*s,18,.2*s)}this.groundFirePreviewLit=!0}let c=u(o.body.velocity),l=c>.1?r(o.body.velocity,-1/c):Ee(P(-1),o.body.angle);this.previewOilSplatter&&(c>.5?this.oilSplatterPreviewSeconds=0:c<.2&&(this.oilSplatterPreviewSeconds+=t),this.oilSplatterPreviewSeconds<2.25&&this.liquidLayer.pourOilPreview(n[0].point,t));let d={zoom:this.view.zoom,particlePoint:e=>this.particlePoint(e),particleVelocity:e=>this.particleVelocity(e),spray:(...e)=>this.sprayTirePaint(...e),smoke:this.tireSmokeEnabled?e=>this.volumetrics.emitSmoke(e):void 0};um(e,n,0,t,l,a,d,this.previewOilSplatter&&c<.2&&this.oilSplatterPreviewSeconds>1&&this.oilSplatterPreviewSeconds<2.25);let f=n.length;for(let{vehicle:e,tires:n}of i){if(!e.isGhost){let i=e.sim,a=u(i.body.velocity),o=a>.1?r(i.body.velocity,-1/a):Ee(P(-1),i.body.angle);um(e,n,f,t,o,this.particleVelocity(i.body.velocity),d)}f+=n.length}(e.isGhost||o.car.preset.sound.electric)&&(this.exhaustBursts=[]);for(let e of this.exhaustBursts){e.age+=t;let n=e.intensity*Math.max(0,1-e.age/e.lifetime);if(n<=0)continue;let i=Ee(P(-1,0),o.body.angle),a=E(r(i,4+5*n),r(o.body.velocity,.12));for(let e of this.vehicles.exhaustOutlets(o)){let s=o.body.world(e);if(this.combustion.emitJet(s,s,a,.13,n*.8,`exhaust`),n>.55){let e=E(s,r(i,1.45));this.volumetrics.emitSmoke({point:this.particlePoint(e),amount:t*n*.2,flow:this.particleVelocity(r(a,.48)),radiusPx:.13*this.particleScale(),swirlPx:7})}}}this.exhaustBursts=this.exhaustBursts.filter(e=>e.age<e.lifetime);let p=o.car.boostActive&&!e.isGhost;return p?this.combustion.stepBoostFire(o,t,e=>this.liquidLayer.igniteAtLocal(e)):this.combustion.clearTireHistory(),p}skidView(){return{pixelSpace:this.pixelSpace,zoom:this.view.zoom,width:this.view.width,height:this.view.height,screen:e=>this.particleScreen(e)}}vehicleLightInput(e,t,n){let r=be(e.sim.car.preset),i=e=>[-1,1].map(t=>P(e.xM*this.view.zoom,t*e.yM*this.view.zoom)),a=e.sim,o=this.vehicles.imageFor(a.car.preset)??void 0,s=o?un(a.car.preset,o.naturalWidth,o.naturalHeight):null,c=a.body.velocity.x*Math.cos(a.body.angle)+a.body.velocity.y*Math.sin(a.body.angle),l=a.lastInput,u=Math.max(l.brake??0,+!!l.action,+(l.throttle<0&&c>.5||l.throttle>0&&c<-.5));return{center:E(this.screen(a.body.position),this.carVisualOffset(a)),angle:-a.body.angle,width:(s?.lengthM??a.car.preset.geometry.lengthM)*this.view.zoom,height:(s?.widthM??a.car.preset.geometry.widthM)*this.view.zoom,mounts:{headlights:i(r.headlights),taillights:i(r.taillights)},image:o,source:s?.source,dark:e.appearance===`auto`?this.overlay?this.surfaceTones.at(e,this.viewportFromDocument(this.documentPoint(a.body.position)),t):t:e.appearance===`dark`,braking:u,options:this.vehicleLighting,opacity:n}}drawVehicleAndWeapons(e,t,n){performance.now(),Ye(`vehicle render passes`);let r=e.sim,{rocket:i,machineGuns:a,flamethrower:o}=e.weapons,s=this.ctx;if(e.isGhost){this.ghostVehicles.draw(e,s,{imageFor:e=>this.vehicles.imageFor(e),screen:e=>this.screen(e),visualOffset:e=>this.carVisualOffset(e),zoom:this.view.zoom,width:this.view.width,height:this.view.height,pixelSpace:this.pixelSpace,walls:this.wallRects,scroll:this.sceneScroll(),dark:this.darkSurface(),styleName:this.volumetrics.style}),i.drawFlight(s,e=>this.screen(e),r.car.preset,this.view.zoom,t),a.drawProjectiles(s,e=>this.screen(e),this.view.zoom,t);return}let c=this.carVisualOffset(r);if(s.save(),s.translate(c.x,c.y),r.car.explodedAt===null){this.vehicles.car(this.ctx,r.body,r,e.damage,Math.max(o.openAmount,a.openAmount));let i=n??this.vehicleLightInput(e,this.darkSurface(),t);this.vehicleLights.glints(s,{...i,center:this.screen(r.body.position)})}let l;if(i.state!==`idle`||o.state!==`closed`||a.state!==`closed`){let t=this.vehicles.imageFor(r.car.preset);if(t){let n=un(r.car.preset,t.naturalWidth,t.naturalHeight),i=e.damage.spriteFor(t,n);l={image:i??t,source:i?{x:0,y:0,width:i.width,height:i.height}:n.source,lengthM:n.lengthM,widthM:n.widthM}}}r.car.explodedAt===null&&i.drawMount(s,this.screen(r.body.position),r.body.angle,r.car.preset,this.view.zoom,t,l),r.car.explodedAt===null&&o.state!==`closed`?o.drawMount(s,this.screen(r.body.position),r.body.angle,r.car.preset,this.view.zoom,t,l):r.car.explodedAt===null&&a.drawMount(s,this.screen(r.body.position),r.body.angle,r.car.preset,this.view.zoom,t,l),s.restore(),s.save(),this.clipFluidWalls(s),s.translate(c.x,c.y),r.car.explodedAt===null&&this.vehicles.exhaust(this.ctx,r),s.restore(),i.drawFlight(s,e=>this.screen(e),r.car.preset,this.view.zoom,t),a.drawProjectiles(s,e=>this.screen(e),this.view.zoom,t)}drawGroundLayers(e,t,n,r){let i=t.sim;if(!this.pixelSpace){let{left:e,right:t,bottom:n,top:r}=this.bounds();for(let i=Math.floor(e/5)*5;i<=t;i+=5)this.vehicles.line(this.ctx,P(i,n),P(i,r),`#293c46`);for(let i=Math.floor(n/5)*5;i<=r;i+=5)this.vehicles.line(this.ctx,P(e,i),P(t,i),`#293c46`)}for(let t of this.trail){let n=this.screen(t.point),i=1-t.age/this.trailLifetime;e.globalAlpha=.6*i*i*r,e.fillStyle=t.color,e.beginPath(),e.arc(n.x,n.y,.8+1.4*i,0,Math.PI*2),e.fill()}e.globalAlpha=1,e.save(),e.lineCap=`round`,e.lineJoin=`round`;let a=this.sceneScroll(),o=this.pixelSpace?{left:a.x,right:a.x+this.view.width,bottom:a.y,top:a.y+this.view.height}:{left:this.world(P(0,0)).x,right:this.world(P(this.view.width,0)).x,bottom:this.world(P(0,this.view.height)).y,top:this.world(P(0,0)).y},s=this.darkSurface();performance.now(),this.skidTracks.draw(e,{pixelSpace:this.pixelSpace,scroll:a,width:this.view.width,height:this.view.height,ratio:this.rasterPixelRatio(),dark:s,alpha:r,visible:o,view:this.skidView()}),performance.now();let c={pixelSpace:this.pixelSpace,scroll:a,width:this.view.width,height:this.view.height,particleScale:this.particleScale(),rasterRatio:this.rasterPixelRatio(),zoom:this.view.zoom,effectsAlpha:r,screen:e=>this.particleScreen(e)};return this.tireMarks.draw(e,[t,...n],!1,c),e.restore(),this.liquidLayer.draw(e,1),performance.now(),this.tireMarks.draw(e,[t,...n],!0,c),i.barrier&&!this.overlay&&(e.strokeStyle=`#d4ab71`,e.lineWidth=2,e.strokeRect(3,3,this.view.width-6,this.view.height-6)),{scroll:a,darkSurface:s}}render(e,t,n,r,i=[]){let a=e.sim;performance.now(),this.resize();let o=cm(this.effectsFadeStartedAt,t);if(this.effectsFadeStartedAt!==null&&o===0&&(this.clearEffects(!1),o=0),this.view.cameraStep(a,t),this.canvasWorld&&t>=this.nextHistoryPrune){this.nextHistoryPrune=t+2e3;let e=this.documentPoint(a.body.position),n=2800,r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};this.skidTracks.pruneOutside(r),this.tireMarks.pruneOutside(r),this.liquidLayer.pruneOutside(r)}let s=this.ctx;this.surface.clear();let c=this.screenShake.sample(t);s.save(),(c.x||c.y)&&s.translate(c.x,c.y),r?.drawGround?.(s,this.sceneScroll(),{width:this.view.width,height:this.view.height});let{scroll:l,darkSurface:u}=this.drawGroundLayers(s,e,i,o),d=new Map((this.primaryVehicleVisible?[e,...i]:i).filter(e=>e.sim.mode===`car`&&e.sim.car.explodedAt===null&&!e.isGhost).map(t=>[t,this.vehicleLightInput(t,u,o*(t===e?this.primaryVehicleOpacity:1))])),f=[...d.values()].flatMap(e=>this.vehicleLights.smokeLights(e)),p=f.map(e=>({...e,point:{x:e.point.x+l.x,y:e.point.y+l.y}}));this.pixelSpace&&(s.save(),s.translate(-l.x,-l.y),cn(s,this.debris.particles,{x:l.x,y:l.y,width:this.view.width,height:this.view.height},u,`ground`,p),s.restore());for(let t of this.primaryVehicleVisible?[e,...i]:i)t.sim.mode!==`car`||t.sim.car.explodedAt!==null||t.isGhost||t===e&&this.primaryVehicleOpacity<=0||(s.save(),t===e&&(s.globalAlpha*=this.primaryVehicleOpacity),this.vehicles.carGround(this.ctx,t.sim,t.damage,this.rasterPixelRatio(),this.vehicleShadowsEnabled),s.restore());for(let e of d.values())this.vehicleLights.ground(s,e);if(s.save(),performance.now(),this.clipFluidWalls(s),s.globalAlpha=o,s.save(),s.translate(-this.view.smokeMargin,-this.view.smokeMargin),this.volumetrics.drawSmoke(s,this.fluidView(),f.map(e=>({...e,point:E(e.point,P(this.view.smokeMargin,this.view.smokeMargin))})),u),s.restore(),s.restore(),s.globalAlpha=1,r?.draw(s,l,{width:this.view.width,height:this.view.height}),this.debugDrive&&a.mode===`car`&&a.car.explodedAt===null&&!e.isGhost){let e=this.screen(a.body.position);s.save(),s.beginPath(),s.arc(e.x,e.y,M(a.car.preset,this.view.width,this.documentScale())*this.view.zoom,0,Math.PI*2),s.strokeStyle=u?`#92cfff88`:`#12528e88`,s.lineWidth=1,s.setLineDash([5,6]),s.stroke(),s.fillStyle=u?`#b7ddff`:`#12528e`,s.font=`10px ui-monospace, monospace`,s.fillText(`Lightning influence`,e.x+8,e.y-M(a.car.preset,this.view.width,this.documentScale())*this.view.zoom+14),s.restore()}this.volumetrics.ghostAvailable&&(s.save(),s.globalAlpha=o,this.volumetrics.drawGhost(s,this.flameView(),u),s.restore()),this.overlay&&this.debugDrive&&this.tourDebug&&sm(s,this.tourDebug.route,this.tourDebug.stops,{x:l.x,y:l.y,width:this.view.width,height:this.view.height}),this.primaryVehicleVisible&&a.mode===`car`&&(s.save(),s.globalAlpha*=this.primaryVehicleOpacity,this.drawVehicleAndWeapons(e,o,d.get(e)),s.restore(),this.debugDrive&&(r?.drawDebug?.(s,a,this,e.damage),this.diagnostics.draw(s,a,t,e=>this.screen(e),{width:this.view.width,rocketState:e.weapons.rocket.state,gunState:e.weapons.machineGuns.state,bulletCount:e.weapons.machineGuns.projectileCount,fluidEngine:this.volumetrics.smokeResolution.engine,quality:this.quality,fluidCols:this.volumetrics.smokeResolution.cols,fluidRows:this.volumetrics.smokeResolution.rows,fireCols:this.combustion.resolution?.cols??0,fireRows:this.combustion.resolution?.rows??0,groundedFireCount:this.combustion.count}))),this.primaryVehicleVisible&&a.mode===`ship`&&this.vehicles.ship(this.ctx,a.body,a),this.primaryVehicleVisible&&a.mode===`brick`&&this.vehicles.brick(this.ctx,a.body);for(let e of i){let t=e.sim;if(t.mode!==`car`||(this.drawVehicleAndWeapons(e,o,d.get(e)),t.car.explodedAt!==null))continue;let n=this.screen(t.body.position);s.save(),s.font=`600 10px ui-monospace, monospace`,s.textAlign=`center`;let r=e.label||`AI`,i=Math.max(30,Math.ceil(s.measureText(r).width)+14);s.fillStyle=`rgba(24, 27, 30, 0.88)`,s.fillRect(n.x-i/2,n.y-37,i,16),s.fillStyle=`#f5f2ec`,s.fillText(r,n.x,n.y-25),s.restore()}if(this.pixelSpace&&(s.save(),s.translate(-l.x,-l.y),cn(s,this.debris.particles,{x:l.x,y:l.y,width:this.view.width,height:this.view.height},u,`air`,p),s.restore()),s.save(),this.clipFluidWalls(s),performance.now(),this.combustion.draw(s,this.flameView(),u,f),s.restore(),this.electricity.draw(s,t,u,o),performance.now(),this.sparks.draw(s,e=>this.particleScreen(e),o,{width:this.view.width,height:this.view.height},this.view.dpr,this.canvasWorld?void 0:this.surface.canvas),this.pointPuffs.length){s.save(),s.font=`700 13px ui-monospace, monospace`,s.textAlign=`center`,s.textBaseline=`middle`;for(let e of this.pointPuffs){let t=this.particleScreen(e.point),n=e.age/.9;s.globalAlpha=(1-n)*o,s.fillStyle=`#f8f4e9`,s.strokeStyle=`rgba(22, 24, 26, 0.85)`,s.lineWidth=3;let r=`+${e.amount}`,i=t.y-16-n*26;s.strokeText(r,t.x,i),s.fillText(r,t.x,i)}s.restore()}if(r?.drawForeground?.(s,l,{width:this.view.width,height:this.view.height}),performance.now(),r?.drawHealthBars?.(s,l,{width:this.view.width,height:this.view.height},e,this,i),n){let e=this.screen(n.from),t=this.screen(n.to);s.strokeStyle=`#ffdf93`,s.lineWidth=2,s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.stroke()}s.restore(),this.objectGlint?.draw(s,this.view.width,this.view.height,this.darkSurface()),this.vehicles.drawVehicleMarkers(this.ctx,this.primaryVehicleVisible?[e,...i]:i,this.showVehicleMarkers),this.surface.presentLockedCamera(),this.liquidLayer.drawTextVehicles([e,...i].filter(t=>(t!==e||this.primaryVehicleVisible)&&t.sim.mode===`car`&&!t.isGhost&&t.sim.car.explodedAt===null).map(e=>({point:this.screen(e.sim.body.position),radius:Math.hypot(e.sim.car.preset.geometry.lengthM,e.sim.car.preset.geometry.widthM)*this.view.zoom/2+12})),c,t=>{for(let n of[e,...i]){if(n===e&&!this.primaryVehicleVisible||n.sim.mode!==`car`||n.isGhost||n.sim.car.explodedAt!==null)continue;let r=this.carVisualOffset(n.sim);t.save(),t.translate(r.x,r.y),this.vehicles.car(t,n.sim.body,n.sim,n.damage,Math.max(n.weapons.flamethrower.openAmount,n.weapons.machineGuns.openAmount)),t.restore()}}),this.governFluidQuality(t)}governFluidQuality(e){let t=performance.now()-e;if(!(t>=0&&t<1e3))return;let n=this.volumetrics.running||this.combustion.running;this.fluidGovernor.sample(e,t,n,this.quality)&&(Ye(`fluid quality limit ${this.fluidGovernor.limit}`),this.applyFluidQuality())}},Km=Object.freeze({speedFactor:.5,rampMs:300,zoomFactor:0,curve:`ease-in-out`}),qm={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e*e*(3-2*e)},Jm={linear:e=>e*e/2,"ease-in":e=>e*e*e/3,"ease-out":e=>e*e-e*e*e/3,"ease-in-out":e=>e*e*e-e*e*e*e/2},Ym=class{settings={...Km};enabled=!1;speed=1;zoom=1;fromSpeed=1;fromZoom=1;elapsed=0;constructor(e={}){this.configure(e)}get options(){return{...this.settings}}get active(){return this.enabled}get speedFactor(){return this.speed}get zoomFactor(){return this.zoom}configure(e){let t={...this.settings,...e};if(!Number.isFinite(t.speedFactor)||t.speedFactor<=0||t.speedFactor>1)throw RangeError(`Slow-mo speedFactor must be greater than zero and at most one.`);if(!Number.isFinite(t.rampMs)||t.rampMs<0)throw RangeError(`Slow-mo rampMs must be a nonnegative number.`);if(!Number.isFinite(t.zoomFactor)||t.zoomFactor<0||t.zoomFactor>4)throw RangeError(`Slow-mo zoomFactor must be between 0 and 4.`);if(!Object.hasOwn(qm,t.curve))throw TypeError(`Unknown slow-mo curve.`);this.settings=t,this.beginRamp()}setActive(e){this.enabled!==e&&(this.enabled=e,this.beginRamp())}start(){this.setActive(!0)}stop(){this.setActive(!1)}beginRamp(){this.fromSpeed=this.speed,this.fromZoom=this.zoom,this.elapsed=0,this.settings.rampMs||this.advance(0)}advance(e){if(!Number.isFinite(e)||e<0)throw RangeError(`Slow-mo elapsed time must be a nonnegative number.`);let t=this.enabled?this.settings.speedFactor:1,n=this.enabled&&this.settings.zoomFactor||1,r=this.settings.rampMs/1e3;if(!r||this.elapsed>=r)return this.speed=t,this.zoom=n,e*t;let i=this.elapsed/r,a=Math.min(e,r-this.elapsed);this.elapsed+=a;let o=Math.min(1,this.elapsed/r),s=qm[this.settings.curve](o);this.speed=this.fromSpeed+(t-this.fromSpeed)*s,this.zoom=this.fromZoom+(n-this.fromZoom)*s;let c=Jm[this.settings.curve](o)-Jm[this.settings.curve](i);return a*this.fromSpeed+r*(t-this.fromSpeed)*c+(e-a)*t}reset(){this.enabled=!1,this.speed=this.zoom=this.fromSpeed=this.fromZoom=1,this.elapsed=0}captureState(){return{options:{...this.settings},active:this.enabled,speed:this.speed,zoom:this.zoom,fromSpeed:this.fromSpeed,fromZoom:this.fromZoom,elapsed:this.elapsed}}restoreState(e){this.settings={...e.options},this.enabled=e.active,this.speed=e.speed,this.zoom=e.zoom,this.fromSpeed=e.fromSpeed,this.fromZoom=e.fromZoom,this.elapsed=e.elapsed}},Xm=new WeakMap;function Zm(e){let t=Xm.get(e);return!t&&typeof e.createConstantSource==`function`&&(t=e.createConstantSource(),t.offset.value=0,t.start(),Xm.set(e,t)),t}function Qm(e,t){let n=Zm(e);if(!n)return;let r=1200*Math.log2(Number.isFinite(t)&&t>0?Math.min(1,t):1),i=e.currentTime;n.offset.cancelScheduledValues(i),n.offset.setValueAtTime(n.offset.value,i),n.offset.linearRampToValueAtTime(r,i+1/120)}function $m(e){let t=Xm.get(e);t&&(t.stop(),t.disconnect(),Xm.delete(e))}function W(e){if(!e.detune||!e.context)return e;let t=Zm(e.context);return t&&(t.connect(e.detune),e.addEventListener(`ended`,()=>{try{t.disconnect(e.detune)}catch{}},{once:!0})),e}var eh=`data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0UAAAAOAAADTGF2ZjYzLjEuMTAyAAAAAAAAAAAAAAD/83DAAAAAAAAAAAAASW5mbwAAAA8AAAAPAAAJ5QAiIiIiIiIyMjIyMjIyQUFBQUFBUVFRUVFR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VdCLZeCLheCLlcCLpaCLtXCLxUCL9TCMBSCMBSCL1RCLkIB7kKB7oMB7oPB7kzB7s0B8A0B8M1B8Q1B8Q2B8M3B8A4B7w6B7k7B7ZNB7VOB7VMB7RLB7RJB7NIB7PjCLLjCLTjCLTjCLTjCLGvB7GuB7GuB7BTB7NVB7VXB7VYB7VZB7RaB7NbB7JbB7BbB69bB65bB65bB65cB61fB6thB6xkB6xwB6xvB6xwB6txB6h1CKh1CKl0CKpzCKpyCKpxCKo8B6s8B6s7B6o6B6l2CKd3CKReB6NeB6VdB6ddB6biCKXiCKTMCKTLCKPKCKLICJ+PCJyNCJyMCJq2CJ21CJ60CJ60CJ2zCJqyCJexCJPNCI+sBpCtBpCuBo6vBouxBoeyBoKzBnvMCHjKCHfJCHbHCHXHCHPHCHDJCGzLCGaYCGOZCGCZCFvZCFjbCFTbCE8KCUoJCUMJCTsJCTEKCSSwCBc=`;function lh(e){let t=e;return()=>(t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)/2147483648-1)}var uh={"collision-soft":{level:.11,decay:.085,strikes:[[.006,1],[.029,.26]]},"collision-medium":{level:.16,decay:.14,strikes:[[.007,1],[.026,.42],[.057,.2]]},"collision-hard":{level:.22,decay:.2,strikes:[[.008,1],[.024,.47],[.048,.32],[.081,.18]]}};function dh(e,t,n){let r=uh[n],i=[570,1010,1690,2680,4230],a=[.48,.4,.3,.2,.12],o=[.2,1.7,3.1,4.6,5.8],s=i.map(()=>0),c=r.strikes,l=0,u=0,d=0,f=lh(n===`collision-soft`?403364:n===`collision-medium`?581137:1011779);for(let n=0;n<e.length;n++){let p=n/t;for(;l<c.length&&p>=c[l][0];){let e=c[l][1];for(let t=0;t<s.length;t++)s[t]+=e;u+=e,l++}let m=0;for(let e=0;e<s.length;e++){let n=r.decay*(1-e*.14);s[e]*=Math.exp(-1/(t*n));let c=1+.018*Math.exp(-p/.035);o[e]+=2*Math.PI*i[e]*c/t,m+=Math.sin(o[e])*s[e]*a[e]}let h=f();d+=(h-d)*.29,u*=Math.exp(-1/(t*.022)),e[n]+=r.level*(m*.63+(h-d)*u*.22)}}function fh(e,t){let n=[[.004,1],[.012,.75],[.023,.55],[.035,.28]],r=[[.029,1],[.065,.38]],i=lh(504037),a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=1-Math.exp(-2*Math.PI*5200/t);for(let _=0;_<e.length;_++){let v=_/t;for(;d<n.length&&v>=n[d][0];)s+=n[d][1],c+=n[d][1],d++;for(;f<r.length&&v>=r[f][0];)l+=r[f][1],f++;let y=i();a+=(y-a)*.09,o+=(y-o)*.32,u+=(i()-u)*.006,s*=Math.exp(-1/(t*.0045)),c*=Math.exp(-1/(t*.018)),l*=Math.exp(-1/(t*.052));let b=o-a,x=(y-o)*.27+b*.55,S=(a*1.05+b*.18)*(.85+u*.5),C=2.3*(e[_]*.17+x*s*.65+b*c*.15+S*l*1.2);p+=(C-p)*g,m+=(p-m)*g,h+=(m-h)*g,e[_]=h}}function ph(e,t,n){if(n===`crush`)fh(e,t);else if(n===`collision-soft`||n===`collision-medium`||n===`collision-hard`)dh(e,t,n);else return;for(let t=0;t<e.length;t++){let n=Math.abs(e[t]);n>.8&&(e[t]=Math.sign(e[t])*(.8+.18*Math.tanh((n-.8)/.18)))}}function mh(e){let t=0;for(let n of e)t+=n*n;return Math.sqrt(t/e.length)}function hh(e,t){let n=mh(e),r=lh(989808),i=[[.31,.45],[.52,.7],[.79,.5],[1.04,.8],[1.28,.55]],a=0,o=0,s=0,c=0,l=1-Math.exp(-2*Math.PI*170/t),u=1-Math.exp(-2*Math.PI*1500/t),d=Math.exp(-1/(t*.006));for(let n=0;n<e.length;n++){let f=n/t;for(;c<i.length&&f>=i[c][0];)s+=i[c][1],c++;let p=e[n];a+=(p-a)*l,o+=(p-o)*u,s*=d,e[n]=a*.55+(o-a)*.5+(p-o)*.42+r()*s*.04}let f=n/Math.max(1e-6,mh(e))*.9;for(let t=0;t<e.length;t++)e[t]*=f}function gh(e,t){let[n,r]=t.tracks;if(!n||!r)return;let i=t.sampleRate,a=lh(466480),o=[110,145].map(e=>Math.exp(-Math.PI*e/i)),s=[n.frequency[0],r.frequency[0]],c=[0,0],l=[0,0],u=1-Math.exp(-1/(i*.025)),d=0,f=0,p=0,m=0,h=0,g=1-Math.exp(-2*Math.PI*650/i);for(let _=0;_<e.length;_++){let v=Math.min(t.frames-2,Math.floor(_/t.hop)),y=(_-v*t.hop)/t.hop,b=10**((t.envelope[Math.min(t.envelope.length-1,Math.floor(_/t.envelopeHop))]*90/255-90)/20);h+=(b-h)*u,d+=(a()-d)*.003;let x=[n,r],S=0;for(let e=0;e<2;e++){let t=x[e].frequency[v]*(1-y)+x[e].frequency[v+1]*y;s[e]+=(t-s[e])*u;let n=s[e]*(1+d*.03),r=o[e],f=a()*(e===0?.008:.011),p=2*r*Math.cos(2*Math.PI*n/i)*c[e]-r*r*l[e]+f;l[e]=c[e],c[e]=p,S+=p*(e===0?1.15:.9)}let C=Math.min(1.6,h/.18);f+=(e[_]-f)*.11;let w=(e[_]-f)*.65+S*C*1.25;p+=(w-p)*g;let T=w-p;m+=(T-m)*g,e[_]=(T-m)*1.15}}function _h(e,t){if(t.id===`burning-fire`)hh(e,t.sampleRate);else if(t.id===`tire-screech`)gh(e,t);else return;for(let t=0;t<e.length;t++){let n=Math.abs(e[t]);n>.8&&(e[t]=Math.sign(e[t])*(.8+.18*Math.tanh((n-.8)/.18)))}}var vh=[60,90,130,190,270,380,530,730,1e3,1400,1950,2700,3700,5100,7e3,9600,13200,15600],yh=1024,bh=Float32Array.from({length:yh},(e,t)=>.5-.5*Math.cos(2*Math.PI*t/1023)),xh=bh.reduce((e,t)=>e+t,0),Sh=Float32Array.from({length:256},(e,t)=>10**((t*90/255-90)/20));function Ch(e){let t=new DataView(e),n=0,r=()=>t.getUint8(n++),i=()=>{let e=t.getUint16(n,!0);return n+=2,e},a=()=>{let e=t.getUint32(n,!0);return n+=4,e};if(String.fromCharCode(r(),r(),r(),r())!==`JRSM`||r()!==1)throw Error(`Unsupported spectral model format.`);let o=r();if(o!==vh.length)throw Error(`Unexpected spectral band count.`);let s=i(),c=i(),l=i(),u=r(),d=new Map;for(let t=0;t<u;t++){let t=r(),u=new TextDecoder().decode(new Uint8Array(e,n,t));n+=t;let f=a(),p=i(),m=i(),h=r(),g=new Uint8Array(e,n,p*o);n+=g.length;let _=new Uint8Array(e,n,m);n+=_.length;let v=[];for(let e=0;e<h;e++){let e=new Uint16Array(p),t=new Uint8Array(p);for(let n=0;n<p;n++)e[n]=i(),t[n]=r();v.push({frequency:e,amplitude:t})}d.set(u,{id:u,sampleRate:s,hop:c,envelopeHop:l,samples:f,frames:p,bands:g,envelope:_,tracks:v})}if(n!==e.byteLength)throw Error(`Spectral model contains unexpected trailing data.`);return d}function wh(e,t){let n=e.length;for(let r=1,i=0;r<n;r++){let a=n>>1;for(;i&a;)i^=a,a>>=1;i^=a,r<i&&([e[r],e[i]]=[e[i],e[r]],[t[r],t[i]]=[t[i],t[r]])}for(let r=2;r<=n;r*=2){let i=r/2,a=2*Math.PI/r;for(let o=0;o<n;o+=r)for(let n=0;n<i;n++){let r=n*a,s=Math.cos(r),c=Math.sin(r),l=o+n,u=l+i,d=s*e[u]-c*t[u],f=s*t[u]+c*e[u];e[u]=e[l]-d,t[u]=t[l]-f,e[l]+=d,t[l]+=f}}for(let t=0;t<n;t++)e[t]/=n}function Th(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t>>>0}function*Eh(e){let t=new Float32Array(e.samples),n=new Float32Array(e.samples),r=new Float32Array(yh),i=new Float32Array(yh),a=vh.length,o=Th(e.id),s=()=>(o^=o<<13,o^=o>>>17,o^=o<<5,(o>>>0)/4294967296),c=Array.from({length:513},(t,n)=>{let r=n*e.sampleRate/yh,i=vh.findIndex(e=>e>=r);i<0&&(i=vh.length-1);let a=Math.max(0,i-1),o=a===i?0:Math.max(0,Math.min(1,Math.log(r/vh[a])/Math.log(vh[i]/vh[a])));return{left:a,right:i,fraction:o}});for(let o=0;o<e.frames;o++){o%16==0&&(yield),r.fill(0),i.fill(0);let l=o*a;for(let t=1;t<yh/2;t++){let{left:n,right:a,fraction:u}=c[t],d=Sh[e.bands[l+n]],f=Sh[e.bands[l+a]],p=Math.exp(Math.log(d)*(1-u)+Math.log(f)*u)*xh/2;for(let n of e.tracks)Math.abs(t*e.sampleRate/yh-n.frequency[o])<42&&(p*=.62);let m=s()*2*Math.PI;r[t]=p*Math.cos(m),i[t]=p*Math.sin(m),r[yh-t]=r[t],i[yh-t]=-i[t]}wh(r,i);let u=o*e.hop-yh/2;for(let e=0;e<yh;e++){let i=u+e;i<0||i>=t.length||(t[i]+=r[e]*bh[e],n[i]+=bh[e]*bh[e])}}for(let e=0;e<t.length;e++)t[e]/=Math.max(.05,n[e]);for(let n of e.tracks){let r=0;for(let i=0;i<t.length;i++){i%8192==0&&(yield);let a=Math.min(e.frames-2,Math.floor(i/e.hop)),o=(i-a*e.hop)/e.hop,s=n.frequency[a]*(1-o)+n.frequency[a+1]*o,c=Sh[n.amplitude[a]]*(1-o)+Sh[n.amplitude[a+1]]*o;r+=2*Math.PI*s/e.sampleRate,t[i]+=Math.sin(r)*c*.42}}e.id===`crush`&&ph(t,e.sampleRate,e.id);let l=new Float32Array(e.envelope.length);for(let n=0;n<l.length;n++){let r=n*e.envelopeHop,i=Math.min(t.length,r+e.envelopeHop),a=0;for(let e=r;e<i;e++)a+=t[e]**2;let o=Math.sqrt(a/Math.max(1,i-r));l[n]=Math.min(8,Sh[e.envelope[n]]/Math.max(1e-4,o))}for(let n=0;n<t.length;n++){n%8192==0&&(yield);let r=Math.min(l.length-2,Math.floor(n/e.envelopeHop)),i=Math.min(1,(n-r*e.envelopeHop)/e.envelopeHop);t[n]*=l[r]*(1-i)+l[r+1]*i;let a=Math.abs(t[n]);a>.8&&(t[n]=Math.sign(t[n])*(.8+.18*Math.tanh((a-.8)/.18)))}return e.id!==`crush`&&ph(t,e.sampleRate,e.id),_h(t,e),t}var Dh=new WeakMap,Oh=new WeakMap,kh=new WeakMap;function Ah(e,t){let n=kh.get(e);n||(n=new Map,kh.set(e,n));let r=n.get(t);if(r)return r;let i=Dh.get(t);if(!i){let e=Eh(t),n=e.next();for(;!n.done;)n=e.next();i=n.value,Dh.set(t,i)}let a=e.createBuffer(1,i.length,t.sampleRate);return a.getChannelData(0).set(i),n.set(t,a),a}async function jh(e,t,n){if(n?.throwIfAborted(),!Dh.has(t)){let e=Oh.get(t);e||(e=(async()=>{let e=Eh(t),n=e.next();for(;!n.done;)await new Promise(e=>setTimeout(e,0)),n=e.next();Dh.set(t,n.value)})().then(()=>Dh.get(t)),Oh.set(t,e),e.finally(()=>Oh.delete(t)).catch(()=>{})),await e}return n?.throwIfAborted(),Ah(e,t)}var Mh={"electric-charge":.8,"electric-bolt":.68,"ghost-mode":1,attractor:.8},Nh={"electric-charge":4310822,"electric-bolt":7516190,"ghost-mode":6882682,attractor:4880300};function Ph(e,t){if(!Number.isFinite(t)||t<8e3)throw RangeError(`Invalid sample rate`);let n=Math.round(Mh[e]*t),r=new Float32Array(n),i=lh(Nh[e]),a=()=>(i()+1)*.5,o=0,s=0,c=0;for(let i=0;i<n;i++){let l=i/t,u=i/n,d=a()*2-1;o+=(d-o)*.055;let f=d-o,p=f-s;if(s=f,e===`electric-charge`){let e=.56+.44*Math.sin(2*Math.PI*5*l)**2;a()<.0017&&(c=1),c*=.985;let t=Math.sin(2*Math.PI*90*l+.8*Math.sin(2*Math.PI*5*l))*.18+Math.sin(2*Math.PI*270*l)*.09;r[i]=(t+f*.22+p*c*.27)*e}else if(e===`electric-bolt`){let e=Math.exp(-l*125),t=Math.exp(-l*14),n=Math.exp(-l*5.5),a=Math.exp(-Math.max(0,l-.052)*100)*+(l>=.052)*.32+Math.exp(-Math.max(0,l-.11)*90)*+(l>=.11)*.15;r[i]=p*(.58*e+a)+o*2.2*t+f*.1*n+Math.sin(2*Math.PI*(165*l+950*l*l))*.12*t}else if(e===`ghost-mode`){let e=Math.sin(2*Math.PI*2*u),t=.6+.4*e*e;r[i]=(Math.sin(2*Math.PI*80*l+1.8*e)*.12+Math.sin(2*Math.PI*160*l-1.1*e)*.075+o*.7+f*.075)*t}else{let e=.65+.35*Math.sin(2*Math.PI*5*u)**2;r[i]=(Math.sin(2*Math.PI*100*l+.2*Math.sin(2*Math.PI*5*l))*.19+Math.sin(2*Math.PI*300*l)*.09+Math.sin(2*Math.PI*700*l)*.035+o*.6+f*.12)*e}}for(let e=0;e<n;e++)r[e]=.98*Math.tanh(r[e]/.98);if(e!==`electric-bolt`){let e=Math.round(t*.06),i=new Float32Array(n-e);i.set(r.subarray(e));for(let t=0;t<e;t++){let a=t/(e-1)*(Math.PI/2);i[i.length-e+t]=r[n-e+t]*Math.cos(a)+r[t]*Math.sin(a)}let a=i[0]-i[i.length-1],o=Math.round(t*.003);for(let e=0;e<o;e++)i[i.length-o+e]+=a*(e/(o-1));return i}{let e=Math.round(t*.04);for(let t=0;t<e;t++)r[n-e+t]*=1-t/e}return r}function Fh(e,t){let n=Ph(t,e.sampleRate),r=e.createBuffer(1,n.length,e.sampleRate);return r.getChannelData(0).set(n),r}var Ih={"collision-soft":{kind:`recording`,url:eh},"collision-medium":{kind:`recording`,url:th},"collision-hard":{kind:`recording`,url:nh},crush:{kind:`recording`,url:rh},"burning-fire":{kind:`recording`,url:ih},"tire-screech":{kind:`recording`,url:ah},"starter-light":{kind:`recording`,url:oh},"starter-heavy":{kind:`recording`,url:sh},"machine-gun":{kind:`synthetic`,model:`machine-gun`},"bullet-ricochet-1":{kind:`synthetic`,model:`bullet-ricochet-1`},"bullet-ricochet-2":{kind:`synthetic`,model:`bullet-ricochet-2`},"bullet-ricochet-3":{kind:`synthetic`,model:`bullet-ricochet-3`},"rocket-launch":{kind:`synthetic`,model:`rocket-launch`},"rocket-explosion":{kind:`synthetic`,model:`rocket-explosion`},"combustible-explosion":{kind:`synthetic`,model:`combustible-explosion`},"electric-charge":{kind:`procedural`,effect:`electric-charge`},"electric-bolt":{kind:`procedural`,effect:`electric-bolt`},"ghost-mode":{kind:`procedural`,effect:`ghost-mode`},attractor:{kind:`procedural`,effect:`attractor`}};async function Lh(e,t){if(e.startsWith(`data:`)){let t=atob(e.slice(e.indexOf(`,`)+1));return Uint8Array.from(t,e=>e.charCodeAt(0)).buffer}let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`Audio asset HTTP ${n.status}`);return n.arrayBuffer()}var Rh;function zh(){return Rh??=Lh(ch).then(Ch).catch(e=>{throw Rh=void 0,e}),Rh}var Bh=class{context;buffers=new Map;abort=new AbortController;disposed=!1;constructor(e){this.context=e}async initialize(){return Promise.allSettled(Object.keys(Ih).filter(e=>Ih[e].kind!==`procedural`).map(e=>this.load(e)))}load(e){let t=Ih[e];return this.prepare(e,async()=>{if(t.kind===`recording`)return this.decode(t.url);if(t.kind===`procedural`)return Fh(this.context,t.effect);let e=(await zh()).get(t.model);if(!e)throw Error(`Missing sound model: ${t.model}`);return this.assertLive(),jh(this.context,e,this.abort.signal)})}loadUri(e){return this.prepare(e,()=>this.decode(e))}async decode(e){let t=await Lh(e,this.abort.signal);return this.assertLive(),this.context.decodeAudioData(t)}prepare(e,t){if(this.disposed)return Promise.reject(Error(`Sound bank is disposed.`));let n=this.buffers.get(e);if(n)return n;let r=t().then(e=>(this.assertLive(),e)).catch(t=>{throw this.buffers.delete(e),t});return this.buffers.set(e,r),r}assertLive(){this.abort.signal.throwIfAborted()}dispose(){this.disposed=!0,this.abort.abort(),this.buffers.clear()}},Vh=new WeakMap;function Hh(e){let t=Vh.get(e);return t||(t=new Bh(e),Vh.set(e,t)),t}function Uh(e){Vh.get(e)?.dispose(),Vh.delete(e)}function Wh(e,t){let n=Hh(e);return Object.hasOwn(Ih,t)?n.load(t):n.loadUri(t)}var Gh={engine:-9.9,starter:-8.4,tire:-19.2,horn:-20,boost:-24.4,flamethrower:-20.9,rocketFlight:-6.9,collision:-15.4,crush:-14,machineGun:-17.7,ricochet:-15.4,rocketLaunch:-12.8,rocketExplosion:-17.1,combustibleExplosion:-17.1,burningFire:-15.9,electricCharge:-20,electricBolt:-12,ghostMode:-23,attractor:-21},Kh=e=>10**(e/20),qh={pitchShiftSemitones:-3,pitchDynamics:1.8},Jh=(e,t=0,n=1)=>Math.max(t,Math.min(n,e)),Yh=e=>{let t=Jh(e);return t*t*(3-2*t)},Xh={start:.981,end:1.4505,crossfade:.04};function Zh(e,t){let{sampleRate:n}=t,r=Math.round(Xh.start*n),i=Math.round(Xh.end*n),a=Math.round(Xh.crossfade*n);if(t.length<i)throw Error(`Tire recording is shorter than its loop region.`);let o=i-r-a,s=e.createBuffer(t.numberOfChannels,o,n);for(let e=0;e<t.numberOfChannels;e++){let n=t.getChannelData(e),c=s.getChannelData(e),l=0;for(let e=r;e<i;e++)l+=n[e];l/=i-r;let u=0,d=0,f=0;for(let e=0;e<a;e++){let t=n[r+e]-l,o=n[i-a+e]-l;u+=t*t,d+=o*o,f+=t*o}let p=Jh(f/Math.sqrt(u*d||1),0,1);for(let e=0;e<o-a;e++)c[e]=n[r+a+e]-l;for(let e=0;e<a;e++){let t=e/(a-1)*Math.PI*.5,s=Math.cos(t),u=Math.sin(t),d=Math.sqrt(1+2*p*s*u);c[o-a+e]=((n[i-a+e]-l)*s+(n[r+e]-l)*u)/d}}return s}function Qh({car:e,body:t},n){return e.tires.map((r,i)=>{let a=t.velocityAt(t.world(r.local)),o=t.angle+r.angle,s=Math.abs(a.x*Math.cos(o)+a.y*Math.sin(o)),c=r.spinning?Math.abs(r.wheelSurfaceSpeedMps)||s+r.slipSpeedMps:n&&!r.front?s*.35:s;return{skidding:r.skidding,slipMps:r.slipSpeedMps,speedMps:Math.hypot(a.x,a.y),wheelSpeedMps:c,loadN:t.mass*9.81*(r.front?e.frontLoadFraction:1-e.frontLoadFraction)*.5,heat:r.heat,grip:e.statusEffects.factor(`grip`,i)}})}var $h=class{context;ready;output;highpass;voices=new Set;config;clip=null;disposed=!1;constructor(e,t=e.destination,n={}){this.context=e,this.config={...qh,...n},this.output=e.createGain(),this.output.gain.value=Kh(Gh.tire),this.highpass=e.createBiquadFilter(),this.highpass.type=`highpass`,this.highpass.frequency.value=380,this.highpass.Q.value=.55,this.output.connect(this.highpass).connect(t),this.ready=this.load()}async load(){try{let e=await Hh(this.context).load(`tire-screech`);this.disposed||(this.clip=Zh(this.context,e))}catch(e){this.disposed||console.warn(`Joy Ride tire sound could not load.`,e)}}startVoice(e,t,n){if(!this.clip)return null;let r=W(this.context.createBufferSource()),i=this.context.createBiquadFilter(),a=this.context.createGain();r.buffer=this.clip,r.loop=!0,r.playbackRate.value=t,i.type=`lowpass`,i.frequency.value=n,i.Q.value=.55,a.gain.value=0,r.connect(i).connect(a).connect(this.output);let o={index:e,source:r,filter:i,gain:a,level:0,travel:e*.37,stopping:!1};return this.voices.add(o),r.onended=()=>{r.disconnect(),i.disconnect(),a.disconnect(),this.voices.delete(o),this.disposed&&!this.voices.size&&this.disconnect()},r.start(this.context.currentTime,e*.271%1*this.clip.duration),o}update(e,t,n){if(this.disposed)return;let r=this.context.currentTime,i=Jh(e,0,.1),a=Jh((1200/Math.max(200,n))**.12,.86,1.12),o=[...this.voices].filter(e=>!e.stopping);for(let e=0;e<Math.max(4,t.length);e++){let n=t[e],s=o.find(t=>t.index===e),c=Math.max(0,n?.slipMps??0),l=Math.sqrt(1-Math.exp(-c/5)),u=Math.sqrt(Math.max(0,n?.speedMps??0)/(12+Math.max(0,n?.speedMps??0))),d=Math.max(0,n?.wheelSpeedMps??0),f=Jh(n?.heat??0),p=Math.sqrt(Jh((n?.loadN??0)/2943,0,2.5)),m=Math.sqrt(Jh(n?.grip??1,0,1.3)),h=n?.skidding?.38*Yh((c-.7)/1.1)*l*(.42+u*.58)*p*m*(.72+f*.28):0,g=.8+l*.3+Math.tanh(d/28)*.16-f*.045,_=2**(this.config.pitchShiftSemitones/12)*g**this.config.pitchDynamics*a*(1+(e-1.5)*.009),v=Math.min(this.context.sampleRate*.45,2200+l*2400+u*1500-f*550);if(!s&&h>.004&&(s=this.startVoice(e,_,v)??void 0),!s)continue;s.travel+=(d+c)*i;let y=Math.sin(s.travel*3.7+e)*.6+Math.sin(s.travel*7.13)*.4,b=h*(1+y*.035),x=b>s.level?.055:.14;s.level+=(b-s.level)*(1-Math.exp(-i/x)),s.gain.gain.setTargetAtTime(b,r,x),s.source.playbackRate.setTargetAtTime(_*(1+y*.008),r,.09),s.filter.frequency.setTargetAtTime(v,r,.11),h===0&&s.level<5e-4&&this.releaseVoice(s)}}releaseVoice(e){e.stopping||(e.stopping=!0,e.gain.gain.setTargetAtTime(0,this.context.currentTime,.008),e.source.stop(this.context.currentTime+.06))}silence(){for(let e of this.voices)this.releaseVoice(e)}disconnect(){this.output.disconnect(),this.highpass.disconnect()}dispose(){this.disposed||(this.disposed=!0,this.clip=null,this.silence(),this.voices.size||this.disconnect())}};function eg(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function tg(e,t,n){if(n)return 1;let r=(e.x-t.width/2)/Math.max(1,t.width),i=(e.y-t.height/2)/Math.max(1,t.height);return eg(1-Math.hypot(r,i))}function ng(e,t,n){return tg({x:e.x-t.x,y:e.y-t.y},n,!1)}var rg={radiusPx:92,coreRadiusPx:25,damage:100,impulse:1,ignite:!0};function ig(e=1){let t=Number.isFinite(e)?Math.max(.1,Math.min(3,e)):1;return{radiusPx:Math.max(40,rg.radiusPx*t),coreRadiusPx:rg.coreRadiusPx*t,damage:rg.damage*t,impulse:rg.impulse*t,ignite:rg.ignite}}function ag(e,t,n,r){if(r.width<=0||r.height<=0)return null;let i=0,a=1;for(let o of[`x`,`y`]){let s=t[o]-e[o],c=r[o]-n,l=c+(o===`x`?r.width:r.height)+n*2;if(Math.abs(s)<1e-8){if(e[o]<c||e[o]>l)return null;continue}let u=(c-e[o])/s,d=(l-e[o])/s;if(i=Math.max(i,Math.min(u,d)),a=Math.min(a,Math.max(u,d)),i>a)return null}return i<=1&&a>=0?i:null}var og=new WeakMap;function sg(e){let t=og.get(e);if(t)return t;let n=[],{columns:r,rows:i,solid:a}=e;for(let e=0;e<i;e++)for(let t=0;t<r;t++){let o=e*r+t;a[o]&&(t!==0&&t!==r-1&&e!==0&&e!==i-1&&a[o-1]&&a[o+1]&&a[o-r]&&a[o+r]||n.push(P(2*(t+.5)/r-1,2*(e+.5)/i-1)))}return og.set(e,n),n}function cg(e,t){for(let[n,i]of[[e,t],[t,e]]){let e=n.shape;for(let t of sg(n.mask.alpha)){let n=E(e.center,E(r(e.forward,t.x*e.halfLength),r(e.side,t.y*e.halfWidth)));if(gn(i.mask.alpha,i.shape,n))return!0}}return!1}function lg(e,t){let n=c(e.center,t.center),i=1/0,a=P(1);for(let o of[e.forward,e.side,t.forward,t.side]){let s=e.halfLength*Math.abs(A(o,e.forward))+e.halfWidth*Math.abs(A(o,e.side)),c=t.halfLength*Math.abs(A(o,t.forward))+t.halfWidth*Math.abs(A(o,t.side)),l=A(n,o),u=s+c-Math.abs(l);if(u<=0)return null;u<i&&(i=u,a=r(o,l<0?-1:1))}return{normal:a,depth:i}}function ug(e,t,n){let{sim:r}=e,i=t.documentScale(),a=P(Math.cos(r.body.angle),-Math.sin(r.body.angle));return{center:E(t.documentPoint(r.body.position),t.carVisualOffset(r)),forward:a,side:P(-a.y,a.x),halfLength:n.lengthM*i/2,halfWidth:n.widthM*i/2}}function dg(e,t,n,i,a,o){if(e.sim.mode!==`car`||e.sim.car.explodedAt!==null||e.isGhost)return null;let s=ug(e,t,n),l=ag(i,a,o,fn(n.alpha,s));if(l===null)return null;let u=c(a,i),d=Math.min(256,Math.max(1,Math.ceil(Math.hypot(u.x,u.y)/Math.max(2,o)))),f=Math.max(0,Math.floor(l*d)-1),p=o>0?[P(),P(o,0),P(-o,0),P(0,o),P(0,-o)]:[P()];for(let e=f;e<=d;e++){let t=E(i,r(u,e/d));if(p.some(e=>gn(n.alpha,s,E(t,e))))return t}return null}function fg(e,t,n,i){if(e.length<2)return;let a=t.documentScale(),s=e.filter(e=>e.sim.mode===`car`&&e.sim.car.explodedAt===null&&!e.isGhost).map(e=>{let r=n(e);return{entity:e,mask:r,shape:ug(e,t,r)}});for(let e=0;e<s.length;e++)for(let n=e+1;n<s.length;n++){let l=s[e],u=s[n],d=lg(l.shape,u.shape);if(!d||!cg(l,u))continue;let f=d.normal,p=P(f.x,-f.y),m=pn(l.mask.alpha,l.shape,r(f,-1)),h=pn(u.mask.alpha,u.shape,f),g=r(E(m,h),.5),_=t.worldFromDocument(g),v=l.entity.sim.body,y=u.entity.sim.body,b=l.shape,x=u.shape,S=c(_,v.position),C=c(_,y.position),w=A(c(v.velocityAt(_),y.velocityAt(_)),p),T=1/v.mass,D=1/y.mass,O=T+D,ee=(d.depth+.5)/a;if(v.position=E(v.position,r(p,ee*T/O)),y.position=c(y.position,r(p,ee*D/O)),l.shape={...l.shape,center:E(l.shape.center,r(f,(d.depth+.5)*T/O))},u.shape={...u.shape,center:c(u.shape.center,r(f,(d.depth+.5)*D/O))},w>=0)continue;let te=o(S,p),ne=o(C,p),k=O+te**2/v.inertia+ne**2/y.inertia,re=-(1+(w<-.8?.24:0))*w/k,j=r(p,re);v.impulse(j,_),y.impulse(r(j,-1),_);let ie=P(-p.y,p.x),ae=c(v.velocityAt(_),y.velocityAt(_)),oe=o(S,ie),se=o(C,ie),ce=O+oe**2/v.inertia+se**2/y.inertia,le=Math.max(-re*.38,Math.min(re*.38,-A(ae,ie)/ce)),ue=r(ie,le);v.impulse(ue,_),y.impulse(r(ue,-1),_);let de=-w;de<=.8||(l.entity.sim.car.takeImpact(de,v.local(_)),u.entity.sim.car.takeImpact(de,y.local(_)),l.entity.damage.hit(g,f,b,de,a),u.entity.damage.hit(g,r(f,-1),x,de,a),i?.({speedMps:de,point:g,velocity:r(c(v.velocity,y.velocity),a),normal:f,carNormal:vn(l.mask.alpha,b,m),pixelsPerMeter:a}))}}function pg(e){if(e.kind===`impact`||e.kind===`scrape`){let{element:t,...n}=e.impact,{element:r,...i}=e;return{...j({...i,impact:n}),element:r,impact:{...j(n),element:t}}}let{element:t,...n}=e;return{...j(n),element:t}}var mg=class{onObserverError;pending=[];listeners=new Set;draining=!1;constructor(e=e=>console.error(`Joy Ride event observer failed.`,e)){this.onObserverError=e}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}captureState(){return this.pending.map(pg)}restoreState(e){this.pending=e.map(pg)}emit(e){this.pending.push(e)}drain(e){if(this.draining||!this.pending.length)return;let t=this.pending;this.pending=[],this.draining=!0;try{for(let n of t){e(n);for(let e of[...this.listeners])if(this.listeners.has(e))try{e(n)}catch(e){try{this.onObserverError(e)}catch(e){console.error(`Joy Ride event observer error reporting failed.`,e)}}}}finally{this.draining=!1}}clear(){this.pending.length=0}},hg=.15,gg=class{renderer;id=`liquid`;sampleIntervalSeconds=hg;receivesOwnSources=!1;elapsed=0;constructor(e){this.renderer=e}sources(){return this.renderer.burningLiquidSources?.()??[]}expose(e,t){e.length?(this.elapsed+=t,!(this.elapsed<hg)&&(this.renderer.igniteLiquidsFromFire?.(e),this.elapsed%=hg)):this.elapsed=0}captureState(){return this.elapsed}restoreState(e){if(typeof e!=`number`||!Number.isFinite(e)||e<0)throw Error(`Invalid liquid heat checkpoint`);this.elapsed=e}reset(){this.elapsed=0}},_g=class{domains;conductiveDomains;heatClocks=new Map;constructor(e,t){this.domains=[{id:`scene`,sampleIntervalSeconds:1/15,canReceive:()=>e.hasFireTargets?.()??!0,receivesOwnSources:!0,sources:()=>e.burningFireSources?.()??[],expose:(t,n)=>e.exposeToFire?.(t,n)},new gg(t)],this.conductiveDomains=[{id:`liquid`,conduct:(e,n)=>t.hasConductiveLiquidNear?.(e,n)===!1?null:t.conductLightning?.(e,n)??null,ignite:(e,n)=>t.igniteConductedLiquids?.(e,n)}]}registerHeatDomain(e){if(this.domains.some(t=>t.id===e.id))throw Error(`Heat domain already registered: ${e.id}`);if(!!e.captureState!=!!e.restoreState)throw Error(`Heat domain checkpoint methods must be paired: ${e.id}`);return this.domains.push(e),this.heatClocks.set(e.id,0),()=>{let t=this.domains.indexOf(e);t>=0&&this.domains.splice(t,1),this.heatClocks.delete(e.id)}}registerConductiveDomain(e){if(this.conductiveDomains.some(t=>t.id===e.id))throw Error(`Conductive domain already registered: ${e.id}`);if(!!e.captureState!=!!e.restoreState)throw Error(`Conductive domain checkpoint methods must be paired: ${e.id}`);return this.conductiveDomains.push(e),()=>{let t=this.conductiveDomains.indexOf(e);t>=0&&this.conductiveDomains.splice(t,1)}}captureState(){let e=e=>e.map(e=>({id:e.id,state:j(e.captureState?.())}));return{heat:e(this.domains),heatClocks:this.domains.map(e=>({id:e.id,elapsed:this.heatClocks.get(e.id)??0})),conductive:e(this.conductiveDomains)}}validateState(e){let t=(e,t)=>e.length===t.length&&e.every((e,n)=>e.id===t[n].id);if(!t(e.heat,this.domains)||!t(e.heatClocks,this.domains)||!t(e.conductive,this.conductiveDomains))throw Error(`Material domain registry changed since the checkpoint`)}restoreState(e){this.validateState(e),this.domains.forEach((t,n)=>t.restoreState?.(j(e.heat[n].state))),this.heatClocks.clear();for(let{id:t,elapsed:n}of e.heatClocks)this.heatClocks.set(t,n);this.conductiveDomains.forEach((t,n)=>t.restoreState?.(j(e.conductive[n].state)))}reset(){this.heatClocks.clear();for(let e of this.domains)e.reset?.();for(let e of this.conductiveDomains)e.reset?.()}conduct(e,t){let n=[],r=new Set(e.map(e=>`${e.x}:${e.y}`)),i=new Set,a=e.map(e=>({point:e,origin:null,owner:null}));for(let e=0;e<8&&a.length;e++){let e=[];for(let o of this.conductiveDomains){let s=a.filter(e=>e.origin!==o.id);if(!s.length)continue;let c=o.conduct(s.map(e=>e.point),t);if(!c?.points.length)continue;let l=s.filter(e=>c.contains(e.point,t)),u={path:c,bridges:(l.length?l:s).map(({point:e,owner:t})=>({point:e,owner:t}))},d=!1;for(let t of c.points){let n=`${t.x}:${t.y}`;r.has(n)||(r.add(n),e.push({point:t,origin:o.id,owner:u}),d=!0)}(d||!i.has(o.id))&&n.push(u),i.add(o.id)}a=e}return{points:n.flatMap(({path:e})=>e.points),contains:(e,t=0)=>n.some(({path:n})=>n.contains(e,t)),intersects:(e,t=0)=>n.some(({path:n})=>n.intersects(e,t)),pathTo:(t,r=0)=>{let i=n.map(e=>({entry:e,local:e.path.pathTo(t,r)})).filter(({local:e})=>e.length).sort((e,n)=>{let r=e.local[e.local.length-1],i=n.local[n.local.length-1];return Math.hypot(r.x-t.x,r.y-t.y)-Math.hypot(i.x-t.x,i.y-t.y)})[0];if(!i)return[];let a=[...i.local],o=i.entry;for(;;){let e=o.bridges.filter(e=>e.owner).sort((e,t)=>Math.hypot(e.point.x-a[0].x,e.point.y-a[0].y)-Math.hypot(t.point.x-a[0].x,t.point.y-a[0].y))[0];if(!e?.owner)break;let t=e.owner.path.pathTo(e.point,r);(!a.length||Math.hypot(a[0].x-e.point.x,a[0].y-e.point.y)>1e-6)&&a.unshift(e.point),a=[...t,...a],o=e.owner}let s=e.reduce((e,t)=>!e||Math.hypot(t.x-a[0].x,t.y-a[0].y)<Math.hypot(e.x-a[0].x,e.y-a[0].y)?t:e,null);return s&&Math.hypot(s.x-a[0].x,s.y-a[0].y)>1e-6&&a.unshift(s),a.filter((e,t)=>t===0||Math.hypot(e.x-a[t-1].x,e.y-a[t-1].y)>1e-6)}}}igniteConducted(e,t){for(let n of this.conductiveDomains)n.ignite?.(e,t)}stepFire(e){let t=[...this.domains],n=t.map(t=>{let n=(this.heatClocks.get(t.id)??0)+e,r=t.sampleIntervalSeconds??0;return r>0&&n+1e-9<r?(this.heatClocks.set(t.id,n),0):(this.heatClocks.set(t.id,r>0?n%r:0),n)}),r=n.map((e,n)=>e>0&&t[n].canReceive?.()!==!1);if(!r.some(Boolean))return;let i=t.map((e,n)=>r.some((e,r)=>e&&(r!==n||t[r].receivesOwnSources))?e.sources().map(Zf):[]);t.forEach((e,t)=>{if(!r[t])return;let a=i.flatMap((n,r)=>t===r&&!e.receivesOwnSources?[]:n);e.expose(a,n[t])})}},vg={throttle:0,steer:0,action:!1,boost:!1},yg=class{world;state;version=3;disposed=!1;constructor(e,t){this.world=e,this.state=t}get available(){return!this.disposed}restore(){this.world.restoreState(this)}dispose(){this.disposed||(this.disposed=!0,this.state.renderer.dispose(),this.world.releaseCheckpoint(this))}},bg=class{renderer;odometer;sound;overlay;rocketBlastStrength;stateParticipants=new Map;registerStateParticipant(e,t){if(this.stateParticipants.has(e))throw Error(`State participant already registered: ${e}`);return this.stateParticipants.set(e,t),()=>this.stateParticipants.delete(e)}slowMo=new Ym;events=new mg;vehicleRegistry=new Map;drivers=new Map;driveTasks=new Map;tourFactory=null;driverTargets=new Map;cameraVehicleId=null;collisions;materialInteractions;checkpoints=new Set;flameDamageThisStep=new Map;stepSeconds=1/120;destructionPoints=0;disposed=!1;constructor(e,t,n,r,i,a,o=new wn,s={}){this.renderer=t,this.odometer=n,this.sound=r,this.overlay=i,this.rocketBlastStrength=a;let c=se(s);this.vehicleDestructible=c.vehicleDestructible,this.weaponsEnabled=c.weaponsEnabled,this.enabledTools=[...c.enabledTools],e&&this.spawnVehicle({id:`player`,sim:e,control:{kind:`player`}}),this.collisions=o,this.materialInteractions=new _g(o,t),o.setEvents(this.events),o.setAutoPaint?.(s.autoPaint??!1)}get playerVehicle(){return[...this.vehicleRegistry.values()].find(e=>!this.drivers.has(e.id))}get focusVehicle(){return this.playerVehicle??this.vehicleRegistry.values().next().value}get primaryVehicle(){let e=this.focusVehicle;if(!e)throw Error(`Game world has no vehicles`);return e}get sim(){return this.primaryVehicle.sim}get damage(){return this.primaryVehicle.damage}getVehicle(e){return this.vehicleRegistry.get(e)}get cameraVehicle(){return this.cameraVehicleId&&this.getVehicle(this.cameraVehicleId)||this.focusVehicle}watchVehicle(e,t=!0){return e!==null&&!this.vehicleRegistry.has(e)?!1:(this.cameraVehicleId=e,t&&(this.renderer.resumeFollow(),this.overlay&&this.cameraVehicle&&this.renderer.followDocument(this.cameraVehicle.sim)),!0)}get companionVehicles(){let e=this.focusVehicle;return[...this.vehicleRegistry.values()].filter(t=>t!==e)}get vehicles(){return[...this.vehicleRegistry.values()]}registerHeatDomain(e){return this.materialInteractions.registerHeatDomain(e)}registerConductiveDomain(e){return this.materialInteractions.registerConductiveDomain(e)}configureVehicle(e,t){let n=this.getVehicle(e);if(!n)return!1;if(t.appearance!==void 0&&![`auto`,`light`,`dark`].includes(t.appearance))throw TypeError(`Unknown vehicle appearance`);let r=t.slots===void 0?void 0:D(t.slots);return t.control?.kind===`player`&&this.playerVehicle&&this.playerVehicle!==n?!1:(t.preset&&this.collisions.prepare(t.preset),t.control&&this.setVehicleControl(e,t.control),t.preset&&t.preset!==n.sim.car.preset&&n.setPreset(t.preset),t.appearance!==void 0&&(n.appearance=t.appearance),r!==void 0&&(n.slots=r),n===this.focusVehicle&&this.projectFocusVehicle(!!t.preset),!0)}projectedSound;projectedPreset;projectFocusVehicle(e=!1){let t=this.focusVehicle;if(!t)return;let n=this.sound(),r=t.sim.car.preset;(n!==this.projectedSound||r!==this.projectedPreset)&&(n.setPreset(r),this.collisions.prepare(r),this.projectedSound=n,this.projectedPreset=r),e&&this.renderer.resetVehicleDamage()}resetEffects(){this.renderer.reset(),this.materialInteractions.reset()}fadeEffects(){this.materialInteractions.reset(),this.renderer.fadeEffects()}resetScene(){this.destructionPoints=0,this.events.clear(),this.collisions.reset?.(),this.fadeEffects();for(let e of this.vehicleRegistry.values())e.restoreHealth()}deformationEnabled=!0;weaponCooldownEnabled=!1;vehicleDestructible=!0;weaponsEnabled=!0;enabledTools=n.map(e=>e.id);setEnabledTools(e){this.enabledTools=[...new Set(e)];for(let e of this.vehicleRegistry.values())e.weapons.reset()}setVehicleDestructible(e){this.vehicleDestructible=e;for(let t of this.vehicleRegistry.values())t.sim.car.destructible=e,e||t.restoreHealth()}setWeaponsEnabled(e){if(this.weaponsEnabled=e,!e)for(let e of this.vehicleRegistry.values())e.weapons.reset()}setWeaponCooldownEnabled(e){this.weaponCooldownEnabled=e;for(let t of this.vehicleRegistry.values())e||t.weaponReserves.reset(),t.weaponReserves.enabled=e}setDeformationEnabled(e){this.deformationEnabled=e;for(let t of this.vehicleRegistry.values())t.damage.setEnabled(e)}spawnVehicle({id:e,sim:t,control:n,label:r=``}){if(this.vehicleRegistry.has(e))throw Error(`Vehicle ${e} already exists`);if(n.kind===`player`&&this.playerVehicle)throw Error(`Game world already has a player vehicle`);let i=new me(e,t);return t.car.destructible=this.vehicleDestructible,this.vehicleDestructible||i.restoreHealth(),i.weaponReserves.enabled=this.weaponCooldownEnabled,this.bindTourCommands(i),i.damage.setEnabled(this.deformationEnabled),i.label=r,i.controlSource=n.kind===`player`?`player`:`scripted`,this.vehicleRegistry.set(e,i),n.kind===`ai`&&(this.drivers.set(e,n.driver),n.targetId&&this.driverTargets.set(e,n.targetId)),this.focusVehicle===i&&this.renderer.bindVehicle(i),i}setVehicleControl(e,t){let n=this.vehicleRegistry.get(e);if(!n)return!1;if(t.kind===`player`){let t=this.playerVehicle;if(t&&t!==n)return!1;this.drivers.delete(e),this.driverTargets.delete(e)}else this.drivers.set(e,t.driver),t.targetId&&this.driverTargets.set(e,t.targetId);return n.controlSource=t.kind===`player`?`player`:`scripted`,this.focusVehicle===n&&this.renderer.bindVehicle(n),!0}removeVehicle(e){let t=this.vehicleRegistry.get(e);if(!t)return!1;this.stopVehicleTour(e),t.bindTourCommands(void 0),this.drivers.delete(e),this.driverTargets.delete(e),this.vehicleRegistry.delete(e),this.cameraVehicleId===e&&(this.cameraVehicleId=null),this.collisions.forgetVehicle(e),this.renderer.forgetVehicle(e),t.dispose();let n=this.focusVehicle;return n&&this.renderer.bindVehicle(n),!0}setVehicleTarget(e,t){return this.drivers.has(e)?(t?this.driverTargets.set(e,t):this.driverTargets.delete(e),!0):!1}getVehicleTarget(e){if(!this.drivers.has(e))return null;let t=this.driverTargets.get(e),n=t?this.vehicleRegistry.get(t)??null:this.vehicleRegistry.get(e)===this.focusVehicle?null:this.focusVehicle??null;return n?.id===e?null:n}bindTourCommands(e){e.bindTourCommands(this.tourFactory?{start:(t,n)=>this.startVehicleTour(e.id,t,n),stop:()=>this.stopVehicleTour(e.id)}:void 0)}setVehicleTourFactory(e){this.tourFactory=e;for(let e of this.vehicleRegistry.values())this.bindTourCommands(e)}startVehicleTour(e,t,n){let r=this.vehicleRegistry.get(e);if(!r||!this.tourFactory||!t.length)return!1;let i=this.tourFactory(r,t,n);return i?(this.stopVehicleTour(e),i.activate?.(),this.driveTasks.set(e,i),!0):!1}stopVehicleTour(e){let t=this.driveTasks.get(e);return t?(this.driveTasks.delete(e),t.cancel(),!0):!1}getVehicleTour(e){return this.driveTasks.get(e)??null}consumeEvent=e=>{let t=this.sound();switch(e.kind){case`impact`:t.playCrash(e.impact.speedMps),this.renderer.emitSparks(e.impact),this.renderer.emitCrashShake(e.impact.speedMps);break;case`scrape`:this.renderer.emitSparks(e.impact);break;case`crush`:t.playCrush(),this.awardPoints(e.point,e.points);break;case`combustionExplosion`:this.awardPoints(e.point,e.points),t.playCombustibleExplosion(this.overlay?ng(e.point,this.renderer.sceneScroll(),this.renderer.viewportSize()):1);break;case`destructibleDestroyed`:this.awardPoints(e.point,e.points)}};awardPoints(e,t){t<=0||(this.destructionPoints+=t,this.renderer.emitPoints(e,t))}get points(){return this.destructionPoints}get totalPoints(){return this.collisions.totalPoints}vehicleProjectileHit(e,t,n,r){let i=null;for(let a of this.vehicleRegistry.values()){if(a===e)continue;let o=dg(a,this.renderer,this.collisions.vehicleMask(a.sim.car.preset,a.damage),t,n,r);if(!o)continue;let s=u(c(o,t));(!i||s<i.distance)&&(i={vehicle:a,point:o,distance:s})}return i}nearestProjectileTarget(e,t,n,r){let i=this.vehicleProjectileHit(e,t,n,r),a=this.collisions.projectileHit(t,n,r);return i&&(!a||i.distance<u(c(a.point,t)))?{vehicle:i.vehicle,point:i.point,object:null}:a?{vehicle:null,point:a.point,object:a}:null}rocketCollision=(e,t,n,r)=>{this.collisions.setSourceVehicle?.(e.id);let i=this.rocketBlastStrength(),a=this.nearestProjectileTarget(e,t,n,r);if(!a)return null;let o=a.vehicle?a.point:this.collisions.rocketImpact(t,n,r,i,a.object??void 0);if(o){let r=ig(i),s=r.radiusPx;a.vehicle&&this.collisions.applyAreaImpact?.(o,r),r.ignite&&this.renderer.igniteLiquidAt?.(o,this.renderer.documentScale()*2.2);for(let t of this.vehicleRegistry.values()){if(t===e||t.sim.car.explodedAt!==null||t.isGhost)continue;let n=this.renderer.documentPoint(t.sim.body.position),i=u(c(n,o)),l=t===a.vehicle;if(!l&&i>s)continue;let d=l?1:Math.max(.2,1-i/s*.7);t.sim.car.damage(g(`rocket`,e.sim.car.preset)*d*r.damage/100),t.synchronizeLifecycle()}this.renderer.emitRocketExplosionShake(i),this.renderer.emitRocketExplosion(o,c(n,t),i)}return o};bulletCollision=(e,t,n,r)=>{this.collisions.setSourceVehicle?.(e.id);let i=this.nearestProjectileTarget(e,t,n,r);return i?i.vehicle?(i.vehicle.sim.car.damage(g(`bullet`,e.sim.car.preset)),i.vehicle.synchronizeLifecycle(),i.point):this.collisions.bulletImpact(t,n,r,i.object??void 0):null};stepLightning(){let{renderer:e,collisions:t}=this,n=e.documentScale();for(let r of this.vehicleRegistry.values()){let i=r.weapons.lightning,a=i.takeDischarge();if(!i.charging&&!a||r.sim.mode!==`car`||r.isGhost||r.lifecycleState!==`drivable`)continue;let o=Ve(r.sim.car.preset),s=e.documentPoint(r.sim.body.position),l=M(r.sim.car.preset,e.viewportSize?.().width,n)*n,d=[...this.vehicleRegistry.values()].filter(e=>e!==r&&e.sim.mode===`car`&&!e.isGhost&&e.lifecycleState===`drivable`),f=[...t.arcTargets?.(s,l)??[],...d.map(t=>({key:t,point:e.documentPoint(t.sim.body.position)}))].map(e=>({...e,distance:u(c(e.point,s)),score:_e(s,e.point,r.sim.body.angle,o.forwardBias)})).filter(e=>e.distance<=l).sort((e,t)=>e.score-t.score||e.distance-t.distance)[0];if(i.target=f?{...f.point}:null,!a)continue;let p=o.impactRadiusM*n,m={radiusPx:p,coreRadiusPx:p*.35,damage:o.damage,impulse:o.impulse,ignite:o.ignite},h=new Set,g=[],_=[],v=(e,t)=>{if(e.length<2||_.length>=8)return;let n=Math.max(1,Math.ceil(e.length/24)),r=e.filter((e,t)=>t%n===0);t?r.push(t):r.push(e[e.length-1]),_.push(r)},y=(n,i=!0)=>{t.setSourceVehicle?.(r.id);let a=c(n,s),l=u(a);t.applyAreaImpact?.(n,{...m,impulseDirection:l>.001?{x:a.x/l,y:a.y/l}:{x:Math.cos(r.sim.body.angle),y:-Math.sin(r.sim.body.angle)}},h),o.ignite&&e.igniteLiquidAt?.(n,p),i&&g.push({...n})};f&&y(f.point);let b=this.materialInteractions.conduct(f?[s,f.point]:[s],n*.4);if(b?.points.length){o.ignite&&this.materialInteractions.igniteConducted(b.points,n*.7);let e=l;for(let t of b.points)e=Math.max(e,u(c(t,s))+n);for(let r of t.arcTargets?.(s,e)??[]){let e=r.bounds&&b.intersects?b.intersects(r.bounds,n*.7):b.contains(r.point,n*.7);if(h.has(r.key)||!e)continue;y(r.point,!1);let t=r.bounds;if(v(b.pathTo(t?{x:t.x+t.width/2,y:t.y+t.height/2}:r.point,t?Math.hypot(t.width,t.height)/2+n*.7:n*.7),r.point),h.size>=64)break}_.length||v(b.pathTo(b.points[b.points.length-1]))}for(let t of d){let r=e.documentPoint(t.sim.body.position);if(u(c(r,s))>l&&!b?.contains(r,n*(.7+t.sim.car.preset.geometry.widthM*.5)))continue;let i=t.sim.car.statusEffects;i.remaining(`electrified`)<=0&&(t.sim.body.velocity.x*=o.speedFactor,t.sim.body.velocity.y*=o.speedFactor),i.apply(`electrified`,{lifetime:{unit:`seconds`,amount:o.statusSeconds},modifiers:{speed:o.speedFactor,driveForce:o.speedFactor},intensity:`constant`}),u(c(r,s))<=l?g.push(r):b&&v(b.pathTo(r,n*(.7+t.sim.car.preset.geometry.widthM*.5)),r)}i.discharge(g,_),this.sound().playElectricBolt(r===this.focusVehicle?1:.55)}}flameContact=(e,t,n,r,i)=>{this.collisions.setSourceVehicle?.(e.id);let a=this.nearestProjectileTarget(e,t,n,r);if(a?.vehicle){let t=this.flameDamageThisStep.get(a.vehicle.id)??0,n=Math.min(g(`flame`,e.sim.car.preset,i),Math.max(0,f.damagePerSecond*this.stepSeconds-t));return a.vehicle.sim.car.damage(n),this.flameDamageThisStep.set(a.vehicle.id,t+n),a.vehicle.synchronizeLifecycle(),a.point}return this.collisions.flameContact(t,n,r,i,ve(e.sim.car.preset))};gunshot=()=>this.sound().playGunshot();rocketLaunch=e=>this.sound().playRocketLaunch(this.overlay?tg(this.renderer.vehicleViewportPosition(e),this.renderer.viewportSize(),!1):1);rocketImpact=e=>this.sound().playRocketExplosion(this.overlay?tg(this.renderer.vehicleViewportPosition(e),this.renderer.viewportSize(),!1):1);bulletImpact=e=>this.sound().playBulletImpact(this.overlay?tg(this.renderer.vehicleViewportPosition(e),this.renderer.viewportSize(),!1):1);step(e={},t){let n=this.focusVehicle;if(!n)return;this.stepSeconds=t,this.flameDamageThisStep.clear(),performance.now();let{renderer:r,collisions:i}=this,a=n.sim,o=this.playerVehicle,s=this.drivers.size?r.worldFromDocument({x:0,y:0}):null,l=this.drivers.size?1/r.documentScale():0,d=this.drivers.size?{walls:i.wallRects().map(e=>{let t=s.x+e.x*l,n=s.y-e.y*l||0;return{left:t,right:t+e.width*l,bottom:n-e.height*l,top:n}}),vehicles:[...this.vehicleRegistry.values()].map(e=>({id:e.id,position:{...e.sim.body.position},velocity:{...e.sim.body.velocity},radiusM:Math.hypot(e.sim.car.preset.geometry.lengthM,e.sim.car.preset.geometry.widthM)/2}))}:void 0,f={...a.body.position},p=new Map,m={enabledTools:this.enabledTools,weaponsEnabled:this.weaponsEnabled};for(let n of this.vehicleRegistry.values()){p.set(n,{...n.sim.body.position}),n.synchronizeLifecycle(),n===o&&e.userDriven&&e.controls&&(e.controls.throttle!==0||e.controls.steer!==0||e.controls.brake||e.controls.action||e.controls.boost||e.controls.ghost)&&this.stopVehicleTour(n.id);let r=this.driveTasks.get(n.id),i=this.drivers.get(n.id);r?n.setControls(r.next(n,t),`scripted`,m):i?n.setControls(i(this.getVehicleTarget(n.id),n,t,d),`scripted`,m):n.setControls(e.controls??vg,e.userDriven?`player`:`scripted`,m),n.step(t,n===o?this.sound().rpm:null,n===o&&e.manualMoved),r?.afterPhysics(n,t),r?.complete&&this.driveTasks.delete(n.id)}o&&e.userDriven&&a.mode===`car`&&this.odometer.add(u(c(a.body.position,f)),r.documentScale()),e.afterPhysics?.();let h=this.cameraVehicle?.sim??a,g=this.overlay&&(e.allowFollow?.()??!0)&&u(h.body.velocity)>.1&&r.followDocument(h);if(a.barrier&&!this.overlay){let e={...a.body.velocity};a.contain(r.bounds());let t=u(c(e,a.body.velocity));a.mode===`car`&&a.car.takeImpact(t),this.sound().playCrash(t),r.emitCrashShake(t)}performance.now(),i.beginStep(r,t),performance.now();for(let e of this.vehicleRegistry.values()){let n=e.advanceBurn(t);if(n){let a=r.emitVehicleBurn(e,n,i.vehicleMask(e.sim.car.preset,e.damage),t);a&&this.events.emit({kind:`combustionExplosion`,point:a,points:0})}let a=p.get(e)??e.sim.body.position,o={...e.sim.body.position},s=c(o,a),l=Math.max(.25,e.sim.car.preset.geometry.widthM*.35),d=Math.min(16,Math.max(1,Math.ceil(u(s)/l)));d>1&&(e.sim.body.position={...a});for(let t=1;t<=d;t++){let n={x:a.x+s.x*t/d,y:a.y+s.y*t/d};if(e.sim.body.position={...n},i.stepVehicle(e.sim,r,e===this.cameraVehicle&&e.sim.barrier&&g,e.damage,e.id,e.isGhost),u(c(e.sim.body.position,n))>.02)break}e.synchronizeLifecycle()}let _=a.mode===`car`&&a.car.explodedAt===null&&n.controls.attractor&&!n.isGhost?{center:r.documentPoint(a.body.position),velocity:{x:a.body.velocity.x*r.documentScale(),y:-a.body.velocity.y*r.documentScale()},radiusPx:7*r.documentScale()}:null;if(i.endStep(t,_),performance.now(),this.vehicleRegistry.size>1){fg(this.vehicles,r,e=>i.vehicleMask(e.sim.car.preset,e.damage),e=>this.events.emit({kind:`impact`,impact:e}));for(let e of this.vehicleRegistry.values())e.synchronizeLifecycle()}this.stepLightning(),this.events.drain(this.consumeEvent),performance.now(),i.stepElementLiquids?.(r,e.manualMoved?this.companionVehicles:[n,...this.companionVehicles],t),r.advanceEffects(n,t,{walls:i.wallRects(),carMask:i.vehicleMask(a.car.preset,n.damage),tirePaintSources:e=>i.tirePaintAt(e),driven:!e.manualMoved,rocketCollision:this.rocketCollision,bulletCollision:this.bulletCollision,onGunshot:this.gunshot,flameContact:this.flameContact,onRocketLaunch:this.rocketLaunch,onRocketImpact:this.rocketImpact,onBulletImpact:this.bulletImpact,maskFor:e=>i.vehicleMask(e.sim.car.preset,e.damage),companions:this.companionVehicles}),performance.now(),this.materialInteractions.stepFire(t);let v=r.rocketFlightPosition,y=this.sound();y.setRocketFlightProximity(v?this.overlay?tg(r.vehicleViewportPosition(v),r.viewportSize(),!1):1:0),y.setBurningFireProximity(Math.max(i.burningProximity(r.documentPoint(a.body.position)),a.mode===`car`&&a.car.explodedAt===null?w(a.car.health,a.car.maxHealth):0)),this.events.drain(this.consumeEvent)}advanceTime(e){let t=this.slowMo.advance(e);return this.renderer.setSlowMoZoom(this.slowMo.zoomFactor),this.sound().setTimeScale?.(this.slowMo.speedFactor),t}present(e,t,n,r,i,a,o){let s=this.focusVehicle;if(!s)return;let{renderer:c}=this,l=s.sim;this.projectFocusVehicle();let d=this.playerVehicle?{...n,boost:l.lastInput.boost}:{...s.controls,boost:l.lastInput.boost};if(!document.hidden){let e=this.sound(),n=l.paused?0:u(l.body.velocity),o=l.mode===`car`&&!l.paused&&!s.isGhost?Qh(l,l.lastInput.action):[];e.setActive(l.mode===`car`&&i),s.isGhost&&e.silenceTires(),e.setGhostMode(!l.paused&&s.isGhost),e.setAttractor(!l.paused&&!!s.controls.attractor&&!s.isGhost);let f=0;!l.paused&&!s.isGhost&&(s.weapons.lightning.charging?f=.3+s.weapons.lightning.charge*.7:l.car.statusEffects.remaining(`electrified`)>0&&(f=.35)),e.setElectricCharge(f),e.setFlamethrowerFiring(!l.paused&&c.flamethrowerFiring),e.setBoosting(!l.paused&&l.car.boostActive);let p=d.throttle!==0||d.steer!==0||d.action||r;e.setProximity(this.overlay?tg(c.vehicleViewportPosition(l.body.position),c.viewportSize(),p):1),e.setMasterVolume(eg(a)),performance.now(),e.update(t*this.slowMo.speedFactor,d,n,0,0,l.mode===`car`?l.car.boostCharge:0,o);let m=e.takeExhaustPops();!l.paused&&l.mode===`car`&&c.queueExhaustPops(m)}c.render(s,e,o,this.collisions,this.companionVehicles)}snapshot(){let{sim:e}=this;return{mode:e.mode,presetId:e.car.preset.id,position:{...e.body.position},speed:u(e.body.velocity),angle:e.body.angle,spin:e.body.spin,paused:e.paused,health:e.car.health,maxHealth:e.car.maxHealth,burnStage:e.car.stage,points:this.destructionPoints}}saveState(){if(this.disposed)throw Error(`Game world has been disposed`);let e=[...this.vehicleRegistry.values()].map(e=>e.captureState()),t=this.collisions.captureState(),n=this.odometer.captureState(),r=this.events.captureState(),i=this.renderer.captureState(),a;try{a=new yg(this,{extensions:new Map([...this.stateParticipants].map(([e,t])=>[e,j(t.captureState())])),vehicles:e,drivers:new Map(this.drivers),driveTasks:new Map(this.driveTasks),driveTaskStates:new Map([...this.driveTasks].map(([e,t])=>[e,j(t.captureState())])),driverStates:new Map([...this.drivers].flatMap(([e,t])=>t.captureState?[[e,j(t.captureState())]]:[])),driverTargets:new Map(this.driverTargets),cameraVehicleId:this.cameraVehicleId,deformationEnabled:this.deformationEnabled,weaponCooldownEnabled:this.weaponCooldownEnabled,vehicleDestructible:this.vehicleDestructible,weaponsEnabled:this.weaponsEnabled,enabledTools:[...this.enabledTools],slowMo:this.slowMo.captureState(),collisions:t,odometer:n,events:r,points:this.destructionPoints,renderer:i,materialInteractions:this.materialInteractions.captureState()})}catch(e){throw i.dispose(),e}return this.checkpoints.add(a),a}restoreState(e){if(this.disposed||e.world!==this||!e.available)throw Error(`Checkpoint is unavailable for this game world`);let t=e.state;if(t.vehicles.length!==this.vehicleRegistry.size||t.vehicles.some(e=>!this.vehicleRegistry.has(e.id)))throw Error(`Checkpoint vehicle registry does not match`);this.materialInteractions.validateState(t.materialInteractions),this.drivers.clear(),this.driveTasks.clear(),this.driverTargets.clear(),this.deformationEnabled=t.deformationEnabled,this.weaponCooldownEnabled=t.weaponCooldownEnabled,this.vehicleDestructible=t.vehicleDestructible,this.weaponsEnabled=t.weaponsEnabled,this.enabledTools=[...t.enabledTools],this.slowMo.restoreState(t.slowMo),this.sound().setTimeScale?.(this.slowMo.speedFactor),this.destructionPoints=t.points,this.cameraVehicleId=t.cameraVehicleId;for(let[e,n]of t.drivers)this.drivers.set(e,n);for(let[e,n]of t.driveTasks)this.driveTasks.set(e,n);for(let[e,n]of t.driveTaskStates)this.driveTasks.get(e)?.restoreState(j(n));for(let[e,n]of t.driverStates)this.drivers.get(e)?.restoreState?.(j(n));for(let[e,n]of t.driverTargets)this.driverTargets.set(e,n);let n=this.focusVehicle;n&&this.renderer.bindVehicle(n),this.renderer.restoreState(t.renderer),this.materialInteractions.restoreState(t.materialInteractions);for(let e of t.vehicles){let t=this.vehicleRegistry.get(e.id);if(!t)throw Error(`Checkpoint vehicle is unavailable`);t.restoreState(e)}n&&this.collisions.prepare(n.sim.car.preset),this.collisions.restoreState(t.collisions),this.odometer.restoreState(t.odometer),this.events.restoreState(t.events);for(let[e,n]of t.extensions){let t=this.stateParticipants.get(e);if(!t)throw Error(`Checkpoint state participant is unavailable: ${e}`);t.restoreState(j(n))}}releaseCheckpoint(e){this.checkpoints.delete(e)}dispose(){if(!this.disposed){this.disposed=!0;for(let e of[...this.checkpoints])e.dispose();this.slowMo.reset(),this.sound().setTimeScale?.(1),this.events.clear(),this.collisions.destroy(),this.renderer.dispose();for(let e of this.vehicleRegistry.values())e.dispose();this.vehicleRegistry.clear(),this.drivers.clear(),this.driveTasks.clear(),this.stateParticipants.clear()}}},xg=10,Sg=class{active;step;render;stepSeconds;maxSteps;onError;simulationElapsed;frameId=0;running=!1;lastTime=null;accumulator=0;failure=null;constructor(e,t,n,r=1/120,i=12,a=e=>console.error(`Joy Ride stopped after a runtime failure.`,e),o=e=>e){this.active=e,this.step=t,this.render=n,this.stepSeconds=r,this.maxSteps=i,this.onError=a,this.simulationElapsed=o}get status(){return this.failure?`failed`:this.running?`running`:`stopped`}get error(){return this.failure?.error}reset(){this.lastTime=null,this.accumulator=0}advance(e){Pn();let t=this.lastTime===null?0:Math.max(0,(e-this.lastTime)/1e3),n=Math.min(t,.1);if(this.lastTime=e,this.active()){t>n&&this.simulationElapsed(t-n),this.simulationElapsed(0),this.accumulator+=n;let e=0,r=this.stepSeconds*1e-9,i=performance.now();for(;this.accumulator+r>=this.stepSeconds&&e<this.maxSteps&&(this.step(this.simulationElapsed(this.stepSeconds)),this.accumulator=Math.max(0,this.accumulator-this.stepSeconds),e++,!(e>=2&&performance.now()-i>xg)););if(this.accumulator+r>=this.stepSeconds){let e=this.accumulator-this.accumulator%this.stepSeconds;this.simulationElapsed(e),this.accumulator-=e}}else this.accumulator=0;this.render(e,n)}start(){this.running||(this.failure=null,this.running=!0,this.frameId=requestAnimationFrame(this.onFrame))}stop(){this.running=!1,this.frameId&&cancelAnimationFrame(this.frameId),this.frameId=0,this.reset()}onFrame=e=>{this.frameId=0;try{this.advance(e)}catch(e){this.stop(),this.failure={error:e},this.onError(e);return}this.running&&(this.frameId=requestAnimationFrame(this.onFrame))}};function Cg(e,t,...n){try{return t?.(...n)}catch(t){try{e(t)}catch(e){console.error(`Joy Ride host callback error reporting failed.`,e)}return}}function wg(e,t=0,n=1){let r=Math.max(0,Math.min(1,(e-t)/(n-t)));return 1-r*r*(3-2*r)}var Tg=(e,t,n)=>{let r=Math.max(0,Math.min(1,(n-e)/(t-e)));return r*r*(3-2*r)},Eg=class{sprites=new WeakMap;colors=new Map;colorCanvas=null;nextPhase=0;get(e,t,n,r,i=!1){if(t>=1)return e;let[a,o,s]=this.rgb(n),c=this.sprites.get(e);if(!c||c.canvas.width!==e.width||c.canvas.height!==e.height){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height,c={canvas:t,revision:-1,tint:-1,radialStep:-1,phase:this.nextPhase},this.nextPhase=(this.nextPhase+.61803398875)%1,this.sprites.set(e,c)}let l=Math.max(0,Math.min(1,Math.round(t*32+c.phase-.5)/32)),u=Math.round(a*l),d=Math.round(o*l),f=Math.round(s*l),p=u<<16|d<<8|f;if(i||c.revision!==r||c.tint!==p){Ye(`burn sprite recolors`);let t=c.canvas.getContext(`2d`);t&&(t.clearRect(0,0,e.width,e.height),t.globalCompositeOperation=`source-over`,t.drawImage(e,0,0),t.globalCompositeOperation=`source-in`,t.fillStyle=`rgb(${u} ${d} ${f})`,t.fillRect(0,0,e.width,e.height),t.globalCompositeOperation=`source-over`,c.revision=r,c.tint=p,c.radialStep=-1)}return c.canvas}getRadialBurn(e,t,n){let r=this.sprites.get(e);if(!r||r.canvas.width!==e.width||r.canvas.height!==e.height){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height,r={canvas:t,revision:-1,tint:-1,radialStep:-1,phase:0},this.sprites.set(e,r)}let i=Math.round(t.age*30);if(r.revision===n&&r.radialStep===i)return r.canvas;let a=r.canvas.getContext(`2d`);if(!a)return e;a.save(),a.clearRect(0,0,e.width,e.height),a.drawImage(e,0,0);let o=e=>{let n=a.createRadialGradient(t.originX,t.originY,0,t.originX,t.originY,Math.max(1,t.farthest));for(let r=0;r<=16;r++){let i=r/16,a=(t.age-i*t.spreadSeconds)/Math.max(.01,t.burnSeconds);n.addColorStop(i,`rgba(0, 0, 0, ${e(a)})`)}return n};return a.globalCompositeOperation=`source-atop`,a.fillStyle=o(e=>Tg(.12,.72,e)*.95),a.fillRect(0,0,e.width,e.height),a.globalCompositeOperation=`destination-out`,a.fillStyle=o(e=>1-wg(e,.78,1.02)),a.fillRect(0,0,e.width,e.height),a.restore(),r.revision=n,r.radialStep=i,r.tint=-1,r.canvas}bytesFor(e){let t=e&&this.sprites.get(e)?.canvas;return t?t.width*t.height*4:0}clear(){this.sprites=new WeakMap,this.colors.clear(),this.colorCanvas=null,this.nextPhase=0}rgb(e){let t=this.colors.get(e);if(t)return t;let n=this.colorCanvas??=document.createElement(`canvas`);n.width=n.height=1;let r=n.getContext(`2d`,{willReadFrequently:!0});if(!r)return[255,255,255];r.clearRect(0,0,1,1),r.fillStyle=e,r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data,a=[i[0],i[1],i[2]];return this.colors.set(e,a),a}};function Dg(e,t,n,r,i){if(!(r.speedMps>.8))return!1;let a=r.pixelsPerMeter,o=c(r.point,n.center);return e.car.takeImpact(r.speedMps,P(A(o,n.forward)/a,A(o,n.side)/a)),t?.hit(r.point,r.normal,n,r.speedMps,a),i(),!0}var Og=class{sources;cells=new Map;largeSources=[];cellSize=64;constructor(e){this.sources=e;for(let t of e){let e=t.bounds??{x:t.point.x,y:t.point.y,width:0,height:0},n=Math.floor((e.x-t.radiusPx)/this.cellSize),r=Math.floor((e.x+e.width+t.radiusPx)/this.cellSize),i=Math.floor((e.y-t.radiusPx)/this.cellSize),a=Math.floor((e.y+e.height+t.radiusPx)/this.cellSize);if((r-n+1)*(a-i+1)>256)this.largeSources.push(t);else for(let e=i;e<=a;e++)for(let i=n;i<=r;i++){let n=`${i}:${e}`,r=this.cells.get(n)??[];r.push(t),this.cells.set(n,r)}}}*near(e){let t=Math.floor(e.x/this.cellSize),n=Math.floor((e.x+e.width)/this.cellSize),r=Math.floor(e.y/this.cellSize),i=Math.floor((e.y+e.height)/this.cellSize);if((n-t+1)*(i-r+1)>256){for(let t of this.sources)this.overlaps(t,e)&&(yield t);return}let a=new Set;for(let e=r;e<=i;e++)for(let r=t;r<=n;r++)for(let t of this.cells.get(`${r}:${e}`)??[])a.has(t)||(a.add(t),yield t);for(let t of this.largeSources)this.overlaps(t,e)&&(yield t)}overlaps(e,t){let n=e.bounds??{x:e.point.x,y:e.point.y,width:0,height:0},r=e.radiusPx;return n.x-r<=t.x+t.width&&n.x+n.width+r>=t.x&&n.y-r<=t.y+t.height&&n.y+n.height+r>=t.y}},kg=343,Ag={vtwin:{label:`V-twin 90° 1.2`,cylinders:2,firingOrder:[1,2],banks:[[1],[2]],pinOffsets:{2:-90},idleRpm:1150,redlineRpm:9500,peakTorque:125,peakTorqueRpm:8e3,gears:6,engineInertia:.055,gasTempFactor:1.34,pulse:{attack:40,decay:6.5,hardness:.72,jitter:2},exhaust:{bank:.95,bankB:1.1,collector:.55,reflection:.5,damping:.34,muffler:[.16,.11,.075]},intake:{helmholtz:165,q:6,level:.4},voice:.92},i3:{label:`Inline-3 1.0`,cylinders:3,firingOrder:[1,2,3],banks:[[1,2,3]],idleRpm:850,redlineRpm:6500,peakTorque:200,peakTorqueRpm:2200,gears:5,engineInertia:.16,gasTempFactor:1.3,pulse:{attack:34,decay:5.5,hardness:.62,jitter:1.6},exhaust:{bank:1.45,collector:1.1,reflection:.55,damping:.42,muffler:[.32,.21,.14]},intake:{helmholtz:105,q:5.5,level:.34},voice:1},rotary2:{label:`Rotary 1.3 twin-rotor`,cylinders:4,firingOrder:[1,2,3,4],banks:[[1,2,3,4]],idleRpm:900,redlineRpm:9e3,peakTorque:220,peakTorqueRpm:5500,gears:5,engineInertia:.14,gasTempFactor:1.4,pulse:{attack:18,decay:3,hardness:.7,jitter:1.2},exhaust:{bank:1.05,collector:.8,reflection:.52,damping:.3,muffler:[.2,.13,.09]},intake:{helmholtz:145,q:6.6,level:.46},voice:.94},i4:{label:`Inline-4 2.0`,cylinders:4,firingOrder:[1,3,4,2],banks:[[1,2,3,4]],idleRpm:800,redlineRpm:7200,peakTorque:240,peakTorqueRpm:3900,gears:6,engineInertia:.19,gasTempFactor:1.28,pulse:{attack:38,decay:6.2,hardness:.66,jitter:1.1},exhaust:{bank:1.3,collector:1.05,reflection:.52,damping:.44,muffler:[.3,.19,.12]},intake:{helmholtz:118,q:6,level:.32},voice:.96},boxer4:{label:`Flat-4 boxer (unequal headers)`,cylinders:4,firingOrder:[1,3,2,4],banks:[[1,3],[2,4]],pinOffsets:{3:6,4:-6},idleRpm:800,redlineRpm:6800,peakTorque:300,peakTorqueRpm:3200,gears:6,engineInertia:.2,gasTempFactor:1.27,pulse:{attack:32,decay:5.4,hardness:.6,jitter:2.2},exhaust:{bank:1.62,bankB:.98,collector:1.15,reflection:.58,damping:.4,muffler:[.34,.22,.15]},intake:{helmholtz:100,q:5.2,level:.36},voice:1},i5:{label:`Inline-5 2.5`,cylinders:5,firingOrder:[1,2,4,5,3],banks:[[1,2,3,4,5]],idleRpm:820,redlineRpm:7e3,peakTorque:360,peakTorqueRpm:3200,gears:6,engineInertia:.24,gasTempFactor:1.29,pulse:{attack:33,decay:5.6,hardness:.64,jitter:1.5},exhaust:{bank:1.38,collector:1.08,reflection:.56,damping:.41,muffler:[.31,.2,.13]},intake:{helmholtz:108,q:5.6,level:.34},voice:1},i6:{label:`Inline-6 3.0`,cylinders:6,firingOrder:[1,5,3,6,2,4],banks:[[1,2,3,4,5,6]],idleRpm:750,redlineRpm:7e3,peakTorque:420,peakTorqueRpm:3e3,gears:7,engineInertia:.27,gasTempFactor:1.28,pulse:{attack:30,decay:5,hardness:.58,jitter:.7},exhaust:{bank:1.55,collector:1.2,reflection:.54,damping:.38,muffler:[.33,.21,.14]},intake:{helmholtz:95,q:6.4,level:.33},voice:.98},i6diesel:{label:`Inline-6 diesel 6.7`,cylinders:6,firingOrder:[1,5,3,6,2,4],banks:[[1,2,3,4,5,6]],idleRpm:640,redlineRpm:4600,peakTorque:950,peakTorqueRpm:1900,gears:8,engineInertia:.62,gasTempFactor:1.16,pulse:{attack:68,decay:9.5,hardness:.88,jitter:1.4},exhaust:{bank:1.35,collector:1.65,reflection:.52,damping:.6,muffler:[.46,.3,.2]},intake:{helmholtz:88,q:4.6,level:.24},voice:1.02},v6:{label:`V6 60°`,cylinders:6,firingOrder:[1,4,2,5,3,6],banks:[[1,2,3],[4,5,6]],idleRpm:780,redlineRpm:6800,peakTorque:380,peakTorqueRpm:3600,gears:6,engineInertia:.26,gasTempFactor:1.28,pulse:{attack:31,decay:5.2,hardness:.61,jitter:1.3},exhaust:{bank:1.2,collector:1.05,reflection:.56,damping:.4,muffler:[.3,.2,.13]},intake:{helmholtz:102,q:5.8,level:.33},voice:.98},v6tt:{label:`V6 3.8 twin-turbo build`,cylinders:6,firingOrder:[1,4,2,5,3,6],banks:[[1,2,3],[4,5,6]],idleRpm:750,redlineRpm:7100,peakTorque:640,peakTorqueRpm:3600,gears:7,engineInertia:.29,gasTempFactor:1.22,pulse:{attack:29,decay:5,hardness:.6,jitter:1.2},exhaust:{bank:.95,collector:1.3,reflection:.5,damping:.52,muffler:[.34,.23,.15]},intake:{helmholtz:112,q:5.4,level:.3},voice:.98},flat6:{label:`Flat-6 3.8`,cylinders:6,firingOrder:[1,6,2,4,3,5],banks:[[1,2,3],[4,5,6]],idleRpm:800,redlineRpm:8500,peakTorque:420,peakTorqueRpm:5e3,gears:7,engineInertia:.22,gasTempFactor:1.31,pulse:{attack:44,decay:7,hardness:.74,jitter:.9},exhaust:{bank:.85,collector:.72,reflection:.48,damping:.3,muffler:[.22,.15,.1]},intake:{helmholtz:138,q:7.2,level:.42},voice:1},v8cross:{label:`V8 cross-plane 5.0`,cylinders:8,firingOrder:[1,8,7,3,6,5,4,2],banks:[[1,2,3,4],[5,6,7,8]],idleRpm:700,redlineRpm:7e3,peakTorque:540,peakTorqueRpm:4200,gears:6,engineInertia:.38,gasTempFactor:1.26,pulse:{attack:26,decay:4.4,hardness:.55,jitter:2.6},exhaust:{bank:1.75,collector:1.35,reflection:.63,damping:.34,muffler:[.4,.26,.17]},intake:{helmholtz:78,q:5,level:.3},voice:1.06},v8tt:{label:`V8 4.0 twin-turbo build`,cylinders:8,firingOrder:[1,8,7,3,6,5,4,2],banks:[[1,2,3,4],[5,6,7,8]],idleRpm:660,redlineRpm:6800,peakTorque:800,peakTorqueRpm:3e3,gears:8,engineInertia:.42,gasTempFactor:1.21,pulse:{attack:24,decay:4.2,hardness:.54,jitter:2.4},exhaust:{bank:1.1,collector:1.55,reflection:.58,damping:.55,muffler:[.42,.28,.18]},intake:{helmholtz:74,q:4.8,level:.28},voice:1.05},v8flat:{label:`V8 flat-plane 4.5`,cylinders:8,firingOrder:[1,5,3,7,4,8,2,6],banks:[[1,2,3,4],[5,6,7,8]],idleRpm:900,redlineRpm:9e3,peakTorque:460,peakTorqueRpm:6e3,gears:7,engineInertia:.25,gasTempFactor:1.33,pulse:{attack:52,decay:8.4,hardness:.82,jitter:.6},exhaust:{bank:.78,collector:.62,reflection:.44,damping:.26,muffler:[.18,.12,.08]},intake:{helmholtz:155,q:7.8,level:.44},voice:1},v10:{label:`V10 5.2`,cylinders:10,firingOrder:[1,6,5,10,2,7,3,8,4,9],banks:[[1,2,3,4,5],[6,7,8,9,10]],idleRpm:900,redlineRpm:8700,peakTorque:560,peakTorqueRpm:6500,gears:7,engineInertia:.3,gasTempFactor:1.32,pulse:{attack:48,decay:7.8,hardness:.8,jitter:.8},exhaust:{bank:.82,collector:.66,reflection:.46,damping:.27,muffler:[.19,.13,.09]},intake:{helmholtz:148,q:7.4,level:.45},voice:1.02},v12:{label:`V12 6.5`,cylinders:12,firingOrder:[1,7,5,11,3,9,6,12,2,8,4,10],banks:[[1,2,3,4,5,6],[7,8,9,10,11,12]],idleRpm:850,redlineRpm:8500,peakTorque:690,peakTorqueRpm:5800,gears:8,engineInertia:.36,gasTempFactor:1.31,pulse:{attack:46,decay:7.4,hardness:.78,jitter:.5},exhaust:{bank:.9,collector:.7,reflection:.47,damping:.28,muffler:[.2,.14,.09]},intake:{helmholtz:142,q:7,level:.44},voice:1.04}};function jg(e){let t=720/e.cylinders,n=new Map;return e.firingOrder.forEach((r,i)=>{let a=e.pinOffsets&&e.pinOffsets[r]||0;n.set(r,(i*t+a+720)%720)}),n}function Mg(e,t){let n=jg(e);return e.banks[t].map(e=>n.get(e)).sort((e,t)=>e-t)}function Ng(e,t=1){return kg*t/(4*Math.max(.05,e))}function Pg(e,t=1){return 2*Math.max(.05,e)/(kg*t)}var Fg={hatch:{label:`Hot hatch`,mass:1320,wheelRadius:.31,finalDrive:4.05,gearRatios:[3.31,2.13,1.48,1.14,.95,.82],dragArea:.68,rollingResistance:.014,brakeForce:9500,gearbox:`manual`,shiftTimeMs:130,gearTeeth:[37,31,27,24,22,20]},sports:{label:`Sports car`,mass:1450,wheelRadius:.33,finalDrive:3.73,gearRatios:[3.55,2.05,1.39,1,.82,.67],dragArea:.62,rollingResistance:.013,brakeForce:12e3,gearbox:`manual`,shiftTimeMs:95,gearTeeth:[39,33,28,25,22,19]},supercar:{label:`Supercar (dual-clutch)`,mass:1560,wheelRadius:.34,finalDrive:3.9,gearRatios:[3.08,2.19,1.63,1.29,1.03,.84,.69],dragArea:.6,rollingResistance:.012,brakeForce:15e3,gearbox:`dct`,shiftTimeMs:45,gearTeeth:[41,35,30,26,23,20,18]},muscle:{label:`Muscle car`,mass:1720,wheelRadius:.35,finalDrive:3.55,gearRatios:[2.97,2.07,1.43,1,.71],dragArea:.78,rollingResistance:.016,brakeForce:11e3,gearbox:`manual`,shiftTimeMs:150,gearTeeth:[35,30,26,23,20]},truck:{label:`Pickup (automatic)`,mass:2400,wheelRadius:.38,finalDrive:3.73,gearRatios:[4.17,2.34,1.52,1.14,.87,.69],dragArea:1.05,rollingResistance:.018,brakeForce:13e3,gearbox:`auto`,shiftTimeMs:190,gearTeeth:[43,36,31,27,24,21]}},Ig={stiffness:5200,dampingRatio:.22,damping:13,backlash:.035,clutchTorqueCapacity:900,clutchStiffness:3.2},Lg=(e,t,n)=>e<t?t:e>n?n:e,Rg=(e,t)=>typeof e==`number`&&isFinite(e)?e:t,zg=Object.freeze({mix:Object.freeze({exhaust:1,intake:.75,transmission:.45,turbo:.4,transients:.42,sub:.25}),tone:Object.freeze({rumble:1,brightness:1,punch:1}),eq:Object.freeze([0,0,0,0,0]),fx:Object.freeze({reverbMix:.14,reverbSize:.32,reverbDamping:4200,width:.35,popDepth:1.05,dynamics:1}),turbo:Object.freeze({enabled:0,inertia:.42,maxBoost:1.1,whineOrder:52,boostRpm:3500,valve:1,bov:.4,surge:1,flutterHz:13,screamer:0,antiLag:0}),position:0,volume:.7}),Bg=Object.freeze([{path:`engine.idleRpm`,label:`Idle`,min:400,max:2500,step:10,unit:`rpm`,group:`engine`,rebuild:!1},{path:`engine.redlineRpm`,label:`Redline`,min:3e3,max:12e3,step:100,unit:`rpm`,group:`engine`,rebuild:!1},{path:`engine.peakTorque`,label:`Peak torque`,min:40,max:1400,step:5,unit:`N·m`,group:`engine`,rebuild:!1},{path:`engine.peakTorqueRpm`,label:`Torque peak at`,min:1200,max:9e3,step:100,unit:`rpm`,group:`engine`,rebuild:!1},{path:`engine.gears`,label:`Gears`,min:3,max:10,step:1,unit:``,group:`engine`,rebuild:!0},{path:`engine.engineInertia`,label:`Rotating inertia`,min:.02,max:1.2,step:.005,unit:`kg·m²`,group:`engine`,rebuild:!1},{path:`engine.gasTempFactor`,label:`Gas temperature`,min:.8,max:1.8,step:.01,unit:`×c`,group:`engine`,rebuild:!0},{path:`engine.voice`,label:`Voice level`,min:.2,max:2,step:.01,unit:`%`,group:`engine`,rebuild:!1},{path:`engine.pulse.attack`,label:`Blowdown attack`,min:5,max:90,step:1,unit:``,group:`pulse`,rebuild:!0},{path:`engine.pulse.decay`,label:`Blowdown decay`,min:1,max:14,step:.1,unit:``,group:`pulse`,rebuild:!0},{path:`engine.pulse.hardness`,label:`Load hardening`,min:0,max:1.5,step:.01,unit:``,group:`pulse`,rebuild:!0},{path:`engine.pulse.jitter`,label:`Cylinder jitter`,min:0,max:6,step:.1,unit:``,group:`pulse`,rebuild:!0},{path:`engine.exhaust.bank`,label:`Header length`,min:.2,max:2.5,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.collector`,label:`Collector length`,min:.2,max:3,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.reflection`,label:`End reflection`,min:.05,max:.9,step:.01,unit:``,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.damping`,label:`Pipe damping`,min:.1,max:1.5,step:.01,unit:``,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.muffler.0`,label:`Muffler stage 1`,min:0,max:.8,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.muffler.1`,label:`Muffler stage 2`,min:0,max:.8,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.exhaust.muffler.2`,label:`Muffler stage 3`,min:0,max:.8,step:.01,unit:`m`,group:`exhaust`,rebuild:!0},{path:`engine.intake.helmholtz`,label:`Plenum resonance`,min:40,max:400,step:1,unit:`Hz`,group:`intake`,rebuild:!0},{path:`engine.intake.q`,label:`Plenum Q`,min:.5,max:14,step:.1,unit:``,group:`intake`,rebuild:!0},{path:`engine.intake.level`,label:`Induction level`,min:0,max:1.5,step:.01,unit:`%`,group:`intake`,rebuild:!0},{path:`turbo.enabled`,label:`Turbo`,min:0,max:1,step:1,unit:`bool`,group:`turbo`,rebuild:!1},{path:`turbo.inertia`,label:`Turbo inertia`,min:.05,max:2,step:.01,unit:`s`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.boostRpm`,label:`Boost onset`,min:1200,max:7e3,step:100,unit:`rpm`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.maxBoost`,label:`Max boost`,min:.2,max:3,step:.05,unit:`bar`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.whineOrder`,label:`Blade order`,min:10,max:120,step:1,unit:``,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.valve`,label:`Blow-off valve`,min:0,max:2,step:1,unit:`enum`,options:[`None`,`Atmos`,`Recirc`],group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.bov`,label:`Valve size`,min:0,max:1,step:.01,unit:`%`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.surge`,label:`Flutter trim`,min:0,max:2,step:.01,unit:`%`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.flutterHz`,label:`Flutter rate`,min:5,max:25,step:.5,unit:`Hz`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.screamer`,label:`Screamer pipe`,min:0,max:1,step:1,unit:`bool`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`turbo.antiLag`,label:`Anti-lag`,min:0,max:1,step:1,unit:`bool`,group:`turbo`,rebuild:!1,needs:`turbo`},{path:`mix.exhaust`,label:`Exhaust`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.intake`,label:`Intake`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.transmission`,label:`Gearbox`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.turbo`,label:`Turbo`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.transients`,label:`Pops`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`mix.sub`,label:`Sub`,min:0,max:1.6,step:.01,unit:`%`,group:`mix`,rebuild:!1},{path:`tone.rumble`,label:`Rumble`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`tone.brightness`,label:`Brightness`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`tone.punch`,label:`Bass punch`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`fx.popDepth`,label:`Pop depth`,min:0,max:2,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`fx.dynamics`,label:`Compression`,min:0,max:1,step:.01,unit:`%`,group:`tone`,rebuild:!1},{path:`fx.reverbMix`,label:`Reverb mix`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`fx.reverbSize`,label:`Reverb size`,min:.05,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`fx.reverbDamping`,label:`Reverb damping`,min:800,max:12e3,step:100,unit:`Hz`,group:`fx`,rebuild:!1},{path:`fx.width`,label:`Stereo width`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`position`,label:`Listener position`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`volume`,label:`Volume`,min:0,max:1,step:.01,unit:`%`,group:`fx`,rebuild:!1},{path:`eq.0`,label:`Sub 60`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.1`,label:`Body 200`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.2`,label:`Honk 800`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.3`,label:`Rasp 2.5k`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1},{path:`eq.4`,label:`Air 8k`,min:-18,max:18,step:.5,unit:`dB`,group:`eq`,rebuild:!1}]),Vg=Object.freeze([{id:`engine`,label:`Engine`,note:`The machine itself. Torque and inertia drive the physics; gas temperature sets the speed of sound in the pipes.`},{id:`pulse`,label:`Combustion pulse`,note:`The shape of one cylinder blowing down. Attack is the crack, decay is the tail, hardening is how much both sharpen under load.`},{id:`exhaust`,label:`Exhaust`,note:`Waveguide geometry in metres. Header and collector lengths set the resonances; reflection and damping set how many survive.`},{id:`intake`,label:`Intake`,note:`Airbox Helmholtz resonance. It does not track rpm — what tracks rpm is how hard it is excited.`},{id:`turbo`,label:`Turbo`,note:`Bolts onto any engine. Inertia is lag. No blow-off valve = full "stu-stu-stu"; an atmospheric valve goes "pssh", a recirculating one is quiet — the bigger the valve, the less is left to flutter. A screamer pipe vents the wastegate to air; anti-lag keeps the turbo spooled off-throttle, with bangs.`},{id:`mix`,label:`Voice mix`,note:`Balance between the voices.`},{id:`tone`,label:`Tone`,note:`The fixed-frequency part of the response, plus how hard the compressor works.`},{id:`fx`,label:`Space`,note:`Reverb, width, where the listener is, and output level.`},{id:`eq`,label:`EQ`,note:`Five bands, ±18 dB.`}]);function Hg(e,t){let n=e;for(let e of t.split(`.`)){if(n==null)return;n=n[e]}return n}function Ug(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e++)(i[r[e]]==null||typeof i[r[e]]!=`object`)&&(i[r[e]]={}),i=i[r[e]];return i[r[r.length-1]]=n,e}function Wg(e){return Bg.find(t=>t.path===e)}function Gg(e){if(Array.isArray(e))return e.map(Gg);if(e&&typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=Gg(e[n]);return t}return e}function Kg(e){let t=Ag[e];return t?Jg({version:3,id:e,label:t.label,engine:Gg(t),...Gg(zg)}):null}function qg(){let e={};for(let t of Object.keys(Ag))e[t]=Kg(t);return e}function Jg(e){let t=e&&typeof e==`object`?e:{},n=Ag[t.id]||Ag.v8cross,r={version:3,id:typeof t.id==`string`&&t.id?t.id:`custom`,label:typeof t.label==`string`&&t.label?t.label:n.label,engine:{},mix:{},tone:{},eq:[],fx:{},turbo:{},position:0,volume:.7},i=t.engine&&typeof t.engine==`object`?t.engine:n,a=Lg(Math.round(Rg(i.cylinders,n.cylinders)),1,16);r.engine.cylinders=a;let o=Array.isArray(i.firingOrder)?i.firingOrder.slice(0,a):null,s=o&&o.length===a&&o.every(e=>Number.isInteger(e)&&e>=1&&e<=a)&&new Set(o).size===a;r.engine.firingOrder=s?o:n.cylinders===a?Gg(n.firingOrder):Array.from({length:a},(e,t)=>t+1);let c=Array.isArray(i.banks)?i.banks.filter(Array.isArray):null,l=c?c.flat():[],u=c&&c.length>0&&l.length===a&&l.every(e=>r.engine.firingOrder.includes(e));if(r.engine.banks=u?Gg(c):n.cylinders===a?Gg(n.banks):[r.engine.firingOrder.slice()],i.pinOffsets&&typeof i.pinOffsets==`object`){let e={};for(let[t,n]of Object.entries(i.pinOffsets)){let r=Number(t);Number.isInteger(r)&&r>=1&&r<=a&&(e[r]=Lg(Rg(n,0),-360,360))}Object.keys(e).length&&(r.engine.pinOffsets=e)}let d=Rg(i.exhaust&&i.exhaust.bankB,NaN);r.engine.exhaust={},isFinite(d)&&r.engine.banks.length>1&&(r.engine.exhaust.bankB=Lg(d,.2,2.5));let f=!(t.turbo&&typeof t.turbo==`object`)&&i.turbo&&typeof i.turbo==`object`?{...i.turbo,enabled:1}:null,p=f?{...t,turbo:f}:t,m={engine:n,...zg};for(let e of Bg){let t=Hg(p,e.path);isFinite(Number(t))||(t=Hg(m,e.path)),isFinite(Number(t))||(t=e.min);let n=Lg(Number(t),e.min,e.max);Ug(r,e.path,e.unit===`bool`||e.unit===`enum`?Math.round(n):n)}let h=r.engine.exhaust.muffler;return r.engine.exhaust.muffler=[0,1,2].map(e=>Lg(Rg(h&&h[e],.2),0,.8)),r.eq=[0,1,2,3,4].map(e=>Lg(Rg(r.eq[e],0),-18,18)),r}function Yg(e){return JSON.stringify(Jg(e),null,2).replace(/\[\s+((?:-?[\d.]+,?\s+)+)\]/g,(e,t)=>`[`+t.trim().replace(/,\s+/g,`, `)+`]`)}function Xg(e){let t;try{t=JSON.parse(String(e))}catch(e){return{preset:null,error:`not valid JSON: `+e.message}}return!t||typeof t!=`object`?{preset:null,error:`not an object`}:{preset:Jg(t),error:null}}var Zg=8192,Qg=1024;function $g(e,t){let n=e.length;for(let r=1,i=0;r<n;r++){let a=n>>1;for(;i&a;a>>=1)i^=a;if(i^=a,r<i){let n=e[r];e[r]=e[i],e[i]=n,n=t[r],t[r]=t[i],t[i]=n}}for(let r=2;r<=n;r<<=1){let i=-2*Math.PI/r,a=Math.cos(i),o=Math.sin(i);for(let i=0;i<n;i+=r){let n=1,s=0;for(let c=0;c<r/2;c++){let l=e[i+c],u=t[i+c],d=e[i+c+r/2]*n-t[i+c+r/2]*s,f=e[i+c+r/2]*s+t[i+c+r/2]*n;e[i+c]=l+d,t[i+c]=u+f,e[i+c+r/2]=l-d,t[i+c+r/2]=u-f;let p=n*a-s*o;s=n*o+s*a,n=p}}}}function e_(e){let t=e>>>0||1;return()=>(t^=t<<13,t>>>=0,t^=t>>17,t^=t<<5,t>>>=0,t/4294967296)}function t_(e,t,n){return e<0||e>1?0:(1-Math.exp(-t*e))*Math.exp(-n*e)}function n_(e,t,n,r=0){let i=e.pulse,a=Math.max(0,Math.min(1.5,typeof i.hardness==`number`&&isFinite(i.hardness)?i.hardness:.65))/.65,o=i.attack*(.55+.85*a*n),s=i.decay*(1.25-.35*a*n),c=new Float64Array(Zg),l=e_(e.cylinders*2654435761+Math.round(i.attack*97)),u=(i.jitter||0)/100;for(let e of t){let t=1+(l()*2-1)*u*2.5,n=(l()*2-1)*u*6,i=1+(l()*2-1)*u*1.5,a=((e+r+n)%720+720)%720/720;for(let e=0;e<Zg;e++){let n=e/Zg-a;n<0&&(n+=1),c[e]+=t*t_(n,o,s*i)}}return c}function r_(e){let t=e.length,n=new Float64Array(t);for(let r=0;r<t;r++)n[r]=e[(r+1)%t]-e[r];let r=0;for(let e=0;e<t;e++)r+=n[e];r/=t;for(let e=0;e<t;e++)n[e]-=r;return n}var i_=24;function a_(e,t=Qg,n=i_){let r=e.length,i=new Float64Array(r),a=new Float64Array(r);i.set(e),$g(i,a);let o=Math.min(t,r/2),s=new Float32Array(o),c=new Float32Array(o),l=n>0?2*n:0;for(let e=1;e<o;e++){let t=l?1/(1+e/l):1;s[e]=2*i[e]/r*t,c[e]=-2*a[e]/r*t}return s[0]=0,c[0]=0,{real:s,imag:c}}function o_(e,t=.25){let n=0;for(let t=1;t<e.real.length;t++)n+=.5*(e.real[t]**2+e.imag[t]**2);let r=t/(Math.sqrt(n)||1);for(let t=0;t<e.real.length;t++)e.real[t]*=r,e.imag[t]*=r;return e}function s_(e,t,n){let r={disableNormalization:!0},i=(n,i,a)=>{let o=o_(a_(r_(n_(t,n,i,a))));return e.createPeriodicWave(o.real,o.imag,r)},a=t.banks.map((e,r)=>{let a=n(t,r);return{soft:i(a,0,0),hard:i(a,1,0)}}),o=t.banks.flat().map((e,n)=>n*720/t.cylinders);return{banks:a,intake:{soft:i(o,0,360),hard:i(o,1,360)}}}function c_(e,t,n){let r=Math.max(.02,Number(e.engineInertia)||.25),i=Math.max(1,e.cylinders||4),a=Math.max(40,(Number(t)||0)*Math.PI/30),o=.3*((Number(e.peakTorque)||300)*(.12+.88*Math.max(0,Math.min(1,n))))*(4*Math.PI/i)/(r*a*a);return Math.max(0,Math.min(.12,o))}function l_(e,t){let n=e.pulse,r=(n.jitter||0)/100,i=e_(e.cylinders*2654435761+Math.round(n.attack*97)+7),a=[],o=e.banks.length,s=[];for(let n=0;n<o;n++)for(let o of t(e,n)){let e=1+(i()*2-1)*r*2.5,t=(i()*2-1)*r*6,c=1+(i()*2-1)*r*1.5,l=((o+t)%720+720)%720/720;a.push({out:n,angle:l,ampTrim:e,decayTrim:c}),s.push({angle:o+t+360,ampTrim:e,decayTrim:c})}for(let e of s)a.push({out:o,angle:(e.angle%720+720)%720/720,ampTrim:e.ampTrim,decayTrim:e.decayTrim});let c=Math.max(0,Math.min(1.5,typeof n.hardness==`number`&&isFinite(n.hardness)?n.hardness:.65))/.65,l=Zg,u=1-Math.exp(-2*Math.PI*48/l),d=[];for(let e=0;e<=o;e++){let t=[];for(let r=0;r<=4;r++){let i=r/4*c,o=n.attack*(.55+.85*i),s=n.decay*(1.25-.35*i),d=new Float64Array(l);for(let t of a)if(t.out===e)for(let e=0;e<l;e++){let n=e/l-t.angle;n<0&&(n+=1),d[e]+=t.ampTrim*t_(n,o,s*t.decayTrim)}let f=0,p=0;for(let e=0;e<2;e++)for(let t=0;t<l;t++){let n=(d[t]-d[(t+l-1)%l])*l;f+=u*(n-f),e&&(p+=f*f)}let m=Math.sqrt(p/l)||1;t.push(.25/m)}d.push(t)}return{events:a.sort((e,t)=>e.angle-t.angle),outputs:o+1,attack:n.attack,decay:n.decay,hardness:c,ccv:typeof n.ccv==`number`?n.ccv:.012+.012*(n.jitter||1),jitterDeg:typeof n.jitterDeg==`number`?n.jitterDeg:.4+.5*(n.jitter||1),gains:d,seed:e.cylinders*40503+Math.round(n.attack*131)>>>0}}var u_=1.02,d_=10,f_=2e4,p_=.92,m_=.02,h_=.09,G=(e,t,n)=>e<t?t:e>n?n:e;function K(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function g_(e,t,n,r=m_){let i=K(t,0),a=K(n,0);e.setTargetAtTime(i,a<0?0:a,r>0?r:m_)}function __(e,t,n,r){let i=2*Math.PI*G(t,1,.49*r)/r,a=Math.cos(i),o=Math.sin(i)/(2*Math.max(1e-4,n)),s=1+o,c=(1-a)/2/s,l=(1-a)/s,u=c,d=-2*a/s,f=(1-o)/s,p=2*Math.PI*G(e,.01,.49*r)/r,m=Math.cos(p),h=Math.sin(p),g=Math.cos(2*p),_=Math.sin(2*p),v=c+l*m+u*g,y=-(l*h+u*_),b=1+d*m+f*g,x=-(d*h+f*_),S=Math.atan2(y,v)-Math.atan2(x,b);return Number.isFinite(S)?S:0}function v_(e,t,n,r){let i=2*Math.PI*e;if(!(i>0))return 0;let a=__(e,t,n,r),o=(Math.PI+a)/i;return o>0&&Number.isFinite(o)?o:1/(2*e)}var y_=new Map;function b_(e,t,n=4096,r=x_()){let i=e+`:`+t+`:`+n+`:`+r,a=y_.get(i);if(a)return a;let o=1/Math.max(.2,e/3.2)*1.05,s=1/Math.max(.2,t/3.2)*.85,c=new Float32Array(n);for(let e=0;e<n;e++){let t=r*(e/(n-1)*2-1);c[e]=t>=0?o*Math.tanh(t/o):s*Math.tanh(t/s)}return y_.set(i,c),c}var x_=()=>6,S_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1;let r=t&&t.exhaust||{};this.length=G(K(n.length,K(r.bank,1)),.05,12),this.gasTemp=G(K(n.gasTempFactor,K(t&&t.gasTempFactor,1)),.5,2.5),this.reflection=G(K(n.reflection,K(r.reflection,.5)),0,p_),this.damping=G(K(n.damping,K(r.damping,.4)),.05,2),this.thermalSpan=G(K(n.thermalSpan,.05),0,.25),this.thermalBias=.35,this.sampleRate=K(e&&e.sampleRate,48e3),this.minLoopDelay=128/this.sampleRate,this.nominalDelay=Pg(this.length,this.gasTemp),this.frequency=Ng(this.length,this.gasTemp),this.lpBase=G(this.frequency*(1.8/this.damping),150,12e3),this.loopQ=.5;let i=.49*this.sampleRate;if(this.fMax=Math.min(f_,i),this.tunedDelay=this._tunedDelay(this.frequency,this.lpBase),this.phaseCompensation=this.tunedDelay/this.nominalDelay,this.maxHeatScale=1+this.thermalSpan*(1-this.thermalBias),this.shortestDelay=this._tunedDelay(this.frequency*this.maxHeatScale,this.lpBase*this.maxHeatScale*1.35),this.mode=this.shortestDelay>=this.minLoopDelay*u_?`delay`:`bandpass`,this.inGain=e.createGain(),this.inGain.gain.value=1,this.out=e.createGain(),this.out.gain.value=1,this.dryGain=e.createGain(),this.dryGain.gain.value=G(K(n.dry,.3),0,4),this.inGain.connect(this.dryGain),this.dryGain.connect(this.out),this.wetGain=e.createGain(),this.wetGain.gain.value=G(K(n.wet,.9),0,4),this.wetGain.connect(this.out),this.mode===`delay`){let t=Math.max(.01,this.nominalDelay/(1-this.thermalSpan)*1.25);this.maxDelayTime=t,this.sum=e.createGain(),this.sum.gain.value=1,this.delay=e.createDelay(t),this.delay.delayTime.value=G(this.tunedDelay,this.minLoopDelay,t),this.loopLP=e.createBiquadFilter(),this.loopLP.type=`lowpass`,this.loopLP.frequency.value=this._f(this.lpBase),this.loopLP.Q.value=this.loopQ,this.fb=e.createGain(),this.fb.gain.value=-this._fbMag(0),this.inGain.connect(this.sum),this.sum.connect(this.delay),this.delay.connect(this.loopLP),this.loopLP.connect(this.fb),this.fb.connect(this.sum),this.loopLP.connect(this.wetGain)}else{let t=this._fbMag(0);this.fallbackQ=G(Math.PI/(2*Math.max(.02,1-t)),.7,24);let r=G(Math.round(K(n.maxModes,3)),1,6);this.modes=[];let i=0,a=[];for(let e=0;e<r;e++){let t=this.frequency*(2*e+1);if(t>this.fMax*.95)break;let n=1/Math.sqrt(1+t/this.lpBase*(t/this.lpBase)),r=(1/(2*e+1))**.7*n;a.push(r),i+=r}a.length||(a.push(1),i=1);let o=.6/Math.max(.08,1-t);for(let t=0;t<a.length;t++){let n=e.createBiquadFilter();n.type=`bandpass`,n.frequency.value=this._f(this.frequency*(2*t+1)),n.Q.value=this.fallbackQ;let r=e.createGain();r.gain.value=a[t]/i*o,this.inGain.connect(n),n.connect(r),r.connect(this.wetGain),this.modes.push({bp:n,g:r,order:2*t+1})}}this._nodeCount=this._countNodes()}get input(){return this.inGain}get output(){return this.out}_f(e){return G(K(e,d_),d_,this.fMax)}_tunedDelay(e,t){return v_(G(K(e,d_),d_,this.fMax),G(K(t,150),20,.49*this.sampleRate),this.loopQ,this.sampleRate)}_fbMag(e){return G(this.reflection*(.92+.08*G(e,0,1)),0,p_)}_heatScale(e){let t=G(K(e&&e.load,0),0,1),n=G(K(e&&e.rpmNorm,0),0,1),r=G(.6*t+.4*n,0,1);return 1+this.thermalSpan*(r-this.thermalBias)}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=this._heatScale(e);if(this.mode===`delay`){let e=G(this.nominalDelay/r,this.minLoopDelay,this.maxDelayTime);g_(this.delay.delayTime,e,t,h_),g_(this.loopLP.frequency,this._f(this.lpBase*r*(1+.35*n)),t,m_),g_(this.fb.gain,-this._fbMag(n),t,m_)}else for(let e=0;e<this.modes.length;e++){let n=this.modes[e];g_(n.bp.frequency,this._f(this.frequency*n.order*r),t,h_)}}_countNodes(){let e=4;return this.mode===`delay`?e+=4:e+=this.modes.length*2,e}dispose(){if(this.disposed)return;this.disposed=!0;let e=[this.inGain,this.out,this.dryGain,this.wetGain,this.sum,this.delay,this.loopLP,this.fb];if(this.modes)for(let t of this.modes)e.push(t.bp,t.g);for(let t of e)t&&t.disconnect&&t.disconnect()}},C_=class e{constructor(t,n,r={}){this.ctx=t,this.profile=n,this.disposed=!1;let i=n&&n.exhaust||{},a=Array.isArray(r.chambers)?r.chambers:Array.isArray(i.muffler)?i.muffler:[.3,.2,.13];this.chambers=a.map(e=>G(K(e,.2),.02,3)),this.gasTemp=G(K(r.gasTempFactor,K(n&&n.gasTempFactor,1)),.5,2.5),this.sampleRate=K(t&&t.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.thermalSpan=G(K(r.thermalSpan,.025),0,.2),this.thermalBias=.35;let o=this.chambers.map(e=>Pg(e,this.gasTemp));this.spread=G(K(r.spread,.06),0,.25);let s=r.decorrelate!==!1,c=e.peakCoincidence(o);this.delays=s?e._decorrelate(o,this.spread):o.slice();let l=e.peakCoincidence(this.delays);this.coincidence={before:c,after:l},this.notches=this.delays.map(e=>1/(2*e));let u=G(K(i.reflection,.5),0,1);this.branchGain=G(K(r.branchGain,.55+.3*u),.05,.9);let d=G(K(r.packingOctaves,7),1,40);this.packingBase=G(Ng(Math.max(...this.chambers),this.gasTemp)*d,500,11e3),this.inGain=t.createGain(),this.inGain.gain.value=1,this.out=t.createGain(),this.out.gain.value=1,this.stages=[];let f=this.inGain;for(let e=0;e<this.delays.length;e++){let n=this.delays[e],r=t.createGain();r.gain.value=1;let i=t.createGain();i.gain.value=1;let a=Math.max(.005,n/(1-this.thermalSpan)*1.5),o=t.createDelay(a);o.delayTime.value=G(n,0,a);let s=t.createGain();s.gain.value=this.branchGain*.92**e,f.connect(i),i.connect(r),f.connect(o),o.connect(s),s.connect(r),this.stages.push({sum:r,thru:i,delay:o,branch:s,T:n,maxT:a,taper:.92**e}),f=r}this.packing=t.createBiquadFilter(),this.packing.type=`lowpass`,this.packing.frequency.value=G(this.packingBase,d_,this.fMax),this.packing.Q.value=.6;let p=1;for(let e of this.stages)p*=1+e.branch.gain.value;this.trim=t.createGain(),this.trim.gain.value=1/Math.max(1,p*.72),f.connect(this.packing),this.packing.connect(this.trim),this.trim.connect(this.out),this._nodeCount=4+this.stages.length*4}get input(){return this.inGain}get output(){return this.out}static peakCoincidence(e,t=6,n=45){let r=0;for(let i=0;i<e.length;i++)for(let a=i+1;a<e.length;a++)for(let o=1;o<=t;o++)for(let s=1;s<=t;s++){let t=o/e[i],c=s/e[a];if(t>8e3||c>8e3)continue;let l=(t-c)/n;r+=Math.exp(-l*l)/(o*s)}return r}static _decorrelate(t,n){let r=t.slice();for(let i=1;i<r.length;i++){let a=r[i],o=1/0;for(let s=0;s<41;s++){let c=1+n*(2*s/40-1),l=r.slice(0,i+1);l[i]=t[i]*c;let u=e.peakCoincidence(l);u<o-1e-12&&(o=u,a=t[i]*c)}r[i]=a}return r}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.rpmNorm,0),0,1),i=G(.6*n+.4*r,0,1),a=1+this.thermalSpan*(i-this.thermalBias);for(let r=0;r<this.stages.length;r++){let i=this.stages[r];g_(i.delay.delayTime,G(i.T/a,0,i.maxT),t,h_);let o=G(K(e&&e.valve,0),0,1);g_(i.branch.gain,G(this.branchGain*i.taper*(1-.12*n)*(1-.65*o),0,.95),t,m_)}let o=G(K(e&&e.valve,0),0,1);g_(this.packing.frequency,G(this.packingBase*(1+.3*n)*(1+1.1*o)*a,d_,this.fMax),t,m_)}dispose(){if(this.disposed)return;this.disposed=!0;let e=[this.inGain,this.out,this.packing,this.trim];for(let t of this.stages)e.push(t.sum,t.thru,t.delay,t.branch);for(let t of e)t&&t.disconnect&&t.disconnect()}},w_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1;let r=t&&t.intake||{};this.f0=G(K(n.helmholtz,K(r.helmholtz,110)),d_,2e3),this.q0=G(K(n.q,K(r.q,6)),.3,30),this.level=G(K(n.level,K(r.level,.33)),0,4),this.sampleRate=K(e&&e.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.out=e.createGain(),this.out.gain.value=this.level,this.inGain=e.createGain(),this.inGain.gain.value=1,this.helm=e.createBiquadFilter(),this.helm.type=`bandpass`,this.helm.frequency.value=this._f(this.f0),this.helm.Q.value=this.q0,this.helmGain=e.createGain(),this.helmGain.gain.value=0,this.inGain.connect(this.helm),this.helm.connect(this.helmGain),this.helmGain.connect(this.out),this.directLP=e.createBiquadFilter(),this.directLP.type=`lowpass`,this.directLP.frequency.value=this._f(this.f0*4),this.directLP.Q.value=.7,this.directGain=e.createGain(),this.directGain.gain.value=0,this.inGain.connect(this.directLP),this.directLP.connect(this.directGain),this.directGain.connect(this.out),this.noiseBuf=this._makeNoise(e,2),this.noiseSrc=W(e.createBufferSource()),this.noiseSrc.buffer=this.noiseBuf,this.noiseSrc.loop=!0,this.noiseHP=e.createBiquadFilter(),this.noiseHP.type=`highpass`,this.noiseHP.frequency.value=this._f(this.f0*.8),this.noiseHP.Q.value=.7,this.noiseBP=e.createBiquadFilter(),this.noiseBP.type=`bandpass`,this.noiseBP.frequency.value=this._f(this.f0*3),this.noiseBP.Q.value=.9,this.noiseGain=e.createGain(),this.noiseGain.gain.value=0,this.noiseSrc.connect(this.noiseHP),this.noiseHP.connect(this.noiseBP),this.noiseBP.connect(this.noiseGain),this.noiseGain.connect(this.out),this.noiseToHelm=e.createGain(),this.noiseToHelm.gain.value=0,this.noiseHP.connect(this.noiseToHelm),this.noiseToHelm.connect(this.helm),this.started=!1,this._nodeCount=10}get input(){return this.inGain}get output(){return this.out}_f(e){return G(K(e,d_),d_,this.fMax)}_makeNoise(e,t){let n=Math.max(1,Math.floor(K(e&&e.sampleRate,48e3)*t)),r=e.createBuffer(1,n,K(e&&e.sampleRate,48e3)),i=r.getChannelData(0),a=2654435769,o=0,s=0;for(let e=0;e<n;e++){a^=a<<13,a>>>=0,a^=a>>17,a^=a<<5,a>>>=0;let t=a/4294967296*2-1;o=.997*o+t*.0555179,s=.985*s+t*.3104856,i[e]=G((o+s+t*.1848)*.32,-1,1)}return r}start(e){if(!(this.started||this.disposed)){this.started=!0;try{this.noiseSrc.start(K(e,0))}catch{}}}update(e){if(this.disposed)return;this.started||this.start(K(e&&e.now,0));let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.throttle,0),0,1),i=G(K(e&&e.rpmNorm,0),0,1),a=G(K(e&&e.overrun,0),0,1),o=Math.max(n,.001)**.7,s=G(r*(.25+.75*i),0,1),c=G(a*(.15+.85*i),0,1);g_(this.helm.Q,G(this.q0*(.55+.45*r),.3,30),t,.05),g_(this.helm.frequency,this._f(this.f0),t,.1),g_(this.helmGain.gain,G((.12+.88*o)*(.35+.65*i),0,4),t,m_),g_(this.directGain.gain,G(.3*(.2+.8*o),0,4),t,m_),g_(this.noiseBP.frequency,this._f(this.f0*(3+9*s)*(1+.6*c)),t,m_),g_(this.noiseBP.Q,G(.9+.7*s,.3,6),t,.05),g_(this.noiseGain.gain,G(.42*s**1.2+.16*c,0,4),t,m_),g_(this.noiseToHelm.gain,G(.2*s+.05*c,0,2),t,m_),g_(this.out.gain,G(this.level,0,4),t,.1)}dispose(){if(this.disposed)return;this.disposed=!0;try{this.started&&this.noiseSrc.stop()}catch{}let e=[this.inGain,this.out,this.helm,this.helmGain,this.directLP,this.directGain,this.noiseSrc,this.noiseHP,this.noiseBP,this.noiseGain,this.noiseToHelm];for(let t of e)t&&t.disconnect&&t.disconnect()}},T_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1,this.maxDrive=G(K(n.maxDrive,4.5),1,40),this.idleDrive=G(K(n.idleDrive,1),.1,10);let r=G(K(n.kp,3.2),.5,12),i=G(K(n.kn,2),.5,12);this.sampleRate=K(e&&e.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.drive=e.createGain(),this.drive.gain.value=this.idleDrive,this.shaper=e.createWaveShaper(),this.shaper.curve=b_(r,i,4096),this.shaper.oversample=`4x`,this.span=e.createGain(),this.span.gain.value=1/x_(),this.dcBlock=e.createBiquadFilter(),this.dcBlock.type=`highpass`,this.dcBlock.frequency.value=G(22,d_,this.fMax),this.dcBlock.Q.value=.7,this.makeup=e.createGain(),this.makeup.gain.value=this._makeupFor(this.idleDrive),this.out=e.createGain(),this.out.gain.value=1,this.drive.connect(this.span),this.span.connect(this.shaper),this.shaper.connect(this.dcBlock),this.dcBlock.connect(this.makeup),this.makeup.connect(this.out),this._nodeCount=6}get input(){return this.drive}get output(){return this.out}_makeupFor(e){return G(1/Math.max(.05,e)**.7,.05,4)}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.rpmNorm,0),0,1),i=G(K(e&&e.boost,0),0,1),a=G(K(e&&e.overrun,0),0,1),o=G(n**1.5*(.55+.45*r)+.55*i*n,0,1.4),s=.25*a*(.3+.7*r)+.22*G(K(e&&e.valve,0),0,1)*(.4+.6*n),c=G(this.idleDrive+(this.maxDrive-this.idleDrive)*G(o+s,0,1),.1,this.maxDrive);g_(this.drive.gain,c,t,m_),g_(this.makeup.gain,this._makeupFor(c),t,m_)}dispose(){if(!this.disposed){this.disposed=!0;for(let e of[this.drive,this.span,this.shaper,this.dcBlock,this.makeup,this.out])e&&e.disconnect&&e.disconnect()}}},E_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1,this.sampleRate=K(e&&e.sampleRate,48e3),this.fMax=Math.min(f_,.49*this.sampleRate),this.boomHz=G(K(n.boomHz,62),20,300),this.panelHz=G(K(n.panelHz,155),40,800),this.extLP=G(K(n.exteriorLP,17e3),1e3,this.fMax),this.intLP=G(K(n.interiorLP,1050),120,8e3),this.intBoomDb=G(K(n.boomDb,6.5),0,18),this.intPanelDb=G(K(n.panelDb,3.5),0,18),this.intShelfDb=G(K(n.shelfDb,-11),-40,0),this.shelfHz=G(K(n.shelfHz,3200),500,this.fMax),this.position=G(K(n.position,0),0,1),this.target=this.position,this.inGain=e.createGain(),this.inGain.gain.value=1,this.boom=e.createBiquadFilter(),this.boom.type=`peaking`,this.boom.frequency.value=G(this.boomHz,d_,this.fMax),this.boom.Q.value=G(K(n.boomQ,3.2),.3,20),this.boom.gain.value=0,this.panel=e.createBiquadFilter(),this.panel.type=`peaking`,this.panel.frequency.value=G(this.panelHz,d_,this.fMax),this.panel.Q.value=G(K(n.panelQ,2.4),.3,20),this.panel.gain.value=0,this.lp=e.createBiquadFilter(),this.lp.type=`lowpass`,this.lp.frequency.value=G(this.extLP,d_,this.fMax),this.lp.Q.value=.6,this.shelf=e.createBiquadFilter(),this.shelf.type=`highshelf`,this.shelf.frequency.value=G(this.shelfHz,d_,this.fMax),this.shelf.gain.value=0,this.trim=e.createGain(),this.trim.gain.value=1,this.out=e.createGain(),this.out.gain.value=1,this.inGain.connect(this.boom),this.boom.connect(this.panel),this.panel.connect(this.lp),this.lp.connect(this.shelf),this.shelf.connect(this.trim),this.trim.connect(this.out),this._nodeCount=7,this._write(K(e.currentTime,0),.001)}get input(){return this.inGain}get output(){return this.out}setPerspective(e){return e===`interior`?this.setPosition(1):e===`exterior`&&this.setPosition(0),this}setPosition(e){return this.target=G(K(e,0),0,1),this.disposed||this._write(K(this.ctx.currentTime,0),.05),this}get perspective(){return this.target>=.5?`interior`:`exterior`}_write(e,t){let n=this.target,r=this.extLP*(this.intLP/this.extLP)**+n;g_(this.lp.frequency,G(r,d_,this.fMax),e,t),g_(this.boom.gain,this.intBoomDb*n,e,t),g_(this.panel.gain,this.intPanelDb*n,e,t),g_(this.shelf.gain,this.intShelfDb*n,e,t),g_(this.trim.gain,G(10**(-4.5*n/20),.05,1),e,t)}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0));this._write(t,.05),this.position=this.target}dispose(){if(!this.disposed){this.disposed=!0;for(let e of[this.inGain,this.boom,this.panel,this.lp,this.shelf,this.trim,this.out])e&&e.disconnect&&e.disconnect()}}},D_=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.disposed=!1;let r=t&&t.exhaust||{},i=t&&Array.isArray(t.banks)&&t.banks.length?t.banks:[[1]];t&&t.gasTempFactor,this.sampleRate=K(e&&e.sampleRate,48e3),this.bankLengths=i.map((e,t)=>t===1&&Number.isFinite(r.bankB)?r.bankB:K(r.bank,1.2)),this.collectorNode=e.createGain(),this.collectorNode.gain.value=1/Math.sqrt(i.length);let a=n.transit!==!1;this.banks=[],this.transits=[],this.inputs=[];for(let r=0;r<i.length;r++){let i=new S_(e,t,Object.assign({length:this.bankLengths[r]},n.bankOpts));if(this.banks.push(i),this.inputs.push(i.input),a){let t=i.nominalDelay/2,n=Math.max(.005,t*2),r=e.createDelay(n);r.delayTime.value=G(t,0,n),i.output.connect(r),r.connect(this.collectorNode),this.transits.push({d:r,t,maxT:n})}else i.output.connect(this.collectorNode),this.transits.push(null)}this.collector=new S_(e,t,Object.assign({length:K(r.collector,1),reflection:G(K(r.reflection,.5)*.7,0,p_),damping:G(K(r.damping,.4)*1.5,.05,2)},n.collectorOpts)),this.collectorNode.connect(this.collector.input),this.muffler=new C_(e,t,n.mufflerOpts),this.collector.output.connect(this.muffler.input),this.useNonlinearity=n.nonlinearity!==!1,this.out=e.createGain(),this.out.gain.value=1,this.useNonlinearity?(this.nonlinearity=new T_(e,t,n.nonlinearityOpts),this.muffler.output.connect(this.nonlinearity.input),this.nonlinearity.output.connect(this.out)):(this.nonlinearity=null,this.muffler.output.connect(this.out)),this._thermalSpan=this.banks.length?this.banks[0].thermalSpan:.05,this._thermalBias=this.banks.length?this.banks[0].thermalBias:.35,this.report={bankLengths:this.bankLengths.slice(),bankFrequencies:this.banks.map(e=>e.frequency),bankModes:this.banks.map(e=>e.mode),collectorFrequency:this.collector.frequency,collectorMode:this.collector.mode,mufflerNotches:this.muffler.notches.slice(),transitSkewMs:this.transits[0]&&this.transits[1]?Math.abs(this.transits[0].t-this.transits[1].t)*1e3:0},this._nodeCount=this._countNodes()}get input(){return this.inputs[0]}get output(){return this.out}update(e){if(this.disposed)return;let t=K(e&&e.now,K(this.ctx.currentTime,0)),n=G(K(e&&e.load,0),0,1),r=G(K(e&&e.rpmNorm,0),0,1),i=G(.6*n+.4*r,0,1),a=1+this._thermalSpan*(i-this._thermalBias);for(let n=0;n<this.banks.length;n++){this.banks[n].update(e);let r=this.transits[n];r&&g_(r.d.delayTime,G(r.t/a,0,r.maxT),t,h_)}this.collector.update(e),this.muffler.update(e),this.nonlinearity&&this.nonlinearity.update(e)}_countNodes(){let e=2;for(let t of this.banks)e+=t._nodeCount;for(let t of this.transits)t&&(e+=1);return e+=this.collector._nodeCount+this.muffler._nodeCount,this.nonlinearity&&(e+=this.nonlinearity._nodeCount),e}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.banks)e.dispose();for(let e of this.transits)e&&e.d.disconnect&&e.d.disconnect();this.collector.dispose(),this.muffler.dispose(),this.nonlinearity&&this.nonlinearity.dispose();for(let e of[this.collectorNode,this.out])e&&e.disconnect&&e.disconnect()}}},O_=3800,k_=-5.5,A_=1150,j_=.02,M_=10,N_=2e4,P_=.004;function q(e,t,n){return e<t?t:e>n?n:e}function J(e,t){return typeof e==`number`&&isFinite(e)?e:t}function F_(e,t){return q(J(e,t),M_,N_)}function I_(e,t,n,r){e.setTargetAtTime(J(t,0),J(n,0),r>0?r:j_)}function L_(e,t,n,r,i){e.setTargetAtTime(F_(t,i===void 0?M_:i),J(n,0),r>0?r:j_)}function R_(e){let t=e>>>0||1;return function(){return t^=t<<13,t>>>=0,t^=t>>17,t^=t<<5,t>>>=0,t/4294967296}}var z_=new WeakMap;function B_(e,t){let n=z_.get(e);if(n||(n={},z_.set(e,n)),n[t])return n[t];let r=J(e.sampleRate,48e3),i=Math.max(1024,Math.floor(r*2)),a=e.createBuffer(1,i,r),o=a.getChannelData(0),s=R_(t===`pink`?2654435769:2246822507);if(t===`pink`){let e=0,t=0,n=0,r=0,a=0,c=0,l=0;for(let u=0;u<i;u++){let i=s()*2-1;e=.99886*e+i*.0555179,t=.99332*t+i*.0750759,n=.969*n+i*.153852,r=.8665*r+i*.3104856,a=.55*a+i*.5329522,c=-.7616*c-i*.016898,o[u]=(e+t+n+r+a+c+l+i*.5362)*.11,l=i*.115926}}else for(let e=0;e<i;e++)o[e]=s()*2-1;let c=Math.min(2048,i>>2);for(let e=0;e<c;e++){let t=e/c;o[e]=o[e]*t+o[i-c+e]*(1-t)}return n[t]=a,a}function V_(e,t,n){let r=W(e.createBufferSource());r.buffer=B_(e,t),r.loop=!0;try{r.start(0,J(n,0)),r.__started=!0}catch{}return r}function H_(e,t,n,r){let i=e.createGain();return i.gain.value=n,t.connect(i),i.connect(r),i}function U_(e,t){let n=J(t,0);for(let t=0;t<e.length;t++){let r=e[t];if(r&&!r.__started)try{r.start(n),r.__started=!0}catch{}}}function W_(e,t){for(let n=0;n<e.length;n++){try{e[n].stop(J(t,0))}catch{}try{e[n].disconnect()}catch{}}}function G_(e){for(let t=0;t<e.length;t++)try{e[t].disconnect()}catch{}}var K_=class{constructor(e,t,n){this.ctx=e,this.profile=t;let r=n||{};this.level=J(r.level,1),this.gearCut=r.gearCut===`straight`?`straight`:`helical`,this.driveshaftScale=typeof r.driveshaftScale==`number`&&isFinite(r.driveshaftScale)?r.driveshaftScale:`auto`,this._scale=0,this._srcs=[],this._nodes=[];let i=e=>(this._nodes.push(e),e);this.out=i(e.createGain()),this.out.gain.value=this.level;let a=V_(e,`white`,.71),o=V_(e,`pink`,1.31);this._srcs.push(a,o),this.meshOsc1=W(e.createOscillator()),this.meshOsc1.type=`sine`,this.meshOsc1.frequency.value=500,this.meshOsc2=W(e.createOscillator()),this.meshOsc2.type=`sine`,this.meshOsc2.frequency.value=1e3,this.runoutOsc=W(e.createOscillator()),this.runoutOsc.type=`sine`,this.runoutOsc.frequency.value=20,this._srcs.push(this.meshOsc1,this.meshOsc2,this.runoutOsc),this.meshH2=i(e.createGain()),this.meshH2.gain.value=this.gearCut===`straight`?.55:.2,this.meshBP=i(e.createBiquadFilter()),this.meshBP.type=`bandpass`,this.meshBP.frequency.value=500,this.meshBP.Q.value=this.gearCut===`straight`?9:3.5,this.meshNoiseG=i(e.createGain()),this.meshNoiseG.gain.value=this.gearCut===`straight`?.22:.6,this.meshAM=i(e.createGain()),this.meshAM.gain.value=.85,i(H_(e,this.runoutOsc,.15,this.meshAM.gain)),this.meshGain=i(e.createGain()),this.meshGain.gain.value=0,this.meshOsc1.connect(this.meshAM),this.meshOsc2.connect(this.meshH2),this.meshH2.connect(this.meshAM),a.connect(this.meshBP),this.meshBP.connect(this.meshNoiseG),this.meshNoiseG.connect(this.meshAM),this.meshAM.connect(this.meshGain),this.meshGain.connect(this.out),this.ratBP1=i(e.createBiquadFilter()),this.ratBP1.type=`bandpass`,this.ratBP1.frequency.value=1800,this.ratBP1.Q.value=2,this.ratBP2=i(e.createBiquadFilter()),this.ratBP2.type=`bandpass`,this.ratBP2.frequency.value=3600,this.ratBP2.Q.value=2.5,this.ratH2=i(e.createGain()),this.ratH2.gain.value=.5,this.ratAM=i(e.createGain()),this.ratAM.gain.value=.4,this.torsOsc=W(e.createOscillator()),this.torsOsc.type=`sawtooth`,this.torsOsc.frequency.value=60,this._srcs.push(this.torsOsc),i(H_(e,this.torsOsc,.6,this.ratAM.gain)),this.ratGain=i(e.createGain()),this.ratGain.gain.value=0,o.connect(this.ratBP1),o.connect(this.ratBP2),this.ratBP1.connect(this.ratAM),this.ratBP2.connect(this.ratH2),this.ratH2.connect(this.ratAM),this.ratAM.connect(this.ratGain),this.ratGain.connect(this.out),this.setVehicle(r.vehicle,r.gearTeeth,r.finalDrive),this.setProfile(t)}get input(){return null}get output(){return this.out}setVehicle(e,t,n){let r=e||null,i=t||r&&r.gearTeeth||null;this.teeth=i&&i.length?i:[37,31,27,24,22,20],this.finalDrive=q(J(n,J(r&&r.finalDrive,3.9)),1,12),this._scale=0}setProfile(e){this.profile=e,this.cyl=q(J(e&&e.cylinders,4),1,16),this.idleRpm=J(e&&e.idleRpm,800)}_shaftRpm(e){let t=Math.abs(J(e.wheelRpm,0));if(this.driveshaftScale!==`auto`)return t*this.driveshaftScale;if(this._scale===0){let n=J(e.gearRatio,0),r=J(e.rpm,0);if(n>.05&&t>50&&r>200&&J(e.clutchEngaged,0)>.9){let e=r/t,i=Math.abs(e-n),a=Math.abs(e-n/this.finalDrive);this._scale=i<a?this.finalDrive:1}}return t*(this._scale||1)}meshFrequency(e,t){let n=Math.round(J(e,0))-1;return n<0||n>=this.teeth.length?0:Math.abs(J(t,0))/60*J(this.teeth[n],0)}update(e){let t=J(e.now,0),n=Math.round(J(e.gear,0)),r=q(J(e.load,0),0,1),i=Math.max(0,J(e.rpm,0)),a=J(e.f0,i/120),o=q(J(e.clutchEngaged,0),0,1),s=e.shiftPhase||``,c=this._shaftRpm(e),l=this.meshFrequency(n,c),u=0;if(l>0){let e=1/(1+(l/1800)**2.4);u=q((l-30)/40,0,1)*e}let d=J(e.torqueSign,1)>=0?.22+.85*r:.34,f=+(n>0&&Math.abs(J(e.gearRatio,0))>.001),p=s===`open`||s===`sync`||s===`cut`?.05:1,m=.45+.55*q(c/2500,0,1),h=.065*(this.gearCut===`straight`?1:.42)*f*o*p*d*u*m;L_(this.meshOsc1.frequency,l,t,j_,500),L_(this.meshOsc2.frequency,l*2,t,j_,1e3);let g=this.gearCut===`straight`?.55:.2;I_(this.meshH2.gain,g/(1+(l*2/2600)**2.4),t,j_),L_(this.meshBP.frequency,l,t,j_,500),L_(this.runoutOsc.frequency,c/60*2,t,j_,M_),I_(this.meshGain.gain,h,t,j_);let _=q(Math.abs(J(e.dRpm,0))/4e3,0,1),v=q(Math.abs(J(e.clutchSlip,0))/800,0,1),y=o*q(1-(i-this.idleRpm)/Math.max(200,this.idleRpm*1.6),0,1)*(1-.7*r)*(f?.4:1),b=1-.65*r*f,x=q(.5*y+.75*_+.7*v,0,1)*b;L_(this.torsOsc.frequency,this.cyl*a,t,j_,M_),I_(this.ratGain.gain,.09*x*q(i/Math.max(1,this.idleRpm*.6),0,1),t,j_)}start(e){U_(this._srcs,e)}dispose(){let e=J(this.ctx.currentTime,0);W_(this._srcs,e),G_(this._nodes),this._srcs.length=0}},q_=e=>e<.1,J_=class e{static supports(e){return!!(e&&e.turbo)}constructor(t,n,r){this.ctx=t;let i=r||{};this.level=J(i.level,1),this.maxTurboRpm=J(i.maxTurboRpm,15e4),this.flutterMode=i.flutter!==!1,this.surgeLevel=q(J(i.surgeLevel,1),0,3),this.spool=0,this.boost=0,this.boostBar=0,this.turboRpm=0,this._vent=0,this._surge=0,this._climb=0,this._liftRate=13,this._liftPitch=1,this._liftTau=.26,this._lastBov=-1e9,this._prevThrottle=0,this._prevShifting=!1,this._rnd=R_(1374496523),this._srcs=[],this._nodes=[];let a=e=>(this._nodes.push(e),e);if(this.out=a(t.createGain()),this.out.gain.value=this.level,this._graphBuilt=!1,this.setProfile(n),!e.supports(n))return;this.bus=a(t.createGain()),this.airLP=a(t.createBiquadFilter()),this.airLP.type=`lowpass`,this.airLP.frequency.value=O_,this.airLP.Q.value=-3.01,this.airShelf=a(t.createBiquadFilter()),this.airShelf.type=`highshelf`,this.airShelf.frequency.value=2600,this.airShelf.gain.value=k_,this.bus.connect(this.airLP),this.airLP.connect(this.airShelf),this.airShelf.connect(this.out);let o=V_(t,`white`,1.07);this._srcs.push(o),this.whineOsc=W(t.createOscillator()),this.whineOsc.setPeriodicWave(X_(t)),this.whineOsc.frequency.value=1200,this._srcs.push(this.whineOsc),this.whineBP=a(t.createBiquadFilter()),this.whineBP.type=`bandpass`,this.whineBP.frequency.value=1500,this.whineBP.Q.value=1.5,this.whineGain=a(t.createGain()),this.whineGain.gain.value=0,this.whineDrive=a(t.createGain()),this.whineDrive.gain.value=1,this.whineShaper=a(t.createWaveShaper()),this.whineShaper.curve=Z_(1024,.55),this.whineShaper.oversample=`4x`,this.whineOsc.connect(this.whineDrive),this.whineDrive.connect(this.whineShaper),this.whineShaper.connect(this.whineBP),this.whineBP.connect(this.whineGain),this.whineGain.connect(this.bus);let s=V_(t,`pink`,.29);this._srcs.push(s),this.grainBP=a(t.createBiquadFilter()),this.grainBP.type=`bandpass`,this.grainBP.frequency.value=55,this.grainBP.Q.value=.6,this.grainDepth=a(t.createGain()),this.grainDepth.gain.value=0,s.connect(this.grainBP),this.grainBP.connect(this.grainDepth),this.grainDepth.connect(this.whineGain.gain),this.wander1=W(t.createOscillator()),this.wander1.type=`sine`,this.wander1.frequency.value=.31,this.wander2=W(t.createOscillator()),this.wander2.type=`sine`,this.wander2.frequency.value=2.17,this._srcs.push(this.wander1,this.wander2),this.wanderDepth1=a(H_(t,this.wander1,0,this.whineOsc.detune)),this.wanderDepth2=a(H_(t,this.wander2,0,this.whineOsc.detune)),this.shaftOsc=W(t.createOscillator()),this.shaftOsc.type=`sine`,this.shaftOsc.frequency.value=180,this._srcs.push(this.shaftOsc),this.shaftDepth=a(t.createGain()),this.shaftDepth.gain.value=0,this.shaftOsc.connect(this.shaftDepth),this.shaftDepth.connect(this.whineGain.gain),this.hissBP=a(t.createBiquadFilter()),this.hissBP.type=`bandpass`,this.hissBP.frequency.value=2e3,this.hissBP.Q.value=.8,this.hissGain=a(t.createGain()),this.hissGain.gain.value=0,o.connect(this.hissBP),this.hissBP.connect(this.hissGain),this.hissGain.connect(this.bus),this.hissGrain=a(t.createGain()),this.hissGrain.gain.value=0,this.grainBP.connect(this.hissGrain),this.hissGrain.connect(this.hissGain.gain),this.whineNoiseBP=a(t.createBiquadFilter()),this.whineNoiseBP.type=`bandpass`,this.whineNoiseBP.frequency.value=800,this.whineNoiseBP.Q.value=6,this.whineNoiseGain=a(t.createGain()),this.whineNoiseGain.gain.value=0,o.connect(this.whineNoiseBP),this.whineNoiseBP.connect(this.whineNoiseGain),this.whineNoiseGain.connect(this.bus);let c=V_(t,`pink`,1.31);this._srcs.push(c),this.airflowHP=a(t.createBiquadFilter()),this.airflowHP.type=`highpass`,this.airflowHP.frequency.value=280,this.airflowHP.Q.value=.5,this.airflowLP=a(t.createBiquadFilter()),this.airflowLP.type=`lowpass`,this.airflowLP.frequency.value=1400,this.airflowLP.Q.value=.5,this.airflowGain=a(t.createGain()),this.airflowGain.gain.value=0,c.connect(this.airflowHP),this.airflowHP.connect(this.airflowLP),this.airflowLP.connect(this.airflowGain),this.airflowGain.connect(this.bus),this.bovBP=a(t.createBiquadFilter()),this.bovBP.type=`bandpass`,this.bovBP.frequency.value=2400,this.bovBP.Q.value=7,this.bovGain=a(t.createGain()),this.bovGain.gain.value=0,o.connect(this.bovBP),this.bovBP.connect(this.bovGain),this.bovGain.connect(this.bus),this.wgBP=a(t.createBiquadFilter()),this.wgBP.type=`bandpass`,this.wgBP.frequency.value=1500,this.wgBP.Q.value=.6,this.wgLevel=a(t.createGain()),this.wgLevel.gain.value=0,this.wgOsc=W(t.createOscillator()),this.wgOsc.type=`sawtooth`,this.wgOsc.frequency.value=24,this._srcs.push(this.wgOsc),this.wgShaper=a(t.createWaveShaper()),this.wgShaper.curve=Q_(1024),this.wgShaper.oversample=`2x`,this.wgAM=a(t.createGain()),this.wgAM.gain.value=.05,this.wgOsc.connect(this.wgShaper),this.wgShaper.connect(this.wgAM.gain),o.connect(this.wgBP),this.wgBP.connect(this.wgAM),this.wgAM.connect(this.wgLevel),this.wgLevel.connect(this.bus),this.wgJitter=a(t.createGain()),this.wgJitter.gain.value=6,this.grainBP.connect(this.wgJitter),this.wgJitter.connect(this.wgOsc.frequency),this.wgGrain=a(t.createGain()),this.wgGrain.gain.value=0,this.grainBP.connect(this.wgGrain),this.wgGrain.connect(this.wgLevel.gain),this.hiOsc=W(t.createOscillator()),this.hiOsc.type=`sine`,this.hiOsc.frequency.value=6e3,this._srcs.push(this.hiOsc),this.hiGain=a(t.createGain()),this.hiGain.gain.value=0,this.hiOsc.connect(this.hiGain),this.hiGain.connect(this.out),this.hiGrain=a(t.createGain()),this.hiGrain.gain.value=0,this.grainBP.connect(this.hiGrain),this.hiGrain.connect(this.hiGain.gain),this.hiWander=a(H_(t,this.wander2,0,this.hiOsc.detune)),this.buzzOsc=W(t.createOscillator()),this.buzzOsc.type=`sawtooth`,this.buzzOsc.frequency.value=60,this._srcs.push(this.buzzOsc),this.buzzBP=a(t.createBiquadFilter()),this.buzzBP.type=`bandpass`,this.buzzBP.frequency.value=1500,this.buzzBP.Q.value=1.2,this.buzzGain=a(t.createGain()),this.buzzGain.gain.value=0,this.buzzOsc.connect(this.buzzBP),this.buzzBP.connect(this.buzzGain),this.buzzGain.connect(this.bus),this.bovHissHP=a(t.createBiquadFilter()),this.bovHissHP.type=`highpass`,this.bovHissHP.frequency.value=1800,this.bovHissHP.Q.value=-3.01,this.bovHissGain=a(t.createGain()),this.bovHissGain.gain.value=0,o.connect(this.bovHissHP),this.bovHissHP.connect(this.bovHissGain),this.bovHissGain.connect(this.bus),this.surgeOsc=W(t.createOscillator()),this.surgeOsc.type=`sawtooth`,this.surgeOsc.frequency.value=16,this._srcs.push(this.surgeOsc),this.surgeShaper=a(t.createWaveShaper()),this.surgeShaper.curve=Q_(1024),this.surgeShaper.oversample=`2x`,this.surgeOsc.connect(this.surgeShaper),this.surgeBus=a(t.createGain()),this.surgeBus.gain.value=.7,this.surgeLP=a(t.createBiquadFilter()),this.surgeLP.type=`lowpass`,this.surgeLP.frequency.value=6500,this.surgeLP.Q.value=-3.01,this.surgeBus.connect(this.surgeLP),this.surgeLP.connect(this.out),this.whooshBP=a(t.createBiquadFilter()),this.whooshBP.type=`bandpass`,this.whooshBP.frequency.value=5e3,this.whooshBP.Q.value=.7,this.whooshGain=a(t.createGain()),this.whooshGain.gain.value=0,o.connect(this.whooshBP),this.whooshBP.connect(this.whooshGain),this.whooshGain.connect(this.surgeLP),this.whooshGrain=a(t.createGain()),this.whooshGrain.gain.value=0,this.grainBP.connect(this.whooshGrain),this.whooshGrain.connect(this.whooshGain.gain),this.surgeSend=a(t.createGain()),this.surgeSend.gain.value=.55,this.surgeJitter=a(t.createGain()),this.surgeJitter.gain.value=0,this.grainBP.connect(this.surgeJitter),this.surgeJitter.connect(this.surgeOsc.frequency),this.surgeBody=a(t.createBiquadFilter()),this.surgeBody.type=`bandpass`,this.surgeBody.frequency.value=3e3,this.surgeBody.Q.value=1.1,this.surgeBodyAM=a(t.createGain()),this.surgeBodyAM.gain.value=0,this.surgeBodyLvl=a(t.createGain()),this.surgeBodyLvl.gain.value=0,o.connect(this.surgeBody),this.surgeBody.connect(this.surgeBodyAM),this.surgeBodyAM.connect(this.surgeBodyLvl),this.surgeBodyLvl.connect(this.surgeBus),this.surgeBodyLvl.connect(this.surgeSend),this.surgeBodyDepth=a(t.createGain()),this.surgeBodyDepth.gain.value=1,this.surgeShaper.connect(this.surgeBodyDepth),this.surgeBodyDepth.connect(this.surgeBodyAM.gain),this.surgeChirp=a(t.createGain()),this.surgeChirp.gain.value=0,this.surgeShaper.connect(this.surgeChirp),this.fwOsc=W(t.createOscillator()),this.fwOsc.type=`sine`,this.fwOsc.frequency.value=7e3,this._srcs.push(this.fwOsc),this.fwBP=a(t.createBiquadFilter()),this.fwBP.type=`bandpass`,this.fwBP.frequency.value=7e3,this.fwBP.Q.value=3,this.fwNoise=a(t.createGain()),this.fwNoise.gain.value=3.2,this.fwTone=a(t.createGain()),this.fwTone.gain.value=.2,o.connect(this.fwBP),this.fwBP.connect(this.fwNoise),this.hiSurgeAM=a(t.createGain()),this.hiSurgeAM.gain.value=0,this.hiSurgeLvl=a(t.createGain()),this.hiSurgeLvl.gain.value=0,this.fwOsc.connect(this.fwTone),this.fwTone.connect(this.hiSurgeAM),this.fwNoise.connect(this.hiSurgeAM),this.hiSurgeAM.connect(this.hiSurgeLvl),this.hiSurgeLvl.connect(this.out),this.surgeShaper.connect(this.hiSurgeAM.gain),this.hiChirp=a(t.createGain()),this.hiChirp.gain.value=0,this.surgeShaper.connect(this.hiChirp),this.hiChirp.connect(this.fwOsc.frequency),this.hiChirpN=a(t.createGain()),this.hiChirpN.gain.value=0,this.surgeShaper.connect(this.hiChirpN),this.hiChirpN.connect(this.fwBP.frequency),this.surgeChirp.connect(this.surgeBody.frequency),this.surgeEdge=a(t.createBiquadFilter()),this.surgeEdge.type=`bandpass`,this.surgeEdge.frequency.value=5200,this.surgeEdge.Q.value=.8,this.surgeEdgeAM=a(t.createGain()),this.surgeEdgeAM.gain.value=0,this.surgeEdgeLvl=a(t.createGain()),this.surgeEdgeLvl.gain.value=0,o.connect(this.surgeEdge),this.surgeEdge.connect(this.surgeEdgeAM),this.surgeEdgeAM.connect(this.surgeEdgeLvl),this.surgeEdgeLvl.connect(this.surgeBus),this.surgeEdgeDepth=a(t.createGain()),this.surgeEdgeDepth.gain.value=1,this.surgeShaper.connect(this.surgeEdgeDepth),this.surgeEdgeDepth.connect(this.surgeEdgeAM.gain),this._graphBuilt=!0,this.enabled=!0}get input(){return null}get output(){return this.out}get state(){return{spool:this.spool,boost:this.boost,boostBar:this.boostBar,turboRpm:this.turboRpm,surge:this._surge}}setProfile(e){this.profile=e;let t=e&&e.turbo||null;this.turbo=t,this.enabled=!!t&&this._graphBuilt===!0,this.inertia=q(J(t&&t.inertia,.4),.05,3),this.maxBoost=q(J(t&&t.maxBoost,1),0,5),this.bovLevel=q(J(t&&t.bov,.5),0,2),this.surgeTrim=q(J(t&&t.surge,1),0,3),this.valve=Math.round(q(J(t&&t.valve,1),0,2)),this.flutterHz=q(J(t&&t.flutterHz,13),3,30),this.screamer=J(t&&t.screamer,0)>=.5,this.antiLag=J(t&&t.antiLag,0)>=.5;let n=J(e&&e.redlineRpm,7e3);this.boostRpm=Math.min(q(J(t&&t.boostRpm,3500),800,9e3),.65*n);let r=.5*J(t&&t.whineOrder,70);this.whineRef=q(n/120*r,200,A_)}update(e){if(!this.enabled)return;let t=J(e.now,0),n=q(J(e.dt,1/60),0,.25),r=q(J(e.load,0),0,1),i=q(J(e.throttle,0),0,1),a=q(J(e.rpmNorm,0),0,1),o=!!e.shifting;this._als=this.antiLag&&i<.12&&a>.15;let s=J(e.rpm,0),c=Math.max(.6*J(this.profile&&this.profile.redlineRpm,7e3),this.boostRpm+1500),l=q((s-this.boostRpm)/(c-this.boostRpm),0,1),u=e.limiter?Math.max(r,.95*i):r,d=this._als?.7*(.3+.7*a):q(u*(.08+.92*l),0,1),f=i<.12,p=q((d-this.spool)*3,0,1);this._climb+=(p-this._climb)*Math.min(1,n/.08);let m=d>this.spool?this.inertia*1.1:this.inertia*(f?.45:1.3),h=n>0?1-Math.exp(-n/Math.max(.001,m)):0;this.spool+=(d-this.spool)*h;let g=.04+.07*a;this.spool<g&&(this.spool=g),this.spool=q(J(this.spool,g),0,1),this._vent>0&&(this._vent*=Math.exp(-n/.18),this._vent<.001&&(this._vent=0));let _=this.spool*this.spool;this.boost=q(_*(1-.92*this._vent),0,1),this.boostBar=this.boost*this.maxBoost,this.turboRpm=this.spool*this.maxTurboRpm;let v=Math.max(120,this.whineRef*Math.max(.05,this.spool)**1.55);L_(this.whineOsc.frequency,v,t,j_,1e3),L_(this.whineBP.frequency,v*1.25,t,j_,1600),L_(this.whineNoiseBP.frequency,v,t,j_,800);let y=this.spool**2,b=q(Math.max(r,i*.7),0,1),x=.085*y*(.62+.38*b);I_(this.whineGain.gain,x,t,j_),I_(this.whineNoiseGain.gain,.3*y*(.5+.5*b),t,j_),I_(this.airflowGain.gain,.2*(.15+.85*this.spool)*this.spool*(.25+.75*b),t,.05),L_(this.airflowLP.frequency,900+1300*this.spool,t,j_,1400);let S=26*(1-.75*this.spool);I_(this.wanderDepth1.gain,S,t,.08),I_(this.wanderDepth2.gain,S*.4,t,.08);let C=.55-.3*this.spool;I_(this.grainDepth.gain,x*C,t,.05),I_(this.whineDrive.gain,.8+.9*this.spool,t,j_),L_(this.grainBP.frequency,28+120*this.spool,t,j_,55),L_(this.shaftOsc.frequency,q(v/11,4,400),t,j_,180),I_(this.shaftDepth.gain,x*(.52-.28*this.spool),t,j_);let w=q((this.spool-.4)/.3,0,1)*q((a-.4)/.3,0,1),T=w*i*(this.screamer?1.3:.7);L_(this.wgOsc.frequency,18+12*w+8*a,t,.05,24),L_(this.wgBP.frequency,(this.screamer?900:1400)+1300*this.spool,t,j_,1500),I_(this.wgLevel.gain,T,t,.05),I_(this.wgGrain.gain,T*.5,t,.05);let E=.1*y*(.45+.55*b);I_(this.hissGain.gain,E,t,j_),I_(this.hissGrain.gain,E*.65,t,.05),L_(this.hissBP.frequency,q(v*2.2,900,4200),t,j_,2e3);let D=.18*(q((this.boost-.12)/.45,0,1)*i*(1-.75*a)+.6*this._climb*Math.sqrt(this.spool));I_(this.whooshGain.gain,D,t,.04),I_(this.whooshGrain.gain,D*.6,t,.05),L_(this.whooshBP.frequency,q(4e3+3500*this.spool,3e3,8e3),t,j_,5e3);let O=.08*q((this.spool-.62)/.25,0,1)*b;L_(this.buzzOsc.frequency,q(v/11,20,400),t,j_,60),L_(this.buzzBP.frequency,q(v*1.5,400,6e3),t,j_,1500),I_(this.buzzGain.gain,O,t,j_),L_(this.hiOsc.frequency,q(5e3+8e3*this.spool**1.4,3e3,15e3),t,j_,6e3);let ee=.022*y*(.55+.45*b);I_(this.hiGain.gain,ee,t,j_),I_(this.hiGrain.gain,ee*.4,t,.05),I_(this.hiWander.gain,12*(1-.6*this.spool),t,.08);let te=q(J(e.evBov,0),0,1);te>0&&this._fireBov(t,te),this._stepSurge(t,n,i,a,o,e),this._prevLimiter=!!e.limiter,this._prevThrottle=i,this._prevShifting=o}_stepSurge(e,t,n,r,i,a){this._surge*=Math.exp(-t/this._liftTau),this._closedT=q_(n)?(this._closedT||0)+t:0,this._surge<.001&&(this._surge=0);let o=n<.1,s=o&&this._prevThrottle>=.25,c=this._prevThrottle-n>.2&&n<.5,l=i&&!this._prevShifting,u=this.flutterMode===!1||this.antiLag?0:1,d=q((this.spool-.12)/.28,0,1)*(this.valve===0?1:q(1-.9*this.bovLevel,.15,1))*u,f=a.gearbox===`dct`?.35:a.gearbox===`auto`?.15:1,p=s||c?d:l?d*f:0;if(p>0){if(this._surge<.1){let e=()=>this._rnd();this._liftRate=this.flutterHz*(.7+.45*r+.35*this.boost)*(.85+.3*e()),this._liftPitch=(.85+.25*r)*(.92+.16*e()),this._liftTau=.1+.1*e()+.04*this.boost}this._surge=Math.max(this._surge,p)}o&&d>.06&&this._closedT<.15&&(this._surge=Math.max(this._surge,d*.8));let m=n>.5||n>this._prevThrottle+.05;!o&&!i&&m&&(this._surge*=Math.exp(-t/.11));let h=q(this._surge,0,1),g=this._liftRate*(.7+.45*h);L_(this.surgeOsc.frequency,g,e,.03,16),L_(this.surgeBody.frequency,(2400+700*h+500*r)*this._liftPitch,e,.04,3e3),L_(this.surgeEdge.frequency,(4600+600*h+600*r)*this._liftPitch,e,.04,5200),I_(this.surgeChirp.gain,600*h,e,.04),I_(this.surgeJitter.gain,18*h,e,.04);let _=q(J(a.overrun,0),0,1),v=(.6+.4*r)*(.8+.3*_),y=this.surgeLevel*this.surgeTrim;I_(this.surgeBodyLvl.gain,6.5*y*h*v,e,.03),I_(this.surgeEdgeLvl.gain,.25*y*h*h*v,e,.03);let b=q(5500+3500*this.spool,4500,9500);L_(this.fwOsc.frequency,b,e,.03,7e3),L_(this.fwBP.frequency,b,e,.03,7e3),I_(this.hiSurgeLvl.gain,1.6*y*h*v,e,.03),I_(this.hiChirp.gain,900*h,e,.04),I_(this.hiChirpN.gain,900*h,e,.04)}release(){let e=J(this.ctx.currentTime,0);this.enabled=!1,this.out.gain.setTargetAtTime(0,e,.07),this.surgeSend.gain.setTargetAtTime(0,e,.07);for(let t of this._srcs)try{t.stop(e+.5)}catch{}this._srcs.length=0}_fireBov(e,t){if(this.valve===0)return;let n=this.valve===2,r=q(this.boost,0,1),i=q(this.bovLevel*1.35*t*(.15+.85*r)*(n?.3:1),5e-4,2.5),a=q(.11+.26*r,.05,.5),o=J(e,0)+P_,s=this.bovBP.frequency;s.cancelScheduledValues(o),s.setValueAtTime(F_((n?1300:2600)+1800*r,2800),o),s.exponentialRampToValueAtTime(F_((n?300:520)+180*r,620),o+a*.8);let c=this.bovBP.Q;c.cancelScheduledValues(o),c.setValueAtTime(n?1.5:4.5,o),c.linearRampToValueAtTime(n?3:11,o+a*.6);let l=this.bovHissGain.gain;l.cancelScheduledValues(o),n||(l.setValueAtTime(4e-4,o),l.linearRampToValueAtTime(i*.45,o+.008),l.exponentialRampToValueAtTime(4e-4,o+a*.9),l.setValueAtTime(0,o+a));let u=this.bovGain.gain;u.cancelScheduledValues(o),u.setValueAtTime(4e-4,o),u.linearRampToValueAtTime(i,o+.012),u.exponentialRampToValueAtTime(4e-4,o+a),u.setValueAtTime(0,o+a+.005),this._vent=q(this.bovLevel,.15,1),this.spool*=.97,this._lastBov=J(e,0)}start(e){U_(this._srcs,e)}dispose(){let e=J(this.ctx.currentTime,0);W_(this._srcs,e),G_(this._nodes),this._srcs.length=0,this.enabled=!1}},Y_=new WeakMap;function X_(e){let t=Y_.get(e);if(t)return t;let n=new Float32Array(11),r=new Float32Array(11);for(let e=1;e<=10;e++){let t=e%2?1.25:.8;r[e]=1/e**1.4*t}let i=e.createPeriodicWave(n,r,{disableNormalization:!1});return Y_.set(e,i),i}function Z_(e=1024,t=.55){let n=new Float32Array(e);for(let r=0;r<e;r++){let i=r/(e-1)*2-1,a=i>=0?2.4*(1+t):2.4*(1-t);n[r]=Math.tanh(a*i)/Math.tanh(a)}return n}function Q_(e=1024){let t=new Float32Array(e),n=.24;for(let r=0;r<e;r++){let i=r/(e-1),a=i<n?.5-.5*Math.cos(Math.PI*i/n):1;t[r]=a*Math.exp(-4.5*Math.max(0,i-n))}return t}var $_=Object.freeze({bang:Object.freeze({bus:`combustion`,fA:112,qA:1.6,fB:680,qB:2,mixB:.58,atk:.005,dec:.19,lvl:1}),crackle:Object.freeze({bus:`combustion`,fA:700,qA:3,fB:1850,qB:3.6,mixB:.62,atk:.003,dec:.055,lvl:.5}),clunk:Object.freeze({bus:`mechanical`,fA:330,qA:7,fB:1250,qB:6,mixB:.45,atk:.0035,dec:.075,lvl:.62}),thump:Object.freeze({bus:`mechanical`,fA:95,qA:2.2,fB:320,qB:3,mixB:.35,atk:.004,dec:.13,lvl:.8}),click:Object.freeze({bus:`mechanical`,fA:1500,qA:5,fB:2800,qB:6,mixB:.4,atk:.0018,dec:.02,lvl:.16})}),ev=class{constructor(e,t,n){this.ctx=e;let r=n||{};this.level=J(r.level,1),this.lookahead=q(J(r.lookahead,P_),0,.05),this.overrunCrackle=r.overrunCrackle!==!1,this.maxPerFrame=q(Math.round(J(r.maxPerFrame,18)),1,48),this.stolen=0,this.fired=0,this.pops=[],this._next=0,this._nextPop=0,this._prevPhase=``,this._syncClicks=0,this._rnd=R_(625341585),this._srcs=[],this._nodes=[];let i=e=>(this._nodes.push(e),e);this.out=i(e.createGain()),this.combOut=i(e.createGain()),this.makeup=q(J(r.makeup,9),1,40),this.out.gain.value=this.level*this.makeup,this.combOut.gain.value=this.level*this.makeup;let a=q(Math.round(J(r.voices,16)),2,40),o=Math.max(1,Math.round(a*.62));this.voices=Array(a),this.pools={combustion:[],mechanical:[]},this._cursor={combustion:0,mechanical:0};for(let t=0;t<a;t++){let n=V_(e,`white`,t*.137%1.9);this._srcs.push(n);let r=i(e.createBiquadFilter());r.type=`bandpass`,r.frequency.value=1e3,r.Q.value=6;let a=i(e.createBiquadFilter());a.type=`bandpass`,a.frequency.value=3e3,a.Q.value=8;let s=i(e.createGain());s.gain.value=.5;let c=i(e.createGain());c.gain.value=0;let l=t<o?`combustion`:`mechanical`;n.connect(r),n.connect(a),r.connect(c),a.connect(s),s.connect(c),c.connect(l===`combustion`?this.combOut:this.out);let u={bpA:r,bpB:a,mixB:s,gain:c,busyUntil:-1,bus:l};this.voices[t]=u,this.pools[l].push(u)}this.setProfile(t)}get input(){return null}get output(){return this.out}get combustionOutput(){return this.combOut}setProfile(e){this.profile=e;let t=q(J(e&&e.cylinders,6),1,16);this.cyl=t,this.idleRpm=J(e&&e.idleRpm,800),this.sizeF=(6/t)**.35,this.sizeA=(t/6)**.3,this.burstCount=q(1+Math.round(t/5),1,3)}trigger(e,t,n,r,i){let a=$_[e]||$_.click,o=J(this.ctx.currentTime,0),s=Math.max(J(t,o),o+this.lookahead),c=q(J(n,0)*a.lvl,8e-4,4),l=q(J(r,1),.2,5),u=q(a.dec*q(J(i,1),.2,6),.004,1.5),d=s+a.atk+u+.002,f=a.bus===`combustion`?`combustion`:`mechanical`,p=this.pools[f],m=p.length,h=-1;for(let e=0;e<m;e++){let t=(this._cursor[f]+e)%m;if(p[t].busyUntil<=s){h=t;break}}if(h<0){let e=0;for(let t=1;t<m;t++)p[t].busyUntil<p[e].busyUntil&&(e=t);h=e,this.stolen++}this._cursor[f]=(h+1)%m;let g=p[h];g.bpA.frequency.cancelScheduledValues(s),g.bpA.frequency.setValueAtTime(F_(a.fA*l,1e3),s),g.bpA.Q.setValueAtTime(J(a.qA,4),s),g.bpB.frequency.cancelScheduledValues(s),g.bpB.frequency.setValueAtTime(F_(a.fB*l,3e3),s),g.bpB.Q.setValueAtTime(J(a.qB,6),s),g.mixB.gain.cancelScheduledValues(s),g.mixB.gain.setValueAtTime(J(a.mixB,.5),s);let _=g.gain.gain;return _.cancelScheduledValues(s),_.setValueAtTime(4e-4,s),_.linearRampToValueAtTime(c,s+a.atk),_.exponentialRampToValueAtTime(4e-4,s+a.atk+u),_.setValueAtTime(0,d),g.busyUntil=d,this.fired++,f===`combustion`&&this.pops.length<64&&this.pops.push({time:s,amp:q(J(n,0),0,1)}),h}update(e){let t=J(e.now,0),n=Math.max(0,J(e.rpm,0)),r=q(J(e.rpmNorm,0),0,1),i=this._rnd,a=this.maxPerFrame,o=q(J(e.evCut,0),0,1);if(o>0&&a>0){let e=Math.min(a,this.burstCount),n=t+this.lookahead+i()*.008;for(let t=0;t<e;t++){let e=.72**t*(.55+.65*i()),s=q(.55*o*this.sizeA*e*(.5+.7*r),.001,1),c=t===0||i()<.45?`bang`:`crackle`;this.trigger(c,n,s,this.sizeF*(.75+.6*i()),.7+.8*i()),n+=.012+i()*.048,a--}}let s=q(J(e.evPop,0),0,1);if(s>0&&a>0){let e=i(),n=.5*s+.5*r,o;o=e<.34-.16*n?`crack`:e<.8-.1*n?`double`:`stutter`;let c=q(Math.round((1+6/Math.max(3,this.cyl))*(.6+.7*i())),2,3),l=Math.min(a,o===`crack`?1:o===`double`?2:c),u=o===`crack`?2.6:o===`double`?2:1.6,d=.42+1.05*i()*i(),f=t+this.lookahead+i()*.006;for(let e=0;e<l;e++){let t=.86**e*(.6+.8*i()),n=q(u*d*s*this.sizeA*t*(.5+.65*r),.001,2),c=e===0||i()<.5?`bang`:`crackle`,l=this.sizeF*(.62+.7*i())*(1-.22*s);this.trigger(c,f,n,l,.7+.9*i());let p=o===`stutter`?.55:1;f+=(.055+i()*.16)*(.6+4/Math.max(3,this.cyl))*p,a--}}let c=q(J(e.evLash,0),0,1);if(c>0&&a>0){let e=t+this.lookahead;this.trigger(`clunk`,e,q(.5*c,.001,1),.9+.25*i(),.8+.5*c),a--,c>.35&&a>0&&(this.trigger(`clunk`,e+.018+i()*.012,q(.16*c,.001,1),1.3,.5),a--)}let l=q(J(e.evEngage,0),0,1);l>0&&a>0&&(this.trigger(`thump`,t+this.lookahead,q(.45*l,.001,1),1,.8+.6*l),a--);let u=e.shiftPhase||``;u===`sync`?(this._prevPhase!==`sync`&&(this._syncClicks=0,this._syncNext=t),this._syncClicks<1&&t>=J(this._syncNext,t)&&a>0&&(this.trigger(`click`,t+this.lookahead,.3+.22*i(),.85+.4*i(),1),this._syncClicks++,this._syncNext=t+.035+i()*.03,a--)):this._prevPhase===`sync`&&(this._syncClicks=0),this._prevPhase=u;let d=q(J(e.overrun,0),0,1),f=e.popIntensity==null?d*.55:q(J(e.popIntensity,0),0,1);if(!(this.overrunCrackle&&f>.3&&n>this.idleRpm*1.5&&!e.shifting)){this._nextPop=t;return}this._nextPop<t&&(this._nextPop=t+.01+i()*.04);let p=t+.12,m=.35+1.2*f*(.35+.65*r)*(this.cyl/6);for(;this._nextPop<p&&a>0;){let e=Math.max(this._nextPop,t+this.lookahead),n=q(.3*f*this.sizeA*(.25+1.5*i()*i())*(.45+.55*r),.001,1);this.trigger(i()<.4?`bang`:`crackle`,e,n,this.sizeF*(.7+.9*i()),.6+.9*i()),this._nextPop=e+(.25+2.2*i()*i())/Math.max(.4,m),a--}this._nextPop<t&&(this._nextPop=t)}start(e){U_(this._srcs,e)}dispose(){let e=J(this.ctx.currentTime,0);W_(this._srcs,e),G_(this._nodes),this._srcs.length=0,this.voices.length=0}},tv=(e,t,n)=>e<t?t:e>n?n:e,nv=(e,t=0)=>typeof e==`number`&&isFinite(e)?e:t,rv=.02;function iv(e,t,n,r=rv){if(!e)return;let i=nv(t,0);e.setTargetAtTime(i,Math.max(0,nv(n,0)),r>0?r:rv)}function av(e,t,n){let r=Math.max(1,Math.floor(e.sampleRate*t)),i=e.createBuffer(1,r,e.sampleRate),a=i.getChannelData(0),o=0;for(let e=0;e<r;e++){let t=Math.random()*2-1;n?(o=(o+.02*t)/1.02,a[e]=o*3.5):a[e]=t}let s=Math.min(2048,r>>2);for(let e=0;e<s;e++){let t=e/s;a[e]=a[e]*t+a[r-s+e]*(1-t)}return i}var ov=class{constructor(e,t,n={}){this.ctx=e,this.profile=t,this.cyl=t.cylinders,this.pulseOrder=Math.max(.5,this.cyl/2/Math.max(1,t.banks.length)),this.src=W(e.createBufferSource()),this.src.buffer=av(e,2.7,!1),this.src.loop=!0,this.hp=e.createBiquadFilter(),this.hp.type=`highpass`,this.hp.frequency.value=55,this.body=e.createBiquadFilter(),this.body.type=`lowpass`,this.body.frequency.value=900,this.body.Q.value=.9,this.peak=e.createBiquadFilter(),this.peak.type=`peaking`,this.peak.frequency.value=140,this.peak.Q.value=1.4,this.peak.gain.value=7,this.level=e.createGain(),this.level.gain.value=0,this.pulse=W(e.createOscillator()),this.pulse.type=`sawtooth`,this.pulse.frequency.value=40,this.pulseDepth=e.createGain(),this.pulseDepth.gain.value=0,this.out=e.createGain(),this.out.gain.value=1,this.src.connect(this.hp),this.hp.connect(this.peak),this.peak.connect(this.body),this.body.connect(this.level),this.level.connect(this.out),this.pulse.connect(this.pulseDepth),this.pulseDepth.connect(this.level.gain),this.gain=tv(nv(n.gain,1),0,4),this.started=!1}get input(){return null}get output(){return this.out}start(e){if(!this.started){this.started=!0;try{this.src.start(e)}catch{}try{this.pulse.start(e)}catch{}}}stop(e){try{this.src.stop(e)}catch{}try{this.pulse.stop(e)}catch{}this.started=!1}update(e){let t=nv(e.now,0),n=tv(nv(e.rpmNorm,0),0,1),r=tv(nv(e.load,0),0,1),i=tv(nv(e.overrun,0),0,1),a=tv(tv(nv(e.f0,10),.05,4e3)*this.pulseOrder*2,10,6e3),o=.3+.7*r,s=this.gain*.28*o*(.25+.75*n)*(1+.35*i);iv(this.level.gain,s,t),iv(this.pulse.frequency,a,t),iv(this.pulseDepth.gain,Math.min(s*.85,s*(1.1-.7*n)),t),iv(this.peak.frequency,tv(a,30,2e3),t),iv(this.body.frequency,tv(450+2600*r+1800*n,120,9e3),t),iv(this.hp.frequency,tv(40+30*n,20,400),t)}dispose(){for(let e of[this.src,this.hp,this.peak,this.body,this.level,this.pulse,this.pulseDepth,this.out])e&&e.disconnect&&e.disconnect()}},sv=class{constructor(e,t,n={}){this.ctx=e,this.profile=t;let r=Math.max(.5,t.cylinders/4),i=(t.idleRpm+t.redlineRpm)/2/120;for(;r*i<38&&r<8;)r*=2;for(;r*i>85&&r>.5;)r/=2;this.order=r,this.subHz=r*i,this.osc=W(e.createOscillator()),this.osc.type=`sine`,this.osc.frequency.value=40,this.shaper=e.createWaveShaper(),this.shaper.curve=this._curve(),this.shaper.oversample=`2x`,this.tone=e.createBiquadFilter(),this.tone.type=`lowpass`,this.tone.frequency.value=220,this.tone.Q.value=.7,this.level=e.createGain(),this.level.gain.value=0,this.out=e.createGain(),this.out.gain.value=tv(nv(n.gain,1),0,4),this.osc.connect(this.shaper),this.shaper.connect(this.tone),this.tone.connect(this.level),this.level.connect(this.out),this.started=!1}_curve(e=2048){let t=new Float32Array(e);for(let n=0;n<e;n++){let r=n/(e-1)*2-1;t[n]=Math.tanh(1.8*r)*.92+.08*Math.tanh(2.6*r*r*Math.sign(r))}return t}get input(){return null}get output(){return this.out}start(e){if(!this.started){this.started=!0;try{this.osc.start(e)}catch{}}}stop(e){try{this.osc.stop(e)}catch{}this.started=!1}update(e){let t=nv(e.now,0),n=tv(nv(e.f0,10),.05,4e3),r=tv(nv(e.load,0),0,1),i=tv(nv(e.rpmNorm,0),0,1),a=tv(nv(e.overrun,0),0,1);iv(this.osc.frequency,tv(n*this.order,12,400),t);let o=.34*(.18+.82*r**.75)*(1-.45*i)*(1-.6*a);iv(this.level.gain,o,t),iv(this.tone.frequency,tv(150+260*r,80,800),t)}dispose(){for(let e of[this.osc,this.shaper,this.tone,this.level,this.out])e&&e.disconnect&&e.disconnect()}},cv=class{constructor(e,t,n={}){this.ctx=e,this.depthCents=tv(nv(n.detuneCents,7),0,60),this.depthGain=tv(nv(n.tremolo,.1),0,.6);let r=[.237,1.703,5.317];this.lfos=r.map(t=>{let n=W(e.createOscillator());n.type=`sine`,n.frequency.value=t;let i=e.createGain();return i.gain.value=1/r.length,n.connect(i),{osc:n,gain:i}}),this.rough=W(e.createBufferSource()),this.rough.buffer=av(e,3.1,!0),this.rough.loop=!0,this.roughLP=e.createBiquadFilter(),this.roughLP.type=`lowpass`,this.roughLP.frequency.value=22,this.roughGain=e.createGain(),this.roughGain.gain.value=.9,this.rough.connect(this.roughLP),this.roughLP.connect(this.roughGain),this.bus=e.createGain(),this.bus.gain.value=1;for(let e of this.lfos)e.gain.connect(this.bus);this.roughGain.connect(this.bus),this.detune=e.createGain(),this.detune.gain.value=0,this.tremolo=e.createGain(),this.tremolo.gain.value=0,this.bus.connect(this.detune),this.bus.connect(this.tremolo),this.started=!1}get input(){return null}get output(){return this.bus}setEventSource(e){this._event=e}start(e){if(!this.started){this.started=!0;for(let t of this.lfos)try{t.osc.start(e)}catch{}try{this.rough.start(e)}catch{}}}stop(e){for(let t of this.lfos)try{t.osc.stop(e)}catch{}try{this.rough.stop(e)}catch{}this.started=!1}update(e){let t=nv(e.now,0),n=tv(nv(e.rpmNorm,0),0,1),r=tv(nv(e.load,0),0,1),i=(1-n)*(1-.55*r),a=tv(nv(e.rough,0),0,1),o=+!this._event;iv(this.detune.gain,o*this.depthCents*(.25+.75*i)*(1+2.5*a),t,.08),iv(this.tremolo.gain,(this._event?.2:1)*this.depthGain*(.2+.8*i)*(1+1.5*a),t,.08),iv(this.roughLP.frequency,tv(8+40*n,4,200),t,.1)}dispose(){for(let e of this.lfos)e.osc.disconnect(),e.gain.disconnect();for(let e of[this.rough,this.roughLP,this.roughGain,this.bus,this.detune,this.tremolo])e&&e.disconnect&&e.disconnect()}},lv=Object.freeze([{id:`strain`,label:`Strain`,default:0,note:`Engine working against something — a climb, a trailer, a heavy car. More rumble, harder combustion, more growl, at the same throttle.`},{id:`aggression`,label:`Exhaust valve`,default:0,note:`Active exhaust bypass. Opens the muffler: shallower chambers, brighter packing, more rasp and more level.`},{id:`roughness`,label:`Roughness`,default:0,note:`Engine health. Cycle-to-cycle variation and random misfires — a skipped combustion event in the pipe.`},{id:`distance`,label:`Distance`,default:0,note:`Listener distance. Air absorption takes the top off, level falls, and the room takes over.`},{id:`environment`,label:`Enclosure`,default:0,note:`Open road → tunnel. Hard parallel walls: dense fluttering reflections and a longer tail.`}]),uv=Object.freeze(Object.fromEntries(lv.map(e=>[e.id,e.default]))),dv=(e,t,n)=>e<t?t:e>n?n:e,fv=60/(2*Math.PI),pv={manual:{cutF:.3,openF:.3,syncF:.15,engageF:.35,cutMin:.03,openMin:.035,syncMin:.018,engageMin:.05,openClutch:0,engageStart:0,cutDepth:1,cutBang:.85,blip:.85,blipTolRpm:130,lashMax:.17,shuffle:.36,openStretch:2.6},dct:{cutF:.3,openF:.25,syncF:.15,engageF:.6,cutMin:.012,openMin:.01,syncMin:.008,engageMin:.028,openClutch:.1,engageStart:.4,cutDepth:1,cutBang:1,blip:1,blipTolRpm:60,lashMax:.09,shuffle:.26,openStretch:2},auto:{cutF:.2,openF:.25,syncF:.18,engageF:.9,cutMin:.02,openMin:.025,syncMin:.018,engageMin:.09,openClutch:0,engageStart:.12,cutDepth:.55,cutBang:.15,blip:.35,blipTolRpm:220,lashMax:.2,shuffle:.42,openStretch:1.6}},mv=class{constructor(e={}){this.type=e.type in pv?e.type:`manual`,this.k=pv[this.type],this.S=Math.max(.02,(e.shiftTimeMs||120)/1e3),this.gearCount=e.gearCount||6,this.idleRpm=e.idleRpm||800,this.redlineRpm=e.redlineRpm||7e3,this.revMatch=e.revMatch!==!1,this.autoShift=e.autoShift!==!1,this.upFracLow=.55,this.upFracHigh=.936,this.downFracLow=.28,this.downFracHigh=.44,this.kickdownThrottle=.85,this.minShiftInterval=.35,this.tCut=0,this.tOpen=0,this.tSync=0,this.tEngage=0,this.reset()}reset(){this.phase=``,this.t=0,this.from=0,this.to=0,this.isDown=!1,this.revTargetW=0,this.sinceShift=999,this.contactSeen=!1,this.blipHeld=!1}get shifting(){let e=this.phase;return e===`cut`||e===`open`||e===`sync`||e===`engage`}get busy(){return this.phase!==``}request(e,t,n=!1){if(t=Math.round(t),this.shifting||t<0||t>this.gearCount||t===e.gear||!n&&this.sinceShift<this.minShiftInterval||this.wouldOverRev(e,t))return!1;this.from=e.gear,this.to=t,this.isDown=t!==0&&(e.gear===0||t<e.gear),this.contactSeen=!1,this.blipHeld=!1;let r=this.k,i=this.S;this.tCut=Math.max(r.cutMin,r.cutF*i),this.tOpen=Math.max(r.openMin,r.openF*i),this.tSync=Math.max(r.syncMin,r.syncF*i),this.tEngage=Math.max(r.engageMin,r.engageF*i),this.revTargetW=this.isDown&&this.revMatch&&t>0?dv(e.gearedRpm(t),this.idleRpm,this.redlineRpm*.97)/fv:0,this.phase=`cut`,this.t=0;let a=dv(((typeof e.egt==`number`?e.egt:1)-.45)/.35,0,1),o=r.cutBang*(.25+.75*e.throttle)*r.cutDepth*a,s=dv((.12+.55*a)*r.cutBang,0,.9);return o>.04&&Math.random()<s&&e.fireEvent(`cut`,dv(o,0,1)),!0}wouldOverRev(e,t){return t<=0?!1:e.gearedRpm(t)>this.redlineRpm}upshiftRpm(e){let t=this.upFracLow+(this.upFracHigh-this.upFracLow)*dv(e,0,1);return Math.max(this.idleRpm*1.6,this.redlineRpm*t)}downshiftRpm(e){let t=this.downFracLow+(this.downFracHigh-this.downFracLow)*dv(e,0,1);return Math.max(this.idleRpm*1.15,this.redlineRpm*t)}auto(e){if(!this.autoShift||this.busy||e.gear===0||this.sinceShift<this.minShiftInterval)return;let t=e.throttle,n=e.rpm,r=this.upshiftRpm(t);if(n>=r&&e.gear<this.gearCount&&t>.05){this.request(e,e.gear+1);return}let i=typeof e.wotTorque==`function`?t=>e.wotTorque(t)*t:null;if(i&&t>=this.kickdownThrottle&&e.gear<this.gearCount&&n>this.redlineRpm*.6){let t=e.gearedRpm(e.gear+1);if(t>this.idleRpm*1.5&&i(t)>=i(n)){this.request(e,e.gear+1);return}}if(e.gear>1){let a=e.gear-1,o=e.gearedRpm(a);if(o>=r)return;if(n<=this.downshiftRpm(t)){this.request(e,a);return}t>=this.kickdownThrottle&&n<this.redlineRpm*.55&&o<this.redlineRpm*.92&&(!i||i(o)>i(n))&&this.request(e,a)}}step(e,t){if(t.gearboxNeutral=!1,t.syncing=!1,t.fuelCut=0,t.throttleOverride=null,t.clutchCmd=null,t.clutchRate=0,!this.busy&&(this.sinceShift+=e,this.auto(t),!this.busy)){t.shiftPhase=``,t.shifting=!1;return}this.t+=e;let n=this.k;switch(this.phase){case`cut`:t.fuelCut=n.cutDepth,t.clutchCmd=1,this.t>=this.tCut&&this._enter(`open`,t);break;case`open`:if(t.gearboxNeutral=!0,t.clutchCmd=n.openClutch,t.clutchRate=60,this.isDown&&this.revTargetW>0){let e=this.revTargetW-t.we,r=n.blipTolRpm/fv;e>r?this.blipHeld=!0:e<0&&(this.blipHeld=!1),t.throttleOverride=this.blipHeld?n.blip:0;let i=Math.abs(e)<=r;(this.t>=this.tOpen&&i||this.t>=this.tOpen*n.openStretch)&&this._enter(`sync`,t)}else t.fuelCut=n.cutDepth,n.cutDepth>=1&&(t.throttleOverride=0),this.t>=this.tOpen&&this._enter(`sync`,t);break;case`sync`:{t.gearboxNeutral=!0,t.clutchCmd=n.openClutch,t.fuelCut=n.cutDepth,n.cutDepth>=1&&(t.throttleOverride=0),this.to>0&&(t.syncing=!0,t.syncTargetW=t.inputShaftTargetW(this.to));let e=this.to===0||Math.abs(t.wg-t.syncTargetW)<3;(this.t>=this.tSync&&e||this.t>=this.tSync*3)&&this._enter(`engage`,t);break}case`engage`:{let e=dv(this.t/this.tEngage,0,1),r=e*e*(3-2*e);t.clutchCmd=n.engageStart+(1-n.engageStart)*r,t.clutchRate=4/this.tEngage,this.to===0&&(t.clutchCmd=0),t.lashContactedSince&&(this.contactSeen=!0),this.t>=this.tEngage&&this._enter(`lash`,t);break}case`lash`:t.clutchCmd=this.to===0?0:1,t.lashContactedSince&&(this.contactSeen=!0),(this.contactSeen||this.t>=n.lashMax||this.to===0)&&this._enter(`shuffle`,t);break;case`shuffle`:t.clutchCmd=this.to===0?0:null,this.t>=n.shuffle&&(this.phase=``,this.t=0,this.sinceShift=0,t.clutchCmd=null)}t.shiftPhase=this.phase,t.shifting=this.shifting}_enter(e,t){if(this.phase,this.phase=e,this.t=0,e===`sync`&&(t.selectGear(this.to),this.to>0&&(t.syncTargetW=t.inputShaftTargetW(this.to))),e===`engage`){t.gearboxNeutral=!1;let e=Math.abs(t.we-t.wg)*fv;t.fireEvent(`engage`,dv(.15+e/1800,0,1)),t.lashContactedSince=!1,this.contactSeen=!1}e===`lash`&&t.fireEvent(`shiftDone`,1)}},hv=60/(2*Math.PI),gv=2*Math.PI/60,_v=1.225,vv=9.81,Y=(e,t,n)=>e<t?t:e>n?n:e,yv=2e3,bv=240,xv=.03,Sv=.02,Cv=52,wv=.2,Tv=15,Ev=1.5,Dv=.055,Ov=.55,kv=2.4,Av=.85,jv=.45,Mv=class{constructor(e,t,n={}){this.engine=e,this.vehicle=t,this.dl=Object.assign({},Ig,n.driveline),this.eff=n.driveEfficiency==null?.92:n.driveEfficiency,this.Je=Math.max(.02,e.engineInertia),this.Jin=n.inputInertia==null?xv:n.inputInertia,this.Jout=n.outputInertia==null?Sv:n.outputInertia,this.r=t.wheelRadius,this.fd=t.finalDrive,this.ratios=t.gearRatios,this.gearCount=this.ratios.length,this.Jv=t.mass*this.r*this.r+Cv*this.r*this.r,this.subStep=n.subStep||5e-4,this.launchFlareRpm=n.launchFlareRpm==null?2400:n.launchFlareRpm,this.launchRateOverride=n.launchRate==null?null:n.launchRate,this.launchRate=this.launchRateFor(1),this.shift=n.shiftController||new mv({type:t.gearbox,shiftTimeMs:t.shiftTimeMs,gearCount:this.gearCount,idleRpm:e.idleRpm,redlineRpm:e.redlineRpm,autoShift:n.autoShift!==!1,revMatch:n.revMatch!==!1}),this.isAuto=t.gearbox===`auto`,this.throttle=0,this.brake=0,this.we=e.idleRpm*gv,this.wg=this.we,this.wo=0,this.ww=0,this.twist=0,this.dtwist=0,this.lash=0,this.contact=0,this.clutch=0,this.boost=0,this.gear=1,this.Tp=0,this.Te=0,this.Tc=0,this.load=0,this.overrun=0,this.limiterCut=0,this.limiterActive=!1,this.lashTimer=0,this.lashContactedSince=!1,this.launchArmed=!0,this.launchI=0,this.launchT=0,this.launchRef=0,this.lockup=0,this.bovArm=0,this.boostDump=0,this.turboSpeed=0,this.egt=0,this.dfco=0,this.dfcoEdge=0,this.prevDfco=0,this.popCharge=0,this.prevOverride=0,this.thrPeak=0,this.cutRpmN=0,this.popRefractory=0,this.lashHeat=0,this.prevLimiter=!1,this.limiterBark=0,this.prevRpm=this.we*hv,this.gearboxNeutral=!1,this.syncing=!1,this.syncTargetW=0,this.clutchCmd=null,this.burnoutClutchOverride=null,this.clutchRate=0,this.fuelCut=0,this.throttleOverride=null,this.shiftPhase=``,this.shifting=!1,this.ev={cut:0,lash:0,engage:0,bov:0,shiftDone:0,pop:0},this.params={now:0,dt:0,rpm:0,f0:0,rpmNorm:0,dRpm:0,throttle:0,load:0,overrun:0,torqueSign:1,gear:1,gearRatio:0,speed:0,wheelRpm:0,clutchSlip:0,clutchEngaged:0,boost:0,shifting:!1,shiftPhase:``,evCut:0,evLash:0,evEngage:0,evBov:0,evShiftDone:0,evPop:0},this.clutch=0,this._writeParams(0,0)}setThrottle(e){this.throttle=Y(Number(e)||0,0,1)}setBrake(e){this.brake=Y(Number(e)||0,0,1)}setEngine(e){this.engine=e,this.Je=Math.max(.02,e.engineInertia),this.launchRate=this.launchRateFor(1),this.shift.idleRpm=e.idleRpm,this.shift.redlineRpm=e.redlineRpm;let t=Y(this.we*hv,e.idleRpm,e.redlineRpm);this.we=t*gv,this.prevRpm=t,this.boost=0,this.limiterCut=0,this.limiterActive=!1}setVehicle(e){let t=this.speed;this.vehicle=e,this.r=e.wheelRadius,this.fd=e.finalDrive,this.ratios=e.gearRatios,this.gearCount=this.ratios.length,this.Jv=e.mass*this.r*this.r+Cv*this.r*this.r,this.isAuto=e.gearbox===`auto`,this.shift.type=e.gearbox,this.shift.gearCount=this.gearCount,this.shift.setTiming&&this.shift.setTiming(e.shiftTimeMs),this.shift.reset(),this.launchRate=this.launchRateFor(1),this.gear=Y(Math.round(this.gear),0,this.gearCount),this.ww=t/this.r,this.wo=this.ww*this.fd,this.twist=0,this.dtwist=0,this.contact=0}setAutoShift(e){this.shift.autoShift=!!e}shiftUp(){return this.gear>=this.gearCount?!1:this.shift.request(this,this.gear+1,!0)}shiftDown(){return this.gear<=1?!1:this.shift.request(this,this.gear-1,!0)}setGear(e){return this.shift.request(this,e,!0)}get rpm(){return this.we*hv}get speed(){return this.ww*this.r}get gearRatio(){return this.gear>0?this.ratios[this.gear-1]:0}get totalRatio(){return this.gear>0?this.ratios[this.gear-1]*this.fd:0}gearedRpm(e){return e<=0||e>this.gearCount?0:Math.abs(this.ww)*this.fd*this.ratios[e-1]*hv}launchRateFor(e){if(this.launchRateOverride!=null)return this.launchRateOverride;let t=Y(Math.round(e),1,this.gearCount)-1,n=Math.abs(this.ratios[t]*this.fd)||1;return Y(this.engine.peakTorque*n*this.eff/this.r/Math.max(1,this.vehicle.mass)/this.r*n*hv*.55,400,12e3)}inputShaftTargetW(e){return e<=0||e>this.gearCount?0:this.ww*this.fd*this.ratios[e-1]}selectGear(e){this.gear=Y(Math.round(e),0,this.gearCount)}fireEvent(e,t){t>this.ev[e]&&(e===`pop`&&this.we*hv<yv||(this.ev[e]=t>1?1:t))}_JoutSide(e,t=!0){if(e<=0)return this.Jout;let n=this.ratios[e-1];return(t?this.Je+this.Jin:this.Jin)*n*n+this.Jout}_JvehOut(){return this.Jv/(this.fd*this.fd)}modeW(e,t=!0){let n=this._JoutSide(e,t),r=this._JvehOut();return Math.sqrt(this.dl.stiffness*(1/n+1/r))}modeHz(e,t=!0){return this.modeW(e,t)/(2*Math.PI)}modeZeta(e,t=!0){if(this.dl.dampingRatio!=null)return this.dl.dampingRatio;let n=this._Jred(e,t);return this.dl.damping/(2*Math.sqrt(this.dl.stiffness*n))}_Jred(e,t=!0){let n=this._JoutSide(e,t),r=this._JvehOut();return 1/(1/n+1/r)}_dampCoeff(){if(this.dl.dampingRatio==null)return this.dl.damping;let e=this.clutch>.5&&!this.gearboxNeutral,t=this._Jred(this.gear>0?this.gear:1,e);return Y(2*this.dl.dampingRatio*Math.sqrt(this.dl.stiffness*Math.max(1e-4,t)),1,400)}stabilityReport(){let e=0,t=``;for(let n=1;n<=this.gearCount;n++)for(let r of[!0,!1]){let i=this.modeW(n,r);i>e&&(e=i,t=`gear ${n} clutch ${r?`locked`:`open`}`)}let n=Math.sqrt(this.dl.stiffness/this.Jout);n>e&&(e=n,t=`gearbox neutral (output shaft alone)`);let r=this.dl.damping/this.Jout;return{subStep:this.subStep,worstModeRadS:e,worstModeHz:e/(2*Math.PI),worstModeWhere:t,stableBelowSpring:2/e,stableBelowDamper:2/r,phasePerStepRad:e*this.subStep,marginSpring:2/e/this.subStep,marginDamper:2/r/this.subStep}}getState(){return{rpm:this.rpm,speed:this.speed,speedKmh:this.speed*3.6,gear:this.gear,throttle:this.throttle,brake:this.brake,twist:this.twist,contact:this.contact,clutch:this.clutch,Tp:this.Tp,boost:this.boost,phase:this.shiftPhase,shifting:this.shifting,limiter:this.limiterActive,gearCount:this.gearCount,redline:this.engine.redlineRpm,idle:this.engine.idleRpm}}torqueFactor(e){let t=(e-this.engine.peakTorqueRpm)/(this.engine.redlineRpm*.75);return Y(1-.85*t*t,.3,1)}wotTorque(e){return this.engine.peakTorque*this.torqueFactor(e)*this._boostMult()-this.frictionTorque(e,1)}frictionTorque(e,t){return(18+.012*e+22e-7*e*e)*(1-.62*t)}step(e,t=0){let n=Number(e)||0;if(n<=0)return this.params.now=t,this.params.dt=0,this.params.evCut=this.params.evLash=this.params.evEngage=0,this.params.evBov=this.params.evShiftDone=0,this.params;n=Math.min(n,.1);let r=Math.min(bv,Math.max(1,Math.ceil(n/this.subStep))),i=n/r;for(let e=0;e<r;e++)this._substep(i);return this._writeParams(n,t),this.params}_substep(e){let t=this.engine;this.vehicle;let n=this.dl;this.lashContactedSince=!1,this.shift.step(e,this);let r=this.gear>0&&!this.gearboxNeutral,i=this.gear>0?this.ratios[this.gear-1]:0;this.limiterCut>0?(this.limiterCut-=e,this.limiterCut<=0&&this.rpm>t.redlineRpm-200&&(this.limiterCut=.012)):this.rpm>=t.redlineRpm&&(this.limiterCut=.05),this.limiterActive=this.limiterCut>0;let a=this.throttleOverride==null?this.throttle:this.throttleOverride;a*=1-Y(this.fuelCut,0,1),this.limiterActive&&(a=0),this.thrEff=a,this._stepTurbo(e,a),this._stepExhaustThermal(e,a);let o=this.we*hv,s=a*t.peakTorque*this.torqueFactor(o)*this._boostMult()-this.frictionTorque(o,a);if(this.throttle<.06&&o<t.idleRpm*1.25&&!this.limiterActive){let e=this.frictionTorque(t.idleRpm,0)+(t.idleRpm-o)*.55;e>s&&(s=e)}this.Te=s;let c=n.backlash,l=this._dampCoeff(),u=0;this.twist>c?(u=n.stiffness*(this.twist-c)+l*this.dtwist,u<0&&(u=0)):this.twist<-c&&(u=n.stiffness*(this.twist+c)+l*this.dtwist,u>0&&(u=0)),this.Tp=u,this._stepClutch(e,r,i);let d=0,f=0;if(this.isAuto){let e=this._converter(this.we,this.wg);d=e.pump,f=e.turbine}let p=r?this.Jin+this.Jout/(i*i):this.Jin,m=-this._gearboxDrag(this.wg);if(r&&(m-=u/i),this.syncing){let e=this.syncTargetW-this.wg;m+=Y(e*this.Jin/.008,-400,400)}m+=f;let h=s-d,g=m,_=this.Je*p/(this.Je+p),v=n.clutchTorqueCapacity*this.clutch*this._stallGuard(),y=_*((this.we-this.wg)/e+h/this.Je-g/p);y>v?y=v:y<-v&&(y=-v),this.Tc=y,this.we+=e*(h-y)/this.Je,this.wg+=e*(g+y)/p;let b=t.idleRpm*.42*gv,x=t.redlineRpm*1.015*gv;this.we<b&&(this.we=b),this.we>x&&(this.we=x),r?this.wo=this.wg/i:this.wo+=e*(-u-this._gearboxDrag(this.wo)*.5)/this.Jout,this._stepVehicle(e,u),this.dtwist=this.wo-this.ww*this.fd,this.twist+=e*this.dtwist,Math.abs(this.twist)<3||(this.twist=Y(this.twist||0,-3,3)),this.lash=Y(this.twist,-c,c),this._detectLash(e,c)}_gearboxDrag(e){return .006*e+(e>.5?.4:e<-.5?-.4:0)}_stallGuard(){let e=this.engine.idleRpm*gv;return Y((this.we-e*.92)/(e*.55),0,1)}_stepClutch(e,t,n){let r=this.burnoutClutchOverride??this.clutchCmd,i=this.burnoutClutchOverride==null?this.clutchRate:18;r??(this.isAuto?(r=t&&this.gear>=2&&this.gearedRpm(this.gear)>this.engine.idleRpm*1.35&&this.throttle<.85?1:0,i=2.5):r=this._launchClutch(e,t)),i>0||(i=this.dl.clutchStiffness*12),this.clutch+=(Y(r,0,1)-this.clutch)*Math.min(1,e*i),this.clutch=Y(this.clutch,0,1)}_launchClutch(e,t){let n=this.engine.idleRpm,r=this.gearedRpm(this.gear);if(!t||this.gear===0)return this.launchI=0,this.launchT=0,this.launchRef=0,this.launchArmed=!0,0;let i=Y(n*1.05+this.throttle*this.launchFlareRpm,n,this.engine.redlineRpm*.9);if(this.launchArmed&&this.clutch>.985&&r>i*.75?this.launchArmed=!1:!this.launchArmed&&r<n*.95&&(this.launchArmed=!0),!this.launchArmed)return this.launchI=0,this.launchT=0,this.launchRef=0,1;if(this.throttle<.05&&r<n*.5)return this.launchT=0,this.launchRef=0,this.launchI=Math.max(0,this.launchI-e/.2),Y(this.launchI,0,.22);this.launchT=Math.min(4,(this.launchT||0)+e);let a=this.launchRateFor(this.gear),o=Math.max(300,i-n),s=r+o*(1-Y(r/Math.max(1,o*1.8),0,1));this.launchRef>0||(this.launchRef=Math.max(n*1.05,this.rpm));let c=s-this.launchRef,l=c>0?Math.min(a,c/jv):c/jv;this.launchRef+=l*e;let u=Math.max(s,n*1.05);this.launchRef=Math.min(this.launchRef,u,this.rpm+o*.5),this.launchRef=Math.max(this.launchRef,n*1.05),this.rpm>this.launchRef&&(this.launchRef=Math.min(this.rpm,u));let d=this.launchRef,f=this.dl.clutchTorqueCapacity*this._stallGuard(),p=this.Te-this.Je*l*gv,m=f>1?Y(p/f,0,1):0,h=(this.rpm-d)/d;this.launchI=Y(this.launchI*(1-Math.min(1,e/.6))+8*h*e,-.4,.5);let g=Y(m+this.launchI+1.5*h,0,1),_=Y((this.launchT-.9)/1.2,0,1);return Math.max(g,Math.min(_,m))}_converter(e,t){if(e>t+.5){let n=Y(t/Math.max(e,.001),0,1),r=Y(.008*e*e*(1-n*n),0,4*this.engine.peakTorque);return{pump:r,turbine:r*(1+1*(1-n)**1.2)}}if(t>e+.5){let n=Y(e/Math.max(t,.001),0,1),r=Y(.0048*t*t*(1-n*n),0,4*this.engine.peakTorque);return{pump:-r,turbine:-r}}return{pump:0,turbine:0}}_stepVehicle(e,t){let n=this.vehicle,r=this.ww*this.r,i=t>0?t*this.fd*this.eff:t*this.fd,a=.5*_v*n.dragArea*r*r,o=r>0?a*this.r:0,s=(n.rollingResistance*n.mass*vv+this.brake*n.brakeForce)*this.r,c=i-o;if(this.ww>1e-6){let t=this.ww+e*(c-s)/this.Jv;this.ww=t<0&&c<s?0:Math.max(0,t)}else this.ww=c>s?e*(c-s)/this.Jv:0}_detectLash(e,t){this.lashTimer+=e,this.lashHeat=Math.max(0,this.lashHeat-e/Ov);let n=this.twist>t?1:this.twist<-t?-1:0;if(n===0){Math.abs(this.twist)<t*Av&&(this.contact=0);return}if(n===this.contact)return;let r=Math.abs(this.dtwist);if(this.contact=n,r<wv||this.lashTimer<Dv)return;this.lashTimer=0,this.lashContactedSince=!0;let i=1/(1+kv*this.lashHeat);this.lashHeat=Math.min(3,this.lashHeat+1);let a=Y((r/Tv)**+Ev*i,.001,1);a<.05||this.fireEvent(`lash`,a)}_stepExhaustThermal(e,t){let n=this.we*hv,r=Y((n-this.engine.idleRpm)/Math.max(1,this.engine.redlineRpm-this.engine.idleRpm),0,1),i=Y(.12+.88*t**.6*(.35+.65*r),0,1),a=i>this.egt?5:26;this.egt+=(i-this.egt)*Math.min(1,e/a);let o=this.throttle,s=o<.06&&n>this.engine.idleRpm*1.5&&!this.gearboxNeutral;if(this.dfco=+!!s,this.thrPeak=Math.max(o,this.thrPeak-e/.7),this.popRefractory=Math.max(0,this.popRefractory-e),this.limiterBark=Math.max(0,this.limiterBark-e),this.limiterActive&&!this.prevLimiter&&this.egt>.5&&this.limiterBark<=0&&(this.limiterBark=.34,this.fireEvent(`pop`,Y(.16+.14*Math.random(),0,1))),this.prevLimiter=this.limiterActive,this.dfco!==this.prevDfco){if(this.dfcoEdge=1,this.dfco){let e=Y(this.thrPeak,0,1),t=r**1.7;this.cutRpmN=r;let n=.55+Math.random()*.95;this.popCharge=Y(this.popCharge+(.5+2.1*t)*(.4+.6*e)*n,0,3.4);let i=Y((this.egt-.42)/.34,0,1)*(.18+.82*t)*(.45+.55*e);this.egt>.42&&this.popRefractory<=0&&Math.random()<i&&(this.popRefractory=.45,this.fireEvent(`pop`,Y((this.egt-.35)*1.25*(.1+1.3*t)*(.35+.65*e)*n,0,1)))}else this.popCharge=Y(this.popCharge+.35,0,3.4)}this.prevDfco=this.dfco,this.dfcoEdge=Math.max(0,this.dfcoEdge-e/.85);let c=this.throttleOverride;if(this.prevOverride>.3&&!(c>.3)){this.popCharge=Y(this.popCharge+1.1+.5*r,0,2.6);let e=Y((this.egt-.32)/.3,0,1)*(.35+.65*r);this.egt>.32&&this.popRefractory<=0&&Math.random()<e&&(this.popRefractory=.45,this.fireEvent(`pop`,Y((this.egt-.25)*1.45*(.5+.5*r),0,1)))}this.prevOverride=c??0,this.popCharge=Math.max(0,this.popCharge-e*(.22+.55*(1-this.dfco)))}_stepTurbo(e,t){let n=this.engine.turbo;if(!n){this.boost=0;return}let r=this.we*hv,i=Math.min(Y(Number(n.boostRpm)||3500,800,9e3),.65*this.engine.redlineRpm),a=Math.max(.6*this.engine.redlineRpm,i+1500),o=Y((r-i)/(a-i),0,1),s=n.antiLag>=.5&&t<.12&&r>.3*this.engine.redlineRpm,c=s?.7*o:Y(t,0,1)*o;s&&(this._alsT=(this._alsT||0)-e,this._alsT<=0&&(this._alsT=.06+.16*Math.random(),this.fireEvent(`pop`,.35+.45*Math.random())));let l=this.boostDump>0?.05:c>this.boost?.25+n.inertia*.9:.18+n.inertia*.4;this.boost+=(c-this.boost)*Math.min(1,e/l),this.boost=Y(this.boost,0,1),this.boostDump>0&&(this.boostDump-=e);let u=r>900?.12+.2*o:0,d=Y(Math.max(u,c),0,1),f=d>this.turboSpeed?.22+n.inertia*.85:.42+n.inertia*.55;this.turboSpeed+=(d-this.turboSpeed)*Math.min(1,e/f),this.turboSpeed=Y(this.turboSpeed,0,1),t>.45?this.bovArm=1:this.bovArm>0&&t<.12&&this.boost>.18&&!this.limiterActive&&n.valve>=.5&&!s&&(this.bovArm=0,this.boostDump=.12,this.fireEvent(`bov`,Y(this.boost*(.4+.6*n.bov),.1,1)))}_boostMult(){let e=this.engine.turbo;return e?1+.55*this.boost*e.maxBoost:1}_writeParams(e,t){let n=this.params,r=this.engine,i=this.we*hv;n.now=t,n.dt=e,n.rpm=i,n.f0=i/120,n.rpmNorm=Y((i-r.idleRpm)/(r.redlineRpm-r.idleRpm),0,1),n.dRpm=e>0?(i-this.prevRpm)/e:0,this.prevRpm=i,n.throttle=this.throttle,n.limiter=(this.limiterActive||i>r.redlineRpm-120)&&this.throttle>.5?1:0;let a=Y(this.thrEff||0,0,1),o=e>0?Y(e*12,0,1):1;this.load+=(a-this.load)*o,n.load=Y(this.load,0,1);let s=+(this.thrEff<.05&&i>r.idleRpm*1.7&&this.gear>0&&this.Tp<-2);this.overrun+=(s-this.overrun)*(e>0?Y(e*8,0,1):1),n.overrun=Y(this.overrun,0,1),n.torqueSign=this.Tp>1?1:this.Tp<-1?-1:this.Te>=0?1:-1,n.gear=this.gear,n.gearRatio=this.totalRatio,n.speed=this.ww*this.r,n.wheelRpm=this.ww*this.fd*hv,n.clutchSlip=(this.we-this.wg)*hv,n.clutchEngaged=this.clutch,n.boost=this.boost,n.shifting=this.shifting,n.gearbox=this.vehicle.gearbox,n.shiftPhase=this.shiftPhase;let c=this.ev;return n.evCut=c.cut,n.evLash=c.lash,n.evEngage=c.engage,n.evBov=c.bov,n.evShiftDone=c.shiftDone,n.evPop=c.pop,c.cut=c.lash=c.engage=c.bov=c.shiftDone=c.pop=0,n.turboSpeed=this.turboSpeed,n.egt=this.egt,n.dfco=this.dfco,n.cutRpmN=this.cutRpmN,n.popIntensity=Y(Math.max(0,this.egt-.45)/.55*Y(this.popCharge,0,1)*(.12+.88*this.dfcoEdge)*(.45+.55*this.cutRpmN),0,1)*+(i>=yv),n}},Nv=1.225,Pv=9.81,Fv=60/(2*Math.PI),Iv=.8,Lv=(e,t,n)=>e<t?t:e>n?n:e;function Rv(e,t,n=1){let r=(t-e.peakTorqueRpm)/(e.redlineRpm*.75),i=Lv(1-.85*r*r,.3,1),a=e.turbo,o=a?1+.55*n*a.maxBoost:1,s=(18+.012*t+22e-7*t*t)*.38;return e.peakTorque*i*o-s}function zv(e){let t={rpm:e.redlineRpm,power:0,torque:0};for(let n=e.idleRpm;n<=e.redlineRpm;n+=25){let r=Rv(e,n),i=r*n/Fv;i>t.power&&(t.power=i,t.rpm=n),r>t.torque&&(t.torque=r)}return t}function Bv(e){return[2.6+.4*(e-4),3.8+.8*(e-4)]}function Vv(e,t,n={}){let r=Math.round(Lv(n.gears||e.gears||t.gearRatios&&t.gearRatios.length||6,3,10)),i=t.gravity||Pv,a=n.efficiency||.92,o=t.wheelRadius,s=t.finalDrive,c=t.mass,l=e=>.5*Nv*t.dragArea*e*e+t.rollingResistance*c*i,u=zv(e),d=Math.min(u.rpm*1.04,e.redlineRpm*.9),f=a*Rv(e,d)*d/Fv,p=0,m=200;for(let e=0;e<60;e++){let e=.5*(p+m);l(e)*e<f?p=e:m=e}let h=p,g=d/Fv*o/Math.max(h,1),_=.6*c*i*o/(Math.max(1,u.torque)*a),[v,y]=Bv(r),b=Lv(_/g,v,y),x=[];for(let e=1;e<=r;e++){let t=((r-e)/(r-1))**1.15;x.push(+(Iv*g*b**+t/s).toFixed(3))}return{gearRatios:x,gearTeeth:x.map(e=>Math.round(Lv(16+6.5*e,17,46))),topSpeed:h}}function Hv(e,t,n){let r=Vv(e,t,n);return{...t,gearRatios:r.gearRatios,gearTeeth:r.gearTeeth}}var Uv=(e,t,n)=>e<t?t:e>n?n:e,Wv=(e,t=0)=>typeof e==`number`&&isFinite(e)?e:t,Gv=class e{static BANDS=[{f:60,type:`lowshelf`,label:`sub`},{f:200,type:`peaking`,q:.9,label:`body`},{f:800,type:`peaking`,q:1,label:`honk`},{f:2500,type:`peaking`,q:.9,label:`rasp`},{f:8e3,type:`highshelf`,label:`air`}];constructor(t,n={}){this.ctx=t,this.inGain=t.createGain(),this.out=t.createGain(),this.bands=e.BANDS.map(e=>{let n=t.createBiquadFilter();return n.type=e.type,n.frequency.value=e.f,e.q&&(n.Q.value=e.q),n.gain.value=0,n});let r=this.inGain;for(let e of this.bands)r.connect(e),r=e;r.connect(this.out),n.gains&&this.setGains(n.gains)}get input(){return this.inGain}get output(){return this.out}setGains(e){let t=this.ctx.currentTime;for(let n=0;n<this.bands.length&&n<e.length;n++)this.bands[n].gain.setTargetAtTime(Uv(Wv(e[n],0),-18,18),t,.03)}setBand(e,t){e<0||e>=this.bands.length||this.bands[e].gain.setTargetAtTime(Uv(Wv(t,0),-18,18),this.ctx.currentTime,.03)}getGains(){return this.bands.map(e=>e.gain.value)}reset(){this.setGains(this.bands.map(()=>0))}update(){}dispose(){for(let e of[this.inGain,this.out,...this.bands])e.disconnect()}},Kv=class{constructor(e,t={}){this.ctx=e,this.inGain=e.createGain(),this.out=e.createGain(),this.dry=e.createGain(),this.wet=e.createGain(),this.conv=e.createConvolver(),this.conv.normalize=!0,this.damp=e.createBiquadFilter(),this.damp.type=`lowpass`,this.damp.frequency.value=4200,this.damp.Q.value=.7,this.hp=e.createBiquadFilter(),this.hp.type=`highpass`,this.hp.frequency.value=110,this.inGain.connect(this.dry),this.dry.connect(this.out),this.inGain.connect(this.hp),this.hp.connect(this.conv),this.conv.connect(this.damp),this.damp.connect(this.wet),this.wet.connect(this.out),this._size=Uv(Wv(t.size,.35),.05,1),this._mix=Uv(Wv(t.mix,.16),0,1),this.setSize(this._size),this.setMix(this._mix)}get input(){return this.inGain}get output(){return this.out}_buildIR(e){let t=this.ctx,n=.15+2.05*Uv(e,0,1),r=Math.max(64,Math.floor(t.sampleRate*n)),i=t.createBuffer(2,r,t.sampleRate),a=2.6+3.4*(1-e);for(let e=0;e<2;e++){let n=i.getChannelData(e);for(let e=0;e<r;e++){let t=e/r;n[e]=(Math.random()*2-1)*(1-t)**a}for(let e=0;e<7;e++){let i=Math.floor((.004+.055*Math.random())*t.sampleRate);i<r&&(n[i]+=(Math.random()*2-1)*.55*(1-e/7))}}return i}setSize(e){return this._size=Uv(Wv(e,.35),.05,1),this.conv.buffer=this._buildIR(this._size),this._size}setMix(e){return this._mix=Uv(Wv(e,0),0,1),this._writeMix(.03),this._mix}setExtra(e){let t=Uv(Wv(e,0),0,1);Math.abs(t-(this._extra||0))<.001||(this._extra=t,this._writeMix(.08))}_writeMix(e){let t=Uv(this._mix+(this._extra||0)*(1-this._mix),0,1),n=this.ctx.currentTime;this.dry.gain.setTargetAtTime(Math.cos(t*Math.PI/2),n,e),this.wet.gain.setTargetAtTime(Math.sin(t*Math.PI/2)*1.4,n,e)}setDamping(e){this.damp.frequency.setTargetAtTime(Uv(Wv(e,4200),400,18e3),this.ctx.currentTime,.05)}getState(){return{size:this._size,mix:this._mix,damping:this.damp.frequency.value}}update(){}dispose(){for(let e of[this.inGain,this.out,this.dry,this.wet,this.conv,this.damp,this.hp])e.disconnect()}},qv=class{constructor(e,t={}){this.ctx=e,this.inGain=e.createGain(),this.merger=e.createChannelMerger(2),this.out=e.createGain(),this.delay=e.createDelay(.08),this.delay.delayTime.value=.016,this.tilt=e.createBiquadFilter(),this.tilt.type=`highshelf`,this.tilt.frequency.value=1800,this.tilt.gain.value=-3,this.plus=e.createGain(),this.minus=e.createGain(),this.plus.gain.value=0,this.minus.gain.value=0,this.inGain.connect(this.merger,0,0),this.inGain.connect(this.merger,0,1),this.inGain.connect(this.delay),this.delay.connect(this.tilt),this.tilt.connect(this.plus),this.tilt.connect(this.minus),this.plus.connect(this.merger,0,0),this.minus.connect(this.merger,0,1),this.merger.connect(this.out),this.setWidth(Wv(t.width,.35))}get input(){return this.inGain}get output(){return this.out}setWidth(e){this._width=Uv(Wv(e,0),0,1);let t=this.ctx.currentTime,n=this._width*.85;return this.plus.gain.setTargetAtTime(n,t,.03),this.minus.gain.setTargetAtTime(-n,t,.03),this.delay.delayTime.setTargetAtTime(.008+.018*this._width,t,.05),this._width}getWidth(){return this._width}update(){}dispose(){for(let e of[this.inGain,this.merger,this.out,this.delay,this.tilt,this.plus,this.minus])e.disconnect()}},Jv=class e{static BANDS=[{name:`low`,f:220,threshold:-16,ratio:2.6,attack:.018,release:.26,knee:10,makeup:1.1},{name:`mid`,f:2e3,threshold:-18,ratio:2,attack:.022,release:.2,knee:14,makeup:2.12},{name:`high`,f:0,threshold:-24,ratio:3,attack:.003,release:.12,knee:8,makeup:.9}];constructor(t,n={}){this.ctx=t,this._amount=Uv(Wv(n.amount,1),0,1),this.inGain=t.createGain(),this.out=t.createGain(),this.out.gain.value=Uv(Wv(n.makeup,1),0,4);let r=(e,n)=>{let r=t.createBiquadFilter();return r.type=e,r.frequency.value=Uv(n,20,2e4),r.Q.value=-3.0103,r};this.bands=[];let[i,a]=e.BANDS;for(let n of e.BANDS){let e=t.createDynamicsCompressor();e.threshold.value=n.threshold,e.ratio.value=n.ratio,e.attack.value=n.attack,e.release.value=n.release,e.knee.value=n.knee;let o=t.createGain();o.gain.value=n.makeup;let s=[];n.name===`low`?s.push(r(`lowpass`,i.f),r(`lowpass`,i.f)):n.name===`mid`?s.push(r(`highpass`,i.f),r(`highpass`,i.f),r(`lowpass`,a.f),r(`lowpass`,a.f)):s.push(r(`highpass`,a.f),r(`highpass`,a.f));let c=this.inGain;for(let e of s)c.connect(e),c=e;c.connect(e),e.connect(o),o.connect(this.out),this.bands.push({spec:n,comp:e,makeup:o,chain:s})}this.setAmount(this._amount)}get input(){return this.inGain}get output(){return this.out}setAmount(e){this._amount=Uv(Wv(e,1),0,1);let t=Wv(this.ctx.currentTime,0);for(let e of this.bands){let n=Uv(e.spec.threshold*this._amount,-100,0);e.comp.threshold.setTargetAtTime(n,t,.05);let r=1+(e.spec.makeup-1)*this._amount,i=Yv(n,e.spec.ratio,e.spec.knee);e.makeup.gain.setTargetAtTime(r*10**(-i/20),t,.05)}return this._amount}getAmount(){return this._amount}getReduction(){let e={};for(let t of this.bands)e[t.spec.name]=Wv(t.comp.reduction,0);return e}update(){}dispose(){for(let e of this.bands){for(let t of e.chain)t.disconnect();e.comp.disconnect(),e.makeup.disconnect()}this.inGain.disconnect(),this.out.disconnect()}};function Yv(e,t,n=0){let r=Math.min(0,Wv(e,0))+Math.max(0,Wv(n,0))/2,i=Math.max(1,Wv(t,1));return Math.max(0,-.6*Math.min(0,r)*(1-1/i))}var Xv=class{constructor(e){this.ctx=e,this.pre=e.createGain(),this.pre.gain.value=1/4,this.shaper=e.createWaveShaper();let t=8193,n=new Float32Array(t),r=.6,i=.39;for(let e=0;e<t;e++){let t=4*(e/8192*2-1),a=Math.abs(t),o=a<=r?a:r+i*Math.tanh((a-r)/i);n[e]=Math.sign(t)*o}this.shaper.curve=n,this.shaper.oversample=`2x`,this.pre.connect(this.shaper)}get input(){return this.pre}get output(){return this.shaper}dispose(){this.pre.disconnect(),this.shaper.disconnect()}},Zv=class{constructor(e,t={}){this.ctx=e;let n=-3.0103,r=(t,n,r)=>{let i=e.createBiquadFilter();return i.type=t,i.frequency.value=n,i.Q.value=r,i};this.inGain=e.createGain(),this.lp1=r(`lowpass`,140,n),this.lp2=r(`lowpass`,140,n),this.drive=e.createGain(),this.drive.gain.value=2.2,this.span=e.createGain(),this.span.gain.value=1/4,this.shaper=e.createWaveShaper();let i=4097,a=new Float32Array(i);for(let e=0;e<i;e++){let t=4*(e/4096*2-1),n=Math.tanh(t);a[e]=n+.45*n*n}this.shaper.curve=a,this.shaper.oversample=`2x`,this.hp=r(`highpass`,90,.7),this.lp3=r(`lowpass`,420,.6),this.amount=e.createGain(),this.amount.gain.value=Uv(Wv(t.amount,.15),0,2),this.inGain.connect(this.lp1),this.lp1.connect(this.lp2),this.lp2.connect(this.drive),this.drive.connect(this.span),this.span.connect(this.shaper),this.shaper.connect(this.hp),this.hp.connect(this.lp3),this.lp3.connect(this.amount)}get input(){return this.inGain}get output(){return this.amount}setAmount(e){this.amount.gain.setTargetAtTime(Uv(Wv(e,0),0,2),this.ctx.currentTime,.05)}dispose(){for(let e of[this.inGain,this.lp1,this.lp2,this.drive,this.span,this.shaper,this.hp,this.lp3,this.amount])e.disconnect()}},Qv=class{constructor(e){this.ctx=e,this.inGain=e.createGain(),this.out=e.createGain(),this.inGain.connect(this.out),this.loops=[.037,.061].map((t,n)=>{let r=e.createGain(),i=e.createDelay(.2);i.delayTime.value=t;let a=e.createBiquadFilter();a.type=`lowpass`,a.frequency.value=n?1900:2600,a.Q.value=.5;let o=e.createBiquadFilter();o.type=`highpass`,o.frequency.value=70,o.Q.value=.5;let s=e.createGain();s.gain.value=0;let c=e.createGain();return c.gain.value=0,this.inGain.connect(r),r.connect(i),i.connect(a),a.connect(o),o.connect(s),s.connect(r),o.connect(c),c.connect(this.out),{sum:r,d:i,lp:a,hp:o,fb:s,wet:c}}),this._env=-1}get input(){return this.inGain}get output(){return this.out}setEnvironment(e){if(e=Uv(Wv(e,0),0,1),Math.abs(e-this._env)<.001)return;this._env=e;let t=this.ctx.currentTime;this.loops.forEach((n,r)=>{n.fb.gain.setTargetAtTime(.52*e,t,.08),n.wet.gain.setTargetAtTime((r?.3:.38)*e,t,.08)})}dispose(){this.inGain.disconnect(),this.out.disconnect();for(let e of this.loops)for(let t of Object.values(e))t.disconnect()}},$v=`/**
|
|
1011
1011
|
* combustion-worklet.js — the engine's source, one combustion event at a time.
|
|
1012
1012
|
*
|
|
1013
1013
|
* Runs on the audio thread (AudioWorkletProcessor 'engine-combustion').
|
|
@@ -1249,4 +1249,4 @@ registerProcessor('engine-combustion', CombustionProcessor);
|
|
|
1249
1249
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?je(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je(`Lazy`);case 13:return e.child!==t&&t!==null?je(`Suspense Fallback`):je(`Suspense`);case 19:return je(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return je(`Activity`);case 30:return je(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
1250
1250
|
Error generating stack: `+e.message+`
|
|
1251
1251
|
`+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function $e(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&>(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Ah(e.type)):e}function St(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bm(e);e!==null;){if(n=e[wt])return n;e=bm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Gt={},Kt={};function qt(e){return Ie.call(Kt,e)?!0:Ie.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(e,t,n){if(qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Zt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+$t(s):e.removeAttribute(`name`)}function cn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+$t(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function dn(e,t,n){t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function hn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var vn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),yn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));sn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Wd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Fn=i.slice(e,1<r?1-r:void 0)}function Ln(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Rn(){return!0}function zn(){return!1}function Bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Rn:zn,this.isPropagationStopped=zn,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=w({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=w({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(w({},Jn,{dataTransfer:0})),Zn=Bn(w({},Un,{relatedTarget:0})),Qn=Bn(w({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(w({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(w({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(w({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(w({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(w({},Vn,{submitter:0})),lr=Bn(w({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(w({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(w({},Jn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),fr=Bn(w({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=tp(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){qf(e,0)}function jr(e){if(rn(It(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var F=document.createElement(`div`);F.setAttribute(`oninput`,`return;`),Fr=typeof F.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function I(){Or&&(Or.detachEvent(`onpropertychange`,Ir),kr=Or=null)}function Ir(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function Lr(e,t,n){e===`focusin`?(I(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&I()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function zr(e,t){if(e===`click`)return jr(t)}function Br(e,t){if(e===`input`||e===`change`)return jr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ie.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Xr=An&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Ur($r,r)||($r=r,r=tp(Qr,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};An&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Ht(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Pd)throw Pd=0,Fd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ii(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case oe:return e=Ni(31,n,t,a),e.elementType=oe,e.lanes=o,e;case O:return Ri(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Ni(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case A:return e=Ni(13,n,t,a),e.elementType=A,e.lanes=o,e;case j:return e=Ni(19,n,t,a),e.elementType=j,e.lanes=o,e;case se:case le:return e=a|32,e=Ni(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case k:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case ie:s=14;break a;case ae:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-et(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,L=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ha(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Jf(`cancel`,t),Jf(`close`,t);break;case`iframe`:case`object`:case`embed`:Jf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)Jf(Gf[n],t);break;case`source`:Jf(`error`,t);break;case`img`:case`image`:case`link`:Jf(`error`,t),Jf(`load`,t);break;case`details`:Jf(`toggle`,t);break;case`input`:Jf(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Jf(`invalid`,t);break;case`textarea`:Jf(`invalid`,t),fn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||sp(t.textContent,n)?(r.popover!=null&&(Jf(`beforetoggle`,t),Jf(`toggle`,t)),r.onScroll!=null&&Jf(`scroll`,t),r.onScrollEnd!=null&&Jf(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||la(e,!0)}function da(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ia=ia.return}}function fa(e){if(e!==ia)return!1;if(!L)return da(e),L=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||xp(e.type,e.memoizedProps)),n=!n),n&&aa&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=ym(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=ym(e)}else t===27?(t=aa,Ap(e.type)?(e=vm,vm=null,aa=e):aa=t):aa=ia?_m(e.stateNode.nextSibling):null;return!0}function pa(){aa=ia=null,L=!1}function ma(){var e=oa;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),oa=null),e}function ha(e){oa===null?oa=[e]:oa.push(e)}var ga=ye(null),_a=null,va=null;function ya(e,t,n){xe(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,be(ga)}function xa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Sa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),xa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),xa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),xa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ca(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===P.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,R={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new ka,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Pa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=Bf(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=M.S;M.S=function(e,t){if(bd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=Ef;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=ye(null);function Ka(){var e=Ga.current;return e===null?V.pooledCache:e}function qa(e,t){t===null?xe(Ga,Ga.current):xe(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:R._currentValue,pool:e}}var Ya=Error(i(460)),Xa=Error(i(474)),Za=Error(i(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=V,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function ro(){if(no===null)throw Error(i(459));var e=no;return no=null,e}function io(e){if(e===Ya||e===Za)throw Error(i(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),eo(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===T?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ae&&to(i)===t.type)?(t=a(t,n.props),co(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),co(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ri(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=Li(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case D:return t=Vi(t,e.mode,n),t.return=e,t;case ae:return t=to(t),f(e,t,n)}if(he(t)||fe(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===k)return f(e,Da(e,t),n);lo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case ae:return n=to(n),p(e,t,n,r)}if(he(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===k)return p(e,t,Da(e,n),r);lo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ae:return r=to(r),m(e,t,n,r,i)}if(he(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,so(r),i);if(r.$$typeof===k)return m(e,t,n,Da(t,r),i);lo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),L&&$i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return L&&$i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),L&&$i(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),L&&$i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return L&&$i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),L&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ae&&to(l)===r.type){n(e,r.sibling),c=a(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Ri(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case ae:return o=to(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(fe(o)){if(l=fe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,so(o),c);if(o.$$typeof===k)return _(e,r,Da(e,o),c);lo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,rd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function yo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function bo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=Ba;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(U&f)===f:(r&f)===f){f!==0&&f===za&&(xo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=w({},d,f);break a;case 2:mo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),dd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=ye(null),Do=ye(0);function Oo(e,t){e=ld,xe(Do,e),xe(Eo,t),ld=e|t.baseLanes}function ko(){xe(Do,ld),xe(Eo,Eo.current)}function Ao(){ld=Do.current,be(Eo),be(Do)}var jo=ye(null),Mo=null;function No(e){var t=e.alternate;xe(Ro,Ro.current&1),xe(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){xe(Ro,Ro.current),xe(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(xe(Ro,Ro.current),xe(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){xe(Ro,Ro.current),xe(jo,jo.current)}function Lo(e){be(jo),Mo===e&&(Mo=null),be(Ro)}var Ro=ye(0);function zo(e,t){xe(jo,jo.current),xe(Ro,t)}function Bo(e){be(Ro),be(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mm(n)||hm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ho=0,z=null,Uo=null,Wo=null,Go=!1,Ko=!1,qo=!1,Jo=0,Yo=0,Xo=null,Zo=0;function Qo(){throw Error(i(321))}function $o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function es(e,t,n,r,i,a){return Ho=a,z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?_c:vc,qo=!1,a=n(r,i),qo=!1,Ko&&(a=ns(t,n,r,i)),ts(e),a}function ts(e){M.H=gc;var t=Uo!==null&&Uo.next!==null;if(Ho=0,Wo=Uo=z=null,Go=!1,Yo=0,Xo=null,t)throw Error(i(300));e===null||Fc||(e=e.dependencies,e!==null&&wa(e)&&(Fc=!0))}function ns(e,t,n,r){z=e;var a=0;do{if(Ko&&(Xo=null),Yo=0,Ko=!1,25<=a)throw Error(i(301));if(a+=1,Wo=Uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=yc,o=t(n,r)}while(Ko);return o}function rs(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(Uo===null?null:Uo.memoizedState)!==e&&(z.flags|=1024),t}function is(){var e=Jo!==0;return Jo=0,e}function as(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function os(e){if(Go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Go=!1}Ho=0,Wo=Uo=z=null,Ko=!1,Yo=Jo=0,Xo=null}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wo===null?z.memoizedState=Wo=e:Wo=Wo.next=e,Wo}function cs(){if(Uo===null){var e=z.alternate;e=e===null?null:e.memoizedState}else e=Uo.next;var t=Wo===null?z.memoizedState:Wo.next;if(t!==null)Wo=t,Uo=e;else{if(e===null)throw z.alternate===null?Error(i(467)):Error(i(310));Uo=e,e={memoizedState:Uo.memoizedState,baseState:Uo.baseState,baseQueue:Uo.baseQueue,queue:Uo.queue,next:null},Wo===null?z.memoizedState=Wo=e:Wo=Wo.next=e}return Wo}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Yo;return Yo+=1,Xo===null&&(Xo=[]),e=eo(Xo,e,t),t=z,(Wo===null?t.memoizedState:Wo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===ue)return;if(e.$$typeof===k)return Ea(e)}throw Error(i(438,String(e)))}function fs(e){var t=null,n=z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=z.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ls(),z.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ce;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(cs(),Uo,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ho&f)===f:(U&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===za&&(d=!0);else if((Ho&p)===p){u=u.next,p===za&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,z.lanes|=p,dd|=p;f=u.action,qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,z.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Fc=!0,d&&(n=Ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=cs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Hr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=z,a=cs(),o=L;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((Uo||a).memoizedState,n);if(s&&(a.memoizedState=n,Fc=!0),a=a.queue,Hs(bs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Wo!==null&&!!(Wo.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,a,n,t),null),e){if(r.flags|=2048,V===null)throw Error(i(349));o||Ho&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=z.updateQueue,t===null?(t=ls(),z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function Ss(e){var t=Oi(e,2);t!==null&&zd(t,e,2)}function Cs(e){var t=ss();if(typeof e==`function`){var n=e;if(e=n(),qo){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,Uo,typeof r==`function`?r:ps)}function Ts(e,t,n,r,a){if(pc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(L){var n=V.formState;if(n!==null){a:{var r=z;if(L){if(aa){b:{for(var i=aa,a=sa;i.nodeType!==8;)if(!a||(i=_m(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=_m(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=ss(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,z,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,z,!1,r.queue),r=ss(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(cs(),Uo,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Ya?Za:e}else r=t;t=cs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(z.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=cs(),n=Uo;if(n!==null)return Ps(t,n,e);cs(),t=t.memoizedState,n=cs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=z.updateQueue,t===null&&(t=ls(),z.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return cs().memoizedState}function zs(e,t,n,r){var i=ss();z.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=cs();r=r===void 0?null:r;var a=i.memoizedState.inst;Uo!==null&&r!==null&&$o(r,Uo.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(z.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){z.flags|=4;var t=z.updateQueue;if(t===null)t=ls(),z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=cs().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(rd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$o(t,r[1]))return r[0];if(r=e(),qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Ho&1073741824&&!(U&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),z.lanes|=e,dd|=e,n)}function $s(e,t,n,r){return Hr(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(U&261930)?(Fc=!0,e.memoizedState=n):(e=Ld(),z.lanes|=e,dd|=e,t):(e=Qs(e,n,r),Hr(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,fc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Ua(c,r),Id(e)):dc(e,t,r,Id(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,ge,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},Id())}function ac(){return Ea(mh)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=_o(n);var r=vo(t,e,n);r!==null&&(zd(r,t,n),yo(r,t,n)),t={cache:Ma()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Di(e,t,n,r),n!==null&&(zd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,Id())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ei(e,t,i,0),V===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return zd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&zd(t,e,2)}function pc(e){var t=e.alternate;return e===z||t!==null&&t===z}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var gc={readContext:Ea,use:ds,useCallback:Qo,useContext:Qo,useEffect:Qo,useImperativeHandle:Qo,useLayoutEffect:Qo,useInsertionEffect:Qo,useMemo:Qo,useReducer:Qo,useRef:Qo,useState:Qo,useDebugValue:Qo,useDeferredValue:Qo,useTransition:Qo,useSyncExternalStore:Qo,useId:Qo,useHostTransitionStatus:Qo,useFormState:Qo,useActionState:Qo,useOptimistic:Qo,useMemoCache:Qo,useCacheRefresh:Qo,useEffectEvent:Qo},_c={readContext:Ea,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,z,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,z,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=z,a=ss();if(L){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),V===null)throw Error(i(349));U&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=V.identifierPrefix;if(L){var n=Qi,r=Zi;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Zo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=ss();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,z,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return ss().memoizedState=cc.bind(null,z)},useEffectEvent:function(e){var t=ss(),n={impl:e};return t.memoizedState=n,function(){if(rd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Ea,use:ds,useCallback:Xs,useContext:Ea,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(cs(),Uo.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(cs(),Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Ea,use:ds,useCallback:Xs,useContext:Ea,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=cs();return Uo===null?Qs(n,e,t):$s(n,Uo.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=cs();return Uo===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(zd(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(zd(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(zd(t,e,n),yo(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=w({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){xi(e)}function Ec(e){console.error(e)}function Dc(e){xi(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=_o(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,a,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Zd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(L)return t=jo.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ha(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Ac(e.stateNode,r,a),bo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ha(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ac(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=jc(a),Mc(a,e,n,r),bo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(i(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?po(t,null,n,r):fo(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ta(t),r=es(e,t,n,o,a,i),s=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(L&&s&&ta(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),ko(),Io()):(qa(t,a.cachePool),Oo(t,a),Io(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:R._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),ko(),Fo(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return fo(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Lo(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(L){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Po(t),(e=aa)?(e=pm(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(t),a){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Fc||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,Fc||a){if(Eo.current===null){if(r=V,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),zd(r,e,s),Pc;Zd()}t=Wc(e,t,n)}else e=o.treeContext,aa=_m(s.nextSibling),ia=t,L=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return Ta(t),n=es(e,t,n,r,void 0,i),r=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(L&&r&&ta(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=ns(t,r,n,i),ts(e),r=is(),e!==null&&!Fc?(as(e,t,a),dl(e,t,a)):(L&&r&&ta(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=mo||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,go(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=mo||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=fo(t,e.child,null,i),t.child=fo(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return pa(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Ja()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(L){if(i?No(t):Io(),(e=aa)?(e=pm(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=hm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(No(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Ja():(s=R._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(No(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return fo(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(No(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Io(),o=a.fallback,s=t.mode,a=nl({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,fo(t,e.child,null,c),a=t.child,a.memoizedState=Qc(c),a.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,a)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),hm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ha({value:a,source:null,stack:null})),rl(e,t,c)}if(Fc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Eo.current!==null)return rl(e,t,c);if(r=V,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),zd(r,e,a),Pc;return mm(o)||Zd(),rl(e,t,c)}return mm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=_m(o.nextSibling),ia=t,L=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=tl(t,a.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(n)===null&&(t=e),e=e.sibling}return t}function sl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=L?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function pl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),ya(t,R,e.memoizedState.cache),pa();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(No(t),e=dl(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:ya(t,R,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,L&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Lc(null,t,e,r,n);break a}if(a===ie){t.tag=14,t=Rc(null,t,e,r,n);break a}if(a===k){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=wc(r,t.pendingProps),Yc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,R,r),r!==o.cache&&Sa(t,[R],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ha(a),t=Xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(aa=_m(e.firstChild),ia=t,L=!0,oa=null,sa=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=n:L||(t.stateNode=bp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&L&&(r=t.stateNode=Cm(t.type,t.pendingProps,we.current),ia=t,sa=!0,a=aa,Ap(t.type)?(vm=a,aa=_m(r.firstChild)):aa=a),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&L&&((a=r=aa)&&(r=dm(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,ia=t,aa=_m(r.firstChild),sa=!1,a=!0)),a||la(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,xp(a,o)?r=null:s!==null&&xp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=es(e,t,rs,null,null,n),mh._currentValue=a),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&L&&((e=n=aa)&&(n=fm(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||la(t)),null;case 13:return el(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ta(t),a=Ea(a),r=r(a),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(R),e===null?(a=Ka(),a===null&&(a=V,o=Ma(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ho(t),ya(t,R,a)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,R,r),r!==a.cache&&Sa(t,[R],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,R,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:L&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Jd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(Jd())e.flags|=8192;else throw no=Qa,Xa}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,hd|=t)}function yl(e,t){if(!L)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function bl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bl(t),null;case 1:return bl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(R),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),bl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(bl(t),gl(t,a,null,r,n)):(bl(t),_l(t,o))):o?o===e.memoizedState?(bl(t),t.flags&=-16777217):(hl(t),bl(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),bl(t),gl(t,a,e,r,n)),null;case 27:if(Oe(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}e=Se.current,fa(t)?ua(t,e):(e=Cm(a,r,n),t.stateNode=e,hl(t))}return bl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,fa(t))ua(t,o);else{var s=_p(we.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(up(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||sp(e.nodeValue,n)),e||la(t,!0)}else e=_p(e).createTextNode(r),e[wt]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(i(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),bl(t),null);case 4:return Ee(),e===null&&Zf(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return ba(t.type),bl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return bl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return zo(t,Ro.current&1|2),L&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>xd&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!L)return bl(t),null}else 2*Ve()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Ro.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||L?zo(t,o):(n=o,xe(jo,t),xe(Ro,n),Mo===null&&(Mo=t)),L&&$i(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&be(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(R),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(R),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return ba(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&be(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(R),null;case 25:return null;default:return null}}function Cl(e,t){switch(na(t),t.tag){case 3:ba(R),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ba(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&be(Ga);break;case 24:ba(R)}}function wl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){yf(t,t.return,e)}}function Tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){yf(e,e.return,t)}}}function Dl(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function Ol(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Hp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Up(e);f(e.child,!1,om,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){yf(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){yf(e,t,n)}else n.current=null}}function Al(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)cm(e.stateNode,t[n])}function jl(e){for(var t=e.return;t!==null&&(Pl(t)&&cm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Ml(e){for(var t=e.return;t!==null&&(Pl(t)&&lm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Nl(e){return e.tag===5||e.tag===3||e.tag===27}function Pl(e){return e&&e.tag===7&&e.stateNode!==null}function Fl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){yf(e,e.return,t)}}function Il(e,t,n){try{var r=e.stateNode;fp(r,e.type,n,t),r[Tt]=t}catch(t){yf(e,e.return,t)}}function Ll(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ap(e.type)||e.tag===4}function Rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ll(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ap(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xn)),Al(e,r),Jt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Ap(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Al(e,r),Jt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Ap(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Bl(e,t,n,r),e=e.sibling;e!==null;)Bl(e,t,n,r),e=e.sibling}function Vl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);up(t,r,n),t[wt]=e,t[Tt]=n}catch(t){yf(e,e.return,t)}}var Hl=!1,Ul=null;function Wl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Hl=!0)}var Gl=null;function Kl(){var e=Gl;return Gl=null,e}var ql=0;function Jl(e,t,n,r,i){return ql=0,Yl(e.child,t,n,r,i)}function Yl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ip(o);r.push(s),s.view&&(a=!0)}else a||Ip(o).view&&(a=!0);Hl=!0,Np(o,ql===0?t:t+`_`+ql,n),ql++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Yl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Xl(e,t){for(;e!==null;)e.tag===5?Pp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Xl(e.child,t),e=e.sibling}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Jl(e,n,t,null,!1)||Xl(e.child,!1))}e=e.sibling}}function Ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Zl(e):Jl(e,i,a,null,!1)?(Zl(e),n.paired||t||Rd(e,r.onEnter)):Xl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e,t),e=e.sibling;else Zl(e)}function $l(e){if(Ul!==null&&Ul.size!==0){var t=Ul;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Jl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Xl(e.child,!1)),t.delete(r),t.size===0)break}}}$l(e)}e=e.sibling}}}function eu(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Ul===null?void 0:Ul.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Jl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ul.delete(n),Rd(e,t.onShare)):Xl(e.child,!1)),Ul!==null&&$l(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else Ul!==null&&$l(e)}function tu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Jl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&tu(e);e=e.sibling}}function nu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Xl(e.child,!1))}nu(e)}e=e.sibling}}function ru(e){if(e.tag===30)e.stateNode.paired=null,Xl(e.child,!1),nu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else nu(e)}function iu(e){for(e=e.child;e!==null;)e.tag===30?Xl(e.child,!1):e.subtreeFlags&33554432&&iu(e),e=e.sibling}function au(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&ql<a.length){var l=a[ql],u=Ip(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Np(c,ql===0?n:n+`_`+ql,i),s&&e.flags&4||(Gl===null&&(Gl=[]),Gl.push(c,ql===0?r:r+`_`+ql,t.memoizedProps)),ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:au(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ou(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Lp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;ql=0,i=au(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ou(e,t);e=e.sibling}}var su=!1,cu=!1,lu=!1,uu=!1,du=typeof WeakSet==`function`?WeakSet:Set,fu=null,pu=!1,mu=!1,hu=!1,gu=!1;function _u(e,t,n){if(e=e.containerInfo,hp=Ch,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(gp={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,fu=t,t=n?9270:1024;fu!==null;){if(e=fu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&eu(r[a]);if(e.alternate===null&&e.flags&2)n&&Wl(e),vu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&eu(r),vu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Wl(e),vu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,fu=r):(n&&tu(e),vu(n))}}Ul=null}function vu(e){for(;fu!==null;){var t=fu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)um(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:um(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Jl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,fu=r;break}fu=t.return}}function yu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&wl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(Ru(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{To(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&Vl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Fl(n),r&512&&Ol(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Ou(e,n);break;case 13:Ru(e,n),r&4&&ku(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),gm(e,n))));break;case 22:if(r=n.memoizedState!==null||su,!r){var a=t!==null&&t.memoizedState!==null||cu;t=su,i=cu,su=r,(cu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),su=t,cu=i}break;case 30:Ru(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:Ru(e,n)}}function bu(e,t){for(e=e.child;e!==null;)xu(e,t),e=e.sibling}function xu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){yf(e,e.return,t)}Su(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Mp(s,!0):Mp(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&bu(e,t);break;default:bu(e,t)}}function Su(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:xu(n,r);break a;case 22:n.memoizedState===null&&Su(n,r);break a;default:Su(n,r)}}e=e.sibling}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var wu=null,Tu=!1;function Eu(e,t,n){for(n=n.child;n!==null;)Du(e,t,n),n=n.sibling}function Du(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:cu||kl(n,t),Eu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!cu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cu||kl(n,t),Ml(n);var r=wu,i=Tu;Ap(n.type)&&(wu=n.stateNode,Tu=!1),Eu(e,t,n),wm(n.stateNode,n.type,n.memoizedProps),wu=r,Tu=i;break;case 5:cu||kl(n,t),Ml(n);case 6:if(n.tag===6&&Ml(n),r=wu,i=Tu,wu=null,Eu(e,t,n),wu=r,Tu=i,wu!==null){if(Tu)try{(wu.nodeType===9?wu.body:wu.nodeName===`HTML`?wu.ownerDocument.body:wu).removeChild(n.stateNode),Jt=!0}catch(e){yf(n,t,e)}else try{wu.removeChild(n.stateNode),Jt=!0}catch(e){yf(n,t,e)}}break;case 18:wu!==null&&(Tu?(e=wu,jp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Yh(e)):jp(wu,n.stateNode));break;case 4:r=wu,i=Tu,wu=n.stateNode.containerInfo,Tu=!0,Eu(e,t,n),wu=r,Tu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),cu||Tl(4,n,t),Eu(e,t,n);break;case 1:cu||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),Eu(e,t,n);break;case 21:Eu(e,t,n);break;case 22:cu=(r=cu)||n.memoizedState!==null,Eu(e,t,n),cu=r;break;case 30:kl(n,t),Eu(e,t,n);break;case 7:cu||kl(n,t),Eu(e,t,n);break;default:Eu(e,t,n)}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yh(e)}catch(e){yf(t,t.return,e)}}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yh(e)}catch(e){yf(t,t.return,e)}}function Au(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new du),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new du),t;default:throw Error(i(435,e.tag))}}function ju(e,t){var n=Au(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function Mu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ap(l.type)){wu=l.stateNode,Tu=!1;break a}break;case 5:wu=l.stateNode,Tu=!1;break a;case 3:case 4:wu=l.stateNode.containerInfo,Tu=!0;break a}l=l.return}if(wu===null)throw Error(i(160));Du(s,c,o),wu=null,Tu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var B=null;function Nu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Mu(t,e,n),Pu(e),a&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:Mu(t,e,n),Pu(e),a&512&&(cu||r===null||kl(r,r.return)),a&64&&su&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=B,Mu(t,e,n),Pu(e),a&512&&(cu||r===null||kl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(su)e.stateNode=bp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),up(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=$m(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=$m(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else su||W(o,e.type,e.stateNode)}else e.stateNode=Jm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Il(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||cu||t.parentNode.removeChild(t)):a.count--,n===null?su||W(o,e.type,e.stateNode):Jm(o,n,e.memoizedProps))}break;case 27:Mu(t,e,n),Pu(e),a&512&&(cu||r===null||kl(r,r.return)),r!==null&&a&4&&Il(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=lu,lu=!1,Mu(t,e,n),lu=o,Pu(e),a&512&&(cu||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Il(e,t,r===null?t:r.memoizedProps)),a&1024&&(uu=!0);break;case 6:if(Mu(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){yf(e,e.return,t)}}break;case 3:if(Jt=!1,Qm=null,o=B,B=Om(t.containerInfo),Mu(t,e,n),B=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Yh(t.containerInfo)}catch(t){yf(e,e.return,t)}uu&&(uu=!1,Fu(e)),Jt=!1;break;case 4:a=lu,lu=su,r=Yt(),o=B,B=Om(e.stateNode.containerInfo),Mu(t,e,n),Pu(e),B=o,Jt&&mu&&(hu=!0),Jt=r,lu=a;break;case 12:Mu(t,e,n),Pu(e);break;case 31:Mu(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 13:Mu(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=su,l=cu,u=lu;su=c||o,lu=u||o,cu=l||s,Mu(t,e,n),cu=l,lu=u,su=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||su||cu||(t=s||cu,n=su,r=cu,su=o||su,cu=t,zu(e,2),su=n,cu=r),!o&&lu||bu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ju(e,n))));break;case 19:Mu(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 30:a&512&&(cu||r===null||kl(r,r.return)),a=Yt(),o=mu,s=(n&335544064)===n,c=e.memoizedProps,mu=s&&bi(c.default,c.update)!==`none`,Mu(t,e,n),Pu(e),s&&r!==null&&Jt&&(e.flags|=4),mu=o,Jt=a;break;case 21:break;case 7:a&512&&(cu||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mu(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ll(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Pl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Nl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Bl(e,Rl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),Bl(e,Rl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;zl(e,Rl(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else ou(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Ql(e,!1);else switch(e.tag){case 3:if(gu=pu=!1,Kl(),Iu(t,e),!pu&&!hu){if(e=Gl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Pp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),gu=!0}Gl=null;break;case 5:Iu(t,e);break;case 4:r=pu,pu=!1,Iu(t,e),pu&&(hu=!0),pu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Ql(e,!1));break;case 30:r=pu,i=Kl(),pu=!1,Iu(t,e),pu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,ql=0,t=au(e,n,t,o,s,a,!0),ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Gl=i):i!==null&&(i.push.apply(i,Gl),Gl=i),pu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),zu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),zu(n,r);break;case 27:r&2&&wm(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||Ml(n),zu(n,r);break;case 6:Ml(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||cu||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:kl(n,n.return),zu(n,r);break;case 7:kl(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Bu(i,a,n),wl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)wo(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Vl(a);case 5:a.tag!==5&&a.tag!==27||jl(a),Bu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 6:jl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||su||W(Om(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 13:Bu(i,a,n),s&&o&4&&ku(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Ol(a,a.return);break;case 30:Bu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Na(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&iu(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ru(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&wl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&gu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Na(a)));break;case 12:if(a&2048){Uu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){yf(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ru(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ru(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Xl(a.child,!0),Xl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Gu(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,B,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=B;B=Om(e.stateNode.containerInfo),Ju(e,t,n),B=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ul===null&&(Ul=new Map),Ul.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;fu!==null;){var n=fu;switch(n.tag){case 0:case 11:case 15:Tl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fu=r;else a:for(n=e;fu!==null;){r=fu;var i=r.sibling,a=r.return;if(Cu(r),r===n){fu=null;break a}if(i!==null){i.return=a,fu=i;break a}fu=a}}}var td={getCacheForType:function(e){var t=Ea(R),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(R).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,rd=0,V=null,H=null,U=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return rd&2&&U!==0?U&-U:M.T===null?xt():Bf()}function Ld(){if(md===0){if(!(U&536870912)||L){var e=at;at<<=1,!(at&3932160)&&(at=262144),md=e}else md=536870912}return e=jo.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Hp(vi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===V&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,U,md,!1)),mt(e,n),rd&2&&e===V||(e===V&&(!(rd&2)&&(fd|=n),ud===4&&Ud(e,U,md,!1)),Mf(e))}function Bd(e,t,n){if(rd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n))a=Qd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-Ve(),10<a)){if(Ud(r,t,md,!od),ct(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=wp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}}while(1);Mf(e)}function Vd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Ul=null,Yu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-Ve():(a&4194048)===a?bd-Ve():0,m=sh(d,m),m!==null)?(Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l)):cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ud(e,t,n,r){t=ut(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&>(e,n,t)}function Wd(){return rd&6?!0:(Nf(0,!1),!1)}function Gd(){if(H!==null){if(id===0)var e=H.return;else e=H,va=_a=null,os(e),ao=null,oo=0,e=H;for(;e!==null;)Cl(e.alternate,e),e=e.return;H=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Tp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),V=e,H=n=Fi(e.current,null),U=t,id=0,ad=null,od=!1,sd=lt(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=ut(e,t),Ti(),n}function qd(e,t){z=null,M.H=gc,t===Ya||t===Za?(t=ro(),id=3):t===Xa?(t=ro(),id=4):id=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,H===null&&(ud=1,Oc(e,Ui(t,e.current)))}function Jd(){var e=jo.current;return e===null?!0:(U&4194048)===U?Mo===null:(U&62914560)===U||U&536870912?e===Mo:!1}function Yd(){var e=M.H;return M.H=gc,e===null?gc:e}function Xd(){var e=M.A;return M.A=td,e}function Zd(){ud=4,od||(U&4194048)!==U&&jo.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||V===null||Ud(V,U,md,!1)}function Qd(e,t,n){var r=rd;rd|=2;var i=Yd(),a=Xd();(V!==e||U!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&H!==null){var s=H,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,rd=r,M.H=i,M.A=a,H===null&&(V=null,U=0,Ti()),o}function $d(){for(;H!==null;)nf(H)}function ef(e,t){var n=rd;rd|=2;var r=Yd(),a=Xd();V!==e||U!==t?(Sd=null,xd=Ve()+500,Kd(e,t)):sd=lt(e,t);a:do try{if(id!==0&&H!==null){t=H;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if($a(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||V!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:$a(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(H.tag){case 26:s=H.memoizedState;case 5:case 27:var c=H;if(s?nh(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)H=l;else{var u=c.return;u===null?H=null:(H=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return va=_a=null,M.H=r,M.A=a,rd=n,H===null?(V=null,U=0,Ti(),ud):0}function tf(){for(;H!==null&&!ze();)nf(H)}function nf(e){var t=ml(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):H=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,U);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,U);break;case 5:os(t);var r=t;r===ia&&(L?(da(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(da(r),L=!0));default:Cl(n,t),t=H=Ii(t,ld),t=ml(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):H=t}function af(e,t,n,r){va=_a=null,os(t),ao=null,oo=0;var i=t.return;try{if(Nc(e,i,t,n,U)){ud=1,Oc(e,Ui(n,e.current)),H=null;return}}catch(t){if(i!==null)throw H=i,t;ud=1,Oc(e,Ui(n,e.current)),H=null;return}t.flags&32768?(L||r===1?e=!0:sd||U&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=xl(t.alternate,t,ld);if(n!==null){H=n;return}if(t=t.sibling,t!==null){H=t;return}H=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,H=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){H=e;return}H=e=n}while(e!==null);ud=6,H=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(rd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===V&&(H=V=null,U=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=wi,ht(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Ia(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Ge,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Hl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=rd,rd|=4;try{_u(e,t,n)}finally{rd=a,N.p=i,M.T=r}}wd=1,Hl?jd=Bp(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Lu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=rd;rd|=4;try{mu=hu=!1,Nu(t,e,n),n=gp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ch=!!hp,gp=hp=null}finally{rd=a,N.p=i,M.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=rd;rd|=4;try{yu(e,t.alternate,t)}finally{rd=i,N.p=r,M.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Be();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),bt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{M.T=n,N.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=bt(Dd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,rd&6)throw Error(i(331));var c=rd;if(rd|=4,Qu(o.current),Wu(o,o.current,s,n),rd=c,Nf(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{N.p=a,M.T=r,hf(e,t)}}function vf(e,t,n){t=Ui(n,t),t=Ac(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(mt(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Ui(n,e),n=jc(2),r=vo(t,n,2),r!==null&&(Mc(n,r,t,e),mt(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,V===e&&(U&n)===n&&(ud===4||ud===3&&(U&62914560)===U&&300>Ve()-yd?rd&2?pd|=n:Kd(e,0):pd|=n,hd===U&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=ft()),e=Oi(e,t),e!==null&&(mt(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Le(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=U,a=ct(r,r===V?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Cp()&&(e=jf);for(var t=Ve(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=V,n=U,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),bt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Lf.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=U;return r=ct(e,e===V?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Op(function(){rd&6?Le(Ue,Pf):Ff()})}function Bf(){if(jf===0){var e=za;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<hi.length;Uf++){var Wf=hi[Uf];gi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}}}}function Jf(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Qf(t,e,2,!1),n.add(r))}function Yf(e,t,n){var r=0;t&&(r|=4),Qf(n,e,r,t)}var Xf=`_reactListening`+Math.random().toString(36).slice(2);function Zf(e){if(!e[Xf]){e[Xf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Yf(t,!1,e),Yf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xf]||(t[Xf]=!0,Yf(`selectionchange`,!1,t))}}function Qf(e,t,n,r){switch(Ah(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!jn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function $f(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}On(function(){var r=a,i=Cn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case si:case ci:case li:l=Qn;break;case pi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=kn(m,p),g!=null&&d.push(ep(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Pt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?C(c,l,np):null,c!==null&&rp(s,u,c,d,!1),l!==null&&f!==null&&rp(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=Mr):_=zr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(mr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=tp(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=tp(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function ep(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=kn(e,n),i!=null&&r.unshift(ep(e,i,a)),i=kn(e,t),i!=null&&r.push(ep(e,i,a))),e.tag===3)return r;e=e.return}return[]}function np(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=kn(n,a),l!=null&&o.unshift(ep(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(ep(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ip=/\r\n?/g,ap=/\u0000|\uFFFD/g;function op(e){return(typeof e==`string`?e:``+e).replace(ip,`
|
|
1252
|
-
`).replace(ap,``)}function sp(e,t){return t=op(t),op(e)===t}function cp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&cp(e,t,`name`,a.name,a,null),cp(e,t,`formEncType`,a.formEncType,a,null),cp(e,t,`formMethod`,a.formMethod,a,null),cp(e,t,`formTarget`,a.formTarget,a,null)):(cp(e,t,`encType`,a.encType,a,null),cp(e,t,`method`,a.method,a,null),cp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=bn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function lp(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,o,s,n,null)}}a&&cp(e,t,`srcSet`,n.srcSet,n,null),r&&cp(e,t,`src`,n.src,n,null);return;case`input`:Jf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:cp(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:cp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Jf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:cp(e,t,s,c,n,null)}fn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:cp(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&lp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&cp(e,t,c,r,n,null))}var dp={};function fp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||cp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&cp(e,t,p,m,r,f)}}sn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||cp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&cp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:cp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&cp(e,t,s,a,r,o)}dn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:cp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:cp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&cp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:cp(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&lp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||lp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&cp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||cp(e,t,f,p,r,m)}function pp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function mp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&pp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&pp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var hp=null,gp=null;function _p(e){return e.nodeType===9?e:e.ownerDocument}function vp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function yp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function bp(e,t,n,r){return n=_p(n).createElement(e),n[wt]=r,n[Tt]=t,up(n,e,t),Rt(n),n}function xp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sp=null;function Cp(){var e=window.event;return e&&e.type===`popstate`?e!==Sp&&(Sp=e,!0):(Sp=null,!1)}var wp=typeof setTimeout==`function`?setTimeout:void 0,Tp=typeof clearTimeout==`function`?clearTimeout:void 0,Ep=typeof Promise==`function`?Promise:void 0,Dp=typeof requestAnimationFrame==`function`?requestAnimationFrame:wp,Op=typeof queueMicrotask==`function`?queueMicrotask:Ep===void 0?wp:function(e){return Ep.resolve(null).then(e).catch(kp)};function kp(e){setTimeout(function(){throw e})}function Ap(e){return e===`head`}function jp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function Mp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Np(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Pp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Fp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ip(e){return Fp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Lp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Fp(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Rp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(zp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Jp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=_(e),xm(e,t))}Up.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=_p(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,Sm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Up.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function am(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Xp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),am(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),am(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=_(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,t))}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function um(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:um(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function dm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_m(e.nextSibling),e===null)break}return null}function fm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_m(e.nextSibling),e===null))return null;return e}function pm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_m(e.nextSibling),e===null))return null;return e}function mm(e){return e.data===`$?`||e.data===`$~`}function hm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _m(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vm=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _m(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Sm(e){Dp(function(){Dp(function(t){return e(t)})})}function Cm(e,t,n){switch(t=_p(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&cp(e,t,r,null,dp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Nt(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Em=new Map,Dm=new Set;function Om(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var km=N.d;N.d={f:Am,r:jm,D:Pm,C:Fm,L:Im,m:Lm,X:zm,S:Rm,M:Bm};function Am(){var e=km.f(),t=Wd();return e||t}function jm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):km.r(e)}var Mm=typeof document>`u`?null:document;function Nm(e,t,n){var r=Mm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),up(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Pm(e){km.D(e),Nm(`dns-prefetch`,e,null)}function Fm(e,t){km.C(e,t),Nm(`preconnect`,e,t)}function Im(e,t,n){km.L(e,t,n);var r=Mm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Hm(e);break;case`script`:a=Km(e)}if(!(Em.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Em.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);up(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Lm(e,t){km.m(e,t);var n=Mm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Km(e)}if(!Em.has(a)&&(e=w({rel:`modulepreload`,href:e},t),Em.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),up(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=Lt(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Em.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);Rt(c),up(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){km.X(e,t);var n=Mm;if(n&&e){var r=Lt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Rt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){km.M(e,t);var n=Mm;if(n&&e){var r=Lt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Rt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=we.current)?Om(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Hm(n.href),t=Lt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Em.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Em.set(e,o)),Gm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Km(n),t=Lt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hm(e){return`href="`+on(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),up(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Km(e){return`[src="`+on(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),up(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Wm(n),(a=Em.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),up(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Em.get(o))&&(r=w({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),up(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ym(r,n.precedence,e));return t.instance}function Ym(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function $m(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function W(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),up(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*mp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:k,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function _h(e){return e?(e=ji,e):ji}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(zd(n,e,t),yo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&zd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Id();t=yt(t);var n=Oi(e,t);n!==null&&zd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Eh(e,t,n,r)}finally{N.p=a,M.T=i}}function Th(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Eh(e,t,n,r)}finally{N.p=a,M.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)$f(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(rd&6)&&(xd=Ve()+500,Nf(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&zd(s,a,2),Wd(),bh(a,2)}if(a=Dh(r),a===null&&$f(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(e,t,r,null,n)}}function Dh(e){return e=Cn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=Pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=Pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,St(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=Ft(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Id(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Wd(),t[Et]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.1`)throw Error(i(527,$h,`19.3.1`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{Xe=tg.inject(eg),Ze=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[Et]=t.current,Zf(e),new Zh(t)}})),SD=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=xD()}))(),CD={root:`selector`,definitions:`portable`,bindings:`portable`,player:`portable`,options:`portable`,routes:`portable`,foregroundSelector:`host`,screenShakeProfiles:`host`,canPlaceManually:`host`,recordingUiMode:`host`,shadowDom:`host`,hudMode:`host`,hudLinks:`host`},wD=Object.keys(CD),TD=Object.entries(CD).filter(([,e])=>e===`host`).map(([e])=>e),ED=class{root;report;isStopped;subscriptions=new Set;constructor(e,t,n){this.root=e,this.report=t,this.isStopped=n}on(e,t){if(this.isStopped())throw Error(`Playground is disposed`);let n=!0,r=r=>{let i=r.detail;if(e===`dispose`){if(n)try{t(i)}catch(e){this.report(e)}}else queueMicrotask(()=>{if(!this.isStopped()&&n)try{t(i)}catch(t){e!==`diagnostic`&&this.report(t)}})};this.root.addEventListener(`joyride:${e}`,r);let i=()=>{n=!1,this.root.removeEventListener(`joyride:${e}`,r),this.subscriptions.delete(i)};return this.subscriptions.add(i),i}emitDispose(){this.root.dispatchEvent(new CustomEvent(`joyride:dispose`))}emitStateChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:state:change`,{bubbles:!0,detail:e}))}emitTourChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:tour:change`,{bubbles:!0,detail:e}))}emitRecordingEnd(e){this.root.dispatchEvent(new CustomEvent(`joyride:recording:end`,{bubbles:!0,detail:e}))}clear(){for(let e of this.subscriptions)Cg(this.report,e);this.subscriptions.clear()}};function DD(e){let{settings:t,preset:n,recording:r,aiCars:i,popoverAnchor:a,popoverTab:o,selectedAiId:s,embedSettings:c,requestedMasterVolume:l,exportConfiguration:u}=e,d=c??Pe({...t,masterVolume:l}),f,p;if(a&&u)try{if(f=u(),c){let{format:e,version:n,...r}=f;f=ie({...r,options:Pe(ce({...t,masterVolume:l},c))})}}catch(e){p=e instanceof Error?e.message:String(e)}return{settings:t,preset:n,recording:r,aiCars:i,popover:{anchor:a,tab:o,selectedAiId:s},exportedConfiguration:f,embed:{bookmarklet:a&&f?Ae(f):``,html:a&&f?Fe(f):``,async:a&&f?ze(f):``,npm:a&&f?Ce(f):``,error:p,configuration:d}}}function OD({options:e,registry:t,resources:n,getDrive:r,render:i,onDisposed:a}){let o=ce(y,e.options??{}),s,c,l=new Promise((e,t)=>{s=e,c=t});l.catch(()=>{});let u=!1,d=new ED(t.root,e=>t.report(e),()=>u);n.own(()=>d.clear());let f=ue.porsche911997,p=o.masterVolume,m=p>0;o={...o,masterVolume:0};let g=p||1,_={popoverAnchor:null,popoverTab:`vehicle`,selectedAiId:null},v=new NS;n.own(()=>v.detach());let b=new gt(e.recordingUiMode),x=new Sy(f,{idleSound:o.idleSound,masterVolume:o.masterVolume});n.own(()=>x.stop());let S=()=>{if(u)throw Error(`Playground is disposed`);let e=r()?.getPlayground();if(!e)throw Error(`Playground is initializing; await ride.ready before issuing this command`);return e},C=e=>{_={..._,...e},i()},w=(e,t=e.masterVolume!==void 0)=>{if(u)throw Error(`Playground is disposed`);t&&(m=!1);let n=o.masterVolume<=0;o=ce(o,Pe({...o,...e})),o.masterVolume>0&&(g=o.masterVolume),x.setMasterVolume(o.masterVolume),n&&o.masterVolume>0&&x.start(),x.setIdleSound(o.idleSound),i()},T=0,E=e=>{let n=we(e);if(!n)return!1;let r=fe(e)||Me(e)?t.registerVehiclePreset(`editor-${++T}`,n):e;return S().player?.update({vehicle:r}),i(),!0},D={ready:l,bind:(e,n)=>t.bind(e,n),inspect:e=>typeof e==`string`?t.objects.find(t=>t.id===e)??null:t.get(e)??null,on:(e,t)=>d.on(e,t),spawn:e=>S().spawn(e),pour:(e,t)=>S().pour(e,t),debris:(e,t)=>S().debris(e,t),route:(e,t)=>S().route(e,t),reset:()=>S().reset(),dispose(){u||(u=!0,Cg(e=>t.report(e),()=>d.emitDispose()),c(Error(`Playground disposed before initialization completed`)),n.dispose())},update(e){if(u)throw Error(`Playground is disposed`);w(ce(o,e),e.audio?.masterVolume!==void 0)},get options(){return Pe({...o,masterVolume:m?g:o.masterVolume})},exportConfiguration(){let n=S(),r=TD.filter(t=>e[t]!==void 0).map(e=>({path:e,reason:`this host presentation override is not part of portable playground authoring`}));if(e.root instanceof Element&&r.push({path:`root`,reason:`use a selector root for portable configuration`}),r.length)throw new h(r);let i=n.player?.state,a=n.world.playerVehicle;return ie({root:typeof e.root==`string`?e.root:void 0,definitions:t.exportDefinitions(),player:i&&a?{vehicle:t.vehicleName(a.sim.car.preset.id),appearance:i.appearance,slots:i.slots}:void 0,bindings:t.exportBindings(),routes:n.zones.exportRoutes(),options:D.options})},openConfigure(){S();let e=r()?.getCarAnchor();return!e||u?!1:(C({popoverAnchor:e,popoverTab:`vehicle`,selectedAiId:null}),!0)},startAudio:()=>(S(),x.start()),async setSlowMo(e,t){await l,S(),r()?.setSlowMo(e,t)},getCarAnchor:()=>r()?.getCarAnchor()??null,async arriveAt(e){return await l,S(),r()?.arriveAt(e)??`unavailable`},async startTour(e,t){return await l,S(),r()?.startTour(e,t)??!1},stopTour:()=>{S(),r()?.stopTour()},getVehicle:e=>S().getVehicle(e),get player(){return S().player},get state(){let e=r()?.getPlayground();return u||!e?null:Object.freeze({playerId:e.world.playerVehicle?.id??null,focusVehicleId:e.world.cameraVehicle?.id??null,player:e.player?.state??null,points:e.world.points})},async driveVehicleTo(e,t,n){return await l,S(),r()?.driveVehicleTo(e,t,n)??!1},async tourVehicle(e,t,n){return await l,S(),r()?.tourVehicle(e,t,n)??!1},startRecording:()=>(S(),r()?.startRecording()??!1),stopRecording:()=>(S(),r()?.stopRecording()??null),async playRecording(e,t){let n;try{n=pt(e)}catch{return!1}return await l,S(),r()?.playRecording(n,t)??!1},stopPlayback:()=>{S(),r()?.stopPlayback()}};return{controller:D,events:d,aiFleet:v,recordingSession:b,audio:x,get stopped(){return u},get ui(){return _},presentation(){return DD({options:e,settings:o,preset:r()?.getPlayground()?.world.focusVehicle?.sim.car.preset??f,recording:b.state,aiCars:v.getSnapshot(),..._,requestedMasterVolume:_.embedSettings&&r()?.getPlayground()?D.options.audio.masterVolume:o.masterVolume,exportConfiguration:r()?.getPlayground()?()=>D.exportConfiguration():void 0})},applySettings:w,selectPreset:E,savePreset(e){He(e),E(e.id)},deletePreset(e){Ie(e),E(fe(e)?ue.porsche911997.id:e)},updateUi:C,toggleMute(){w({masterVolume:o.masterVolume>0?0:g})},onAudioInteraction(){m&&w({masterVolume:g})},openHudSettings(){let e=r()?.getCarAnchor();e&&C({popoverAnchor:e,popoverTab:`settings`,selectedAiId:null})},onReady(){try{e.player&&S().player?.update(e.player);for(let[t,n]of Object.entries(e.routes??{}))S().route(t,n);s(D),i()}catch(e){c(e),queueMicrotask(()=>D.dispose())}},onReactError(e){c(e),queueMicrotask(()=>D.dispose())},onRecordingEnd(e,t){b.setRecording(e),d.emitRecordingEnd({recording:e,reason:t})},onPlaybackEnd(){b.state.mode===`playing`&&b.setMode(`ready`)},onPlacementEnd(e){b.state.recording&&b.setPose(`custom`,e)},connect(){let e=()=>i();t.root.addEventListener(`joyride:vehicle:change`,e),n.own(()=>t.root.removeEventListener(`joyride:vehicle:change`,e)),n.own(b.subscribe(i)),n.own(()=>{u=!0,c(Error(`Playground disposed before initialization completed`)),a(D)})},attachAiWhenReady(){l.then(()=>{let e=r();!u&&e&&v.attach(e)}).catch(()=>{})}}}var kD=`[data-jr-arrive-to]`;function AD(e,t,n,r=()=>!0){let i=e.getAttribute(t);if(i===null)return n;let a=Number(i);if(!i.trim()||!Number.isFinite(a)||!r(a))throw TypeError(`${t} must be a valid number`);return a}function jD(e){let t=e.querySelector(kD);if(!t)return null;let n=AD(t,`data-jr-arrive-to-angle-rad`,0),r=AD(t,`data-jr-arrive-to-distance-px`,185,e=>e>0),i=AD(t,`data-jr-arrive-to-fade-fraction`,.5,e=>e>=0&&e<=1),a=AD(t,`data-jr-arrive-to-steer`,.04,e=>Math.abs(e)<=1),o=AD(t,`data-jr-arrive-to-delay-ms`,0,e=>e>=0),s=t.getAttribute(`data-jr-arrive-to-speed-mps`)===null?void 0:AD(t,`data-jr-arrive-to-speed-mps`,0,e=>e>0);return{target:t,delayMs:o,approach:{angleRad:n,distancePx:r,fadeFraction:i,...s?{initialSpeedMps:s}:{}},handbrake:{steer:a}}}function MD(e,t=Math.random){return{target:{xPx:e.scrollX+e.innerWidth/2,yPx:e.scrollY+e.innerHeight/2},approach:{angleRad:t()*Math.PI*2,distancePx:Math.min(185,Math.max(80,Math.min(e.innerWidth,e.innerHeight)*.4)),fadeFraction:.5},handbrake:{steer:.04}}}function ND(e,t,n){if(n.aborted)return Promise.resolve(!1);let r=Math.max(0,t+e-performance.now());return r===0?Promise.resolve(!0):new Promise(e=>{let t=t=>{clearTimeout(a),n.removeEventListener(`abort`,i),e(t)},i=()=>t(!1),a=setTimeout(()=>t(!0),r);n.addEventListener(`abort`,i,{once:!0})})}async function PD(e,t){let n=performance.now()+2e3,r=null;for(;!t();){let t=e.getBoundingClientRect(),i=e.isConnected&&t.width>0&&t.height>0&&t.left>=0&&t.top>=0&&t.right<=window.innerWidth&&t.bottom<=window.innerHeight&&getComputedStyle(e).visibility!==`hidden`;if(i&&r&&Math.abs(t.x-r.x)<2&&Math.abs(t.y-r.y)<2&&Math.abs(t.width-r.width)<2&&Math.abs(t.height-r.height)<2)return!0;if(r=i?t:null,performance.now()>=n)return!1;await new Promise(e=>requestAnimationFrame(()=>e()))}return!1}var FD=`modulepreload`,ID=function(e,t){return new URL(e,t).href},LD={},RD=function(e){return e.pathname.endsWith(`.css`)},zD=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},BD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ID(t,n);let r=s(t),i=RD(r);return zD(LD,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:FD,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},VD=iD(aD),HD=(0,Q.lazy)(()=>BD(()=>import(`./vehicle-popover-BOloRPP9.js`).then(e=>({default:e.VehiclePopover})),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),UD,WD=()=>UD;function GD(e={}){let t=performance.now(),n=jD(document),{format:r,version:i,...a}=`format`in e?oe(e):e,o=new Set(wD);for(let e of Object.keys(a))if(!o.has(e))throw TypeError(`Unknown mount option: ${e}`);let s=a;if(UD)throw Error(`JoyRide is already mounted. Dispose the current playground before mounting another.`);let c=typeof s.root==`string`?document.querySelector(s.root):s.root;if(s.root&&!c)throw Error(`Playground root did not match an element`);let l=new BS;try{let e=new Ue(c??document,s.definitions);if(l.own(()=>e.dispose()),s.player){let t=pe(s.player);e.resolveVehicle(t.vehicle);for(let n of Object.values(t.slots??{}))n&&n.action===`eject`&&e.resolveLiquid(n.liquid)}let r=(0,Q.createRef)(),i=!0,a=()=>{},o=()=>{},u=OD({options:s,registry:e,resources:l,getDrive:()=>r.current,render:()=>o(),onDisposed:e=>{UD===e&&(UD=void 0)}}),{controller:d,events:f,aiFleet:p,recordingSession:m,audio:h}=u,g=document.createElement(`div`);l.own(()=>g.remove()),g.dataset.jrEmbed=``,g.style.display=`contents`;let _=s.shadowDom===!1?null:g.attachShadow({mode:`open`});if(_){let e=document.createElement(`style`);e.textContent=VD,_.append(e)}l.own(_?vD(g):()=>{}),document.body.append(g);let v=(0,SD.createRoot)(_??g,{onUncaughtError:e=>u.onReactError(e)});l.own(()=>v.unmount()),o=()=>{if(u.stopped)return;let t=u.presentation(),{preset:n,recording:c,popover:l}=t,g=_D(m,{driveRef:r,close:()=>u.updateUi({popoverAnchor:null})});v.render((0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(fD,{workMode:t.settings,showGithub:t.settings.showGithub,brandColor:t.settings.brandColor,brandName:t.settings.brandName,vehicleDestructible:t.settings.vehicleDestructible,weaponsEnabled:t.settings.weaponsEnabled,enabledTools:t.settings.enabledTools,ref:r,playground:e,initialArrivalPending:!0,onReady:e=>{i&&(a=()=>{i&&(i=!1,e.sim.paused=!1)}),u.onReady()},overlay:!0,overlayRoot:_??void 0,showHud:t.settings.showHud,showTotalPoints:t.settings.showTotalPoints,hudMode:s.hudMode,hudLinks:[{id:`hide`,label:`Hide`,ariaLabel:`Hide HUD`,onClick:()=>u.applySettings({showHud:!1})},...(s.hudLinks??[]).map(t=>({...t,onClick:()=>Cg(t=>e.report(t),t.onClick)}))],onHudConfigure:u.openHudSettings,mode:`car`,preset:n,canPlaceManually:s.canPlaceManually,audioEngine:h,paused:!!l.anchor,viewportWalls:t.settings.viewportWalls,viewportMode:t.settings.viewportMode,speedZoom:t.settings.speedZoom,lighting:t.settings.lighting,onLightingChange:e=>u.applySettings({lighting:e}),masterVolume:t.settings.masterVolume,onAudioInteraction:u.onAudioInteraction,onToggleMute:u.toggleMute,showToolbar:c.uiMode!==`record`||c.mode===`idle`,idleSound:t.settings.idleSound,quality:t.settings.quality,smokeTint:t.settings.smokeTint,sparks:t.settings.sparks,deform:t.settings.deform,screenShake:t.settings.screenShake,showHealthBars:t.settings.showHealthBars,showVehicleMarkers:t.settings.showVehicleMarkers,showWeaponBar:t.settings.showWeaponBar,weaponCooldown:t.settings.weaponCooldown,screenShakeProfiles:s.screenShakeProfiles,surfaceTone:t.settings.surfaceTone,debug:t.settings.debug,autoPaint:t.settings.autoPaint,bindings:s.bindings,foregroundSelector:s.foregroundSelector,rocketBlastStrength:t.settings.rocketBlastStrength,onCarClick:e=>{m.state.uiMode===`record`&&g.onExitPlayback(),u.updateUi({popoverAnchor:u.ui.popoverAnchor?null:e,popoverTab:`vehicle`,selectedAiId:null})},onCompanionClick:(e,t)=>u.updateUi({popoverAnchor:t,popoverTab:`ai`,selectedAiId:e}),onCompanionRemove:e=>{p.remove(e),u.updateUi(u.ui.selectedAiId===e?{selectedAiId:null,popoverAnchor:null}:{})},onStateChange:()=>f.emitStateChange(d.state),onTourStateChange:e=>f.emitTourChange(e),onRecordingEnd:u.onRecordingEnd,onRecordShortcut:g.onRecordShortcut,onPlaybackEnd:u.onPlaybackEnd,onPlacementEnd:u.onPlacementEnd,onExit:()=>{d.dispose()}}),c.uiMode===`record`&&(0,$.jsx)(mD,{mode:c.mode,showPath:c.showPath,driveRef:r,onTogglePath:g.onTogglePath,onStartRecord:g.onStartRecord,onStopRecord:g.onStopRecord,onPlay:g.onPlay,onStopPlayback:g.onStopPlayback,onDownload:g.onDownload,onDelete:g.onDelete,onExitPlayback:g.onExitPlayback}),c.uiMode===`record`&&(0,$.jsx)(hD,{snapshot:c,driveRef:r}),c.uiMode===`record`&&c.showPath&&c.mode===`playing`&&c.recording&&(0,$.jsx)(gD,{driveRef:r,durationMs:c.recording.durationMs}),l.anchor&&(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(HD,{objects:r.current?.getPlayground()?.objects,onDriveToObject:e=>{let t=r.current?.getPose()??null;u.updateUi({popoverAnchor:null}),requestAnimationFrame(()=>{e.scrollIntoView({block:`center`,inline:`center`,behavior:`instant`}),r.current?.arriveAt(Kw(e,t))})},...t.settings,preset:n,slots:d.player?.state.slots,presets:he(),options:t.settings,initialTab:l.tab,embed:{...t.embed,onConfigure:e=>u.updateUi({embedSettings:e})},onSelectPreset:e=>u.selectPreset(e.id),onSavePreset:u.savePreset,onDeletePreset:u.deletePreset,onChange:e=>u.applySettings(e),onClose:()=>u.updateUi({popoverAnchor:null}),recording:g,ai:{cars:t.aiCars,selectedId:l.selectedAiId,onSelect:e=>u.updateUi({selectedAiId:e}),onSpawn:(e,t,n,r)=>{u.updateUi({selectedAiId:p.add(e,t,n,r).id})},onUpdate:(e,t)=>{p.update(e,t),o()},onRemove:e=>{p.remove(e),u.updateUi({selectedAiId:null})}},onReset:()=>r.current?.reset(),onQuit:()=>queueMicrotask(()=>d.dispose())})})]}))},u.connect(),UD=d,o(),u.attachAiWhenReady();let y=new AbortController;return l.own(()=>y.abort()),d.ready.then(async()=>{let e=n?await PD(n.target,()=>u.stopped):!1;if(u.stopped)return;let i=e?n:MD(window),o=await ND(i.delayMs??0,t,y.signal);if(u.stopped||!o)return;a();let s=r.current?.arriveAt({...i,delayMs:0});s?s.finally(()=>{u.stopped||r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}):r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}).catch(t=>{e.report(t),u.stopped||(a(),r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1))}),d}catch(e){throw l.dispose(),e}}var KD={mount:GD,options:{presets:{sfw(e={}){return{...e,options:{...v,...e.options,policy:{...v.policy,...e.options?.policy},ui:{...v.ui,...e.options?.ui}}}}}},vehicleTools:n,availableVehicleTools:te,overlayLayers:Af,overlayZIndex:jf,define:We,get active(){return WD()},listPresets:he,listVehicleOptions:Re,getPreset:we,keyboardControls:rt};export{rt as S,Sy as _,iD as a,dn as b,ZE as c,GE as d,BT as f,MS as g,lT as h,aD as i,XE as l,vT as m,BD as n,eD as o,hT as p,vD as r,$E as s,KD as t,KE as u,Gm as v,ot as x,jf as y};
|
|
1252
|
+
`).replace(ap,``)}function sp(e,t){return t=op(t),op(e)===t}function cp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&cp(e,t,`name`,a.name,a,null),cp(e,t,`formEncType`,a.formEncType,a,null),cp(e,t,`formMethod`,a.formMethod,a,null),cp(e,t,`formTarget`,a.formTarget,a,null)):(cp(e,t,`encType`,a.encType,a,null),cp(e,t,`method`,a.method,a,null),cp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=bn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function lp(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,o,s,n,null)}}a&&cp(e,t,`srcSet`,n.srcSet,n,null),r&&cp(e,t,`src`,n.src,n,null);return;case`input`:Jf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:cp(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:cp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Jf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:cp(e,t,s,c,n,null)}fn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:cp(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&lp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&cp(e,t,c,r,n,null))}var dp={};function fp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||cp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&cp(e,t,p,m,r,f)}}sn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||cp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&cp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:cp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&cp(e,t,s,a,r,o)}dn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:cp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:cp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&cp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:cp(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&lp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||lp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&cp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||cp(e,t,f,p,r,m)}function pp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function mp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&pp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&pp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var hp=null,gp=null;function _p(e){return e.nodeType===9?e:e.ownerDocument}function vp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function yp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function bp(e,t,n,r){return n=_p(n).createElement(e),n[wt]=r,n[Tt]=t,up(n,e,t),Rt(n),n}function xp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sp=null;function Cp(){var e=window.event;return e&&e.type===`popstate`?e!==Sp&&(Sp=e,!0):(Sp=null,!1)}var wp=typeof setTimeout==`function`?setTimeout:void 0,Tp=typeof clearTimeout==`function`?clearTimeout:void 0,Ep=typeof Promise==`function`?Promise:void 0,Dp=typeof requestAnimationFrame==`function`?requestAnimationFrame:wp,Op=typeof queueMicrotask==`function`?queueMicrotask:Ep===void 0?wp:function(e){return Ep.resolve(null).then(e).catch(kp)};function kp(e){setTimeout(function(){throw e})}function Ap(e){return e===`head`}function jp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function Mp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Np(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Pp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Fp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ip(e){return Fp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Lp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Fp(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Rp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(zp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Jp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=_(e),xm(e,t))}Up.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=_p(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,Sm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Up.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function am(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Xp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),am(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),am(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=_(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,t))}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function um(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:um(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function dm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_m(e.nextSibling),e===null)break}return null}function fm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_m(e.nextSibling),e===null))return null;return e}function pm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_m(e.nextSibling),e===null))return null;return e}function mm(e){return e.data===`$?`||e.data===`$~`}function hm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _m(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vm=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _m(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Sm(e){Dp(function(){Dp(function(t){return e(t)})})}function Cm(e,t,n){switch(t=_p(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&cp(e,t,r,null,dp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Nt(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Em=new Map,Dm=new Set;function Om(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var km=N.d;N.d={f:Am,r:jm,D:Pm,C:Fm,L:Im,m:Lm,X:zm,S:Rm,M:Bm};function Am(){var e=km.f(),t=Wd();return e||t}function jm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):km.r(e)}var Mm=typeof document>`u`?null:document;function Nm(e,t,n){var r=Mm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),up(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Pm(e){km.D(e),Nm(`dns-prefetch`,e,null)}function Fm(e,t){km.C(e,t),Nm(`preconnect`,e,t)}function Im(e,t,n){km.L(e,t,n);var r=Mm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Hm(e);break;case`script`:a=Km(e)}if(!(Em.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Em.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);up(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Lm(e,t){km.m(e,t);var n=Mm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Km(e)}if(!Em.has(a)&&(e=w({rel:`modulepreload`,href:e},t),Em.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),up(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=Lt(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Em.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);Rt(c),up(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){km.X(e,t);var n=Mm;if(n&&e){var r=Lt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Rt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){km.M(e,t);var n=Mm;if(n&&e){var r=Lt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Rt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=we.current)?Om(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Hm(n.href),t=Lt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Em.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Em.set(e,o)),Gm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Km(n),t=Lt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hm(e){return`href="`+on(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),up(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Km(e){return`[src="`+on(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),up(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Wm(n),(a=Em.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),up(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Em.get(o))&&(r=w({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),up(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ym(r,n.precedence,e));return t.instance}function Ym(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function $m(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function W(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),up(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*mp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:k,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function _h(e){return e?(e=ji,e):ji}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(zd(n,e,t),yo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&zd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Id();t=yt(t);var n=Oi(e,t);n!==null&&zd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Eh(e,t,n,r)}finally{N.p=a,M.T=i}}function Th(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Eh(e,t,n,r)}finally{N.p=a,M.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)$f(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(rd&6)&&(xd=Ve()+500,Nf(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&zd(s,a,2),Wd(),bh(a,2)}if(a=Dh(r),a===null&&$f(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(e,t,r,null,n)}}function Dh(e){return e=Cn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=Pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=Pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,St(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=Ft(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Id(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Wd(),t[Et]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.1`)throw Error(i(527,$h,`19.3.1`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{Xe=tg.inject(eg),Ze=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[Et]=t.current,Zf(e),new Zh(t)}})),SD=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=xD()}))(),CD={root:`selector`,definitions:`portable`,bindings:`portable`,player:`portable`,options:`portable`,routes:`portable`,foregroundSelector:`host`,screenShakeProfiles:`host`,canPlaceManually:`host`,recordingUiMode:`host`,shadowDom:`host`,hudMode:`host`,hudLinks:`host`},wD=Object.keys(CD),TD=Object.entries(CD).filter(([,e])=>e===`host`).map(([e])=>e),ED=class{root;report;isStopped;subscriptions=new Set;constructor(e,t,n){this.root=e,this.report=t,this.isStopped=n}on(e,t){if(this.isStopped())throw Error(`Playground is disposed`);let n=!0,r=r=>{let i=r.detail;if(e===`dispose`){if(n)try{t(i)}catch(e){this.report(e)}}else queueMicrotask(()=>{if(!this.isStopped()&&n)try{t(i)}catch(t){e!==`diagnostic`&&this.report(t)}})};this.root.addEventListener(`joyride:${e}`,r);let i=()=>{n=!1,this.root.removeEventListener(`joyride:${e}`,r),this.subscriptions.delete(i)};return this.subscriptions.add(i),i}emitDispose(){this.root.dispatchEvent(new CustomEvent(`joyride:dispose`))}emitStateChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:state:change`,{bubbles:!0,detail:e}))}emitTourChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:tour:change`,{bubbles:!0,detail:e}))}emitRecordingEnd(e){this.root.dispatchEvent(new CustomEvent(`joyride:recording:end`,{bubbles:!0,detail:e}))}clear(){for(let e of this.subscriptions)Cg(this.report,e);this.subscriptions.clear()}};function DD(e){let{settings:t,preset:n,recording:r,aiCars:i,popoverAnchor:a,popoverTab:o,selectedAiId:s,embedSettings:c,requestedMasterVolume:l,exportConfiguration:u}=e,d=c??Pe({...t,masterVolume:l}),f,p;if(a&&u)try{if(f=u(),c){let{format:e,version:n,...r}=f;f=ie({...r,options:Pe(ce({...t,masterVolume:l},c))})}}catch(e){p=e instanceof Error?e.message:String(e)}return{settings:t,preset:n,recording:r,aiCars:i,popover:{anchor:a,tab:o,selectedAiId:s},exportedConfiguration:f,embed:{bookmarklet:a&&f?Ae(f):``,html:a&&f?Fe(f):``,async:a&&f?ze(f):``,npm:a&&f?Ce(f):``,error:p,configuration:d}}}function OD({options:e,registry:t,resources:n,getDrive:r,render:i,onDisposed:a}){let o=ce(y,e.options??{}),s,c,l=new Promise((e,t)=>{s=e,c=t});l.catch(()=>{});let u=!1,d=new ED(t.root,e=>t.report(e),()=>u);n.own(()=>d.clear());let f=ue.porsche911997,p=o.masterVolume,m=p>0;o={...o,masterVolume:0};let g=p||1,_={popoverAnchor:null,popoverTab:`vehicle`,selectedAiId:null},v=new NS;n.own(()=>v.detach());let b=new gt(e.recordingUiMode),x=new Sy(f,{idleSound:o.idleSound,masterVolume:o.masterVolume});n.own(()=>x.stop());let S=()=>{if(u)throw Error(`Playground is disposed`);let e=r()?.getPlayground();if(!e)throw Error(`Playground is initializing; await ride.ready before issuing this command`);return e},C=e=>{_={..._,...e},i()},w=(e,t=e.masterVolume!==void 0)=>{if(u)throw Error(`Playground is disposed`);t&&(m=!1);let n=o.masterVolume<=0;o=ce(o,Pe({...o,...e})),o.masterVolume>0&&(g=o.masterVolume),x.setMasterVolume(o.masterVolume),n&&o.masterVolume>0&&x.start(),x.setIdleSound(o.idleSound),i()},T=0,E=e=>{let n=we(e);if(!n)return!1;let r=fe(e)||Me(e)?t.registerVehiclePreset(`editor-${++T}`,n):e;return S().player?.update({vehicle:r}),i(),!0},D={ready:l,bind:(e,n)=>t.bind(e,n),inspect:e=>typeof e==`string`?t.objects.find(t=>t.id===e)??null:t.get(e)??null,on:(e,t)=>d.on(e,t),spawn:e=>S().spawn(e),pour:(e,t)=>S().pour(e,t),debris:(e,t)=>S().debris(e,t),route:(e,t)=>S().route(e,t),reset:()=>S().reset(),dispose(){u||(u=!0,Cg(e=>t.report(e),()=>d.emitDispose()),c(Error(`Playground disposed before initialization completed`)),n.dispose())},update(e){if(u)throw Error(`Playground is disposed`);w(ce(o,e),e.audio?.masterVolume!==void 0)},get options(){return Pe({...o,masterVolume:m?g:o.masterVolume})},exportConfiguration(){let n=S(),r=TD.filter(t=>e[t]!==void 0).map(e=>({path:e,reason:`this host presentation override is not part of portable playground authoring`}));if(e.root instanceof Element&&r.push({path:`root`,reason:`use a selector root for portable configuration`}),r.length)throw new h(r);let i=n.player?.state,a=n.world.playerVehicle;return ie({root:typeof e.root==`string`?e.root:void 0,definitions:t.exportDefinitions(),player:i&&a?{vehicle:t.vehicleName(a.sim.car.preset.id),appearance:i.appearance,slots:i.slots}:void 0,bindings:t.exportBindings(),routes:n.zones.exportRoutes(),options:D.options})},openConfigure(){S();let e=r()?.getCarAnchor();return!e||u?!1:(C({popoverAnchor:e,popoverTab:`vehicle`,selectedAiId:null}),!0)},startAudio:()=>(S(),x.start()),async setSlowMo(e,t){await l,S(),r()?.setSlowMo(e,t)},getCarAnchor:()=>r()?.getCarAnchor()??null,async arriveAt(e){return await l,S(),r()?.arriveAt(e)??`unavailable`},async startTour(e,t){return await l,S(),r()?.startTour(e,t)??!1},stopTour:()=>{S(),r()?.stopTour()},getVehicle:e=>S().getVehicle(e),get player(){return S().player},get state(){let e=r()?.getPlayground();return u||!e?null:Object.freeze({playerId:e.world.playerVehicle?.id??null,focusVehicleId:e.world.cameraVehicle?.id??null,player:e.player?.state??null,points:e.world.points})},async driveVehicleTo(e,t,n){return await l,S(),r()?.driveVehicleTo(e,t,n)??!1},async tourVehicle(e,t,n){return await l,S(),r()?.tourVehicle(e,t,n)??!1},startRecording:()=>(S(),r()?.startRecording()??!1),stopRecording:()=>(S(),r()?.stopRecording()??null),async playRecording(e,t){let n;try{n=pt(e)}catch{return!1}return await l,S(),r()?.playRecording(n,t)??!1},stopPlayback:()=>{S(),r()?.stopPlayback()}};return{controller:D,events:d,aiFleet:v,recordingSession:b,audio:x,get stopped(){return u},get ui(){return _},presentation(){return DD({options:e,settings:o,preset:r()?.getPlayground()?.world.focusVehicle?.sim.car.preset??f,recording:b.state,aiCars:v.getSnapshot(),..._,requestedMasterVolume:_.embedSettings&&r()?.getPlayground()?D.options.audio.masterVolume:o.masterVolume,exportConfiguration:r()?.getPlayground()?()=>D.exportConfiguration():void 0})},applySettings:w,selectPreset:E,savePreset(e){He(e),E(e.id)},deletePreset(e){Ie(e),E(fe(e)?ue.porsche911997.id:e)},updateUi:C,toggleMute(){w({masterVolume:o.masterVolume>0?0:g})},onAudioInteraction(){m&&w({masterVolume:g})},openHudSettings(){let e=r()?.getCarAnchor();e&&C({popoverAnchor:e,popoverTab:`settings`,selectedAiId:null})},onReady(){try{e.player&&S().player?.update(e.player);for(let[t,n]of Object.entries(e.routes??{}))S().route(t,n);s(D),i()}catch(e){c(e),queueMicrotask(()=>D.dispose())}},onReactError(e){c(e),queueMicrotask(()=>D.dispose())},onRecordingEnd(e,t){b.setRecording(e),d.emitRecordingEnd({recording:e,reason:t})},onPlaybackEnd(){b.state.mode===`playing`&&b.setMode(`ready`)},onPlacementEnd(e){b.state.recording&&b.setPose(`custom`,e)},connect(){let e=()=>i();t.root.addEventListener(`joyride:vehicle:change`,e),n.own(()=>t.root.removeEventListener(`joyride:vehicle:change`,e)),n.own(b.subscribe(i)),n.own(()=>{u=!0,c(Error(`Playground disposed before initialization completed`)),a(D)})},attachAiWhenReady(){l.then(()=>{let e=r();!u&&e&&v.attach(e)}).catch(()=>{})}}}var kD=`[data-jr-arrive-to]`;function AD(e,t,n,r=()=>!0){let i=e.getAttribute(t);if(i===null)return n;let a=Number(i);if(!i.trim()||!Number.isFinite(a)||!r(a))throw TypeError(`${t} must be a valid number`);return a}function jD(e){let t=e.querySelector(kD);if(!t)return null;let n=AD(t,`data-jr-arrive-to-angle-rad`,0),r=AD(t,`data-jr-arrive-to-distance-px`,185,e=>e>0),i=AD(t,`data-jr-arrive-to-fade-fraction`,.5,e=>e>=0&&e<=1),a=AD(t,`data-jr-arrive-to-steer`,.04,e=>Math.abs(e)<=1),o=AD(t,`data-jr-arrive-to-delay-ms`,0,e=>e>=0),s=t.getAttribute(`data-jr-arrive-to-speed-mps`)===null?void 0:AD(t,`data-jr-arrive-to-speed-mps`,0,e=>e>0);return{target:t,delayMs:o,approach:{angleRad:n,distancePx:r,fadeFraction:i,...s?{initialSpeedMps:s}:{}},handbrake:{steer:a}}}function MD(e,t=Math.random){return{target:{xPx:e.scrollX+e.innerWidth/2,yPx:e.scrollY+e.innerHeight/2},approach:{angleRad:t()*Math.PI*2,distancePx:Math.min(185,Math.max(80,Math.min(e.innerWidth,e.innerHeight)*.4)),fadeFraction:.5},handbrake:{steer:.04}}}function ND(e,t,n){if(n.aborted)return Promise.resolve(!1);let r=Math.max(0,t+e-performance.now());return r===0?Promise.resolve(!0):new Promise(e=>{let t=t=>{clearTimeout(a),n.removeEventListener(`abort`,i),e(t)},i=()=>t(!1),a=setTimeout(()=>t(!0),r);n.addEventListener(`abort`,i,{once:!0})})}async function PD(e,t){let n=performance.now()+2e3,r=null;for(;!t();){let t=e.getBoundingClientRect(),i=e.isConnected&&t.width>0&&t.height>0&&t.left>=0&&t.top>=0&&t.right<=window.innerWidth&&t.bottom<=window.innerHeight&&getComputedStyle(e).visibility!==`hidden`;if(i&&r&&Math.abs(t.x-r.x)<2&&Math.abs(t.y-r.y)<2&&Math.abs(t.width-r.width)<2&&Math.abs(t.height-r.height)<2)return!0;if(r=i?t:null,performance.now()>=n)return!1;await new Promise(e=>requestAnimationFrame(()=>e()))}return!1}var FD=`modulepreload`,ID=function(e,t){return new URL(e,t).href},LD={},RD=function(e){return e.pathname.endsWith(`.css`)},zD=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},BD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ID(t,n);let r=s(t),i=RD(r);return zD(LD,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:FD,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},VD=iD(aD),HD=(0,Q.lazy)(()=>BD(()=>import(`./vehicle-popover-COqSWppE.js`).then(e=>({default:e.VehiclePopover})),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),UD,WD=()=>UD;function GD(e={}){let t=performance.now(),n=jD(document),{format:r,version:i,...a}=`format`in e?oe(e):e,o=new Set(wD);for(let e of Object.keys(a))if(!o.has(e))throw TypeError(`Unknown mount option: ${e}`);let s=a;if(UD)throw Error(`JoyRide is already mounted. Dispose the current playground before mounting another.`);let c=typeof s.root==`string`?document.querySelector(s.root):s.root;if(s.root&&!c)throw Error(`Playground root did not match an element`);let l=new BS;try{let e=new Ue(c??document,s.definitions);if(l.own(()=>e.dispose()),s.player){let t=pe(s.player);e.resolveVehicle(t.vehicle);for(let n of Object.values(t.slots??{}))n&&n.action===`eject`&&e.resolveLiquid(n.liquid)}let r=(0,Q.createRef)(),i=!0,a=()=>{},o=()=>{},u=OD({options:s,registry:e,resources:l,getDrive:()=>r.current,render:()=>o(),onDisposed:e=>{UD===e&&(UD=void 0)}}),{controller:d,events:f,aiFleet:p,recordingSession:m,audio:h}=u,g=document.createElement(`div`);l.own(()=>g.remove()),g.dataset.jrEmbed=``,g.style.display=`contents`;let _=s.shadowDom===!1?null:g.attachShadow({mode:`open`});if(_){let e=document.createElement(`style`);e.textContent=VD,_.append(e)}l.own(_?vD(g):()=>{}),document.body.append(g);let v=(0,SD.createRoot)(_??g,{onUncaughtError:e=>u.onReactError(e)});l.own(()=>v.unmount()),o=()=>{if(u.stopped)return;let t=u.presentation(),{preset:n,recording:c,popover:l}=t,g=_D(m,{driveRef:r,close:()=>u.updateUi({popoverAnchor:null})});v.render((0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(fD,{workMode:t.settings,showGithub:t.settings.showGithub,brandColor:t.settings.brandColor,brandName:t.settings.brandName,vehicleDestructible:t.settings.vehicleDestructible,weaponsEnabled:t.settings.weaponsEnabled,enabledTools:t.settings.enabledTools,ref:r,playground:e,initialArrivalPending:!0,onReady:e=>{i&&(a=()=>{i&&(i=!1,e.sim.paused=!1)}),u.onReady()},overlay:!0,overlayRoot:_??void 0,showHud:t.settings.showHud,showTotalPoints:t.settings.showTotalPoints,hudMode:s.hudMode,hudLinks:[{id:`hide`,label:`Hide`,ariaLabel:`Hide HUD`,onClick:()=>u.applySettings({showHud:!1})},...(s.hudLinks??[]).map(t=>({...t,onClick:()=>Cg(t=>e.report(t),t.onClick)}))],onHudConfigure:u.openHudSettings,mode:`car`,preset:n,canPlaceManually:s.canPlaceManually,audioEngine:h,paused:!!l.anchor,viewportWalls:t.settings.viewportWalls,viewportMode:t.settings.viewportMode,speedZoom:t.settings.speedZoom,lighting:t.settings.lighting,onLightingChange:e=>u.applySettings({lighting:e}),masterVolume:t.settings.masterVolume,onAudioInteraction:u.onAudioInteraction,onToggleMute:u.toggleMute,showToolbar:c.uiMode!==`record`||c.mode===`idle`,idleSound:t.settings.idleSound,quality:t.settings.quality,smokeTint:t.settings.smokeTint,sparks:t.settings.sparks,deform:t.settings.deform,screenShake:t.settings.screenShake,showHealthBars:t.settings.showHealthBars,showVehicleMarkers:t.settings.showVehicleMarkers,showWeaponBar:t.settings.showWeaponBar,weaponCooldown:t.settings.weaponCooldown,screenShakeProfiles:s.screenShakeProfiles,surfaceTone:t.settings.surfaceTone,debug:t.settings.debug,autoPaint:t.settings.autoPaint,bindings:s.bindings,foregroundSelector:s.foregroundSelector,rocketBlastStrength:t.settings.rocketBlastStrength,onCarClick:e=>{m.state.uiMode===`record`&&g.onExitPlayback(),u.updateUi({popoverAnchor:u.ui.popoverAnchor?null:e,popoverTab:`vehicle`,selectedAiId:null})},onCompanionClick:(e,t)=>u.updateUi({popoverAnchor:t,popoverTab:`ai`,selectedAiId:e}),onCompanionRemove:e=>{p.remove(e),u.updateUi(u.ui.selectedAiId===e?{selectedAiId:null,popoverAnchor:null}:{})},onStateChange:()=>f.emitStateChange(d.state),onTourStateChange:e=>f.emitTourChange(e),onRecordingEnd:u.onRecordingEnd,onRecordShortcut:g.onRecordShortcut,onPlaybackEnd:u.onPlaybackEnd,onPlacementEnd:u.onPlacementEnd,onExit:()=>{d.dispose()}}),c.uiMode===`record`&&(0,$.jsx)(mD,{mode:c.mode,showPath:c.showPath,driveRef:r,onTogglePath:g.onTogglePath,onStartRecord:g.onStartRecord,onStopRecord:g.onStopRecord,onPlay:g.onPlay,onStopPlayback:g.onStopPlayback,onDownload:g.onDownload,onDelete:g.onDelete,onExitPlayback:g.onExitPlayback}),c.uiMode===`record`&&(0,$.jsx)(hD,{snapshot:c,driveRef:r}),c.uiMode===`record`&&c.showPath&&c.mode===`playing`&&c.recording&&(0,$.jsx)(gD,{driveRef:r,durationMs:c.recording.durationMs}),l.anchor&&(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(HD,{objects:r.current?.getPlayground()?.objects,onDriveToObject:e=>{let t=r.current?.getPose()??null;u.updateUi({popoverAnchor:null}),requestAnimationFrame(()=>{e.scrollIntoView({block:`center`,inline:`center`,behavior:`instant`}),r.current?.arriveAt(Kw(e,t))})},...t.settings,preset:n,slots:d.player?.state.slots,presets:he(),options:t.settings,initialTab:l.tab,embed:{...t.embed,onConfigure:e=>u.updateUi({embedSettings:e})},onSelectPreset:e=>u.selectPreset(e.id),onSavePreset:u.savePreset,onDeletePreset:u.deletePreset,onChange:e=>u.applySettings(e),onClose:()=>u.updateUi({popoverAnchor:null}),recording:g,ai:{cars:t.aiCars,selectedId:l.selectedAiId,onSelect:e=>u.updateUi({selectedAiId:e}),onSpawn:(e,t,n,r)=>{u.updateUi({selectedAiId:p.add(e,t,n,r).id})},onUpdate:(e,t)=>{p.update(e,t),o()},onRemove:e=>{p.remove(e),u.updateUi({selectedAiId:null})}},onReset:()=>r.current?.reset(),onQuit:()=>queueMicrotask(()=>d.dispose())})})]}))},u.connect(),UD=d,o(),u.attachAiWhenReady();let y=new AbortController;return l.own(()=>y.abort()),d.ready.then(async()=>{let e=n?await PD(n.target,()=>u.stopped):!1;if(u.stopped)return;let i=e?n:MD(window),o=await ND(i.delayMs??0,t,y.signal);if(u.stopped||!o)return;a();let s=r.current?.arriveAt({...i,delayMs:0});s?s.finally(()=>{u.stopped||r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}):r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}).catch(t=>{e.report(t),u.stopped||(a(),r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1))}),d}catch(e){throw l.dispose(),e}}var KD={mount:GD,options:{presets:{sfw(e={}){return{...e,options:{...v,...e.options,policy:{...v.policy,...e.options?.policy},ui:{...v.ui,...e.options?.ui}}}}}},vehicleTools:n,availableVehicleTools:te,overlayLayers:Af,overlayZIndex:jf,define:We,get active(){return WD()},listPresets:he,listVehicleOptions:Re,getPreset:we,keyboardControls:rt};export{rt as S,Sy as _,iD as a,dn as b,ZE as c,GE as d,BT as f,MS as g,lT as h,aD as i,XE as l,vT as m,BD as n,eD as o,hT as p,vD as r,$E as s,KD as t,KE as u,Gm as v,ot as x,jf as y};
|