@opendaw/studio-core-wasm 0.0.11 → 0.0.12
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/dist/wasm/engine.wasm +0 -0
- package/dist/wasm/plugins/device_neon.wasm +0 -0
- package/dist/wasm/plugins/device_vaporisateur.wasm +0 -0
- package/dist/wasm-offline-worker.js +1 -1
- package/dist/wasm-offline-worker.js.map +3 -3
- package/dist/wasm-processor.js +1 -1
- package/dist/wasm-processor.js.map +3 -3
- package/package.json +8 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var kT=Object.defineProperty;var eo=(t,e)=>{for(var r in e)kT(t,r,{get:e[r],enumerable:!0})};var U=t=>t!=null,Qi=t=>t===null,OP=t=>t!==null,Zh=t=>t===void 0,h_=t=>t!==void 0,g_=t=>t==null,v_=(t,e)=>t!=null?e(t):void 0,je=(t,e="asDefined failed")=>t??K(pa(e)),xt=(t,e)=>t instanceof e,Ce=(t,e)=>t instanceof e?t:K(`${t} is not instance of ${e}`),x_=(t,e)=>{t instanceof e||K(`${t} is not instance of ${e}`)};var pa=t=>t instanceof Function?t():t;var $=(t,...e)=>t?.apply(null,e),Gh=t=>U(t)&&typeof t=="object";var Hh=t=>{throw new Error(`Unhandled ${t}`)},K=t=>{throw typeof t=="string"?new Error(t):t},ne=(t,e)=>t?void 0:K(pa(e));var xp=t=>new Proxy({},{get(){return K(t)}});var f_=class{value;status="success";constructor(e){this.value=e}error=xp("Cannot access error when succeeded")},m_=class{error;status="failure";constructor(e){this.error=e}value=xp("Cannot access value when failed")},tr=t=>{try{return new f_(t())}catch(e){return new m_(e)}};var to=(t,e)=>Object.keys(e).length===0?K("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:K(`Invalid enum value: ${String(t)}`),yp=()=>{};var y_;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(y_||(y_={}));var pe=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,r)=>{e.length=0,e.push(...r)};static consume=(e,r)=>{for(let n=0;n<e.length;)r(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,r)=>je(e.at(0),r);static getLast=(e,r)=>je(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?K(`${r} not found in ${e}`):je(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?K(`${r} not found in ${e}`):je(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>je(e.pop(),r);static create=(e,r)=>{let n=new Array(r);for(let i=0;i<r;i++)n[i]=e(i);return n};static equals=(e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0};static satisfy=(e,r)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!r(n,e[i]))return!1;return!0};static remove=(e,r)=>{let n=e.indexOf(r);if(n===-1)return K(`${r} not found in ${e}`);e.splice(n,1)};static removeIf=(e,r)=>{for(let n=e.length-1;n>=0;n--)r(e[n])&&e.splice(n,1)};static removeOpt=(e,r)=>{let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let r=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[r++]=i);return e.length=r,e};static removeDuplicateKeys=(e,r)=>{let n=0,i=new Set;for(let a of e){let o=a[r];i.has(o)||(i.add(o),e[n++]=a)}return e.length=n,e};static partition(e,...r){let n=r.map(()=>[]);for(let i of e)for(let a=0;a<r.length;a++)r[a](i)&&n[a].push(i);return n}static subtract(e,r,n){return e.filter(i=>!r.some(a=>n(i,a)))}static intersect(e,r,n){return e.filter(i=>r.some(a=>n(i,a)))}static merge(e,r,n){return[...e.filter(i=>!r.some(a=>n(i,a))),...r]}static*iterate(e){for(let r=0;r<e.length;r++)yield e[r]}static*iterateReverse(e){for(let r=e.length-1;r>=0;r--)yield e[r]}static*iterateStateFull(e){let r=e.length-1;for(let n=0;n<=r;n++)yield{value:e[n],isFirst:n===0,isLast:n===r}}static*iterateAdjacent(e){if(!(e.length<=1))for(let r=1,n=e[0];r<e.length;r++){let i=e[r];yield[n,i],n=i}}static isSorted(e,r=y_.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let a=e[i];if(Math.sign(n-a)===r)return!1;n=a}return!0}static toRecord(e,r){return e.reduce((n,i)=>(n[r(i)]=i,n),{})}static concatArrayBuffers(e,r){let n=new ArrayBuffer(e.byteLength+r.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(r),e.byteLength),n}};var b;(function(t){t.wrap=r=>U(r)?new e(r):t.None,t.from=r=>t.wrap(r()),t.tryCatch=r=>{try{return t.wrap(r())}catch{return t.None}},t.execute=(r,...n)=>t.wrap(r?.apply(null,n)),t.async=r=>r.then(n=>t.wrap(n),()=>t.None);class e{#e;constructor(n){this.#e=je(n)}unwrap(){return this.#e}unwrapOrElse(n){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(n){return n===this.#e}match(n){return n.some(this.#e)}ifSome(n){return n(this.#e)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return t.wrap(n(this.#e))}mapOr(n,i){return n(this.#e)}flatMap(n){return n(this.#e)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}t.Some=e,t.None=new class{unwrap=r=>K(U(r)?pa(r):"unwrap failed");unwrapOrElse=r=>pa(r);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=r=>!1;match=r=>r.none();ifSome=r=>{};ifAbsent=r=>r(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=r=>t.None;mapOr=(r,n)=>pa(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>K(pa(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var Sr;(function(t){t.async=e=>e.then(r=>t.ok(r),r=>t.err(r)),t.tryGet=e=>{try{return t.ok(e())}catch(r){return t.err(r)}},t.ok=e=>new class{value;constructor(r){this.value=r}asOption=()=>b.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=r=>{try{return t.ok(r(this.value))}catch(n){return t.err(n)}};mapOr=(r,n)=>r(this.value);unwrapOrElse=r=>this.value;flatMap=r=>r(this.value);match=r=>r.ok(this.value);toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),t.Ok=new class{constructor(){}asOption=()=>b.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>t.ok(e());mapOr=(e,r)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},t.err=e=>new class{reason;constructor(r){this.reason=r}asOption=()=>b.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>K(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>pa(n);unwrapOrElse=r=>pa(r);flatMap=()=>this;match=r=>r.err(this.reason);toVoid=()=>t.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Sr||(Sr={}));var yt;(function(t){t.exact=(e,r,n)=>{let i=0,a=e.length-1;for(;i<=a;){let o=i+a>>>1,s=n(e[o],r);if(s===0)return o;s<0?i=o+1:a=o-1}return-1},t.exactMapped=(e,r,n,i)=>{let a=0,o=e.length-1;for(;a<=o;){let s=a+o>>>1,u=n(i(e[s]),r);if(u===0)return s;u<0?a=s+1:o=s-1}return-1},t.leftMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}return i},t.rightMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<=0?i=o+1:a=o}return a-1},t.stableInsert=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}for(;i<e.length&&n(e[i],r)===0;)i++;return i},t.leftMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<0?a=s+1:o=s}return a},t.rightMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<=0?a=s+1:o=s}return o-1},t.rangeMapped=(e,r,n,i)=>[t.leftMostMapped(e,r,n,i),t.rightMostMapped(e,r,n,i)]})(yt||(yt={}));var qh=class{#e;#t=null;constructor(e){this.#e=e}invalidate=()=>this.#t=null;get(){return this.#t===null&&(this.#t=this.#e()),this.#t}terminate(){this.invalidate()}};var rr=class t{static parseCssRgbOrRgba(e){let r=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(U(r)&&r.every(n=>!isNaN(n))){if(r.length===3)return[r[0]/255,r[1]/255,r[2]/255,1];if(r.length===4)return[r[0]/255,r[1]/255,r[2]/255,r[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,r,n){let i=u=>(u+e/30)%12,a=r*Math.min(n,1-n),o=u=>n-a*Math.max(-1,Math.min(i(u)-3,Math.min(9-i(u),1))),s=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${s(o(0))}${s(o(8))}${s(o(4))}`}static hexToHsl(e){let r=e.startsWith("#")?e.slice(1):e,n=parseInt(r.slice(0,2),16)/255,i=parseInt(r.slice(2,4),16)/255,a=parseInt(r.slice(4,6),16)/255,o=Math.max(n,i,a),s=Math.min(n,i,a),u=(o+s)/2,d=0,m=0;if(o!==s){let x=o-s;switch(m=u>.5?x/(2-o-s):x/(o+s),o){case n:d=((i-a)/x+(i<a?6:0))*60;break;case i:d=((a-n)/x+2)*60;break;case a:d=((n-i)/x+4)*60;break}}return{h:d,s:m,l:u}}static hslStringToHex(e){let[r,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return t.hslToHex(r,n/100,i/100)}#e;#t;#r;#i;constructor(e,r,n,i=1){this.#e=e,this.#t=r,this.#r=n,this.#i=i}opacity(e){return new t(this.#e,this.#t,this.#r,e)}brightness(e){let r=Math.max(0,Math.min(100,this.#r+e));return new t(this.#e,this.#t,r,this.#i)}saturate(e){return new t(this.#e,this.#t*e,this.#r,this.#i)}lerp(e,r){let n=Math.PI/180,i=this.#t*Math.cos(this.#e*n),a=this.#t*Math.sin(this.#e*n),o=e.#t*Math.cos(e.#e*n),s=e.#t*Math.sin(e.#e*n),u=i+(o-i)*r,d=a+(s-a)*r,m=(Math.atan2(d,u)/n+360)%360,x=Math.sqrt(u*u+d*d),g=this.#r+(e.#r-this.#r)*r,w=this.#i+(e.#i-this.#i)*r;return new t(m,x,g,w)}fade(e){let r=this.#t*(1-Math.sqrt(e)),n=this.#r+(100-this.#r)*e**3;return new t(this.#e,r,n,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Ro=(t,e)=>t-e;var Oz=Math.PI*2,Vz=Math.PI/2,Uz=Math.PI/4,jz=1/Math.sqrt(2),lt=(t,e,r)=>Math.max(e,Math.min(t,r)),VP=t=>Math.max(0,Math.min(t,1)),UP=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),w_=(t,e)=>Math.floor(t/e)*e;var jP=(t,e,r)=>t+(e-t)*r;var Zs=(t,e)=>BT(t/e)*e,BT=t=>t-Math.floor(t),Jh=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var b_=(t,e)=>t*e/((2*e-1)*(t-1)+e);var ir;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},u)=>t.normalizedAt(u/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=lt(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=lt(a,1e-15,.999999999999999);return Math.log(i*(1-2*o)/(o*o)+1)/(2*Math.log((1-o)/o))},t.coefficients=i=>{let a=t.valueAt(i,1),s=(t.valueAt(i,2)-a)/(a-i.y0),u=a-s*i.y0;return{m:s,q:u}};function*r(i,a,o,s){let{m:u,q:d}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let m=0,x=o;m<a;m++)yield x=u*x+d}t.walk=r,t.run=(i,a,o,s,u)=>{let{m:d,q:m}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let x=0,g=o;x<a;x++)u(g=d*g+m)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),d=(t.normalizedAt(2*o,i)-s)/s;for(let m=0,x=0;m<a;m++)yield x=d*x+s}t.walkNormalized=n,t.byHalf=(i,a,o,s)=>({slope:t.slopeByHalf(a,o,s),steps:i,y0:a,y1:s}),t.slopeByHalf=(i,a,o)=>Math.abs(o-i)<1e-6?.5:(a-i)/(o-i)})(ir||(ir={}));var fa=new DataView(new ArrayBuffer(8)),Pr;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(fa.setInt8(0,e),fa.getInt8(0)),t.toShort=e=>(fa.setInt16(0,e),fa.getInt16(0)),t.toInt=e=>(fa.setInt32(0,e),fa.getInt32(0))})(Pr||(Pr={}));var ro;(function(t){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),a=new Int32Array(n);t.floatToIntBits=o=>{let s=t.floatToRawIntBits(o);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},t.intBitsToFloat=o=>(a[0]=o,i[0]),t.floatToRawIntBits=o=>(i[0]=o,a[0]),t.toFloat32=o=>(fa.setFloat32(0,o),fa.getFloat32(0))})(ro||(ro={}));var KP;(function(t){t.floatToIntBits=e=>{let r=ro.floatToIntBits(e),n=r>>>16&32768,i=(r&2147483647)+4096;return i>=1199570944?(r&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(r&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(r&2147483647)>>>23,n|(r&8388607|8388608)+(8388608>>>i-102)>>>126-i)},t.intBitsToFloat=e=>{let r=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,r===0&&n>115712)return ro.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(r!==0){n=115712;do r<<=1,n-=1024;while((r&1024)===0);r&=1023}return ro.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(KP||(KP={}));var Yh;(function(t){let e=9218868437227405312n,r=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),a=new BigInt64Array(n);t.float64ToLongBits=o=>{let s=t.float64ToRawLongBits(o);return(s&e)===e&&(s&r)!==0n?0x7ff8000000000000n:s},t.longBitsToFloat64=o=>(a[0]=o,i[0]),t.float64ToRawLongBits=o=>(i[0]=o,a[0]),t.clamp=o=>(fa.setFloat64(0,o),fa.getFloat64(0))})(Yh||(Yh={}));var nr=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){ne(U(r)||e>=0,()=>`range count must be non-negative, got ${e}`);let i=U(r)?e:0,a=U(r)?r:e;if(n!==0)if(n>0)for(let o=i;o<a;o+=n)yield o;else for(let o=i;o>a;o+=n)yield o}static count(e){let r=0;for(let n of e)r++;return r}static some(e,r){for(let n of e)if(r(n))return!0;return!1}static every(e,r){for(let n of e)if(!r(n))return!1;return!0}static reduce(e,r,n){let i=n,a=0;for(let o of e)i=r(i,o,a++);return i}static includes(e,r){for(let n of e)if(n===r)return!0;return!1}static forEach(e,r){for(let n of e)r(n)}static*map(e,r){let n=0;for(let i of e)yield r(i,n++)}static*take(e,r){let n=0;for(let i of e){if(n++>=r)return;yield i}}static filter(e,r){let n=[];for(let i of e)r(i)&&n.push(i);return n}static filterMap(e,r){let n=[];for(let i of e){let a=r(i);U(a)&&n.push(a)}return n}static reverse(e){let r=[];for(let n of e)r.push(n);return r.reverse()}static*pairWise(e){let r=e[Symbol.iterator](),{done:n,value:i}=r.next(),a=i;if(n!==!0)for(;;){let{done:o,value:s}=r.next();if(o===!0){yield[a,null];return}yield[a,s],a=s}}};var jt=class t{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,r=0){return new t(new DataView(e,r))}littleEndian=!1;#e;#t=0;constructor(e){this.#e=e}get remaining(){return this.#e.byteLength-this.#t}get position(){return this.#t}set position(e){e<0?K(`position(${e}) cannot be negative.`):e>this.#e.byteLength?K(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#e.setInt8(this.#t++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#e.setInt16(this.#t,e,this.littleEndian),this.#t+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#e.setInt32(this.#t,e,this.littleEndian),this.#t+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#e.setBigInt64(this.#t,e,this.littleEndian),this.#t+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#e.setFloat32(this.#t,e,this.littleEndian),this.#t+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#e.setFloat64(this.#t,e,this.littleEndian),this.#t+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let r=0;r<e.length;++r)this.#e.setInt8(this.#t++,e[r])}writeString(e){let r=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+r*Int16Array.BYTES_PER_ELEMENT),this.writeInt(r);for(let n=0;n<r;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let r=this.#e.byteLength;if(this.#t+e>r){let n=this.#e;this.#e=new DataView(new ArrayBuffer(Jh(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},$u=class{#e=0;writeByte(e){this.#e++}writeShort(e){this.#e+=2}writeInt(e){this.#e+=4}writeLong(e){this.#e+=8}writeFloat(e){this.#e+=4}writeDouble(e){this.#e+=8}writeBoolean(e){this.#e++}writeBytes(e){this.#e+=e.length}writeString(e){this.#e+=e.length+4}get count(){return this.#e}},Xh=class{#e;#t=0;constructor(e=32){this.#e=new Int8Array(e)}result(){return this.#e}equals(e){return e===this?!0:this.#e.every((r,n)=>e.#e[n]===r)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#t>=this.#e.length&&(this.#t=0),this.#e[this.#t++]^=e}writeInt(e){this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBytes(e){e.forEach(r=>this.writeByte(r))}writeFloat(e){this.writeInt(ro.floatToIntBits(e))}writeDouble(e){this.writeLong(Yh.float64ToLongBits(e))}writeLong(e){this.writeByte(Number(e)&255),this.writeByte(Number(e>>8n)&255),this.writeByte(Number(e>>16n)&255),this.writeByte(Number(e>>24n)&255),this.writeByte(Number(e>>32n)&255),this.writeByte(Number(e>>40n)&255),this.writeByte(Number(e>>48n)&255),this.writeByte(Number(e>>56n)&255)}writeString(e){for(let r=0;r<e.length;r++)this.writeShort(e.charCodeAt(r))}toHexString(){return Array.from(nr.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},it=class{littleEndian=!1;#e;#t=0;constructor(e,r=0){this.#e=new DataView(e,r)}get position(){return this.#t}set position(e){e<0?K(`position(${e}) cannot be negative.`):e>this.#e.byteLength?K(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}readByte(){return this.#e.getInt8(this.#t++)}readShort(){let e=this.#e.getInt16(this.#t,this.littleEndian);return this.#t+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#e.getInt32(this.#t,this.littleEndian);return this.#t+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#e.getBigInt64(this.#t,this.littleEndian);return this.#t+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#e.getFloat32(this.#t,this.littleEndian);return this.#t+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#e.getFloat64(this.#t,this.littleEndian);return this.#t+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let r=0;r<e.length;r++)e[r]=this.readByte()}readString(){let e=this.readInt(),r="";for(let n=0;n<e;n++)r+=String.fromCharCode(this.readShort());return r}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var IT=t=>U(t)?t.value!==void 0?"value":t.get!==void 0?"get":K(`Cannot resolve method key of ${t}`):K("Cannot resolve method key of undefined descriptor"),Mu=(t,e,r)=>{if(!U(r))return function(a,o){if(o&&o.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!U(s?.get))return K(`Cannot find getter for property '${e}'`);let u=s.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let n=IT(r),i=je(r[n]);return{[n]:function(...a){if(a.length>0)return K("lazy accessory must not have any construction parameters");let o=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?o:()=>o,configurable:!1,writable:!1,enumerable:!1}),o}}};var io;(function(t){function*e(){}t.empty=e;function*r(...n){for(let i of n)for(let a of i)yield a}t.flatten=r})(io||(io={}));var ar=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?$(i[r],...n):i[r]?.apply(i,n))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var wp=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var bp=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var Qh=class t{map;constructor(e){this.map=new Map(e?.map(r=>{let n=r[0],i=r[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,r){return nr.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return nr.includes(this.map.keys(),e)}containsValue(e){return nr.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??bp.empty()}isEmpty(){return this.keyCount()===0}add(e,r){wp.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=wp.createIfAbsent(this.map,e,()=>new Set);for(let i of r)n.add(i)}remove(e,r){let n=this.map.get(e);return n===void 0?!1:n.delete(r)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let r=new Set;for(let[n,i]of this.map.entries()){for(let a of i)e(a)&&(i.delete(a),r.add(a));i.size===0&&this.map.delete(n)}return r}removeFromKeyIf(e,r){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(r(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let r=this.map.get(e);return this.map.delete(e),r??bp.empty()}forEach(e){nr.forEach(this.map.entries(),r=>e(r[0],r[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let r=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,r.get(i));return this}clone(){let e=new t;return this.map.forEach((r,n)=>{e.map.set(n,new Set(Array.from(r)))}),e}};var fe=Object.freeze({Empty:{terminate:yp},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),X=class t{#e=[];isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}own(e){return this.#e.push(e),e}ownAll(...e){for(let r of e)this.#e.push(r)}spawn(){let e=new t;return e.own({terminate:()=>pe.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var me=class{static subscribeMany(e,...r){return fe.many(...r.map(n=>n.subscribe(()=>e(n))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(r=>r(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var eg;(function(t){let e=Object.freeze({});t.empty=()=>e,t.mergeNoOverlap=(r,n)=>{let i=new Set(Object.keys(r));for(let a of Object.keys(n))if(i.has(a))return K(`'${a}' is an overlapping key`);return{...r,...n}},t.include=(r,...n)=>{let i={};for(let a of n)i[a]=r[a];return i},t.exclude=(r,...n)=>{let i=new Set(n);return Object.entries(r).reduce((a,[o,s])=>(i.has(o)||(a[o]=s),a),{})},t.overwrite=(r,n)=>Object.assign(r,n),t.entries=r=>Object.entries(r)})(eg||(eg={}));var WP;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return fe.Empty}catchupAndSubscribe(r){return r(this),fe.Empty}}})(WP||(WP={}));var LP;(function(t){t.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return fe.Empty}catchupAndSubscribe(e){return e(this),fe.Empty}},t.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(r){e.setValue(!r)}subscribe(r){return e.subscribe(r)}catchupAndSubscribe(r){return r(this),this.subscribe(r)}}})(LP||(LP={}));var $r=class{#e;#t=b.None;constructor(e){this.#e=new me,this.wrap(e)}wrap(e){this.wrapOption(b.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(U(e)&&e(this.#t.unwrap()),this.#t=b.None,this.#e.notify(this))}assert(e){return this.#t.assert(e),this}contains(e){return this.#t.contains(e)}equals(e){return this.#t.equals(e)}flatMap(e){return this.#t.flatMap(e)}ifSome(e){return this.#t.ifSome(e)}ifAbsent(e){return this.#t.ifAbsent(e)}isEmpty(){return this.#t.isEmpty()}map(e){return this.#t.map(e)}mapOr(e,r){return this.#t.mapOr(e,r)}match(e){return this.#t.match(e)}nonEmpty(){return this.#t.nonEmpty()}unwrap(e){return this.#t.unwrap(e)}unwrapOrElse(e){return this.#t.unwrapOrElse(e)}unwrapOrNull(){return this.#t.unwrapOrNull()}unwrapOrUndefined(){return this.#t.unwrapOrUndefined()}subscribe(e){return this.#e.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#e.subscribe(()=>e(this))}terminate(){this.#e.terminate()}};var en=class{#e;#t=b.None;#r;constructor(e,r){this.#e=new me,this.#r=r?.guard(e)??e,this.#t=b.wrap(r)}setValue(e){this.#t.nonEmpty()&&(e=this.#t.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#e.notify(this))}getValue(){return this.#r}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#e.subscribe(e)}terminate(){this.#e.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var __=class{#e;#t;constructor(e,r){ne(e<r,"Linear is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return lt(e,this.#e,this.#t)}floating(){return!0}},F_=class{#e;#t;#r;constructor(e,r){this.#e=lt(Math.round(e),Pr.MIN_VALUE,Pr.MAX_VALUE),this.#t=lt(Math.round(r),Pr.MIN_VALUE,Pr.MAX_VALUE),this.#r=this.#t-this.#e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+Math.round(lt(e,0,1)*this.#r)}clamp(e){return lt(Math.round(e),this.#e,this.#t)}floating(){return!1}},A_=class{#e;#t;constructor(e,r){ne(e<r,"Exponential is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},tg=class{#e;#t;#r;#i;constructor(e,r,n){ne(r!==n,"Power min === max"),this.#e=e,this.#t=r,this.#r=n,this.#i=n-r}x(e){return e<=this.#t?0:e>=this.#r?1:Math.pow((e-this.#t)/this.#i,1/this.#e)}y(e){return e<=0?this.#t:e>=1?this.#r:this.#t+Math.pow(e,this.#e)*this.#i}clamp(e){return Math.min(this.#r,Math.max(this.#t,e))}floating(){return!0}},E_=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?K(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(lt(e,0,1)*(this.#e.length-1));return r>-1?je(this.#e.at(r),`Could not find value for ${e}`):K(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},S_=class{#e;#t;#r;#i;#n;constructor(e,r,n){this.#e=e,this.#t=n;let i=e*e,a=n*n,o=r*r,s=e+n-2*r,u=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(u*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-u/s}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#n)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},A;(function(t){t.linear=(a,o)=>new __(a,o),t.linearInteger=(a,o)=>new F_(a,o),t.exponential=(a,o)=>new A_(a,o),t.power=(a,o,s)=>new tg(a,o,s),t.powerByCenter=(a,o,s)=>{let u=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(u))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new tg(u,o,s)},t.values=a=>new E_(a),t.decibel=(a,o,s)=>new S_(a,o,s);let e=new class{x(a){return a?1:0}y(a){return a>=.5}clamp(a){return a}floating(){return!1}},r=t.linear(0,1),n=t.linear(-1,1);t.bool=e;let i=t.decibel(-72,-12,0);t.unipolar=()=>r,t.bipolar=()=>n,t.DefaultDecibel=i})(A||(A={}));var E;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:u}={})=>new e(a,o,s,u),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let u=o.indexOf(s);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},t.values=(a,o,s)=>new class{x(u){return{unit:a,value:s.at(o.indexOf(u))??"N/A"}}y(u){let d=s.indexOf(u);return d===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:o[d]}}},t.bool=new class{y(a){switch(a.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}},t.boolValues=(a,o)=>new class{y(s){switch(s.trim()){case o:case"on":case"yes":case"true":return{type:"explicit",value:!0};case a:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(o,s,u,d){this.#e=o??"",this.#t=s??0,this.#r=u??!1,this.#i=d??!1}y(o){let s=o.trim();this.#e.length>0&&this.#e!=="%"&&s.endsWith(this.#e)&&(s=s.slice(0,-this.#e.length).trim());let u=parseFloat(s);if(isNaN(u))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:u/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?lt(u/200+.5,0,1):lt(u/100,0,1)};{let m=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(U(m)){let x=r.indexOf(m);if(x>-1)return{type:"explicit",value:u*Math.pow(10,(x-4)*3)}}return{type:"explicit",value:u}}}x(o){if(Number.isNaN(o))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(o)){if(this.#e==="%")return this.#i?{value:(o*200-100).toFixed(this.#t),unit:this.#e}:{value:(o*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:u}=i(o);return{value:s.toFixed(this.#t),unit:`${u}${this.#e}`}}else return{value:o.toFixed(this.#t),unit:this.#e}}else return{value:o===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let r=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=a=>Math.log(a)/Math.log(9.999999999999998),i=a=>{let o=Math.floor(n(a)/3),s=r[o+4];return U(s)?{value:a*Math.pow(10,o*-3),prefix:s}:{value:a,prefix:""}};t.decible=t.numeric({unit:"db",fractionDigits:2}),t.panning=t.percent({unit:"%",fractionDigits:0})})(E||(E={}));var Nu;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})(Nu||(Nu={}));var rg;(function(t){t.create=(e=252854082)=>new P_(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return K("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let u=Math.floor(n.uniform()*(1+r))+1;e[s]=u,a+=u}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(rg||(rg={}));var P_=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,r){return e+this.uniform()*(r-e)}nextInt(e,r){return e+Math.floor(this.uniform()*(r-e))}nextElement(e){return e[Math.floor(this.uniform()*e.length)]}nextBoolean(){return this.uniform()<.5}uniform(){let e=this.#e+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}};var ki;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,u])=>{u instanceof e?o[s]=u.initialValue():typeof u=="object"&&(o[s]=i(u))}),o};return()=>new r(n,Object.seal(i(n)))},t.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},t.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},t.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},t.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},t.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},t.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},t.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},t.floats=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readFloat();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeFloat(a[o])}initialValue(){return new Float32Array(n)}},t.doubles=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readDouble();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeDouble(a[o])}initialValue(){return new Float64Array(n)}};class r{#e;#t;#r;constructor(i,a){this.#e=i,this.#t=a,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?m[u]=d.read(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?d.write(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}#i(){let i=new $u;return this.write(i),i.count}}})(ki||(ki={}));var ku=class{#e;#t;#r;constructor(e,r){this.#e=e,this.#t=r,this.#r=[]}add(e,r=!1){let n=this.#e(e),i=yt.leftMostMapped(this.#r,n,this.#t,this.#e),a=this.#r[i];return U(a)&&this.#t(this.#e(a),n)===0?r?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,r){let n=yt.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(U(i)&&this.#t(this.#e(i),e)===0)return i;let a=r(e);return this.#r.splice(n,0,a),a}addMany(e){for(let r of e)this.#r.push(r);try{return this.#r.sort((r,n)=>{let i=this.#t(this.#e(r),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(r){if(r==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,a)=>this.#t(this.#e(i),this.#e(a))),!1}return K(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=yt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return U(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):K(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=yt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return U(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):null}removeRange(e,r){this.#r.splice(e,(r??this.#r.length)-e)}removeByPredicate(e){let r=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),r++);return r}get(e,r){return je(this.#i(e),r??`Unknown key: ${e}`)}getOrThrow(e,r){let n=this.#i(e);if(U(n))return n;throw r()}opt(e){return b.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return U(this.#i(e))}hasValue(e){return U(this.#i(this.#e(e)))}size(){return this.#r.length}isEmpty(){return this.#r.length===0}forEach(e){this.values().forEach(e)}values(){return this.#r}entries(){return this.#r.map(e=>[this.#e(e),e])}clear(){pe.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=yt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return U(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var Bu=(()=>{let t=b.None;return{info:e=>t.match({none:()=>Promise.resolve(),some:r=>r.info(e)}),approve:e=>t.match({none:()=>Promise.resolve(!0),some:r=>r.approve(e)}),progress:e=>t.match({none:()=>({message:"",terminate:yp}),some:r=>r.progress(e)}),notify:e=>t.match({none:yp,some:r=>r.notify(e)}),install:e=>{ne(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var Gs=class t{static createEstimator=()=>{let e=performance.now(),r=t.millis(Number.POSITIVE_INFINITY),n=0;return i=>{if(i===0)return t.POSITIVE_INFINITY;if(i>=1)return t.millis(0);let a=performance.now()-e;return a>n*1e3&&(r=t.millis(a/i-a),n++),r}};static POSITIVE_INFINITY=new t(Number.POSITIVE_INFINITY);static millis=e=>new t(e);static seconds=e=>new t(e*t.#e);static minutes=e=>new t(e*t.#t);static hours=e=>new t(e*t.#r);static days=e=>new t(e*t.#i);static toHHMMSS=e=>((e/3600|0)+100).toString().slice(1)+":"+((e/60|0)%60+100).toString().slice(1)+":"+(e%60+100).toString().slice(1);static#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/t.#e}absMinutes(){return Math.abs(this.#n)/t.#t}absHours(){return Math.abs(this.#n)/t.#r}absDays(){return Math.abs(this.#n)/t.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,r,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),a=Math.floor(i/60),o=Math.floor(a/24);return n<60?(e=n,r="second"):i<60?(e=i,r="minute"):a<24?(e=a,r="hour"):(e=o,r="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),r)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:r,m:n,s:i}=this.split();return e>0?[t.#a("d",e),t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):r>0?[t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):n>0?[t.#a("m",n),t.#a("s",i)].join(", "):i>0?t.#a("s",i):"now"}static#a=(e,r)=>{switch(e){case"d":return`${r} ${r<2?"day":"days"}`;case"h":return`${r} ${r<2?"hour":"hours"}`;case"m":return`${r} ${r<2?"minute":"minutes"}`;case"s":return`${r} ${r<2?"second":"seconds"}`;default:return Hh(e)}}};var ig;(function(t){let e;(function(r){r[r.READING=0]="READING",r[r.READ=1]="READ",r[r.WRITING=2]="WRITING",r[r.WRITTEN=3]="WRITTEN"})(e||(e={})),t.writer=(r,n,i)=>{if(r.bytesTotal+1>n.byteLength)return K("Insufficient memory allocated.");let a=new Uint8Array(n),o=jt.use(n,1);return Atomics.store(a,0,e.READ),{tryWrite:()=>Atomics.compareExchange(a,0,e.READ,e.WRITING)===e.WRITING?(i(r.object),o.position=0,r.write(o),Atomics.store(a,0,e.WRITTEN),!0):!1}},t.reader=(r,n)=>{let i=new SharedArrayBuffer(r.bytesTotal+1),a=new Uint8Array(i),o=new it(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(a,0,e.WRITTEN,e.READING)===e.READING?(o.position=0,r.read(o),n(r.object),Atomics.store(a,0,e.READ),!0):!1}}})(ig||(ig={}));var M;(function(t){t.length=16,t.generate=()=>r(crypto.getRandomValues(new Uint8Array(t.length))),t.sha256=async n=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(n.slice(0)):n).then(a=>r(new Uint8Array(a.slice(0,t.length))))},t.validateBytes=n=>t.parse(t.toString(n)),t.validateString=n=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n),t.asString=n=>t.validateString(n)?n:K(`Invalid UUID format: ${n}`),t.fromDataInput=n=>{let i=new Uint8Array(t.length);return n.readBytes(new Int8Array(i.buffer)),i},t.toDataOutput=(n,i)=>n.writeBytes(new Int8Array(i.buffer));let e=pe.create(n=>(n+256).toString(16).substring(1),256);t.toString=n=>e[n[0]]+e[n[1]]+e[n[2]]+e[n[3]]+"-"+e[n[4]]+e[n[5]]+"-"+e[n[6]]+e[n[7]]+"-"+e[n[8]]+e[n[9]]+"-"+e[n[10]]+e[n[11]]+e[n[12]]+e[n[13]]+e[n[14]]+e[n[15]],t.parse=n=>{let i=n.replace(/-/g,"").toLowerCase();if(i.length!==32)return K(`Invalid UUID format (${n})`);let a=new Uint8Array(t.length);for(let o=0,s=0;o<32;o+=2,s++)a[s]=parseInt(i.slice(o,o+2),16);return a},t.Comparator=(n,i)=>{if(n.length!==t.length||i.length!==t.length)return K("Unexpected array length for uuid(v4)");for(let a=0;a<t.length;a++){let o=n[a]-i[a];if(o!==0)return o}return 0},t.equals=(n,i)=>t.Comparator(n,i)===0,t.newSet=n=>new ku(n,t.Comparator),t.Lowest=t.parse("00000000-0000-4000-8000-000000000000"),t.Highest=t.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),t.fromInt=n=>{let i=new Uint8Array(t.Lowest),a=new Uint8Array(new Uint32Array([n]).buffer);for(let o=0;o<4;o++)i[o]=a[o];return i},t.zType=n=>n.string().refine(i=>t.validateString(i),{message:"Invalid UUID format (Zod)"}).transform(i=>i);let r=n=>(ne(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(M||(M={}));var Co;(function(t){class e{value;constructor(s){this.value=s}}t.Transfer=e,t.makeTransferable=o=>new e(o),t.sender=(o,s)=>s(new i(o)),t.executor=(o,s)=>new a(o,s);let r=o=>{let s=[];for(let u of o)u instanceof e?s.push(u.value):(u instanceof MessagePort||typeof ImageBitmap<"u"&&u instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&u instanceof OffscreenCanvas)&&s.push(u);return s},n=o=>o instanceof e?o.value:o;class i{#e;#t=new Map;#r;#i=0;constructor(s){this.#e=s,this.#r=s.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(s,...u)=>{let d=r(u);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(nr.map(u,m=>({value:n(m)})))},d)};dispatchAndReturn=(s,...u)=>new Promise((d,m)=>{let x=nr.reduce(u,(w,F,B)=>(typeof F=="function"&&w.push([B,F]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:d,reject:m},callbacks:new Map(x)});let g=r(u);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(nr.map(u,(w,F)=>typeof w=="function"?{callback:F}:{value:n(w)}))},g),this.#i++});#n=s=>{let u=this.#t.get(s.returnId);U(u)?s.type==="resolve"?(u.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(u.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&u.callbacks?.get(s.funcAt).apply(this,s.args):K(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,u){this.#e=s,this.#t=u,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{ne(s.type==="send",()=>"Message type must be 'send'");let u=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),d=je(u[s.func],`${s.func.toString()} does not exists on ${this.#t}`),m=s.returnId;if(m===!1)d.apply(this.#t,s.args.map(x=>"value"in x?x.value:K(`${s.func.toString()} has no promise.`)));else try{d.apply(this.#t,s.args.map(g=>"callback"in g?(...w)=>this.#o(m,g.callback,w):g.value)).then(g=>{try{this.#n(m,g)}catch(w){this.#a(m,w)}},g=>this.#a(m,g))}catch(x){this.#a(m,x)}};#n=(s,u)=>this.#e.send({type:"resolve",returnId:s,resolve:u});#a=(s,u)=>this.#e.send({type:"reject",returnId:s,reject:u});#o=(s,u,d)=>this.#e.send({type:"callback",returnId:s,funcAt:u,args:d})}t.Executor=a})(Co||(Co={}));var N_={for:t=>new $_(t)},TT=[],$_=class{#e;#t=new me;constructor(e){if(this.#e=e,U(e.onmessage)||U(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=r=>this.#t.notify(r.data),e.onmessageerror=r=>{throw new Error(r.type)}}send(e,r){this.#e.postMessage(e,r??TT)}channel(e){return new M_(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},M_=class t{#e;#t;#r=new me;#i;constructor(e,r){this.#e=e,this.#t=r,this.#i=e.subscribe(n=>{U(n)&&n.__id__==="42"&&n.channel===r&&this.#r.notify(n.message)})}send(e,r){this.#e.send({__id__:"42",channel:this.#t,message:e},r)}channel(e){return new t(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var Hs;(function(t){t.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),t.frames=e=>new Promise(r=>{let n=e,i=()=>{--n<=0?r():requestAnimationFrame(i)};requestAnimationFrame(i)}),t.timeSpan=(e,...r)=>new Promise(n=>setTimeout(n,e.millis(),...r)),t.event=(e,r)=>new Promise(n=>e.addEventListener(r,n,{once:!0})),t.observable=e=>new Promise(r=>{let n=e.subscribe(()=>{n.terminate(),r()})}),t.complete=e=>new Promise((r,n)=>{let i=setInterval(()=>{let{status:a,value:o,error:s}=tr(()=>e.next());if(a==="success"){let{done:u,value:d}=o;u&&(clearInterval(i),r(d))}else clearInterval(i),n(s)},0)})})(Hs||(Hs={}));var k_=class{maxRetry;timeSpan;#e=0;constructor(e,r){this.maxRetry=e,this.timeSpan=r}retry(e,r){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(r,this.timeSpan.millis()),!0)}},ng;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=xp("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=xp("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let u=!0;return o.own(fe.create(()=>u=!1)),new Promise((d,m)=>s.then(x=>{u&&d(x)},x=>{u&&m(x)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new k_(3,Gs.seconds(3));t.retry=(o,s=n)=>o().catch(u=>new Promise((d,m)=>{let x=g=>{s.retry(g,()=>o().then(w=>d(w),x))||m(g)};x(u)})),t.guardedRetry=(o,s)=>{let u=async(d=0)=>{try{return await o()}catch(m){if(s(m,++d))return console.debug(`retry after failure (online: ${navigator.onLine}):`,m),await Hs.timeSpan(Gs.seconds(1)),u(d);throw new Error(`Failed after ${d} retries: ${m}`)}};return u()},t.approvedRetry=(o,s)=>{let u=async()=>{try{return await o()}catch(d){if(await Bu.approve(s(d)))return u();throw d}};return u()},t.delay=(o,s)=>Promise.all([o,Hs.timeSpan(s)]).then(([u])=>u),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,u)=>new Promise((d,m)=>{let x=!0,g=setTimeout(()=>{x=!1,m(new Error(u??"timeout"))},s.millis());o.then(w=>{x&&d(w)},w=>{x&&m(w)}).finally(()=>clearTimeout(g))}),t.sequentialAll=o=>o.reduce((s,u)=>s.then(async d=>[...d,await u()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return u=>{let d=()=>o(u),m=s.then(d,d);return s=m.catch(()=>{}),m}},t.memoizeAsync=(o,s)=>{let u=null,d=Date.now();return()=>{let m=Date.now();return(Qi(u)||U(s)&&m-d>s.millis())&&(d=m,u=o(),u.catch(x=>(u=null,x))),u}},t.allWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=!1,x=async()=>{for(;d<o.length&&!m;){let g=d++;try{let w=await o[g]();m||(u[g]=w)}catch(w){throw m=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},x)),u},t.allSettledWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=async()=>{for(;d<o.length;){let x=d++;try{let g=await o[x]();u[x]={status:"fulfilled",value:g}}catch(g){u[x]={status:"rejected",reason:g}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},m)),u};class i{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let u=Promise.withResolvers();return this.#e.push([s,u]),u.promise.finally(()=>this.#r())}}#r(){if(ne(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:u,reject:d}]=this.#e.shift();this.#t++,s().then(u,d)}}}t.Limit=i;class a{#e;#t;#r;#i=b.None;constructor(s,u,d){this.#e=s,this.#t=u,this.#r=d}update(s){this.#i=b.wrap(s),s.then(u=>{this.#i.contains(s)&&this.#e(u)}).catch(u=>{this.#i.contains(s)&&this.#t(u)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),$(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(ng||(ng={}));var ag=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#u;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#u=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new og(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=_p.create(_p.Type.Blackman,this.#e),this.#t=e,this.#o=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#o.fill(0),this.#i.fill(0),this.#s.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#o}waveform(){return this.#s}process(e,r,n,i){for(let a=n;a<i;++a)this.#i[this.#l]=e[a]+r[a],++this.#l===this.#e&&this.#c()}#c(){for(let r=0;r<this.#t;++r)this.#s[r]=this.#i[r<<1];for(let r=0;r<this.#e;++r)this.#i[r]*=this.#a[r];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let r=0;r<this.#t;++r){let n=this.#i[r],i=this.#n[r],a=Math.sqrt(n*n+i*i)*e;this.#o[r]<a?this.#o[r]=a:this.decay&&(this.#o[r]*=this.#u)}this.#l=0,this.#n.fill(0),this.decay=!1}};var B_=(t,e)=>Math.floor(3840/e)*t,ZP=(t,e=4,r=4)=>{let n=B_(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-B_(a*e,r))%n,u=Math.floor(s/240),d=s%240;return{bars:a,beats:i-a*e,semiquavers:u,ticks:d}},GP=(t,e)=>t*e/60*960,HP=(t,e)=>t*60/960/e,DT=(t,e)=>e*60/960/t,RT=(t,e,r)=>GP(t/r,e),CT=(t,e,r)=>HP(t,e)*r,Te={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:B_,toParts:ZP,secondsToPulses:GP,pulsesToSeconds:HP,secondsToBpm:DT,samplesToPulses:RT,pulsesToSamples:CT,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=ZP(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var Bi=128,sg=Te.fromSignature(1,48);var zT=Math.log(10)/20;var qP=t=>Math.exp(t*zT);var Fp;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(Fp||(Fp={}));var Ap;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(Ap||(Ap={}));var no;(function(t){t.globalToLocal=(r,n)=>Zs(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{let u=r-i,d=u+a;if(u>=s||d<=o)return b.None;let m=Math.max(u,o),x=Math.min(d,s);return b.wrap({index:0,rawStart:u,rawEnd:d,regionStart:Math.max(u,r),regionEnd:Math.min(d,n),resultStart:m,resultEnd:x,resultStartValue:u<m?(m-u)/a:0,resultEndValue:d>x?(x-u)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){let u=r-i,d=Math.max(r,o),m=Math.min(n,s),x=Math.floor((d-u)/a),g=u+x*a;for(;g<m;){let w=g+a,F=Math.max(g,r),B=Math.min(w,n),V=Math.max(g,d),W=Math.min(w,m),z=g<V?(V-g)/a:0,ee=w>W?(W-g)/a:1;yield{index:x++,rawStart:g,rawEnd:w,regionStart:F,regionEnd:B,resultStart:V,resultEnd:W,resultStartValue:z,resultEndValue:ee},g=w}}t.locateLoops=e})(no||(no={}));var Or=class t{static DefaultComparator=(e,r)=>e.position-r.position;static create(e){return new t(e??t.DefaultComparator)}#e;constructor(e){this.#e=new lg(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?io.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),r,n)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},zo=class t{static Comparator=(e,r)=>e.position-r.position;static create(e){return new t(e)}#e;constructor(e=t.Comparator){this.#e=new lg(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return io.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return io.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return io.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var lg=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){if(this.#e.includes(e))throw new Error(`Duplicate event added: ${e}`);++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let r=this.#e.indexOf(e);return r===-1?!1:(this.#e.splice(r,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let n=e.position,i=yt.leftMostMapped(this.#e,n,Ro,Fp.PositionExtractor);for(let a=i;a<this.#e.length;a++){let o=this.#e[a];if(o===e)return!0;if(o.position!==n)return!1}return!1}clear(){++this.modCount,pe.clear(this.#e),this.#t=!1}optAt(e){return e<0||e>=this.#e.length?null:(this.#t&&this.#r(),this.#e[e])}asArray(){return this.#t&&this.#r(),this.#e}lowerEqual(e,r){if(r===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(r(i))return i}return null}greaterEqual(e,r){if(r===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(r(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),yt.rightMostMapped(this.#e,e,Ro,Fp.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),yt.leftMostMapped(this.#e,e,Ro,Fp.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,Pr.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,Pr.MAX_VALUE,r);i--}return this.iterate(n,Pr.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=Nu.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=r)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var ug;(function(t){t.hasFading=e=>e.in>0||e.out>0,t.gainAt=(e,r,n)=>{let{in:i,out:a,inSlope:o,outSlope:s}=n,u=1,d=1;i>0&&e<i&&(u=ir.normalizedAt(e/i,o));let m=r-a;if(a>0&&e>m){let x=(e-m)/a;d=1-ir.normalizedAt(x,s)}return Math.min(u,d)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:u,inSlope:d,outSlope:m}=o;if(e.fill(1,0,a),s<=0&&u<=0)return;let x=i-u;if(r>=s&&n<=x)return;let g=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),F=Math.min(a,Math.ceil((w-r)/g));if(F>0){let B=r/s,V=w/s,W=ir.walk(d,F,B,V);for(let z=0;z<F;z++)e[z]=W.next().value}}if(u>0&&n>x){let w=Math.max(r,x),F=Math.max(0,Math.floor((w-r)/g)),B=a-F;if(B>0){let V=(w-x)/u,W=(n-x)/u,z=ir.walk(m,B,1-V,1-W);for(let ee=F;ee<a;ee++)e[ee]=Math.min(e[ee],z.next().value)}}}})(ug||(ug={}));var og=class t{static reverse(e){return e=(e&1431655765)<<1|e>>>1&1431655765,e=(e&858993459)<<2|e>>>2&858993459,e=(e&252645135)<<4|e>>>4&252645135,e=e<<24|(e&65280)<<8|e>>>8&65280|e>>>24,e}#e;#t;#r;#i;constructor(e){this.#e=e;let r=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(r),this.#i=new Float32Array(r);for(let n=0;n<r;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,r){let n,i,a,o;for(let d=0;d<this.#e;++d)i=t.reverse(d)>>>this.#t,i>d&&(o=e[d],e[d]=e[i],e[i]=o,o=r[d],r[d]=r[i],r[i]=o);let s=this.#r,u=this.#i;for(let d=2;d<=this.#e;d<<=1){let m=d>>1,x=this.#e/d;for(n=0;n<this.#e;n+=d){let g=n+m;for(i=n,a=0;i<g;i++,a=a+x|0){let w=i+m|0,F=s[a],B=u[a],V=e[w],W=r[w],z=V*F+W*B,ee=W*F-V*B,Q=e[i],xe=r[i];e[w]=Q-z,r[w]=xe-ee,e[i]=Q+z,r[i]=xe+ee}}if(d===this.#e)break}}inverse(e,r){let n=this.#e;for(let a=0;a<n;a++)r[a]=-r[a];this.process(e,r);let i=1/n;for(let a=0;a<n;a++)e[a]*=i,r[a]=-r[a]*i}};var Oo;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>Te.fromSignature(r,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(n)-t.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(i)-t.toDouble(n))}}})(Oo||(Oo={}));var JP;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(JP||(JP={}));var cg=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,r){let n=this.#e.duration(),i=w_(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var ma;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(ma||(ma={}));var Iu;(function(t){t.isOfType=e=>e.type==="note-event",t.Comparator=(e,r)=>{let n=e.position-r.position;if(n!==0)return n;let i=e.pitch-r.pitch;return i!==0?i:0},t.curveFunc=(e,r)=>r<0?e**2**-r:1-(1-e)**2**r,t.inverseCurveFunc=(e,r)=>r<0?e**2**r:1-Math.max(0,1-e)**2**-r,t.CompleteComparator=(e,r)=>{let n=Ap.complete(e)-Ap.complete(r);return n!==0?n:e.pitch-r.pitch}})(Iu||(Iu={}));var dg=class t{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(t.#e*e)),this.#i=Math.pow(.01,1/(t.#t*e))}clear(){this.#n=0}replace(e,r,n){let i=this.#r,a=this.#i,[o,s]=e.channels(),u=this.#n;for(let d=r;d<n;++d){let m=o[d],x=s[d],g=Math.max(Math.abs(m),Math.abs(x));if(u=g>u?i*(u-g)+g:a*(u-g)+g,u>1){let w=1/u;o[d]=m*w,s[d]=x*w}}this.#n=u}};var Yr;(function(t){t.Musical="musical",t.Seconds="seconds"})(Yr||(Yr={}));var qs;(function(t){function e(r,n,i){return new I_(r,n,i)}t.aware=e})(qs||(qs={}));var I_=class{#e;#t;#r;constructor(e,r,n){this.#r=n,this.#t=r,this.#e=e}toPPQN(e){let r=this.#r.getValue();if(this.getTimeBase()===Yr.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===Yr.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(r,r+e);this.#r.setValue(n)}}toSeconds(e){let r=this.#r.getValue();return this.getTimeBase()===Yr.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return to(this.#t.getValue(),Yr)}};var YP=Te.fromSignature(1,384);var di={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?di.Linear:{type:"curve",slope:t}},pg;(function(t){t.Comparator=(i,a)=>{let o=i.position-a.position;if(o!==0)return o;let s=i.index-a.index;return s!==0?s:i===a?0:K(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return nr.empty();for(let s of i.iterateFrom(a))if(yield s,s.position>=o)return}t.iterateWindow=e,t.nextEvent=(i,a)=>{let o=i.asArray(),s=yt.rightMost(o,a,t.Comparator);return s===-1?null:o[s+1]??null},t.valueAt=(i,a,o)=>{if(i.isEmpty())return o;let s=i.iterateFrom(a),{done:u,value:d}=s.next();if(u)return o;if(d.position<=a){let{done:m,value:x}=s.next();if(m)return d.value;if(a<x.position)return n(d,x,a);if(d.interpolation===di.None)return d.value}return d.value};function*r(i,a,o,s){if(i.isEmpty())return;let u=i.iterateFrom(a),{done:d,value:m}=u.next();if(d)return;let x=o/s,g=m;if(g.position>a){for(;a<g.position;)if(yield{position:a,value:g.value},a+=x,a>o)return;g.position<=o&&(yield g)}for(;a<=o;){let{done:w,value:F}=u.next();if(w)break;for(;a<F.position;){if(a>o)return;yield{position:a,value:n(g,F,a)},a+=x}F.position<o&&(g.interpolation===di.None&&(yield{position:F.position,value:g.value}),yield F),g=F}for(;a<=o;)yield{position:a,value:g.value},a+=x}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,u)=>o.type==="none"?i:o.type==="linear"?i+(u-a)/(s.position-a)*(s.value-i):o.type==="curve"?ir.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},u-a):K("Unknown interpolation")})(pg||(pg={}));var _p;(function(t){let e;(function(r){r[r.Bartlett=0]="Bartlett",r[r.Blackman=1]="Blackman",r[r.BlackmanHarris=2]="BlackmanHarris",r[r.Hamming=3]="Hamming",r[r.Hanning=4]="Hanning"})(e=t.Type||(t.Type={})),t.create=(r,n)=>{let i=new Float32Array(n),a=Math.PI/(n-1);switch(r){case e.Bartlett:{let o=(n>>1)-1,s=0;for(;s<=o;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let o=2*a,s=4*a;for(let u=0;u<n;++u)i[u]=.42323-.49755*Math.cos(o*u)+.07922*Math.cos(s*u);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,u=6*a;for(let d=0;d<n;++d)i[d]=.35875-.48829*Math.cos(o*d)+.14128*Math.cos(s*d)-.01168*Math.cos(u*d);return i}case e.Hamming:{let o=2*a;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(o*s);return i}case e.Hanning:{let o=2*a;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(o*s);return i}}}})(_p||(_p={}));var Be=class t{static newSet(e){return new ku(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return ne(n.every((i,a)=>i===r[a]),`fieldKeys (${n.join(",")}) only allows i16`),new t(e,n)};static decode(e){let r=e.split("/");return ne(r.length>0,"Unable to parse Address"),t.compose(M.parse(r[0]),...r.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,r,n){let i=e.values(),a=yt.leftMostMapped(i,r,M.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(M.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=M.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return e.#r.length-r.#r.length};static MinimalComparator=(e,r)=>{let n=M.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return 0};static LengthComparator=(e,r)=>{let n=M.Comparator(e.#t,r.#t);return n!==0?n:r.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,r){this.#t=e,this.#r=r}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return t.Comparator(this,e)===0}compareTo(e){return t.Comparator(this,e)}append(e){return new t(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return M.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((r,n)=>this.#r[n]===r)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(r=>e.writeShort(r))}moveTo(e){return new t(e,this.#r)}decompose(){return[this.#t,this.#r]}toJSON(){return{uuid:Array.from(this.#t.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(M.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,M.length),e.buffer}toString(){return[M.toString(this.#t),...this.#r].join("/")}static read(e){let r=M.fromDataInput(e),n=e.readByte();return t.compose(r,...pe.create(()=>e.readShort(),n))}},Js;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>Be.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=yt.rangeMapped(r,e,Be.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=yt.rangeMapped(r,e,Be.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=yt.leftMostMapped(r,e,Be.LengthComparator,t.AddressReader),i=yt.rightMostMapped(r,e,Be.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(Js||(Js={}));var ha=class t{static validate(e,r){if(e.address.equals(r.address))return b.wrap(`PointerField cannot point to itself: ${e}`);if(!r.pointerRules.accepts.some(n=>n===e.pointerType)){let n=r.pointerRules.accepts.join(", ");return b.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return b.None}#e;#t;constructor(e){this.#e=e,this.#t=new ar}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=Be.newSet(i=>i.address);return n.addMany(this.filter(...r)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{OP(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():nr.filter(this.incoming().values(),r=>e.some(n=>n===r.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(r=>e.address.equals(r.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let r=t.validate(e,this.#e);if(r.nonEmpty())return K(r.unwrap());this.#t.proxy.onAdded(e)}onRemoved(e){this.#t.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#e.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,r,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onRemoved(i)}})}};var T_=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Tu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},L=class t{static hook(e){return new t(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:r,fieldName:n,pointerRules:i,deprecated:a}){this.#e=e,this.#t=r,this.#r=n,this.#i=i,this.#n=a,(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}accept(e){return $(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new ha(this)}get address(){return this.#e.address.append(this.#t)}get debugPath(){return`${this.box.name}:${this.box.mapFields(e=>e.fieldName,...this.address.fieldKeys).join("/")}`}isBox(){return!1}isField(){return!0}isAttached(){return this.graph.findBox(this.address.uuid).nonEmpty()}fields(){return pe.empty()}record(){return eg.empty()}getField(e){return K()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return K("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(r=>{r.defer(),(r.mandatory||this.pointerRules.mandatory&&e.length===1)&&(console.warn(`[Field.disconnect] Deleting ${r.box} because pointer.mandatory=${r.mandatory} or (field.mandatory=${this.pointerRules.mandatory} and lastPointer=${e.length===1})`),r.box.delete())})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};T_([Mu,Tu("design:type",ha),Tu("design:paramtypes",[])],L.prototype,"pointerHub",null);T_([Mu,Tu("design:type",Be),Tu("design:paramtypes",[])],L.prototype,"address",null);T_([Mu,Tu("design:type",String),Tu("design:paramtypes",[])],L.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var Ys=class t extends L{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=pe.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return $(e.visitArrayField,this)}fields(){return this.#e}record(){return pe.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return je(this.#e[e])}optField(e){return b.wrap(this.#e[e])}read(e){this.#e.forEach(r=>r.read(e))}write(e){this.#e.filter(r=>!r.deprecated).forEach(r=>r.write(e))}size(){return this.#e.length}toJSON(){if(!this.deprecated)return Object.values(this.#e).map(e=>e.toJSON()??null)}fromJSON(e){if(!this.deprecated)if(Array.isArray(e))e.forEach((r,n)=>this.#e[n].fromJSON(r));else return K("Type mismatch")}};var Vo;(function(t){t.writeFields=(r,n)=>{let i=Object.entries(n).filter(([a,o])=>!o.deprecated);r.writeInt(1179403347),r.writeShort(i.length),i.forEach(([a,o])=>{let s=jt.create();o.write(s);let u=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(u.length),r.writeBytes(u)})},t.readFields=(r,n)=>{ne(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(Zh(n[o]))continue;let s=r.readInt(),u=new Int8Array(s);r.readBytes(u);let{status:d,error:m}=tr(()=>n[o]?.read(new it(u.buffer)));d==="failure"&&console.warn(n,m)}}})(Vo||(Vo={}));var OT=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},XP=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},T=class t{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#a;#o;#s=t.Index++;constructor({uuid:e,graph:r,name:n,pointerRules:i,resource:a,ephemeral:o}){this.#e=Be.compose(e),this.#t=r,this.#r=n,this.#i=i,this.#n=a,this.#a=o===!0,this.#o=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return je(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return b.wrap(this.#o[e])}subscribe(e,r){return this.graph.subscribeVertexUpdates(e,this.address,r)}subscribeDeletion(e){return this.graph.subscribeDeletion(this.address.uuid,e)}get box(){return this}get name(){return this.#r}get graph(){return this.#t}get parent(){return this}get address(){return this.#e}get pointerRules(){return this.#i}get resource(){return this.#n}get ephemeral(){return this.#a}get creationIndex(){return this.#s}get pointerHub(){return new ha(this)}estimateMemory(){let e=new $u;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ce(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Vo.readFields(e,this.#o)}write(e){Vo.writeFields(e,this.#o)}serialize(){let e=jt.create();return e.writeInt(this.#s),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=jt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[r,n])=>{let i=n.toJSON();return U(i)&&(e[r]=i),e},{})}fromJSON(e){if(Gh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];U(n)&&i.fromJSON(n)});else return K("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return pe.empty();let n=this.getField(r[0]),i=[e(n)];for(let a=1;a<r.length;a++)n=n.getField(r[a]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return b.wrap(this);let r=this.optField(e[0]);if(r.isEmpty())return b.None;for(let n=1;n<e.length;n++)if(r=r.unwrap().optField(e[n]),r.isEmpty())return b.None;return r}delete(){if(!this.isAttached())return;let{boxes:e,pointers:r}=this.graph.dependenciesOf(this);t.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...r].map(n=>n.toString()).join(`
|
|
1
|
+
var kT=Object.defineProperty;var eo=(t,e)=>{for(var r in e)kT(t,r,{get:e[r],enumerable:!0})};var U=t=>t!=null,Qi=t=>t===null,OP=t=>t!==null,Zh=t=>t===void 0,h_=t=>t!==void 0,g_=t=>t==null,v_=(t,e)=>t!=null?e(t):void 0,je=(t,e="asDefined failed")=>t??K(pa(e)),xt=(t,e)=>t instanceof e,Ce=(t,e)=>t instanceof e?t:K(`${t} is not instance of ${e}`),x_=(t,e)=>{t instanceof e||K(`${t} is not instance of ${e}`)};var pa=t=>t instanceof Function?t():t;var $=(t,...e)=>t?.apply(null,e),Gh=t=>U(t)&&typeof t=="object";var Hh=t=>{throw new Error(`Unhandled ${t}`)},K=t=>{throw typeof t=="string"?new Error(t):t},ne=(t,e)=>t?void 0:K(pa(e));var xp=t=>new Proxy({},{get(){return K(t)}});var f_=class{value;status="success";constructor(e){this.value=e}error=xp("Cannot access error when succeeded")},m_=class{error;status="failure";constructor(e){this.error=e}value=xp("Cannot access value when failed")},tr=t=>{try{return new f_(t())}catch(e){return new m_(e)}};var to=(t,e)=>Object.keys(e).length===0?K("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:K(`Invalid enum value: ${String(t)}`),yp=()=>{};var y_;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(y_||(y_={}));var pe=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,r)=>{e.length=0,e.push(...r)};static consume=(e,r)=>{for(let n=0;n<e.length;)r(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,r)=>je(e.at(0),r);static getLast=(e,r)=>je(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?K(`${r} not found in ${e}`):je(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?K(`${r} not found in ${e}`):je(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>je(e.pop(),r);static create=(e,r)=>{let n=new Array(r);for(let i=0;i<r;i++)n[i]=e(i);return n};static equals=(e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0};static satisfy=(e,r)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!r(n,e[i]))return!1;return!0};static remove=(e,r)=>{let n=e.indexOf(r);if(n===-1)return K(`${r} not found in ${e}`);e.splice(n,1)};static removeIf=(e,r)=>{for(let n=e.length-1;n>=0;n--)r(e[n])&&e.splice(n,1)};static removeOpt=(e,r)=>{let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let r=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[r++]=i);return e.length=r,e};static removeDuplicateKeys=(e,r)=>{let n=0,i=new Set;for(let a of e){let o=a[r];i.has(o)||(i.add(o),e[n++]=a)}return e.length=n,e};static partition(e,...r){let n=r.map(()=>[]);for(let i of e)for(let a=0;a<r.length;a++)r[a](i)&&n[a].push(i);return n}static subtract(e,r,n){return e.filter(i=>!r.some(a=>n(i,a)))}static intersect(e,r,n){return e.filter(i=>r.some(a=>n(i,a)))}static merge(e,r,n){return[...e.filter(i=>!r.some(a=>n(i,a))),...r]}static*iterate(e){for(let r=0;r<e.length;r++)yield e[r]}static*iterateReverse(e){for(let r=e.length-1;r>=0;r--)yield e[r]}static*iterateStateFull(e){let r=e.length-1;for(let n=0;n<=r;n++)yield{value:e[n],isFirst:n===0,isLast:n===r}}static*iterateAdjacent(e){if(!(e.length<=1))for(let r=1,n=e[0];r<e.length;r++){let i=e[r];yield[n,i],n=i}}static isSorted(e,r=y_.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let a=e[i];if(Math.sign(n-a)===r)return!1;n=a}return!0}static toRecord(e,r){return e.reduce((n,i)=>(n[r(i)]=i,n),{})}static concatArrayBuffers(e,r){let n=new ArrayBuffer(e.byteLength+r.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(r),e.byteLength),n}};var b;(function(t){t.wrap=r=>U(r)?new e(r):t.None,t.from=r=>t.wrap(r()),t.tryCatch=r=>{try{return t.wrap(r())}catch{return t.None}},t.execute=(r,...n)=>t.wrap(r?.apply(null,n)),t.async=r=>r.then(n=>t.wrap(n),()=>t.None);class e{#e;constructor(n){this.#e=je(n)}unwrap(){return this.#e}unwrapOrElse(n){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(n){return n===this.#e}match(n){return n.some(this.#e)}ifSome(n){return n(this.#e)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return t.wrap(n(this.#e))}mapOr(n,i){return n(this.#e)}flatMap(n){return n(this.#e)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}t.Some=e,t.None=new class{unwrap=r=>K(U(r)?pa(r):"unwrap failed");unwrapOrElse=r=>pa(r);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=r=>!1;match=r=>r.none();ifSome=r=>{};ifAbsent=r=>r(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=r=>t.None;mapOr=(r,n)=>pa(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>K(pa(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var Sr;(function(t){t.async=e=>e.then(r=>t.ok(r),r=>t.err(r)),t.tryGet=e=>{try{return t.ok(e())}catch(r){return t.err(r)}},t.ok=e=>new class{value;constructor(r){this.value=r}asOption=()=>b.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=r=>{try{return t.ok(r(this.value))}catch(n){return t.err(n)}};mapOr=(r,n)=>r(this.value);unwrapOrElse=r=>this.value;flatMap=r=>r(this.value);match=r=>r.ok(this.value);toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),t.Ok=new class{constructor(){}asOption=()=>b.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>t.ok(e());mapOr=(e,r)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},t.err=e=>new class{reason;constructor(r){this.reason=r}asOption=()=>b.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>K(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>pa(n);unwrapOrElse=r=>pa(r);flatMap=()=>this;match=r=>r.err(this.reason);toVoid=()=>t.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Sr||(Sr={}));var yt;(function(t){t.exact=(e,r,n)=>{let i=0,a=e.length-1;for(;i<=a;){let o=i+a>>>1,s=n(e[o],r);if(s===0)return o;s<0?i=o+1:a=o-1}return-1},t.exactMapped=(e,r,n,i)=>{let a=0,o=e.length-1;for(;a<=o;){let s=a+o>>>1,u=n(i(e[s]),r);if(u===0)return s;u<0?a=s+1:o=s-1}return-1},t.leftMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}return i},t.rightMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<=0?i=o+1:a=o}return a-1},t.stableInsert=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}for(;i<e.length&&n(e[i],r)===0;)i++;return i},t.leftMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<0?a=s+1:o=s}return a},t.rightMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<=0?a=s+1:o=s}return o-1},t.rangeMapped=(e,r,n,i)=>[t.leftMostMapped(e,r,n,i),t.rightMostMapped(e,r,n,i)]})(yt||(yt={}));var qh=class{#e;#t=null;constructor(e){this.#e=e}invalidate=()=>this.#t=null;get(){return this.#t===null&&(this.#t=this.#e()),this.#t}terminate(){this.invalidate()}};var rr=class t{static parseCssRgbOrRgba(e){let r=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(U(r)&&r.every(n=>!isNaN(n))){if(r.length===3)return[r[0]/255,r[1]/255,r[2]/255,1];if(r.length===4)return[r[0]/255,r[1]/255,r[2]/255,r[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,r,n){let i=u=>(u+e/30)%12,a=r*Math.min(n,1-n),o=u=>n-a*Math.max(-1,Math.min(i(u)-3,Math.min(9-i(u),1))),s=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${s(o(0))}${s(o(8))}${s(o(4))}`}static hexToHsl(e){let r=e.startsWith("#")?e.slice(1):e,n=parseInt(r.slice(0,2),16)/255,i=parseInt(r.slice(2,4),16)/255,a=parseInt(r.slice(4,6),16)/255,o=Math.max(n,i,a),s=Math.min(n,i,a),u=(o+s)/2,d=0,m=0;if(o!==s){let x=o-s;switch(m=u>.5?x/(2-o-s):x/(o+s),o){case n:d=((i-a)/x+(i<a?6:0))*60;break;case i:d=((a-n)/x+2)*60;break;case a:d=((n-i)/x+4)*60;break}}return{h:d,s:m,l:u}}static hslStringToHex(e){let[r,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return t.hslToHex(r,n/100,i/100)}#e;#t;#r;#i;constructor(e,r,n,i=1){this.#e=e,this.#t=r,this.#r=n,this.#i=i}opacity(e){return new t(this.#e,this.#t,this.#r,e)}brightness(e){let r=Math.max(0,Math.min(100,this.#r+e));return new t(this.#e,this.#t,r,this.#i)}saturate(e){return new t(this.#e,this.#t*e,this.#r,this.#i)}lerp(e,r){let n=Math.PI/180,i=this.#t*Math.cos(this.#e*n),a=this.#t*Math.sin(this.#e*n),o=e.#t*Math.cos(e.#e*n),s=e.#t*Math.sin(e.#e*n),u=i+(o-i)*r,d=a+(s-a)*r,m=(Math.atan2(d,u)/n+360)%360,x=Math.sqrt(u*u+d*d),g=this.#r+(e.#r-this.#r)*r,w=this.#i+(e.#i-this.#i)*r;return new t(m,x,g,w)}fade(e){let r=this.#t*(1-Math.sqrt(e)),n=this.#r+(100-this.#r)*e**3;return new t(this.#e,r,n,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Ro=(t,e)=>t-e;var Oz=Math.PI*2,Vz=Math.PI/2,Uz=Math.PI/4,jz=1/Math.sqrt(2),lt=(t,e,r)=>Math.max(e,Math.min(t,r)),VP=t=>Math.max(0,Math.min(t,1)),UP=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),w_=(t,e)=>Math.floor(t/e)*e;var jP=(t,e,r)=>t+(e-t)*r;var Zs=(t,e)=>BT(t/e)*e,BT=t=>t-Math.floor(t),Jh=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var b_=(t,e)=>t*e/((2*e-1)*(t-1)+e);var ir;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},u)=>t.normalizedAt(u/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=lt(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=lt(a,1e-15,.999999999999999);return Math.log(i*(1-2*o)/(o*o)+1)/(2*Math.log((1-o)/o))},t.coefficients=i=>{let a=t.valueAt(i,1),s=(t.valueAt(i,2)-a)/(a-i.y0),u=a-s*i.y0;return{m:s,q:u}};function*r(i,a,o,s){let{m:u,q:d}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let m=0,x=o;m<a;m++)yield x=u*x+d}t.walk=r,t.run=(i,a,o,s,u)=>{let{m:d,q:m}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let x=0,g=o;x<a;x++)u(g=d*g+m)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),d=(t.normalizedAt(2*o,i)-s)/s;for(let m=0,x=0;m<a;m++)yield x=d*x+s}t.walkNormalized=n,t.byHalf=(i,a,o,s)=>({slope:t.slopeByHalf(a,o,s),steps:i,y0:a,y1:s}),t.slopeByHalf=(i,a,o)=>Math.abs(o-i)<1e-6?.5:(a-i)/(o-i)})(ir||(ir={}));var fa=new DataView(new ArrayBuffer(8)),Pr;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(fa.setInt8(0,e),fa.getInt8(0)),t.toShort=e=>(fa.setInt16(0,e),fa.getInt16(0)),t.toInt=e=>(fa.setInt32(0,e),fa.getInt32(0))})(Pr||(Pr={}));var ro;(function(t){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),a=new Int32Array(n);t.floatToIntBits=o=>{let s=t.floatToRawIntBits(o);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},t.intBitsToFloat=o=>(a[0]=o,i[0]),t.floatToRawIntBits=o=>(i[0]=o,a[0]),t.toFloat32=o=>(fa.setFloat32(0,o),fa.getFloat32(0))})(ro||(ro={}));var KP;(function(t){t.floatToIntBits=e=>{let r=ro.floatToIntBits(e),n=r>>>16&32768,i=(r&2147483647)+4096;return i>=1199570944?(r&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(r&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(r&2147483647)>>>23,n|(r&8388607|8388608)+(8388608>>>i-102)>>>126-i)},t.intBitsToFloat=e=>{let r=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,r===0&&n>115712)return ro.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(r!==0){n=115712;do r<<=1,n-=1024;while((r&1024)===0);r&=1023}return ro.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(KP||(KP={}));var Yh;(function(t){let e=9218868437227405312n,r=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),a=new BigInt64Array(n);t.float64ToLongBits=o=>{let s=t.float64ToRawLongBits(o);return(s&e)===e&&(s&r)!==0n?0x7ff8000000000000n:s},t.longBitsToFloat64=o=>(a[0]=o,i[0]),t.float64ToRawLongBits=o=>(i[0]=o,a[0]),t.clamp=o=>(fa.setFloat64(0,o),fa.getFloat64(0))})(Yh||(Yh={}));var nr=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){ne(U(r)||e>=0,()=>`range count must be non-negative, got ${e}`);let i=U(r)?e:0,a=U(r)?r:e;if(n!==0)if(n>0)for(let o=i;o<a;o+=n)yield o;else for(let o=i;o>a;o+=n)yield o}static count(e){let r=0;for(let n of e)r++;return r}static some(e,r){for(let n of e)if(r(n))return!0;return!1}static every(e,r){for(let n of e)if(!r(n))return!1;return!0}static reduce(e,r,n){let i=n,a=0;for(let o of e)i=r(i,o,a++);return i}static includes(e,r){for(let n of e)if(n===r)return!0;return!1}static forEach(e,r){for(let n of e)r(n)}static*map(e,r){let n=0;for(let i of e)yield r(i,n++)}static*take(e,r){let n=0;for(let i of e){if(n++>=r)return;yield i}}static filter(e,r){let n=[];for(let i of e)r(i)&&n.push(i);return n}static filterMap(e,r){let n=[];for(let i of e){let a=r(i);U(a)&&n.push(a)}return n}static reverse(e){let r=[];for(let n of e)r.push(n);return r.reverse()}static*pairWise(e){let r=e[Symbol.iterator](),{done:n,value:i}=r.next(),a=i;if(n!==!0)for(;;){let{done:o,value:s}=r.next();if(o===!0){yield[a,null];return}yield[a,s],a=s}}};var jt=class t{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,r=0){return new t(new DataView(e,r))}littleEndian=!1;#e;#t=0;constructor(e){this.#e=e}get remaining(){return this.#e.byteLength-this.#t}get position(){return this.#t}set position(e){e<0?K(`position(${e}) cannot be negative.`):e>this.#e.byteLength?K(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#e.setInt8(this.#t++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#e.setInt16(this.#t,e,this.littleEndian),this.#t+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#e.setInt32(this.#t,e,this.littleEndian),this.#t+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#e.setBigInt64(this.#t,e,this.littleEndian),this.#t+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#e.setFloat32(this.#t,e,this.littleEndian),this.#t+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#e.setFloat64(this.#t,e,this.littleEndian),this.#t+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let r=0;r<e.length;++r)this.#e.setInt8(this.#t++,e[r])}writeString(e){let r=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+r*Int16Array.BYTES_PER_ELEMENT),this.writeInt(r);for(let n=0;n<r;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let r=this.#e.byteLength;if(this.#t+e>r){let n=this.#e;this.#e=new DataView(new ArrayBuffer(Jh(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},$u=class{#e=0;writeByte(e){this.#e++}writeShort(e){this.#e+=2}writeInt(e){this.#e+=4}writeLong(e){this.#e+=8}writeFloat(e){this.#e+=4}writeDouble(e){this.#e+=8}writeBoolean(e){this.#e++}writeBytes(e){this.#e+=e.length}writeString(e){this.#e+=e.length+4}get count(){return this.#e}},Xh=class{#e;#t=0;constructor(e=32){this.#e=new Int8Array(e)}result(){return this.#e}equals(e){return e===this?!0:this.#e.every((r,n)=>e.#e[n]===r)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#t>=this.#e.length&&(this.#t=0),this.#e[this.#t++]^=e}writeInt(e){this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBytes(e){e.forEach(r=>this.writeByte(r))}writeFloat(e){this.writeInt(ro.floatToIntBits(e))}writeDouble(e){this.writeLong(Yh.float64ToLongBits(e))}writeLong(e){this.writeByte(Number(e)&255),this.writeByte(Number(e>>8n)&255),this.writeByte(Number(e>>16n)&255),this.writeByte(Number(e>>24n)&255),this.writeByte(Number(e>>32n)&255),this.writeByte(Number(e>>40n)&255),this.writeByte(Number(e>>48n)&255),this.writeByte(Number(e>>56n)&255)}writeString(e){for(let r=0;r<e.length;r++)this.writeShort(e.charCodeAt(r))}toHexString(){return Array.from(nr.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},it=class{littleEndian=!1;#e;#t=0;constructor(e,r=0){this.#e=new DataView(e,r)}get position(){return this.#t}set position(e){e<0?K(`position(${e}) cannot be negative.`):e>this.#e.byteLength?K(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}readByte(){return this.#e.getInt8(this.#t++)}readShort(){let e=this.#e.getInt16(this.#t,this.littleEndian);return this.#t+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#e.getInt32(this.#t,this.littleEndian);return this.#t+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#e.getBigInt64(this.#t,this.littleEndian);return this.#t+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#e.getFloat32(this.#t,this.littleEndian);return this.#t+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#e.getFloat64(this.#t,this.littleEndian);return this.#t+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let r=0;r<e.length;r++)e[r]=this.readByte()}readString(){let e=this.readInt(),r="";for(let n=0;n<e;n++)r+=String.fromCharCode(this.readShort());return r}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var IT=t=>U(t)?t.value!==void 0?"value":t.get!==void 0?"get":K(`Cannot resolve method key of ${t}`):K("Cannot resolve method key of undefined descriptor"),Mu=(t,e,r)=>{if(!U(r))return function(a,o){if(o&&o.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!U(s?.get))return K(`Cannot find getter for property '${e}'`);let u=s.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let n=IT(r),i=je(r[n]);return{[n]:function(...a){if(a.length>0)return K("lazy accessory must not have any construction parameters");let o=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?o:()=>o,configurable:!1,writable:!1,enumerable:!1}),o}}};var io;(function(t){function*e(){}t.empty=e;function*r(...n){for(let i of n)for(let a of i)yield a}t.flatten=r})(io||(io={}));var ar=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?$(i[r],...n):i[r]?.apply(i,n))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var wp=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var bp=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var Qh=class t{map;constructor(e){this.map=new Map(e?.map(r=>{let n=r[0],i=r[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,r){return nr.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return nr.includes(this.map.keys(),e)}containsValue(e){return nr.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??bp.empty()}isEmpty(){return this.keyCount()===0}add(e,r){wp.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=wp.createIfAbsent(this.map,e,()=>new Set);for(let i of r)n.add(i)}remove(e,r){let n=this.map.get(e);return n===void 0?!1:n.delete(r)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let r=new Set;for(let[n,i]of this.map.entries()){for(let a of i)e(a)&&(i.delete(a),r.add(a));i.size===0&&this.map.delete(n)}return r}removeFromKeyIf(e,r){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(r(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let r=this.map.get(e);return this.map.delete(e),r??bp.empty()}forEach(e){nr.forEach(this.map.entries(),r=>e(r[0],r[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let r=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,r.get(i));return this}clone(){let e=new t;return this.map.forEach((r,n)=>{e.map.set(n,new Set(Array.from(r)))}),e}};var fe=Object.freeze({Empty:{terminate:yp},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),X=class t{#e=[];isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}own(e){return this.#e.push(e),e}ownAll(...e){for(let r of e)this.#e.push(r)}spawn(){let e=new t;return e.own({terminate:()=>pe.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var me=class{static subscribeMany(e,...r){return fe.many(...r.map(n=>n.subscribe(()=>e(n))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(r=>r(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var eg;(function(t){let e=Object.freeze({});t.empty=()=>e,t.mergeNoOverlap=(r,n)=>{let i=new Set(Object.keys(r));for(let a of Object.keys(n))if(i.has(a))return K(`'${a}' is an overlapping key`);return{...r,...n}},t.include=(r,...n)=>{let i={};for(let a of n)i[a]=r[a];return i},t.exclude=(r,...n)=>{let i=new Set(n);return Object.entries(r).reduce((a,[o,s])=>(i.has(o)||(a[o]=s),a),{})},t.overwrite=(r,n)=>Object.assign(r,n),t.entries=r=>Object.entries(r)})(eg||(eg={}));var WP;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return fe.Empty}catchupAndSubscribe(r){return r(this),fe.Empty}}})(WP||(WP={}));var LP;(function(t){t.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return fe.Empty}catchupAndSubscribe(e){return e(this),fe.Empty}},t.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(r){e.setValue(!r)}subscribe(r){return e.subscribe(r)}catchupAndSubscribe(r){return r(this),this.subscribe(r)}}})(LP||(LP={}));var $r=class{#e;#t=b.None;constructor(e){this.#e=new me,this.wrap(e)}wrap(e){this.wrapOption(b.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(U(e)&&e(this.#t.unwrap()),this.#t=b.None,this.#e.notify(this))}assert(e){return this.#t.assert(e),this}contains(e){return this.#t.contains(e)}equals(e){return this.#t.equals(e)}flatMap(e){return this.#t.flatMap(e)}ifSome(e){return this.#t.ifSome(e)}ifAbsent(e){return this.#t.ifAbsent(e)}isEmpty(){return this.#t.isEmpty()}map(e){return this.#t.map(e)}mapOr(e,r){return this.#t.mapOr(e,r)}match(e){return this.#t.match(e)}nonEmpty(){return this.#t.nonEmpty()}unwrap(e){return this.#t.unwrap(e)}unwrapOrElse(e){return this.#t.unwrapOrElse(e)}unwrapOrNull(){return this.#t.unwrapOrNull()}unwrapOrUndefined(){return this.#t.unwrapOrUndefined()}subscribe(e){return this.#e.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#e.subscribe(()=>e(this))}terminate(){this.#e.terminate()}};var en=class{#e;#t=b.None;#r;constructor(e,r){this.#e=new me,this.#r=r?.guard(e)??e,this.#t=b.wrap(r)}setValue(e){this.#t.nonEmpty()&&(e=this.#t.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#e.notify(this))}getValue(){return this.#r}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#e.subscribe(e)}terminate(){this.#e.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var __=class{#e;#t;constructor(e,r){ne(e<r,"Linear is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return lt(e,this.#e,this.#t)}floating(){return!0}},F_=class{#e;#t;#r;constructor(e,r){this.#e=lt(Math.round(e),Pr.MIN_VALUE,Pr.MAX_VALUE),this.#t=lt(Math.round(r),Pr.MIN_VALUE,Pr.MAX_VALUE),this.#r=this.#t-this.#e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+Math.round(lt(e,0,1)*this.#r)}clamp(e){return lt(Math.round(e),this.#e,this.#t)}floating(){return!1}},A_=class{#e;#t;constructor(e,r){ne(e<r,"Exponential is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},tg=class{#e;#t;#r;#i;constructor(e,r,n){ne(r!==n,"Power min === max"),this.#e=e,this.#t=r,this.#r=n,this.#i=n-r}x(e){return e<=this.#t?0:e>=this.#r?1:Math.pow((e-this.#t)/this.#i,1/this.#e)}y(e){return e<=0?this.#t:e>=1?this.#r:this.#t+Math.pow(e,this.#e)*this.#i}clamp(e){return Math.min(this.#r,Math.max(this.#t,e))}floating(){return!0}},E_=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?K(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(lt(e,0,1)*(this.#e.length-1));return r>-1?je(this.#e.at(r),`Could not find value for ${e}`):K(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},S_=class{#e;#t;#r;#i;#n;constructor(e,r,n){this.#e=e,this.#t=n;let i=e*e,a=n*n,o=r*r,s=e+n-2*r,u=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(u*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-u/s}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#n)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},A;(function(t){t.linear=(a,o)=>new __(a,o),t.linearInteger=(a,o)=>new F_(a,o),t.exponential=(a,o)=>new A_(a,o),t.power=(a,o,s)=>new tg(a,o,s),t.powerByCenter=(a,o,s)=>{let u=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(u))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new tg(u,o,s)},t.values=a=>new E_(a),t.decibel=(a,o,s)=>new S_(a,o,s);let e=new class{x(a){return a?1:0}y(a){return a>=.5}clamp(a){return a}floating(){return!1}},r=t.linear(0,1),n=t.linear(-1,1);t.bool=e;let i=t.decibel(-72,-12,0);t.unipolar=()=>r,t.bipolar=()=>n,t.DefaultDecibel=i})(A||(A={}));var E;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:u}={})=>new e(a,o,s,u),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let u=o.indexOf(s);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},t.values=(a,o,s)=>new class{x(u){return{unit:a,value:s.at(o.indexOf(u))??"N/A"}}y(u){let d=s.indexOf(u);return d===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:o[d]}}},t.bool=new class{y(a){switch(a.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}},t.boolValues=(a,o)=>new class{y(s){switch(s.trim()){case o:case"on":case"yes":case"true":return{type:"explicit",value:!0};case a:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(o,s,u,d){this.#e=o??"",this.#t=s??0,this.#r=u??!1,this.#i=d??!1}y(o){let s=o.trim();this.#e.length>0&&this.#e!=="%"&&s.endsWith(this.#e)&&(s=s.slice(0,-this.#e.length).trim());let u=parseFloat(s);if(isNaN(u))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:u/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?lt(u/200+.5,0,1):lt(u/100,0,1)};{let m=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(U(m)){let x=r.indexOf(m);if(x>-1)return{type:"explicit",value:u*Math.pow(10,(x-4)*3)}}return{type:"explicit",value:u}}}x(o){if(Number.isNaN(o))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(o)){if(this.#e==="%")return this.#i?{value:(o*200-100).toFixed(this.#t),unit:this.#e}:{value:(o*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:u}=i(o);return{value:s.toFixed(this.#t),unit:`${u}${this.#e}`}}else return{value:o.toFixed(this.#t),unit:this.#e}}else return{value:o===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let r=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=a=>Math.log(a)/Math.log(9.999999999999998),i=a=>{let o=Math.floor(n(a)/3),s=r[o+4];return U(s)?{value:a*Math.pow(10,o*-3),prefix:s}:{value:a,prefix:""}};t.decible=t.numeric({unit:"db",fractionDigits:2}),t.panning=t.percent({unit:"%",fractionDigits:0})})(E||(E={}));var Nu;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})(Nu||(Nu={}));var rg;(function(t){t.create=(e=252854082)=>new P_(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return K("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let u=Math.floor(n.uniform()*(1+r))+1;e[s]=u,a+=u}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(rg||(rg={}));var P_=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,r){return e+this.uniform()*(r-e)}nextInt(e,r){return e+Math.floor(this.uniform()*(r-e))}nextElement(e){return e[Math.floor(this.uniform()*e.length)]}nextBoolean(){return this.uniform()<.5}uniform(){let e=this.#e+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}};var ki;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,u])=>{u instanceof e?o[s]=u.initialValue():typeof u=="object"&&(o[s]=i(u))}),o};return()=>new r(n,Object.seal(i(n)))},t.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},t.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},t.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},t.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},t.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},t.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},t.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},t.floats=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readFloat();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeFloat(a[o])}initialValue(){return new Float32Array(n)}},t.doubles=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readDouble();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeDouble(a[o])}initialValue(){return new Float64Array(n)}};class r{#e;#t;#r;constructor(i,a){this.#e=i,this.#t=a,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?m[u]=d.read(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?d.write(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}#i(){let i=new $u;return this.write(i),i.count}}})(ki||(ki={}));var ku=class{#e;#t;#r;constructor(e,r){this.#e=e,this.#t=r,this.#r=[]}add(e,r=!1){let n=this.#e(e),i=yt.leftMostMapped(this.#r,n,this.#t,this.#e),a=this.#r[i];return U(a)&&this.#t(this.#e(a),n)===0?r?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,r){let n=yt.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(U(i)&&this.#t(this.#e(i),e)===0)return i;let a=r(e);return this.#r.splice(n,0,a),a}addMany(e){for(let r of e)this.#r.push(r);try{return this.#r.sort((r,n)=>{let i=this.#t(this.#e(r),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(r){if(r==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,a)=>this.#t(this.#e(i),this.#e(a))),!1}return K(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=yt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return U(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):K(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=yt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return U(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):null}removeRange(e,r){this.#r.splice(e,(r??this.#r.length)-e)}removeByPredicate(e){let r=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),r++);return r}get(e,r){return je(this.#i(e),r??`Unknown key: ${e}`)}getOrThrow(e,r){let n=this.#i(e);if(U(n))return n;throw r()}opt(e){return b.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return U(this.#i(e))}hasValue(e){return U(this.#i(this.#e(e)))}size(){return this.#r.length}isEmpty(){return this.#r.length===0}forEach(e){this.values().forEach(e)}values(){return this.#r}entries(){return this.#r.map(e=>[this.#e(e),e])}clear(){pe.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=yt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return U(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var Bu=(()=>{let t=b.None;return{info:e=>t.match({none:()=>Promise.resolve(),some:r=>r.info(e)}),approve:e=>t.match({none:()=>Promise.resolve(!0),some:r=>r.approve(e)}),progress:e=>t.match({none:()=>({message:"",terminate:yp}),some:r=>r.progress(e)}),notify:e=>t.match({none:yp,some:r=>r.notify(e)}),install:e=>{ne(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var Gs=class t{static createEstimator=()=>{let e=performance.now(),r=t.millis(Number.POSITIVE_INFINITY),n=0;return i=>{if(i===0)return t.POSITIVE_INFINITY;if(i>=1)return t.millis(0);let a=performance.now()-e;return a>n*1e3&&(r=t.millis(a/i-a),n++),r}};static POSITIVE_INFINITY=new t(Number.POSITIVE_INFINITY);static millis=e=>new t(e);static seconds=e=>new t(e*t.#e);static minutes=e=>new t(e*t.#t);static hours=e=>new t(e*t.#r);static days=e=>new t(e*t.#i);static toHHMMSS=e=>((e/3600|0)+100).toString().slice(1)+":"+((e/60|0)%60+100).toString().slice(1)+":"+(e%60+100).toString().slice(1);static#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/t.#e}absMinutes(){return Math.abs(this.#n)/t.#t}absHours(){return Math.abs(this.#n)/t.#r}absDays(){return Math.abs(this.#n)/t.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,r,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),a=Math.floor(i/60),o=Math.floor(a/24);return n<60?(e=n,r="second"):i<60?(e=i,r="minute"):a<24?(e=a,r="hour"):(e=o,r="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),r)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:r,m:n,s:i}=this.split();return e>0?[t.#a("d",e),t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):r>0?[t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):n>0?[t.#a("m",n),t.#a("s",i)].join(", "):i>0?t.#a("s",i):"now"}static#a=(e,r)=>{switch(e){case"d":return`${r} ${r<2?"day":"days"}`;case"h":return`${r} ${r<2?"hour":"hours"}`;case"m":return`${r} ${r<2?"minute":"minutes"}`;case"s":return`${r} ${r<2?"second":"seconds"}`;default:return Hh(e)}}};var ig;(function(t){let e;(function(r){r[r.READING=0]="READING",r[r.READ=1]="READ",r[r.WRITING=2]="WRITING",r[r.WRITTEN=3]="WRITTEN"})(e||(e={})),t.writer=(r,n,i)=>{if(r.bytesTotal+1>n.byteLength)return K("Insufficient memory allocated.");let a=new Uint8Array(n),o=jt.use(n,1);return Atomics.store(a,0,e.READ),{tryWrite:()=>Atomics.compareExchange(a,0,e.READ,e.WRITING)===e.WRITING?(i(r.object),o.position=0,r.write(o),Atomics.store(a,0,e.WRITTEN),!0):!1}},t.reader=(r,n)=>{let i=new SharedArrayBuffer(r.bytesTotal+1),a=new Uint8Array(i),o=new it(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(a,0,e.WRITTEN,e.READING)===e.READING?(o.position=0,r.read(o),n(r.object),Atomics.store(a,0,e.READ),!0):!1}}})(ig||(ig={}));var M;(function(t){t.length=16,t.generate=()=>r(crypto.getRandomValues(new Uint8Array(t.length))),t.sha256=async n=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(n.slice(0)):n).then(a=>r(new Uint8Array(a.slice(0,t.length))))},t.validateBytes=n=>t.parse(t.toString(n)),t.validateString=n=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n),t.asString=n=>t.validateString(n)?n:K(`Invalid UUID format: ${n}`),t.fromDataInput=n=>{let i=new Uint8Array(t.length);return n.readBytes(new Int8Array(i.buffer)),i},t.toDataOutput=(n,i)=>n.writeBytes(new Int8Array(i.buffer));let e=pe.create(n=>(n+256).toString(16).substring(1),256);t.toString=n=>e[n[0]]+e[n[1]]+e[n[2]]+e[n[3]]+"-"+e[n[4]]+e[n[5]]+"-"+e[n[6]]+e[n[7]]+"-"+e[n[8]]+e[n[9]]+"-"+e[n[10]]+e[n[11]]+e[n[12]]+e[n[13]]+e[n[14]]+e[n[15]],t.parse=n=>{let i=n.replace(/-/g,"").toLowerCase();if(i.length!==32)return K(`Invalid UUID format (${n})`);let a=new Uint8Array(t.length);for(let o=0,s=0;o<32;o+=2,s++)a[s]=parseInt(i.slice(o,o+2),16);return a},t.Comparator=(n,i)=>{if(n.length!==t.length||i.length!==t.length)return K("Unexpected array length for uuid(v4)");for(let a=0;a<t.length;a++){let o=n[a]-i[a];if(o!==0)return o}return 0},t.equals=(n,i)=>t.Comparator(n,i)===0,t.newSet=n=>new ku(n,t.Comparator),t.Lowest=t.parse("00000000-0000-4000-8000-000000000000"),t.Highest=t.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),t.fromInt=n=>{let i=new Uint8Array(t.Lowest),a=new Uint8Array(new Uint32Array([n]).buffer);for(let o=0;o<4;o++)i[o]=a[o];return i},t.zType=n=>n.string().refine(i=>t.validateString(i),{message:"Invalid UUID format (Zod)"}).transform(i=>i);let r=n=>(ne(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(M||(M={}));var Co;(function(t){class e{value;constructor(s){this.value=s}}t.Transfer=e,t.makeTransferable=o=>new e(o),t.sender=(o,s)=>s(new i(o)),t.executor=(o,s)=>new a(o,s);let r=o=>{let s=[];for(let u of o)u instanceof e?s.push(u.value):(u instanceof MessagePort||typeof ImageBitmap<"u"&&u instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&u instanceof OffscreenCanvas)&&s.push(u);return s},n=o=>o instanceof e?o.value:o;class i{#e;#t=new Map;#r;#i=0;constructor(s){this.#e=s,this.#r=s.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(s,...u)=>{let d=r(u);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(nr.map(u,m=>({value:n(m)})))},d)};dispatchAndReturn=(s,...u)=>new Promise((d,m)=>{let x=nr.reduce(u,(w,F,B)=>(typeof F=="function"&&w.push([B,F]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:d,reject:m},callbacks:new Map(x)});let g=r(u);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(nr.map(u,(w,F)=>typeof w=="function"?{callback:F}:{value:n(w)}))},g),this.#i++});#n=s=>{let u=this.#t.get(s.returnId);U(u)?s.type==="resolve"?(u.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(u.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&u.callbacks?.get(s.funcAt).apply(this,s.args):K(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,u){this.#e=s,this.#t=u,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{ne(s.type==="send",()=>"Message type must be 'send'");let u=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),d=je(u[s.func],`${s.func.toString()} does not exists on ${this.#t}`),m=s.returnId;if(m===!1)d.apply(this.#t,s.args.map(x=>"value"in x?x.value:K(`${s.func.toString()} has no promise.`)));else try{d.apply(this.#t,s.args.map(g=>"callback"in g?(...w)=>this.#o(m,g.callback,w):g.value)).then(g=>{try{this.#n(m,g)}catch(w){this.#a(m,w)}},g=>this.#a(m,g))}catch(x){this.#a(m,x)}};#n=(s,u)=>this.#e.send({type:"resolve",returnId:s,resolve:u});#a=(s,u)=>this.#e.send({type:"reject",returnId:s,reject:u});#o=(s,u,d)=>this.#e.send({type:"callback",returnId:s,funcAt:u,args:d})}t.Executor=a})(Co||(Co={}));var N_={for:t=>new $_(t)},TT=[],$_=class{#e;#t=new me;constructor(e){if(this.#e=e,U(e.onmessage)||U(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=r=>this.#t.notify(r.data),e.onmessageerror=r=>{throw new Error(r.type)}}send(e,r){this.#e.postMessage(e,r??TT)}channel(e){return new M_(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},M_=class t{#e;#t;#r=new me;#i;constructor(e,r){this.#e=e,this.#t=r,this.#i=e.subscribe(n=>{U(n)&&n.__id__==="42"&&n.channel===r&&this.#r.notify(n.message)})}send(e,r){this.#e.send({__id__:"42",channel:this.#t,message:e},r)}channel(e){return new t(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var Hs;(function(t){t.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),t.frames=e=>new Promise(r=>{let n=e,i=()=>{--n<=0?r():requestAnimationFrame(i)};requestAnimationFrame(i)}),t.timeSpan=(e,...r)=>new Promise(n=>setTimeout(n,e.millis(),...r)),t.event=(e,r)=>new Promise(n=>e.addEventListener(r,n,{once:!0})),t.observable=e=>new Promise(r=>{let n=e.subscribe(()=>{n.terminate(),r()})}),t.complete=e=>new Promise((r,n)=>{let i=setInterval(()=>{let{status:a,value:o,error:s}=tr(()=>e.next());if(a==="success"){let{done:u,value:d}=o;u&&(clearInterval(i),r(d))}else clearInterval(i),n(s)},0)})})(Hs||(Hs={}));var k_=class{maxRetry;timeSpan;#e=0;constructor(e,r){this.maxRetry=e,this.timeSpan=r}retry(e,r){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(r,this.timeSpan.millis()),!0)}},ng;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=xp("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=xp("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let u=!0;return o.own(fe.create(()=>u=!1)),new Promise((d,m)=>s.then(x=>{u&&d(x)},x=>{u&&m(x)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new k_(3,Gs.seconds(3));t.retry=(o,s=n)=>o().catch(u=>new Promise((d,m)=>{let x=g=>{s.retry(g,()=>o().then(w=>d(w),x))||m(g)};x(u)})),t.guardedRetry=(o,s)=>{let u=async(d=0)=>{try{return await o()}catch(m){if(s(m,++d))return console.debug(`retry after failure (online: ${navigator.onLine}):`,m),await Hs.timeSpan(Gs.seconds(1)),u(d);throw new Error(`Failed after ${d} retries: ${m}`)}};return u()},t.approvedRetry=(o,s)=>{let u=async()=>{try{return await o()}catch(d){if(await Bu.approve(s(d)))return u();throw d}};return u()},t.delay=(o,s)=>Promise.all([o,Hs.timeSpan(s)]).then(([u])=>u),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,u)=>new Promise((d,m)=>{let x=!0,g=setTimeout(()=>{x=!1,m(new Error(u??"timeout"))},s.millis());o.then(w=>{x&&d(w)},w=>{x&&m(w)}).finally(()=>clearTimeout(g))}),t.sequentialAll=o=>o.reduce((s,u)=>s.then(async d=>[...d,await u()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return u=>{let d=()=>o(u),m=s.then(d,d);return s=m.catch(()=>{}),m}},t.memoizeAsync=(o,s)=>{let u=null,d=Date.now();return()=>{let m=Date.now();return(Qi(u)||U(s)&&m-d>s.millis())&&(d=m,u=o(),u.catch(x=>(u=null,x))),u}},t.allWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=!1,x=async()=>{for(;d<o.length&&!m;){let g=d++;try{let w=await o[g]();m||(u[g]=w)}catch(w){throw m=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},x)),u},t.allSettledWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=async()=>{for(;d<o.length;){let x=d++;try{let g=await o[x]();u[x]={status:"fulfilled",value:g}}catch(g){u[x]={status:"rejected",reason:g}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},m)),u};class i{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let u=Promise.withResolvers();return this.#e.push([s,u]),u.promise.finally(()=>this.#r())}}#r(){if(ne(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:u,reject:d}]=this.#e.shift();this.#t++,s().then(u,d)}}}t.Limit=i;class a{#e;#t;#r;#i=b.None;constructor(s,u,d){this.#e=s,this.#t=u,this.#r=d}update(s){this.#i=b.wrap(s),s.then(u=>{this.#i.contains(s)&&this.#e(u)}).catch(u=>{this.#i.contains(s)&&this.#t(u)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),$(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(ng||(ng={}));var ag=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#u;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#u=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new og(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=_p.create(_p.Type.Blackman,this.#e),this.#t=e,this.#o=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#o.fill(0),this.#i.fill(0),this.#s.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#o}waveform(){return this.#s}process(e,r,n,i){for(let a=n;a<i;++a)this.#i[this.#l]=e[a]+r[a],++this.#l===this.#e&&this.#c()}#c(){for(let r=0;r<this.#t;++r)this.#s[r]=this.#i[r<<1];for(let r=0;r<this.#e;++r)this.#i[r]*=this.#a[r];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let r=0;r<this.#t;++r){let n=this.#i[r],i=this.#n[r],a=Math.sqrt(n*n+i*i)*e;this.#o[r]<a?this.#o[r]=a:this.decay&&(this.#o[r]*=this.#u)}this.#l=0,this.#n.fill(0),this.decay=!1}};var B_=(t,e)=>Math.floor(3840/e)*t,ZP=(t,e=4,r=4)=>{let n=B_(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-B_(a*e,r))%n,u=Math.floor(s/240),d=s%240;return{bars:a,beats:i-a*e,semiquavers:u,ticks:d}},GP=(t,e)=>t*e/60*960,HP=(t,e)=>t*60/960/e,DT=(t,e)=>e*60/960/t,RT=(t,e,r)=>GP(t/r,e),CT=(t,e,r)=>HP(t,e)*r,Te={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:B_,toParts:ZP,secondsToPulses:GP,pulsesToSeconds:HP,secondsToBpm:DT,samplesToPulses:RT,pulsesToSamples:CT,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=ZP(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var Bi=128,sg=Te.fromSignature(1,48);var zT=Math.log(10)/20;var qP=t=>Math.exp(t*zT);var Fp;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(Fp||(Fp={}));var Ap;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(Ap||(Ap={}));var no;(function(t){t.globalToLocal=(r,n)=>Zs(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{if(!(a>0))return b.None;let u=r-i,d=u+a;if(u>=s||d<=o)return b.None;let m=Math.max(u,o),x=Math.min(d,s);return b.wrap({index:0,rawStart:u,rawEnd:d,regionStart:Math.max(u,r),regionEnd:Math.min(d,n),resultStart:m,resultEnd:x,resultStartValue:u<m?(m-u)/a:0,resultEndValue:d>x?(x-u)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){if(!(a>0))return;let u=r-i,d=Math.max(r,o),m=Math.min(n,s),x=Math.floor((d-u)/a),g=u+x*a;for(;g<m;){let w=g+a,F=Math.max(g,r),B=Math.min(w,n),V=Math.max(g,d),W=Math.min(w,m),z=g<V?(V-g)/a:0,ee=w>W?(W-g)/a:1;yield{index:x++,rawStart:g,rawEnd:w,regionStart:F,regionEnd:B,resultStart:V,resultEnd:W,resultStartValue:z,resultEndValue:ee},g=w}}t.locateLoops=e})(no||(no={}));var Or=class t{static DefaultComparator=(e,r)=>e.position-r.position;static create(e){return new t(e??t.DefaultComparator)}#e;constructor(e){this.#e=new lg(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?io.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),r,n)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},zo=class t{static Comparator=(e,r)=>e.position-r.position;static create(e){return new t(e)}#e;constructor(e=t.Comparator){this.#e=new lg(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return io.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return io.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return io.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var lg=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){if(this.#e.includes(e))throw new Error(`Duplicate event added: ${e}`);++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let r=this.#e.indexOf(e);return r===-1?!1:(this.#e.splice(r,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let n=e.position,i=yt.leftMostMapped(this.#e,n,Ro,Fp.PositionExtractor);for(let a=i;a<this.#e.length;a++){let o=this.#e[a];if(o===e)return!0;if(o.position!==n)return!1}return!1}clear(){++this.modCount,pe.clear(this.#e),this.#t=!1}optAt(e){return e<0||e>=this.#e.length?null:(this.#t&&this.#r(),this.#e[e])}asArray(){return this.#t&&this.#r(),this.#e}lowerEqual(e,r){if(r===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(r(i))return i}return null}greaterEqual(e,r){if(r===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(r(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),yt.rightMostMapped(this.#e,e,Ro,Fp.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),yt.leftMostMapped(this.#e,e,Ro,Fp.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,Pr.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,Pr.MAX_VALUE,r);i--}return this.iterate(n,Pr.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=Nu.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=r)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var ug;(function(t){t.hasFading=e=>e.in>0||e.out>0,t.gainAt=(e,r,n)=>{let{in:i,out:a,inSlope:o,outSlope:s}=n,u=1,d=1;i>0&&e<i&&(u=ir.normalizedAt(e/i,o));let m=r-a;if(a>0&&e>m){let x=(e-m)/a;d=1-ir.normalizedAt(x,s)}return Math.min(u,d)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:u,inSlope:d,outSlope:m}=o;if(e.fill(1,0,a),s<=0&&u<=0)return;let x=i-u;if(r>=s&&n<=x)return;let g=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),F=Math.min(a,Math.ceil((w-r)/g));if(F>0){let B=r/s,V=w/s,W=ir.walk(d,F,B,V);for(let z=0;z<F;z++)e[z]=W.next().value}}if(u>0&&n>x){let w=Math.max(r,x),F=Math.max(0,Math.floor((w-r)/g)),B=a-F;if(B>0){let V=(w-x)/u,W=(n-x)/u,z=ir.walk(m,B,1-V,1-W);for(let ee=F;ee<a;ee++)e[ee]=Math.min(e[ee],z.next().value)}}}})(ug||(ug={}));var og=class t{static reverse(e){return e=(e&1431655765)<<1|e>>>1&1431655765,e=(e&858993459)<<2|e>>>2&858993459,e=(e&252645135)<<4|e>>>4&252645135,e=e<<24|(e&65280)<<8|e>>>8&65280|e>>>24,e}#e;#t;#r;#i;constructor(e){this.#e=e;let r=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(r),this.#i=new Float32Array(r);for(let n=0;n<r;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,r){let n,i,a,o;for(let d=0;d<this.#e;++d)i=t.reverse(d)>>>this.#t,i>d&&(o=e[d],e[d]=e[i],e[i]=o,o=r[d],r[d]=r[i],r[i]=o);let s=this.#r,u=this.#i;for(let d=2;d<=this.#e;d<<=1){let m=d>>1,x=this.#e/d;for(n=0;n<this.#e;n+=d){let g=n+m;for(i=n,a=0;i<g;i++,a=a+x|0){let w=i+m|0,F=s[a],B=u[a],V=e[w],W=r[w],z=V*F+W*B,ee=W*F-V*B,Q=e[i],xe=r[i];e[w]=Q-z,r[w]=xe-ee,e[i]=Q+z,r[i]=xe+ee}}if(d===this.#e)break}}inverse(e,r){let n=this.#e;for(let a=0;a<n;a++)r[a]=-r[a];this.process(e,r);let i=1/n;for(let a=0;a<n;a++)e[a]*=i,r[a]=-r[a]*i}};var Oo;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>Te.fromSignature(r,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(n)-t.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(i)-t.toDouble(n))}}})(Oo||(Oo={}));var JP;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(JP||(JP={}));var cg=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,r){let n=this.#e.duration(),i=w_(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var ma;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(ma||(ma={}));var Iu;(function(t){t.isOfType=e=>e.type==="note-event",t.Comparator=(e,r)=>{let n=e.position-r.position;if(n!==0)return n;let i=e.pitch-r.pitch;return i!==0?i:0},t.curveFunc=(e,r)=>r<0?e**2**-r:1-(1-e)**2**r,t.inverseCurveFunc=(e,r)=>r<0?e**2**r:1-Math.max(0,1-e)**2**-r,t.CompleteComparator=(e,r)=>{let n=Ap.complete(e)-Ap.complete(r);return n!==0?n:e.pitch-r.pitch}})(Iu||(Iu={}));var dg=class t{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(t.#e*e)),this.#i=Math.pow(.01,1/(t.#t*e))}clear(){this.#n=0}replace(e,r,n){let i=this.#r,a=this.#i,[o,s]=e.channels(),u=this.#n;for(let d=r;d<n;++d){let m=o[d],x=s[d],g=Math.max(Math.abs(m),Math.abs(x));if(u=g>u?i*(u-g)+g:a*(u-g)+g,u>1){let w=1/u;o[d]=m*w,s[d]=x*w}}this.#n=u}};var Yr;(function(t){t.Musical="musical",t.Seconds="seconds"})(Yr||(Yr={}));var qs;(function(t){function e(r,n,i){return new I_(r,n,i)}t.aware=e})(qs||(qs={}));var I_=class{#e;#t;#r;constructor(e,r,n){this.#r=n,this.#t=r,this.#e=e}toPPQN(e){let r=this.#r.getValue();if(this.getTimeBase()===Yr.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===Yr.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(r,r+e);this.#r.setValue(n)}}toSeconds(e){let r=this.#r.getValue();return this.getTimeBase()===Yr.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return to(this.#t.getValue(),Yr)}};var YP=Te.fromSignature(1,384);var di={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?di.Linear:{type:"curve",slope:t}},pg;(function(t){t.Comparator=(i,a)=>{let o=i.position-a.position;if(o!==0)return o;let s=i.index-a.index;return s!==0?s:i===a?0:K(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return nr.empty();for(let s of i.iterateFrom(a))if(yield s,s.position>=o)return}t.iterateWindow=e,t.nextEvent=(i,a)=>{let o=i.asArray(),s=yt.rightMost(o,a,t.Comparator);return s===-1?null:o[s+1]??null},t.valueAt=(i,a,o)=>{if(i.isEmpty())return o;let s=i.iterateFrom(a),{done:u,value:d}=s.next();if(u)return o;if(d.position<=a){let{done:m,value:x}=s.next();if(m)return d.value;if(a<x.position)return n(d,x,a);if(d.interpolation===di.None)return d.value}return d.value};function*r(i,a,o,s){if(i.isEmpty())return;let u=i.iterateFrom(a),{done:d,value:m}=u.next();if(d)return;let x=o/s,g=m;if(g.position>a){for(;a<g.position;)if(yield{position:a,value:g.value},a+=x,a>o)return;g.position<=o&&(yield g)}for(;a<=o;){let{done:w,value:F}=u.next();if(w)break;for(;a<F.position;){if(a>o)return;yield{position:a,value:n(g,F,a)},a+=x}F.position<o&&(g.interpolation===di.None&&(yield{position:F.position,value:g.value}),yield F),g=F}for(;a<=o;)yield{position:a,value:g.value},a+=x}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,u)=>o.type==="none"?i:o.type==="linear"?i+(u-a)/(s.position-a)*(s.value-i):o.type==="curve"?ir.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},u-a):K("Unknown interpolation")})(pg||(pg={}));var _p;(function(t){let e;(function(r){r[r.Bartlett=0]="Bartlett",r[r.Blackman=1]="Blackman",r[r.BlackmanHarris=2]="BlackmanHarris",r[r.Hamming=3]="Hamming",r[r.Hanning=4]="Hanning"})(e=t.Type||(t.Type={})),t.create=(r,n)=>{let i=new Float32Array(n),a=Math.PI/(n-1);switch(r){case e.Bartlett:{let o=(n>>1)-1,s=0;for(;s<=o;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let o=2*a,s=4*a;for(let u=0;u<n;++u)i[u]=.42323-.49755*Math.cos(o*u)+.07922*Math.cos(s*u);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,u=6*a;for(let d=0;d<n;++d)i[d]=.35875-.48829*Math.cos(o*d)+.14128*Math.cos(s*d)-.01168*Math.cos(u*d);return i}case e.Hamming:{let o=2*a;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(o*s);return i}case e.Hanning:{let o=2*a;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(o*s);return i}}}})(_p||(_p={}));var Be=class t{static newSet(e){return new ku(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return ne(n.every((i,a)=>i===r[a]),`fieldKeys (${n.join(",")}) only allows i16`),new t(e,n)};static decode(e){let r=e.split("/");return ne(r.length>0,"Unable to parse Address"),t.compose(M.parse(r[0]),...r.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,r,n){let i=e.values(),a=yt.leftMostMapped(i,r,M.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(M.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=M.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return e.#r.length-r.#r.length};static MinimalComparator=(e,r)=>{let n=M.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return 0};static LengthComparator=(e,r)=>{let n=M.Comparator(e.#t,r.#t);return n!==0?n:r.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,r){this.#t=e,this.#r=r}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return t.Comparator(this,e)===0}compareTo(e){return t.Comparator(this,e)}append(e){return new t(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return M.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((r,n)=>this.#r[n]===r)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(r=>e.writeShort(r))}moveTo(e){return new t(e,this.#r)}decompose(){return[this.#t,this.#r]}toJSON(){return{uuid:Array.from(this.#t.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(M.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,M.length),e.buffer}toString(){return[M.toString(this.#t),...this.#r].join("/")}static read(e){let r=M.fromDataInput(e),n=e.readByte();return t.compose(r,...pe.create(()=>e.readShort(),n))}},Js;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>Be.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=yt.rangeMapped(r,e,Be.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=yt.rangeMapped(r,e,Be.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=yt.leftMostMapped(r,e,Be.LengthComparator,t.AddressReader),i=yt.rightMostMapped(r,e,Be.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(Js||(Js={}));var ha=class t{static validate(e,r){if(e.address.equals(r.address))return b.wrap(`PointerField cannot point to itself: ${e}`);if(!r.pointerRules.accepts.some(n=>n===e.pointerType)){let n=r.pointerRules.accepts.join(", ");return b.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return b.None}#e;#t;constructor(e){this.#e=e,this.#t=new ar}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=Be.newSet(i=>i.address);return n.addMany(this.filter(...r)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{OP(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():nr.filter(this.incoming().values(),r=>e.some(n=>n===r.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(r=>e.address.equals(r.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let r=t.validate(e,this.#e);if(r.nonEmpty())return K(r.unwrap());this.#t.proxy.onAdded(e)}onRemoved(e){this.#t.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#e.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,r,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onRemoved(i)}})}};var T_=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Tu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},L=class t{static hook(e){return new t(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:r,fieldName:n,pointerRules:i,deprecated:a}){this.#e=e,this.#t=r,this.#r=n,this.#i=i,this.#n=a,(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}accept(e){return $(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new ha(this)}get address(){return this.#e.address.append(this.#t)}get debugPath(){return`${this.box.name}:${this.box.mapFields(e=>e.fieldName,...this.address.fieldKeys).join("/")}`}isBox(){return!1}isField(){return!0}isAttached(){return this.graph.findBox(this.address.uuid).nonEmpty()}fields(){return pe.empty()}record(){return eg.empty()}getField(e){return K()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return K("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(r=>{r.defer(),(r.mandatory||this.pointerRules.mandatory&&e.length===1)&&(console.warn(`[Field.disconnect] Deleting ${r.box} because pointer.mandatory=${r.mandatory} or (field.mandatory=${this.pointerRules.mandatory} and lastPointer=${e.length===1})`),r.box.delete())})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};T_([Mu,Tu("design:type",ha),Tu("design:paramtypes",[])],L.prototype,"pointerHub",null);T_([Mu,Tu("design:type",Be),Tu("design:paramtypes",[])],L.prototype,"address",null);T_([Mu,Tu("design:type",String),Tu("design:paramtypes",[])],L.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var Ys=class t extends L{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=pe.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return $(e.visitArrayField,this)}fields(){return this.#e}record(){return pe.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return je(this.#e[e])}optField(e){return b.wrap(this.#e[e])}read(e){this.#e.forEach(r=>r.read(e))}write(e){this.#e.filter(r=>!r.deprecated).forEach(r=>r.write(e))}size(){return this.#e.length}toJSON(){if(!this.deprecated)return Object.values(this.#e).map(e=>e.toJSON()??null)}fromJSON(e){if(!this.deprecated)if(Array.isArray(e))e.forEach((r,n)=>this.#e[n].fromJSON(r));else return K("Type mismatch")}};var Vo;(function(t){t.writeFields=(r,n)=>{let i=Object.entries(n).filter(([a,o])=>!o.deprecated);r.writeInt(1179403347),r.writeShort(i.length),i.forEach(([a,o])=>{let s=jt.create();o.write(s);let u=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(u.length),r.writeBytes(u)})},t.readFields=(r,n)=>{ne(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(Zh(n[o]))continue;let s=r.readInt(),u=new Int8Array(s);r.readBytes(u);let{status:d,error:m}=tr(()=>n[o]?.read(new it(u.buffer)));d==="failure"&&console.warn(n,m)}}})(Vo||(Vo={}));var OT=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},XP=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},T=class t{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#a;#o;#s=t.Index++;constructor({uuid:e,graph:r,name:n,pointerRules:i,resource:a,ephemeral:o}){this.#e=Be.compose(e),this.#t=r,this.#r=n,this.#i=i,this.#n=a,this.#a=o===!0,this.#o=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return je(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return b.wrap(this.#o[e])}subscribe(e,r){return this.graph.subscribeVertexUpdates(e,this.address,r)}subscribeDeletion(e){return this.graph.subscribeDeletion(this.address.uuid,e)}get box(){return this}get name(){return this.#r}get graph(){return this.#t}get parent(){return this}get address(){return this.#e}get pointerRules(){return this.#i}get resource(){return this.#n}get ephemeral(){return this.#a}get creationIndex(){return this.#s}get pointerHub(){return new ha(this)}estimateMemory(){let e=new $u;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ce(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Vo.readFields(e,this.#o)}write(e){Vo.writeFields(e,this.#o)}serialize(){let e=jt.create();return e.writeInt(this.#s),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=jt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[r,n])=>{let i=n.toJSON();return U(i)&&(e[r]=i),e},{})}fromJSON(e){if(Gh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];U(n)&&i.fromJSON(n)});else return K("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return pe.empty();let n=this.getField(r[0]),i=[e(n)];for(let a=1;a<r.length;a++)n=n.getField(r[a]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return b.wrap(this);let r=this.optField(e[0]);if(r.isEmpty())return b.None;for(let n=1;n<e.length;n++)if(r=r.unwrap().optField(e[n]),r.isEmpty())return b.None;return r}delete(){if(!this.isAttached())return;let{boxes:e,pointers:r}=this.graph.dependenciesOf(this);t.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...r].map(n=>n.toString()).join(`
|
|
2
2
|
`)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
|
|
3
3
|
`),this));for(let n of r)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=r=>r.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};OT([Mu,XP("design:type",ha),XP("design:paramtypes",[])],T.prototype,"pointerHub",null);var Ep;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(Ep||(Ep={}));var ze;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(ze||(ze={}));var fg;(function(t){t.create=()=>new D_})(fg||(fg={}));var D_=class{#e=new Sp(Js.equals);#t=new Sp(Js.startsWith);#r=new Sp(Js.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new R_(r,e,this.#n++,n);if(this.#a){let a=new C_(i,e);return this.#i.push(a),a}else return this.subscribeMonitor(i,e)}dispatch(e){this.#a=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#a=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,r){switch(r){case ze.This:return this.#e.subscribe(e);case ze.Parent:return this.#t.subscribe(e);case ze.Children:return this.#r.subscribe(e);default:return Hh(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},R_=class{address;propagation;order;procedure;constructor(e,r,n,i){this.address=e,this.propagation=r,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${ze[this.propagation]}, order: ${this.order} }`}},Sp=class{filterStrategy;#e=[];#t=!0;constructor(e){this.filterStrategy=e}subscribe(e){return this.#e.push(e),this.#t=this.#e.length<2,{terminate:()=>{let r=this.#e.length;for(;--r>=0;)this.#e[r]===e&&this.#e.splice(r,1)}}}stations(){return this.#t||(this.#e.sort(Js.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},C_=class{monitor;propagation;#e=new X;#t=!1;constructor(e,r){this.monitor=e,this.propagation=r}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var Kt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(Kt||(Kt={}));var ao={[Kt.Boolean]:{type:Kt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[Kt.Float32]:{type:Kt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[Kt.Int32]:{type:Kt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[Kt.String]:{type:Kt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[Kt.Bytes]:{type:Kt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},Xs=class extends L{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return $(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ze.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#e}get initValue(){return this.#t}setInitValue(e){ne(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let r=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,r,n))}writeValue(e,r){ne(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,r)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?K("not implemented"):e}fromJSON(e){return K("Type mismatch")}reset(){this.setValue(this.#t)}},k=class t extends Xs{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,Kt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return ao[Kt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){ne(!this.deprecated,"BooleanField.write: deprecated field"),e.writeBoolean(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString()))}},_=class t extends Xs{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Kt.Float32,i),this.#e=r,this.#t=n}serialization(){return ao[Kt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Ep.clampFloat32(this.#e,ro.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){ne(!this.deprecated,"FLoat32Field.write: deprecated field"),e.writeFloat(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString()))}},P=class t extends Xs{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Kt.Int32,i),this.#e=r,this.#t=n}serialization(){return ao[Kt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Ep.clampInt32(this.#e,Pr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){ne(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=Pr.MIN_VALUE&&e<=Pr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},I=class t extends Xs{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,Kt.String,r)}serialization(){return ao[Kt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){ne(!this.deprecated,"StringField.write: deprecated field"),e.writeString(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString()))}},QP=class t extends Xs{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,Kt.Bytes,r)}serialization(){return ao[Kt.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let r=new Int8Array(e.readInt());e.readBytes(r),this.setValue(r)}write(e){ne(!this.deprecated,"ByteArrayField.write: deprecated field");let r=this.getValue();e.writeInt(r.length),e.writeBytes(r)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(r=>typeof r=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var t$=t=>{let e=M.newSet(i=>i),r=M.newSet(i=>i);for(let i of t)i instanceof Qs?e.add(i.uuid):i instanceof rl&&r.add(i.uuid);let n=M.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof Qs||i instanceof rl?!n.hasKey(i.uuid):i instanceof tl||i instanceof el?!n.hasKey(i.address.uuid):!0)},e$;(function(t){t.decode=e=>{let r=e.readInt();return pe.create(()=>{switch(e.readString()){case"new":{let i=M.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Qs(i,a,o.buffer)}case"pointer":{let i=Be.read(e),a=e.readBoolean()?b.wrap(Be.read(e)):b.None,o=e.readBoolean()?b.wrap(Be.read(e)):b.None;return new tl(i,a,o)}case"primitive":{let i=Be.read(e),a=e.readString(),o=ao[a],s=o.decode(e),u=o.decode(e);return new el(i,o,s,u)}case"delete":{let i=M.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new rl(i,a,o.buffer)}}},r)}})(e$||(e$={}));var Qs=class{type="new";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,r=>r.read(new it(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),M.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${M.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},el=class{type="primitive";#e;#t;#r;#i;constructor(e,r,n,i){this.#e=e,this.#t=r,this.#r=n,this.#i=i}get address(){return this.#e}get serialization(){return this.#t}get oldValue(){return this.#r}get newValue(){return this.#i}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).setValue(this.#r)}forward(e){this.field(e).setValue(this.#i)}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PrimitiveField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),e.writeString(this.#t.type),this.#t.encode(e,this.#r),this.#t.encode(e,this.#i)}toString(){return`{PrimitiveUpdate oldValue: ${this.#r}, newValue: ${this.#i}`}},tl=class{type="pointer";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get address(){return this.#e}get oldAddress(){return this.#t}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#t}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PointerField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),this.#t.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},rl=class{type="delete";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}inverse(e){e.createBox(this.#t,this.#e,r=>r.read(new it(this.#r)))}write(e){e.writeString(this.type),M.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${M.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var DV=Symbol("Unreferenceable"),N=class t extends L{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){ne(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=b.wrap(e);let n=tr(r);if(this.#e=b.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){ne(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=b.wrap(e);let n=tr(r);if(this.#t=b.None,n.status==="failure")throw n.error;return n.value}static#e=b.None;static#t=b.None;#r;#i;#n=b.None;#a=b.None;constructor(e,r,n){super(e),this.#r=r,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return K(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return $(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ze.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=b.wrap(e)}defer(){this.targetVertex=b.None}get targetVertex(){return this.graph.inTransaction()?this.#a.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let r=ha.validate(this,e.unwrap());r.nonEmpty()&&K(r.unwrap())}this.targetAddress=e.map(r=>r.address)}get targetAddress(){return this.#a}set targetAddress(e){let r=this.#a;r.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&r.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#a=e,this.graph.onPointerAddressUpdated(this,r,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap("targetVertex"))}resolvedTo(e){this.#n=e}read(e){let r=e.readBoolean()?b.wrap(Be.read(e)):b.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){ne(!this.deprecated,"PointerField.write: deprecated field"),t.#e.match({none:()=>this.#a,some:r=>r.map(this)}).match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toJSON(){if(!this.deprecated)return t.#e.match({none:()=>this.#a,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(Qi(e)||typeof e=="string"){let r=b.wrap(Qi(e)?null:Be.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return K(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var mg=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=Be.newSet(e=>e.address),this.#t=Be.newSet(e=>e.address),this.#r=Be.newSet(e=>e.address),this.#i=Be.newSet(([e])=>e),this.#n=Be.newSet(([e])=>e.address),this.#a=M.newSet(e=>e)}watchVertex(e){if(xt(e,N)){if(!e.mandatory)return K("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return K("watchVertex called but has no edge requirement");r&&this.#t.add(e),n&&this.#r.add(e)}this.#a.add(e.address.uuid)}unwatchVerticesOf(...e){let r=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return K(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return K(`${n} has incoming edges from: ${a.map(o=>o.toString())}`)}}forgetVerticesOf(e){let r=({box:{address:{uuid:i}}})=>i,{address:{uuid:n}}=e;this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r)}connect(e,r){this.#n.add([e,r]),this.#i.opt(r).match({none:()=>this.#i.add([r,[e]]),some:([,n])=>n.push(e)}),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}disconnect(e){let[,r]=this.#n.removeByKey(e.address),[,n]=this.#i.get(r,"incoming by address");pe.remove(n,e),n.length===0&&this.#i.removeByKey(r),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}isConnected(e,r){return this.#n.opt(e.address).mapOr(([,n])=>n.equals(r),!1)}outgoingEdgesOf(e){return this.#o(this.#n,e.address.uuid,([{box:{address:{uuid:r}}}])=>r)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#i,e.address.uuid,([{uuid:r}])=>r).flatMap(([r,n])=>n):this.#i.opt(e.address).mapOr(([r,n])=>n,pe.empty())}clearAffected(){this.#a.clear()}tryValidateAffected(){let e=({box:{address:{uuid:r}}})=>r;for(let r of this.#a.values()){let n=this.#o(this.#e,r,e);for(let o of n)if(o.isEmpty())return this.#a.clear(),o.mandatory?b.wrap(new Error(`Pointer ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let i=this.#o(this.#t,r,e);for(let o of i)if(o.pointerHub.isEmpty())return this.#a.clear(),o.pointerRules.mandatory?b.wrap(new Error(`Target ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let a=this.#o(this.#r,r,e);for(let o of a){let s=o.pointerHub.size();if(s>1)return this.#a.clear(),b.wrap(new Error(`Target ${o.toString()} is exclusive but has ${s} incoming pointers.`))}}return this.#a.clear(),b.None}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),K(`Pointer ${e.toString()} requires an edge.`)):K(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?(console.warn(e),console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} requires an edge.`),K(`Target ${e.toString()} requires an edge.`)):K(`Illegal state: ${e} has no edge requirements.`)}),this.#r.forEach(e=>{let r=e.pointerHub.size();if(r>1)return console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} is exclusive but has ${r} incoming pointers.`),K(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#o(e,r,n){let i=Be.boxRange(e,r,n);return U(i)?e.values().slice(i[0],i[1]):pe.empty()}#s(e,r,n){let i=Be.boxRange(e,r,n);U(i)&&e.removeRange(i[0],i[1])}};var oo=class{#e;#t;#r;#i;#n;#a;#o;#s;#u;#l;#c;#h;#v;#g=!1;#d=!1;#p=!1;constructor(e=b.None){this.#e=e,this.#t=M.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#u=fg.create(),this.#a=new ar,this.#o=new ar,this.#s=new ar,this.#l=new mg,this.#c=Be.newSet(({pointer:r})=>r.address),this.#h=[],this.#v=M.newSet(r=>r.uuid)}beginTransaction(){ne(!this.#g,"Transaction already in progress"),this.#g=!0,this.#n.length=0,this.#s.proxy.onBeginTransaction()}abortTransaction(){ne(this.#g,"No transaction in progress"),this.#b(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#m()}endTransaction(){ne(this.#g,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>{this.#n.push(r),this.#f(e,r)}),this.#r.length=0),!this.#p&&this.#e.nonEmpty()&&this.#l.tryValidateAffected().ifSome(e=>{throw this.#b(),this.#m(),e}),this.#x(),this.#m()}inTransaction(){return this.#g}constructingBox(){return this.#d}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#w(),ne(!this.#d,"Cannot construct box while other box is constructing"),U(r)){this.#d=!0;let a=tr(()=>r(e));if(this.#d=!1,a.status==="failure")throw this.#_(e),a.error}if(!this.#t.add(e))return this.#_(e),K(`${e.name} ${e.address.toString()} already staged`);let i=new Qs(e.address.uuid,e.name,e.toArrayBuffer());return this.#p||this.#n.push(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#s.subscribe(e)}subscribeToAllUpdates(e){return this.#a.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#o.subscribe(e)}subscribeVertexUpdates(e,r,n){return this.#u.subscribe(e,r,n)}subscribeEndTransaction(e){this.#h.push(e)}subscribeDeletion(e,r){let n=this.#v.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#v.removeByKeyIfExist(e)}}}unstageBox(e){this.#w();let r=this.#t.removeByKey(e.address.uuid);ne(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new rl(e.address.uuid,e.name,e.toArrayBuffer());this.#p||this.#n.push(n),this.#v.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#a.proxy.onUpdate(n),this.#o.proxy.onUpdate(n)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(r=>r.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#l}checksum(){let e=new Xh;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#w(),e.isAttached()&&!this.#d){let i=new el(e.address,e.serialization(),r,n);this.#p||this.#n.push(i),this.#u.dispatch(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#w(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new tl(e.address,r,n);this.#d?this.#r.push({pointerField:e,update:i}):(this.#p||this.#n.push(i),this.#y(e,i),this.#o.proxy.onUpdate(i))}#y(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#u.dispatch(r),this.#a.proxy.onUpdate(r)}#f(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#u.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#m(){for(this.#c.values().toSorted((e,r)=>e.index-r.index).forEach(({pointer:e,initial:r,final:n})=>{r.equals(n)||(r.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#c.clear(),this.#g=!1;this.#h.length>0;)this.#h.splice(0).forEach(e=>e()),this.#h.length>0&&console.debug(`${this.#h.length} new observers while notifying`);this.#s.proxy.onEndTransaction(this.#p),this.#p=!1}#b(){this.#p=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=t$(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof tl||n instanceof el)&&this.findVertex(n.address).isEmpty()){console.warn(`[BoxGraph] rollback skips ${n.type}-update, vertex not found at ${n.address.toString()}`);continue}n.inverse(this)}this.#i.length=0,this.#l.clearAffected(),this.#c.clear(),this.#n.length=0}#_(e){for(let r=this.#r.length-1;r>=0;r--)this.#r[r].pointerField.box===e&&this.#r.splice(r,1);this.#l.outgoingEdgesOf(e).forEach(([r])=>this.#l.disconnect(r)),this.#l.forgetVerticesOf(e)}findOrphans(e){let r=this.#F(e);return this.boxes().filter(n=>!r.has(n))}#F(e){let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!r.has(i)){r.add(i),this.#A(i).forEach(a=>{a.targetAddress.ifSome(o=>{this.findBox(o.uuid).ifSome(s=>{r.has(s)||n.push(s)})})});for(let a of i.incomingEdges())r.has(a.box)||n.push(a.box)}}return r}#A(e){let r=[],n=i=>{for(let a of i)a.accept({visitPointerField:o=>r.push(o),visitObjectField:o=>n(o.fields()),visitArrayField:o=>n(o.fields())})};return n(e.fields()),r}dependenciesOf(e,r={}){let n=U(r.excludeBox)?r.excludeBox:Nu.alwaysFalse,i=U(r.alwaysFollowMandatory)?r.alwaysFollowMandatory:!1,a=U(r.stopAtResources)?r.stopAtResources:!1,o=new Set,s=new Set,u=(m,x=!1)=>{if(!(o.has(m)||!x&&n(m))){if(o.add(m),a&&U(m.resource)){m.incomingEdges().forEach(g=>{s.add(g);let w=g.targetAddress.mapOr(F=>!F.isBox(),!1);if(g.mandatory&&w){if(m.resource==="shared"&&g.targetAddress.flatMap(B=>this.findVertex(B)).mapOr(B=>B.pointerRules.mandatory,!1))return;u(g.box)}});return}m.outgoingEdges().filter(([g])=>!s.has(g)).forEach(([g,w])=>{let F=this.findVertex(w).unwrap(`Could not find target of ${g.toString()}`);if(s.add(g),F.pointerRules.mandatory&&(i||F.pointerHub.incoming().filter(B=>B.targetAddress.mapOr(V=>V.equals(w),!1)).every(B=>s.has(B))))return u(F.box)}),m.incomingEdges().forEach(g=>{s.add(g),g.mandatory&&u(g.box)})}},d=Array.isArray(e)?e:[e];return d.forEach(m=>u(m,!0)),d.forEach(m=>o.delete(m)),{boxes:o,pointers:Array.from(s).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,r=n=>{for(let i of n.fields())i.accept({visitPointerField:a=>{if(a.targetAddress.nonEmpty()){let o=a.targetVertex.nonEmpty(),s=this.findVertex(a.targetAddress.unwrap()).nonEmpty();ne(o,`pointer ${a.address} is broken`),ne(s,`Cannot find target for pointer ${a.address}`),e++}},visitObjectField:a=>r(a)})};return this.#t.forEach(n=>r(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,r)=>(e[M.toString(r.address.uuid)]={class:r.name,"incoming links":r.incomingEdges().length,"outgoing links":r.outgoingEdges().length,"est. memory (bytes)":r.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let r of this.dependenciesOf(e).boxes)console.debug(` ${r}`)})}addressToDebugPath(e){return e.flatMap(r=>r.isBox()?this.findBox(r.uuid).map(n=>n.name):this.findBox(r.uuid).flatMap(n=>n.searchVertex(r.fieldKeys).map(i=>i.isField()?i.debugPath:K("Unknown address"))))}toArrayBuffer(){let e=jt.create(),r=this.#t.values();return e.writeInt(r.length),r.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e,r=!0){ne(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new it(e),i=n.readInt();this.beginTransaction();let a=[];for(let o=0;o<i;o++){let s=n.readInt(),u=new Int8Array(s);n.readBytes(u);let d=new it(u.buffer),m=d.readInt(),x=d.readString(),g=M.fromDataInput(d);a.push({creationIndex:m,name:x,uuid:g,boxStream:d})}a.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:u})=>this.createBox(o,s,d=>d.read(u))),r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:o,update:s})=>this.#y(o,s)),this.#r.length=0),this.#l.clearAffected(),this.#m())}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:je(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return K("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,M.parse(i),s=>{let u=tr(()=>s.fromJSON(o));u.status==="failure"&&console.warn(u.error)});r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:i,update:a})=>this.#y(i,a)),this.#r.length=0),this.#l.clearAffected(),this.#m())}#w(){ne(this.#g,()=>"Modification only prohibited in transaction mode.")}};var pi;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=lt(r,0,n.length);if(i<n.length)for(let a=i;a<n.length;a++)n[a].index.setValue(a+1);return i},t.removeOrder=(e,r)=>{let n=t.collectIndexedBoxes(e);if(r<n.length)for(let i=r+1;i<n.length;i++)n[i].index.setValue(i-1)},t.moveIndex=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=i[r];if(n<0){let o=lt(r+n,0,i.length-1);for(let s=o;s<r;s++)i[s].index.setValue(s+1);a.index.setValue(o)}else if(n>1){let o=lt(r+(n-1),0,i.length-1);for(let s=r;s<o;s++)i[s+1].index.setValue(s);a.index.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${r}, delta: ${n}`)},t.moveIndices=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=new Set(r),o=0;for(;o<r.length&&r[o]<n;)o++;let s=n-o,u=s,d=s+r.length,m=0,x=0,g=0;for(let w=0;w<i.length;w++){let F=i[w],B=a.has(w)?u+x++:w<n?m++:d+g++;F.index.setValue(B)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof P,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:K(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(pi||(pi={}));var De=class extends L{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return $(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return je(this.#e[e])}optField(e){return b.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(ze.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Vo.readFields(e,this.#e)}write(e){Vo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[r,n])=>(e[r]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Gh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];U(n)&&i.fromJSON(n)});else return K("Type mismatch")}};var Uo;(function(t){t[t.Float=0]="Float",t[t.FloatArray=1]="FloatArray",t[t.Integer=2]="Integer",t[t.IntegerArray=3]="IntegerArray",t[t.ByteArray=4]="ByteArray"})(Uo||(Uo={}));var Pp;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(Pp||(Pp={}));var Du;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(Du||(Du={}));var hg=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=jt.create(0);#a=b.None;#o=b.None;#s=b.None;#u=-1;#l=-1;#c=!1;#h=!1;#v=0;constructor(e){this.#i=Co.sender(e,({dispatchAndForget:r})=>new class{sendShareLock(n){r(this.sendShareLock,n)}sendUpdateData(n){r(this.sendUpdateData,n)}sendUpdateStructure(n){r(this.sendUpdateStructure,n)}})}flush(){let e=this.#g();if(e.nonEmpty()){this.#h||(this.#i.sendShareLock(this.#t),this.#h=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#d(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#v){let o=Jh(i),s=new SharedArrayBuffer(o);this.#o=b.wrap(new Uint8Array(s,0,r)),this.#n=jt.use(s,r),this.#a=b.wrap(s),this.#v=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===Pp.WRITE&&(this.#p(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Pp.READ))}broadcastFloat(e,r){return this.#f(new class{type=Uo.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#f(new class{type=Uo.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#f(new class{type=Uo.FloatArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n?.(a),i.writeInt(r.length);for(let o of r)i.writeFloat(o)}})}broadcastIntegers(e,r,n){return this.#f(new class{type=Uo.IntegerArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n(a),i.writeInt(r.length),r.forEach(o=>i.writeInt(o))}})}broadcastByteArray(e,r,n){return this.#f(new class{type=Uo.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#g(){if(this.#c){try{this.#s=b.wrap(this.#m())}catch(e){throw e}this.#c=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=b.None,e}return b.None}#d(){return this.#l===-1&&(this.#l=this.#y()+12),this.#l}terminate(){pe.clear(this.#e),this.#s=b.None,this.#c=!1,this.#l=0}#p(e){ne(!this.#c&&this.#s.isEmpty(),"Cannot flush while update is available");let r=this.#d();ne(e.remaining>=r,"Insufficient data"),e.writeInt(this.#u),e.writeInt(Du.START);let n=this.#o;for(let i=0;i<this.#e.length;i++){let a=n.nonEmpty()&&n.unwrap()[i]!==0;this.#e[i].put(e,a)}e.writeInt(Du.END)}#y(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#f(e){return this.#e.push(e),this.#x(),{terminate:()=>{pe.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#c=!0}#m(){let e=jt.create();e.writeInt(Du.ID),e.writeInt(++this.#u),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};var r$;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(r$||(r$={}));var i$;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(i$||(i$={}));var Mt;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Mt||(Mt={}));var jo={white:new rr(0,0,100),blue:new rr(189,100,65),green:new rr(150,77,69),yellow:new rr(60,100,84),cream:new rr(65,20,83),orange:new rr(31,100,73),red:new rr(354,100,65),purple:new rr(314,100,78),bright:new rr(197,5,95),gray:new rr(197,31,88),dark:new rr(197,15,70),shadow:new rr(197,10,55),black:new rr(197,10,25),background:new rr(197,8,9),panelBackground:new rr(197,14,12),panelBackgroundBright:new rr(197,13,19),panelBackgroundDark:new rr(197,14,11)};var Ke;(function(t){t[t.Add=0]="Add",t[t.Adsr=1]="Adsr",t[t.ArrowDown=2]="ArrowDown",t[t.ArrowLeft=3]="ArrowLeft",t[t.ArrowRight=4]="ArrowRight",t[t.ArrowUp=5]="ArrowUp",t[t.AudioBus=6]="AudioBus",t[t.AudioDevice=7]="AudioDevice",t[t.AudioFile=8]="AudioFile",t[t.AutoGain=9]="AutoGain",t[t.Automation=10]="Automation",t[t.BassGuitar=11]="BassGuitar",t[t.Book=12]="Book",t[t.Box=13]="Box",t[t.Browse=14]="Browse",t[t.Bug=15]="Bug",t[t.Capture=16]="Capture",t[t.Chain=17]="Chain",t[t.ChatEmpty=18]="ChatEmpty",t[t.ChatMessage=19]="ChatMessage",t[t.Copy=20]="Copy",t[t.Maximizer=21]="Maximizer",t[t.Fold=22]="Fold",t[t.Folder=23]="Folder",t[t.Charts=24]="Charts",t[t.Checkbox=25]="Checkbox",t[t.Clips=26]="Clips",t[t.Close=27]="Close",t[t.CloudFolder=28]="CloudFolder",t[t.Code=29]="Code",t[t.CollapseDown=30]="CollapseDown",t[t.Compressor=31]="Compressor",t[t.Connected=32]="Connected",t[t.Cube=33]="Cube",t[t.Cursor=34]="Cursor",t[t.Curve=35]="Curve",t[t.Dattorro=36]="Dattorro",t[t.Delete=37]="Delete",t[t.Dial=38]="Dial",t[t.DinSlot=39]="DinSlot",t[t.Disconnected=40]="Disconnected",t[t.Divide=41]="Divide",t[t.DragConnections=42]="DragConnections",t[t.Dropdown=43]="Dropdown",t[t.Dropbox=44]="Dropbox",t[t.DrumSet=45]="DrumSet",t[t.Tidal=46]="Tidal",t[t.Duration=47]="Duration",t[t.EditBox=48]="EditBox",t[t.Effects=49]="Effects",t[t.Embed=50]="Embed",t[t.EQ=51]="EQ",t[t.Eraser=52]="Eraser",t[t.Exclude=53]="Exclude",t[t.Exit=54]="Exit",t[t.ExpandWidth=55]="ExpandWidth",t[t.FileList=56]="FileList",t[t.Film=57]="Film",t[t.Flask=58]="Flask",t[t.Focus=59]="Focus",t[t.Fullscreen=60]="Fullscreen",t[t.Gate=61]="Gate",t[t.Generator=62]="Generator",t[t.GoogleDrive=63]="GoogleDrive",t[t.Nextcloud=64]="Nextcloud",t[t.Groove=65]="Groove",t[t.Guitar=66]="Guitar",t[t.GuitarTab=67]="GuitarTab",t[t.Headphone=68]="Headphone",t[t.Heart=69]="Heart",t[t.Help=70]="Help",t[t.HighPass=71]="HighPass",t[t.HighShelf=72]="HighShelf",t[t.Insert=73]="Insert",t[t.InsertDown=74]="InsertDown",t[t.Invert=75]="Invert",t[t.Info=76]="Info",t[t.Lock=77]="Lock",t[t.Loop=78]="Loop",t[t.LoopEnd=79]="LoopEnd",t[t.LoopStart=80]="LoopStart",t[t.LowPass=81]="LowPass",t[t.LowShelf=82]="LowShelf",t[t.Magnet=83]="Magnet",t[t.MainMenu=84]="MainMenu",t[t.Maximized=85]="Maximized",t[t.Menu=86]="Menu",t[t.Merge=87]="Merge",t[t.Metronome=88]="Metronome",t[t.Microphone=89]="Microphone",t[t.Midi=90]="Midi",t[t.Minimized=91]="Minimized",t[t.Mix=92]="Mix",t[t.Mixing=93]="Mixing",t[t.Mute=94]="Mute",t[t.NanoWave=95]="NanoWave",t[t.NeuralAmp=96]="NeuralAmp",t[t.New=97]="New",t[t.NoAudio=98]="NoAudio",t[t.Note=99]="Note",t[t.NotePad=100]="NotePad",t[t.Notification=101]="Notification",t[t.OpenDAW=102]="OpenDAW",t[t.Panel=103]="Panel",t[t.Paste=104]="Paste",t[t.Peak=105]="Peak",t[t.Pencil=106]="Pencil",t[t.Piano=107]="Piano",t[t.Play=108]="Play",t[t.Playfield=109]="Playfield",t[t.PlayOnce=110]="PlayOnce",t[t.PlayRepeat=111]="PlayRepeat",t[t.PlayAlternate=112]="PlayAlternate",t[t.Pointer=113]="Pointer",t[t.Popout=114]="Popout",t[t.Primary=115]="Primary",t[t.Random=116]="Random",t[t.Record=117]="Record",t[t.Rectangle=118]="Rectangle",t[t.Redo=119]="Redo",t[t.Region=120]="Region",t[t.Robot=121]="Robot",t[t.RoundDown=122]="RoundDown",t[t.RoundUp=123]="RoundUp",t[t.Run=124]="Run",t[t.Sawtooth=125]="Sawtooth",t[t.Saxophone=126]="Saxophone",t[t.Scissors=127]="Scissors",t[t.Search=128]="Search",t[t.Share=129]="Share",t[t.SelectDown=130]="SelectDown",t[t.SelectUp=131]="SelectUp",t[t.Shadertoy=132]="Shadertoy",t[t.Shutdown=133]="Shutdown",t[t.Signalsmith=134]="Signalsmith",t[t.Sine=135]="Sine",t[t.Solo=136]="Solo",t[t.SoundFont=137]="SoundFont",t[t.Speaker=138]="Speaker",t[t.SpeakerHeadphone=139]="SpeakerHeadphone",t[t.Square=140]="Square",t[t.Stack=141]="Stack",t[t.Start=142]="Start",t[t.Stereo=143]="Stereo",t[t.Stop=144]="Stop",t[t.Subtract=145]="Subtract",t[t.Sun=146]="Sun",t[t.Swap=147]="Swap",t[t.System=148]="System",t[t.Table=149]="Table",t[t.Tape=150]="Tape",t[t.TapeReel=151]="TapeReel",t[t.Time=152]="Time",t[t.Timeline=153]="Timeline",t[t.Tone3000=154]="Tone3000",t[t.Tool=155]="Tool",t[t.Triangle=156]="Triangle",t[t.Undo=157]="Undo",t[t.Unknown=158]="Unknown",t[t.UserFolder=159]="UserFolder",t[t.Velocity=160]="Velocity",t[t.Vinyl=161]="Vinyl",t[t.Vocoder=162]="Vocoder",t[t.Volume=163]="Volume",t[t.VUMeter=164]="VUMeter",t[t.Warning=165]="Warning",t[t.Waveform=166]="Waveform",t[t.Zeitgeist=167]="Zeitgeist",t[t.Github=168]="Github",t[t.Discord=169]="Discord",t[t.Instagram=170]="Instagram",t[t.LinkedIn=171]="LinkedIn",t[t.Neon=172]="Neon",t[t.Ring=173]="Ring",t[t.Noise=174]="Noise"})(Ke||(Ke={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(Ke||(Ke={}));var l;(function(t){t[t.Deprecated=NaN]="Deprecated",t[t.MetaData=0]="MetaData",t[t.AudioBusses=1]="AudioBusses",t[t.AudioConnection=2]="AudioConnection",t[t.AudioEffectHost=3]="AudioEffectHost",t[t.AudioFile=4]="AudioFile",t[t.AudioOutput=5]="AudioOutput",t[t.AudioPlayMode=6]="AudioPlayMode",t[t.AudioUnit=7]="AudioUnit",t[t.AudioUnits=8]="AudioUnits",t[t.Automation=9]="Automation",t[t.AuxSend=10]="AuxSend",t[t.Capture=11]="Capture",t[t.ClipCollection=12]="ClipCollection",t[t.ConnectionCollection=13]="ConnectionCollection",t[t.Device=14]="Device",t[t.DeviceUserInterface=15]="DeviceUserInterface",t[t.Editing=16]="Editing",t[t.FileUploadState=17]="FileUploadState",t[t.Groove=18]="Groove",t[t.InstrumentHost=19]="InstrumentHost",t[t.MarkerEvents=20]="MarkerEvents",t[t.MarkerTrack=21]="MarkerTrack",t[t.MIDIControl=22]="MIDIControl",t[t.MIDIControllers=23]="MIDIControllers",t[t.MIDIDevice=24]="MIDIDevice",t[t.MIDIEffectHost=25]="MIDIEffectHost",t[t.ModularSetup=26]="ModularSetup",t[t.Modulation=27]="Modulation",t[t.ModuleCollection=28]="ModuleCollection",t[t.NoteEventCollection=29]="NoteEventCollection",t[t.NoteEventFeature=30]="NoteEventFeature",t[t.NoteEvents=31]="NoteEvents",t[t.NotesConnection=32]="NotesConnection",t[t.Parameter=33]="Parameter",t[t.ParameterController=34]="ParameterController",t[t.PianoMode=35]="PianoMode",t[t.ProjectMeta=36]="ProjectMeta",t[t.RegionCollection=37]="RegionCollection",t[t.Sample=38]="Sample",t[t.Selection=39]="Selection",t[t.Shadertoy=40]="Shadertoy",t[t.SideChain=41]="SideChain",t[t.SignatureAutomation=42]="SignatureAutomation",t[t.SoundfontFile=43]="SoundfontFile",t[t.StepAutomation=44]="StepAutomation",t[t.Timeline=45]="Timeline",t[t.TrackCollection=46]="TrackCollection",t[t.TransientMarkers=47]="TransientMarkers",t[t.User=48]="User",t[t.ValueEventCollection=49]="ValueEventCollection",t[t.ValueEvents=50]="ValueEvents",t[t.ValueInterpolation=51]="ValueInterpolation",t[t.VoltageConnection=52]="VoltageConnection",t[t.WarpMarkers=53]="WarpMarkers",t[t.NeuralAmpModel=54]="NeuralAmpModel",t[t.CompositeCell=55]="CompositeCell",t[t.AudioEffectCompositeCell=56]="AudioEffectCompositeCell"})(l||(l={}));var gg;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(gg||(gg={}));var ga;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(ga||(ga={}));var n$=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?K(`Indices cannot be equal (${t}, ${e})`):r};var so=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},vg,On,Ko,xg,lo,Ct=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){vg.set(this,void 0),On.set(this,void 0),Ko.set(this,void 0),xg.set(this,void 0),lo.set(this,null),so(this,vg,e,"f"),so(this,On,M.newSet(i=>i.adapter.uuid),"f"),so(this,Ko,new ar,"f"),so(this,xg,e.pointerHub.catchupAndSubscribe({onAdded:i=>{so(this,lo,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{so(this,lo,null,"f"),Mr(this,Ko,"f").proxy.onReorder(a)}),s=Mr(this,On,"f").add({adapter:a,subscription:o});ne(s,`Could not add ${a}`),Mr(this,Ko,"f").proxy.onAdd(a)},onRemoved:i=>{so(this,lo,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=Mr(this,On,"f").removeByKey(a);s.terminate(),Mr(this,Ko,"f").proxy.onRemove(o)}},n),"f")}field(){return Mr(this,vg,"f")}subscribe(e){return Mr(this,Ko,"f").subscribe(e)}catchupAndSubscribe(e){return Mr(this,On,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=yt.exactMapped(this.adapters(),e,n$,n=>n.indexField.getValue());return r===-1?b.None:b.wrap(this.adapters()[r])}getAdapterById(e){return Mr(this,On,"f").opt(e).map(({adapter:r})=>r)}getMinFreeIndex(){let e=this.adapters();for(let r=0;r<e.length;r++)if(e[r].indexField.getValue()>r)return r;return e.length}adapters(){return Mr(this,lo,"f")===null&&so(this,lo,Mr(this,On,"f").values().map(({adapter:e})=>e).filter(e=>e.box.isAttached()).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),Mr(this,lo,"f")}move(e,r){this.moveIndex(e.indexField.getValue(),r)}moveIndex(e,r){if(r===0)return;let n=this.adapters(),i=n[e],a=lt(e+r,0,n.length-1);if(a!==e){if(r<0)for(let o=a;o<e;o++)n[o].indexField.setValue(o+1);else for(let o=e;o<a;o++)n[o+1].indexField.setValue(o);i.indexField.setValue(a)}}size(){return Mr(this,On,"f").size()}isEmpty(){return this.size()===0}terminate(){so(this,lo,null,"f"),Mr(this,On,"f").forEach(({subscription:e})=>e.terminate()),Mr(this,On,"f").clear(),Mr(this,Ko,"f").terminate(),Mr(this,xg,"f").terminate()}};vg=new WeakMap,On=new WeakMap,Ko=new WeakMap,xg=new WeakMap,lo=new WeakMap;var uo;(function(t){t.names=["MetaDataBox","ProjectMetaBox","RootBox","SelectionBox","UserInterfaceBox","UploadFileBox","ShadertoyBox","MIDIControllerBox","TimelineBox","TrackBox","NoteEventBox","NoteEventRepeatBox","NoteEventCollectionBox","NoteRegionBox","NoteClipBox","ValueEventBox","ValueEventCollectionBox","ValueEventCurveBox","ValueRegionBox","ValueClipBox","SignatureEventBox","AudioRegionBox","AudioClipBox","AudioPitchStretchBox","AudioTimeStretchBox","AudioSignalsmithBox","TransientMarkerBox","WarpMarkerBox","MarkerBox","AudioFileBox","SoundfontFileBox","NeuralAmpModelBox","AudioUnitBox","CaptureAudioBox","CaptureMidiBox","AudioBusBox","AuxSendBox","GrooveShuffleBox","UnknownAudioEffectDeviceBox","UnknownMidiEffectDeviceBox","DeviceInterfaceKnobBox","ModularDeviceBox","StereoToolDeviceBox","MaximizerDeviceBox","CompressorDeviceBox","GateDeviceBox","DelayDeviceBox","AutotuneDeviceBox","CrusherDeviceBox","DattorroReverbDeviceBox","VelocityDeviceBox","FoldDeviceBox","TidalDeviceBox","RevampDeviceBox","ReverbDeviceBox","VaporisateurDeviceBox","MIDIOutputDeviceBox","MIDIOutputBox","MIDIOutputParameterBox","SoundfontDeviceBox","NeonDeviceBox","NanoDeviceBox","PlayfieldDeviceBox","PlayfieldSampleBox","TapeDeviceBox","ArpeggioDeviceBox","PitchDeviceBox","ZeitgeistDeviceBox","NeuralAmpDeviceBox","VocoderDeviceBox","WaveshaperDeviceBox","WerkstattDeviceBox","WerkstattParameterBox","WerkstattSampleBox","SpielwerkDeviceBox","ApparatDeviceBox","NoopInstrumentBox","CompositeDeviceBox","CompositeCellBox","AudioEffectCompositeBox","AudioEffectCompositeCellBox","StereoCompositeBox","FrequencySplitBox","ModularBox","ModuleConnectionBox","ModularAudioInputBox","ModularAudioOutputBox","ModuleDelayBox","ModuleMultiplierBox","ModuleGainBox"],t.create=(e,r,n,i)=>{switch(e){case"MetaDataBox":return Vn.create(r,n,i);case"ProjectMetaBox":return yg.create(r,n,i);case"RootBox":return Wo.create(r,n,i);case"SelectionBox":return va.create(r,n,i);case"UserInterfaceBox":return co.create(r,n,i);case"UploadFileBox":return wg.create(r,n,i);case"ShadertoyBox":return bg.create(r,n,i);case"MIDIControllerBox":return _g.create(r,n,i);case"TimelineBox":return il.create(r,n,i);case"TrackBox":return fi.create(r,n,i);case"NoteEventBox":return Lo.create(r,n,i);case"NoteEventRepeatBox":return Fg.create(r,n,i);case"NoteEventCollectionBox":return po.create(r,n,i);case"NoteRegionBox":return nl.create(r,n,i);case"NoteClipBox":return Ru.create(r,n,i);case"ValueEventBox":return Un.create(r,n,i);case"ValueEventCollectionBox":return jn.create(r,n,i);case"ValueEventCurveBox":return Zo.create(r,n,i);case"ValueRegionBox":return al.create(r,n,i);case"ValueClipBox":return Cu.create(r,n,i);case"SignatureEventBox":return zu.create(r,n,i);case"AudioRegionBox":return Go.create(r,n,i);case"AudioClipBox":return Ou.create(r,n,i);case"AudioPitchStretchBox":return Vu.create(r,n,i);case"AudioTimeStretchBox":return Uu.create(r,n,i);case"AudioSignalsmithBox":return ju.create(r,n,i);case"TransientMarkerBox":return Ag.create(r,n,i);case"WarpMarkerBox":return xa.create(r,n,i);case"MarkerBox":return Ku.create(r,n,i);case"AudioFileBox":return tn.create(r,n,i);case"SoundfontFileBox":return ya.create(r,n,i);case"NeuralAmpModelBox":return Eg.create(r,n,i);case"AudioUnitBox":return Xe.create(r,n,i);case"CaptureAudioBox":return wa.create(r,n,i);case"CaptureMidiBox":return ba.create(r,n,i);case"AudioBusBox":return Kn.create(r,n,i);case"AuxSendBox":return Wu.create(r,n,i);case"GrooveShuffleBox":return Lu.create(r,n,i);case"UnknownAudioEffectDeviceBox":return Sg.create(r,n,i);case"UnknownMidiEffectDeviceBox":return Pg.create(r,n,i);case"DeviceInterfaceKnobBox":return $g.create(r,n,i);case"ModularDeviceBox":return Mg.create(r,n,i);case"StereoToolDeviceBox":return Ng.create(r,n,i);case"MaximizerDeviceBox":return Zu.create(r,n,i);case"CompressorDeviceBox":return kg.create(r,n,i);case"GateDeviceBox":return Bg.create(r,n,i);case"DelayDeviceBox":return Ig.create(r,n,i);case"AutotuneDeviceBox":return Tg.create(r,n,i);case"CrusherDeviceBox":return Dg.create(r,n,i);case"DattorroReverbDeviceBox":return Rg.create(r,n,i);case"VelocityDeviceBox":return Cg.create(r,n,i);case"FoldDeviceBox":return zg.create(r,n,i);case"TidalDeviceBox":return Og.create(r,n,i);case"RevampDeviceBox":return Vg.create(r,n,i);case"ReverbDeviceBox":return Ug.create(r,n,i);case"VaporisateurDeviceBox":return Gu.create(r,n,i);case"MIDIOutputDeviceBox":return Hu.create(r,n,i);case"MIDIOutputBox":return Ho.create(r,n,i);case"MIDIOutputParameterBox":return ol.create(r,n,i);case"SoundfontDeviceBox":return qu.create(r,n,i);case"NeonDeviceBox":return Ju.create(r,n,i);case"NanoDeviceBox":return Yu.create(r,n,i);case"PlayfieldDeviceBox":return Xu.create(r,n,i);case"PlayfieldSampleBox":return qo.create(r,n,i);case"TapeDeviceBox":return Qu.create(r,n,i);case"ArpeggioDeviceBox":return jg.create(r,n,i);case"PitchDeviceBox":return Kg.create(r,n,i);case"ZeitgeistDeviceBox":return Wg.create(r,n,i);case"NeuralAmpDeviceBox":return Lg.create(r,n,i);case"VocoderDeviceBox":return Zg.create(r,n,i);case"WaveshaperDeviceBox":return Gg.create(r,n,i);case"WerkstattDeviceBox":return Hg.create(r,n,i);case"WerkstattParameterBox":return _a.create(r,n,i);case"WerkstattSampleBox":return sl.create(r,n,i);case"SpielwerkDeviceBox":return qg.create(r,n,i);case"ApparatDeviceBox":return ec.create(r,n,i);case"NoopInstrumentBox":return tc.create(r,n,i);case"CompositeDeviceBox":return Jg.create(r,n,i);case"CompositeCellBox":return Yg.create(r,n,i);case"AudioEffectCompositeBox":return Xg.create(r,n,i);case"AudioEffectCompositeCellBox":return rc.create(r,n,i);case"StereoCompositeBox":return Qg.create(r,n,i);case"FrequencySplitBox":return ev.create(r,n,i);case"ModularBox":return tv.create(r,n,i);case"ModuleConnectionBox":return rv.create(r,n,i);case"ModularAudioInputBox":return iv.create(r,n,i);case"ModularAudioOutputBox":return nv.create(r,n,i);case"ModuleDelayBox":return av.create(r,n,i);case"ModuleMultiplierBox":return ov.create(r,n,i);case"ModuleGainBox":return sv.create(r,n,i);default:return K(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new it(r),i=n.readString(),a=M.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(uo||(uo={}));var Vn=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MetaDataBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MetaDataBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMetaDataBox,this)}get tags(){return t.Tags}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:p},l.MetaData,!0),2:I.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:p},"{}")}}};var yg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ProjectMetaBox",pointerRules:{accepts:[l.ProjectMeta],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ProjectMetaBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitProjectMetaBox,this)}get tags(){return t.Tags}get projectName(){return this.getField(1)}get artist(){return this.getField(2)}get description(){return this.getField(3)}get tagList(){return this.getField(4)}get notepad(){return this.getField(5)}get created(){return this.getField(6)}get modified(){return this.getField(7)}get coverId(){return this.getField(8)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"projectName",deprecated:!1,pointerRules:p}),2:I.create({parent:this,fieldKey:2,fieldName:"artist",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"description",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"tagList",deprecated:!1,pointerRules:p},"[]"),5:I.create({parent:this,fieldKey:5,fieldName:"notepad",deprecated:!1,pointerRules:p}),6:I.create({parent:this,fieldKey:6,fieldName:"created",deprecated:!1,pointerRules:p}),7:I.create({parent:this,fieldKey:7,fieldName:"modified",deprecated:!1,pointerRules:p}),8:I.create({parent:this,fieldKey:8,fieldName:"coverId",deprecated:!1,pointerRules:p})}}};var lv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get keyboard(){return this.getField(1)}get timeRangeInQuarters(){return this.getField(2)}get noteScale(){return this.getField(3)}get noteLabels(){return this.getField(4)}get transpose(){return this.getField(5)}initializeFields(){return{1:P.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:_.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:_.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:k.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:P.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var Wo=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RootBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RootBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitRootBox,this)}get tags(){return t.Tags}get timeline(){return this.getField(1)}get users(){return this.getField(2)}get created(){return this.getField(3)}get groove(){return this.getField(4)}get baseFrequency(){return this.getField(5)}get modularSetups(){return this.getField(10)}get audioUnits(){return this.getField(20)}get audioBusses(){return this.getField(21)}get outputDevice(){return this.getField(30)}get outputMidiDevices(){return this.getField(35)}get pianoMode(){return this.getField(40)}get shadertoy(){return this.getField(100)}get projectMeta(){return this.getField(101)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!1,exclusive:!1}}),3:I.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:_.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:L.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:L.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:L.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:lv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:N.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:N.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:N.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};var va=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SelectionBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="SelectionBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};var co=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UserInterfaceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUserInterfaceBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get selection(){return this.getField(10)}get uploadStates(){return this.getField(11)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}get midiControllers(){return this.getField(30)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:L.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:N.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:N.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:N.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:L.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var wg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UploadFileBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="UploadFileBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};var bg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[l.Shadertoy],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ShadertoyBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitShadertoyBox,this)}get tags(){return t.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:p}),2:k.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};var _g=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIControllerBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="MIDIControllerBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIControllerBox,this)}get tags(){return t.Tags}get controllers(){return this.getField(1)}get parameter(){return this.getField(2)}get deviceId(){return this.getField(3)}get deviceChannel(){return this.getField(4)}get controlId(){return this.getField(5)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.MIDIControl,!0),3:I.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:p}),4:P.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:P.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};var uv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:P.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:P.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var cv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get from(){return this.getField(2)}get to(){return this.getField(3)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:P.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:P.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var dv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get markers(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var pv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get minBpm(){return this.getField(15)}get maxBpm(){return this.getField(16)}get enabled(){return this.getField(20)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:P.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:P.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var fv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var il=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TimelineBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TimelineBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTimelineBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get signature(){return this.getField(10)}get loopArea(){return this.getField(11)}get deprecatedMarkerTrack(){return this.getField(20)}get markerTrack(){return this.getField(21)}get tempoTrack(){return this.getField(22)}get signatureTrack(){return this.getField(23)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:uv.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:cv.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:L.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:dv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:pv.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:fv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:P.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:_.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var fi=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TrackBox",pointerRules:{accepts:[l.Selection,l.PianoMode,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TrackBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTrackBox,this)}get tags(){return t.Tags}get tracks(){return this.getField(1)}get target(){return this.getField(2)}get regions(){return this.getField(3)}get clips(){return this.getField(4)}get index(){return this.getField(10)}get type(){return this.getField(11)}get enabled(){return this.getField(20)}get excludePianoMode(){return this.getField(30)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:P.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:k.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};var Lo=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventBox",pointerRules:{accepts:[l.Selection,l.NoteEventFeature],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get pitch(){return this.getField(20)}get velocity(){return this.getField(21)}get playCount(){return this.getField(22)}get playCurve(){return this.getField(23)}get cent(){return this.getField(24)}get chance(){return this.getField(25)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:P.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:_.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:P.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:_.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:_.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:P.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};var Fg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventRepeatBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventRepeatBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventRepeatBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get count(){return this.getField(2)}get curve(){return this.getField(3)}get length(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:P.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:_.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:_.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};var po=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="NoteEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var nl=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get eventOffset(){return this.getField(14)}get mute(){return this.getField(15)}get label(){return this.getField(16)}get hue(){return this.getField(17)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:P.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:P.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:P.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:k.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:I.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:P.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Jo=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get loop(){return this.getField(1)}get reverse(){return this.getField(2)}get mute(){return this.getField(3)}get speed(){return this.getField(4)}get quantise(){return this.getField(5)}get trigger(){return this.getField(6)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:k.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:k.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:P.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:P.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:P.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var Ru=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:Jo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:P.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:I.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:P.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Un=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get index(){return this.getField(11)}get interpolation(){return this.getField(12)}get value(){return this.getField(13)}get slope(){return this.getField(14)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:P.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:_.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:_.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};var jn=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="ValueEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Zo=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCurveBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventCurveBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:_.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};var al=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:P.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:P.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:I.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:P.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Cu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:Jo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:P.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:I.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:P.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var zu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SignatureEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSignatureEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get index(){return this.getField(9)}get relativePosition(){return this.getField(10)}get nominator(){return this.getField(21)}get denominator(){return this.getField(22)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:P.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:P.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:P.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:P.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};var mv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get in(){return this.getField(1)}get out(){return this.getField(2)}get inSlope(){return this.getField(3)}get outSlope(){return this.getField(4)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:_.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:_.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:_.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var Go=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}get timeBase(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}get gain(){return this.getField(17)}get fading(){return this.getField(18)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:I.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:_.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:_.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:_.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:_.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:I.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:P.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:_.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:mv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};var Ou=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}get gain(){return this.getField(14)}get playback(){return this.getField(20)}get timeBase(){return this.getField(21)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:Jo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:_.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:_.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:I.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:P.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:_.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),20:I.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:p}),21:I.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical")}}};var Vu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioPitchStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var Uu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioTimeStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioTimeStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:P.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:_.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};var ju=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioSignalsmithBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioSignalsmithBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:_.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};var Ag=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TransientMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:_.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var xa=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WarpMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWarpMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:P.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:_.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var Ku=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MarkerBox",pointerRules:{accepts:[l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMarkerBox,this)}get tags(){return t.Tags}get track(){return this.getField(1)}get position(){return this.getField(2)}get plays(){return this.getField(3)}get label(){return this.getField(4)}get hue(){return this.getField(5)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:P.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:P.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},"non-negative","",1),4:I.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:P.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var tn=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioFileBox",pointerRules:{accepts:[l.AudioFile,l.FileUploadState,l.MetaData],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="AudioFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioFileBox,this)}get tags(){return t.Tags}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}get transientMarkers(){return this.getField(10)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:_.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),3:I.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var ya=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[l.SoundfontFile],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="SoundfontFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSoundfontFileBox,this)}get tags(){return t.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};var Eg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpModelBox",pointerRules:{accepts:[l.NeuralAmpModel],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="NeuralAmpModelBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpModelBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get model(){return this.getField(2)}get packId(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),2:I.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"packId",deprecated:!1,pointerRules:p})}}};var hv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get automationCollapsed(){return this.getField(1)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"automationCollapsed",deprecated:!1,pointerRules:p})}}};var Xe=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[l.Selection,l.Automation,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioUnitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioUnitBox,this)}get tags(){return t.Tags}get type(){return this.getField(1)}get collection(){return this.getField(2)}get editing(){return this.getField(3)}get index(){return this.getField(11)}get volume(){return this.getField(12)}get panning(){return this.getField(13)}get mute(){return this.getField(14)}get solo(){return this.getField(15)}get tracks(){return this.getField(20)}get midiEffects(){return this.getField(21)}get input(){return this.getField(22)}get audioEffects(){return this.getField(23)}get auxSends(){return this.getField(24)}get output(){return this.getField(25)}get capture(){return this.getField(26)}get userInterface(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:p},"instrument"),2:N.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:P.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:_.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:_.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:L.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:L.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:L.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:N.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:N.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1),30:hv.create({parent:this,fieldKey:30,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var wa=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureAudioBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureAudioBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}get inputLatency(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:I.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:P.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:_.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};var ba=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureMidiBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureMidiBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:I.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:P.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};var Kn=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioBusBox",pointerRules:{accepts:[l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioBusBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioBusBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get output(){return this.getField(2)}get input(){return this.getField(3)}get enabled(){return this.getField(4)}get icon(){return this.getField(5)}get label(){return this.getField(6)}get color(){return this.getField(7)}get minimized(){return this.getField(8)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:N.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:I.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:I.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:k.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var Wu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AuxSendBox",pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AuxSendBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAuxSendBox,this)}get tags(){return t.Tags}get audioUnit(){return this.getField(1)}get targetBus(){return this.getField(2)}get index(){return this.getField(3)}get routing(){return this.getField(4)}get sendGain(){return this.getField(5)}get sendPan(){return this.getField(6)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:N.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:P.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:_.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:_.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Lu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[l.Groove],mandatory:!0,exclusive:!1},resource:"internal",ephemeral:!1}),n)}static ClassName="GrooveShuffleBox";static Resource="internal";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitGrooveShuffleBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),10:_.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"non-negative","ppqn",480)}}};var Sg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownAudioEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownAudioEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Pg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownMidiEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownMidiEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var $g=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="DeviceInterfaceKnobBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitDeviceInterfaceKnobBox,this)}get tags(){return t.Tags}get userInterface(){return this.getField(1)}get parameter(){return this.getField(2)}get index(){return this.getField(3)}get anchor(){return this.getField(10)}get color(){return this.getField(11)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:_.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p},"unipolar","%"),11:I.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};var gv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var Mg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitModularDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modularSetup(){return this.getField(10)}get userInterface(){return this.getField(11)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:gv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var Ng=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoToolDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoToolDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get panning(){return this.getField(11)}get stereo(){return this.getField(12)}get invertL(){return this.getField(13)}get invertR(){return this.getField(14)}get swap(){return this.getField(15)}get panningMixing(){return this.getField(20)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:_.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:_.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:k.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:P.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};var Zu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MaximizerDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitMaximizerDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get threshold(){return this.getField(11)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:_.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:0,scaling:"linear"},"dB",0)}}};var kg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompressorDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCompressorDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get automakeup(){return this.getField(11)}get autoattack(){return this.getField(12)}get autorelease(){return this.getField(13)}get inputgain(){return this.getField(14)}get threshold(){return this.getField(15)}get ratio(){return this.getField(16)}get knee(){return this.getField(17)}get attack(){return this.getField(18)}get release(){return this.getField(19)}get makeup(){return this.getField(20)}get mix(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:k.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:k.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:k.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:_.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:_.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:_.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:_.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:_.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:_.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:_.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:_.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Bg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GateDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="GateDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitGateDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get threshold(){return this.getField(10)}get return(){return this.getField(11)}get attack(){return this.getField(12)}get hold(){return this.getField(13)}get release(){return this.getField(14)}get floor(){return this.getField(15)}get inverse(){return this.getField(16)}get sideChain(){return this.getField(30)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-80,max:0,scaling:"linear"},"dB",-6),11:_.create({parent:this,fieldKey:11,fieldName:"return",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",1),13:_.create({parent:this,fieldKey:13,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:500,scaling:"linear"},"ms",50),14:_.create({parent:this,fieldKey:14,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:2e3,scaling:"linear"},"ms",100),15:_.create({parent:this,fieldKey:15,fieldName:"floor",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,max:0,scaling:"linear"},"dB",-72),16:k.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Ig=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DelayDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDelayDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get delayMusical(){return this.getField(10)}get feedback(){return this.getField(11)}get cross(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}get preSyncTimeLeft(){return this.getField(16)}get preMillisTimeLeft(){return this.getField(17)}get preSyncTimeRight(){return this.getField(19)}get preMillisTimeRight(){return this.getField(20)}get delayMillis(){return this.getField(22)}get lfoSpeed(){return this.getField(23)}get lfoDepth(){return this.getField(24)}get version(){return this.getField(99)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:_.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:_.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:_.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:_.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),15:_.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),16:_.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:_.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:_.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:_.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:_.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:_.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:_.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:P.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Tg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AutotuneDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AutotuneDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAutotuneDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get key(){return this.getField(10)}get scale(){return this.getField(11)}get amount(){return this.getField(12)}get retune(){return this.getField(13)}get shift(){return this.getField(14)}get smooth(){return this.getField(15)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"key",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:11},"",0),11:P.create({parent:this,fieldKey:11,fieldName:"scale",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:7},"",1),12:_.create({parent:this,fieldKey:12,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:_.create({parent:this,fieldKey:13,fieldName:"retune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),14:_.create({parent:this,fieldKey:14,fieldName:"shift",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-12,max:12,scaling:"linear"},"st",0),15:_.create({parent:this,fieldKey:15,fieldName:"smooth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6)}}};var Dg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CrusherDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCrusherDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get crush(){return this.getField(10)}get bits(){return this.getField(11)}get boost(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:P.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"bits",16),12:_.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:_.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:1,scaling:"exponential"},"%",1)}}};var Rg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DattorroReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDattorroReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get preDelay(){return this.getField(10)}get bandwidth(){return this.getField(11)}get inputDiffusion1(){return this.getField(12)}get inputDiffusion2(){return this.getField(13)}get decay(){return this.getField(14)}get decayDiffusion1(){return this.getField(15)}get decayDiffusion2(){return this.getField(16)}get damping(){return this.getField(17)}get excursionRate(){return this.getField(18)}get excursionDepth(){return this.getField(19)}get wet(){return this.getField(20)}get dry(){return this.getField(21)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:_.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:_.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:_.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:_.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:_.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:_.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:_.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:_.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:_.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:_.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),21:_.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Cg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VelocityDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitVelocityDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get magnetPosition(){return this.getField(10)}get magnetStrength(){return this.getField(11)}get randomSeed(){return this.getField(12)}get randomAmount(){return this.getField(13)}get offset(){return this.getField(14)}get mix(){return this.getField(15)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:_.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:P.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:_.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:_.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:_.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var zg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FoldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFoldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get drive(){return this.getField(10)}get overSampling(){return this.getField(11)}get volume(){return this.getField(12)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:P.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:_.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var Og=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TidalDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitTidalDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get slope(){return this.getField(10)}get symmetry(){return this.getField(11)}get rate(){return this.getField(20)}get depth(){return this.getField(21)}get offset(){return this.getField(22)}get channelOffset(){return this.getField(23)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:_.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:_.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:16,scaling:"linear"},"",3),21:_.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:_.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:_.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var $p=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get order(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:P.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:_.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Mp=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:_.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var ic=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:_.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:_.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Vg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RevampDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitRevampDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get highPass(){return this.getField(10)}get lowShelf(){return this.getField(11)}get lowBell(){return this.getField(12)}get midBell(){return this.getField(13)}get highBell(){return this.getField(14)}get highShelf(){return this.getField(15)}get lowPass(){return this.getField(16)}get gain(){return this.getField(17)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:$p.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Mp.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:ic.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:ic.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:ic.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Mp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:$p.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:_.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Ug=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get decay(){return this.getField(10)}get preDelay(){return this.getField(11)}get damp(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:_.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:_.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:_.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:_.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:_.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var vv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get volume(){return this.getField(2)}get octave(){return this.getField(3)}get tune(){return this.getField(4)}initializeFields(){return{1:P.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:_.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",-1/0),3:P.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),4:_.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var xv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get rate(){return this.getField(2)}get sync(){return this.getField(3)}get targetTune(){return this.getField(10)}get targetCutoff(){return this.getField(11)}get targetVolume(){return this.getField(12)}initializeFields(){return{1:P.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:_.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:k.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:_.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:_.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:_.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var yv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get attack(){return this.getField(1)}get hold(){return this.getField(2)}get release(){return this.getField(3)}get volume(){return this.getField(4)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:_.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:_.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:_.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",.001)}}};var Gu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VaporisateurDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitVaporisateurDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get octave(){return this.getField(11)}get tune(){return this.getField(12)}get waveform(){return this.getField(13)}get cutoff(){return this.getField(14)}get resonance(){return this.getField(15)}get attack(){return this.getField(16)}get release(){return this.getField(17)}get filterEnvelope(){return this.getField(18)}get decay(){return this.getField(19)}get sustain(){return this.getField(20)}get glideTime(){return this.getField(21)}get voicingMode(){return this.getField(22)}get unisonCount(){return this.getField(23)}get unisonDetune(){return this.getField(24)}get unisonStereo(){return this.getField(25)}get filterOrder(){return this.getField(26)}get filterKeyboard(){return this.getField(27)}get lfo(){return this.getField(30)}get oscillators(){return this.getField(40)}get noise(){return this.getField(50)}get version(){return this.getField(99)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),11:P.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:_.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:P.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:_.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:_.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:_.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:_.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:_.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:_.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:_.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:_.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:P.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),23:P.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,3,5]},"",1),24:_.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:_.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:P.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,2,3,4]},"",1),27:_.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:xv.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:Ys.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>vv.create(e),2),50:yv.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:P.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var wv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var Hu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get deprecatedDevice(){return this.getField(10)}get channel(){return this.getField(11)}get deprecatedDelay(){return this.getField(12)}get parameters(){return this.getField(13)}get device(){return this.getField(14)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:wv.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:P.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:P.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:L.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:N.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};var Ho=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get device(){return this.getField(2)}get id(){return this.getField(3)}get label(){return this.getField(4)}get delayInMs(){return this.getField(5)}get sendTransportMessages(){return this.getField(6)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0,exclusive:!1}}),3:I.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:P.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:k.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var ol=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get controller(){return this.getField(3)}get value(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:P.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:_.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var qu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SoundfontDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitSoundfontDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get file(){return this.getField(10)}get presetIndex(){return this.getField(11)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:P.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};var bv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get wave1(){return this.getField(1)}get wave2(){return this.getField(2)}get dcwKeyFollow(){return this.getField(3)}get dcaKeyFollow(){return this.getField(4)}initializeFields(){return{1:P.create({parent:this,fieldKey:1,fieldName:"wave1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:8},"",0),2:P.create({parent:this,fieldKey:2,fieldName:"wave2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:9},"",0),3:_.create({parent:this,fieldKey:3,fieldName:"dcwKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0),4:_.create({parent:this,fieldKey:4,fieldName:"dcaKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0)}}};var _v=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get rate1(){return this.getField(1)}get rate2(){return this.getField(2)}get rate3(){return this.getField(3)}get rate4(){return this.getField(4)}get rate5(){return this.getField(5)}get rate6(){return this.getField(6)}get rate7(){return this.getField(7)}get rate8(){return this.getField(8)}get level1(){return this.getField(11)}get level2(){return this.getField(12)}get level3(){return this.getField(13)}get level4(){return this.getField(14)}get level5(){return this.getField(15)}get level6(){return this.getField(16)}get level7(){return this.getField(17)}get level8(){return this.getField(18)}get sustain(){return this.getField(20)}get end(){return this.getField(21)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"rate1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),2:_.create({parent:this,fieldKey:2,fieldName:"rate2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),3:_.create({parent:this,fieldKey:3,fieldName:"rate3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),4:_.create({parent:this,fieldKey:4,fieldName:"rate4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),5:_.create({parent:this,fieldKey:5,fieldName:"rate5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),6:_.create({parent:this,fieldKey:6,fieldName:"rate6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),7:_.create({parent:this,fieldKey:7,fieldName:"rate7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),8:_.create({parent:this,fieldKey:8,fieldName:"rate8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),11:_.create({parent:this,fieldKey:11,fieldName:"level1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),12:_.create({parent:this,fieldKey:12,fieldName:"level2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),13:_.create({parent:this,fieldKey:13,fieldName:"level3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),14:_.create({parent:this,fieldKey:14,fieldName:"level4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),15:_.create({parent:this,fieldKey:15,fieldName:"level5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),16:_.create({parent:this,fieldKey:16,fieldName:"level6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),17:_.create({parent:this,fieldKey:17,fieldName:"level7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),18:_.create({parent:this,fieldKey:18,fieldName:"level8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),20:P.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:p},{min:0,max:8},"",0),21:P.create({parent:this,fieldKey:21,fieldName:"end",deprecated:!1,pointerRules:p},{min:1,max:8},"",1)}}};var Fv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get wave(){return this.getField(1)}get delay(){return this.getField(2)}get rate(){return this.getField(3)}get depth(){return this.getField(4)}initializeFields(){return{1:P.create({parent:this,fieldKey:1,fieldName:"wave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),2:_.create({parent:this,fieldKey:2,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),3:_.create({parent:this,fieldKey:3,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),4:_.create({parent:this,fieldKey:4,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0)}}};var Ju=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeonDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeonDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNeonDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lineSelect(){return this.getField(10)}get modulation(){return this.getField(11)}get octave(){return this.getField(12)}get detune(){return this.getField(13)}get glideTime(){return this.getField(15)}get tune(){return this.getField(16)}get voicingMode(){return this.getField(17)}get vibrato(){return this.getField(20)}get lines(){return this.getField(30)}get envelopes(){return this.getField(40)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"lineSelect",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),11:P.create({parent:this,fieldKey:11,fieldName:"modulation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),12:P.create({parent:this,fieldKey:12,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),13:_.create({parent:this,fieldKey:13,fieldName:"detune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-4800,max:4800,scaling:"linear"},"ct",0),15:_.create({parent:this,fieldKey:15,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),16:_.create({parent:this,fieldKey:16,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct",0),17:P.create({parent:this,fieldKey:17,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),20:Fv.create({parent:this,fieldKey:20,fieldName:"vibrato",deprecated:!1,pointerRules:p}),30:Ys.create({parent:this,fieldKey:30,fieldName:"lines",deprecated:!1,pointerRules:p},e=>bv.create(e),2),40:Ys.create({parent:this,fieldKey:40,fieldName:"envelopes",deprecated:!1,pointerRules:p},e=>_v.create(e),6)}}};var Yu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NanoDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNanoDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get file(){return this.getField(15)}get release(){return this.getField(20)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:N.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:_.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var Xu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get samples(){return this.getField(10)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var qo=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[l.Editing,l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes",copyable:!1});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldSampleBox,this)}get tags(){return t.Tags}get device(){return this.getField(10)}get file(){return this.getField(11)}get midiEffects(){return this.getField(12)}get audioEffects(){return this.getField(13)}get index(){return this.getField(15)}get label(){return this.getField(20)}get icon(){return this.getField(21)}get enabled(){return this.getField(22)}get minimized(){return this.getField(23)}get mute(){return this.getField(40)}get solo(){return this.getField(41)}get exclude(){return this.getField(42)}get polyphone(){return this.getField(43)}get gate(){return this.getField(44)}get pitch(){return this.getField(45)}get sampleStart(){return this.getField(46)}get sampleEnd(){return this.getField(47)}get attack(){return this.getField(48)}get release(){return this.getField(49)}get volume(){return this.getField(50)}get panning(){return this.getField(51)}initializeFields(){return{10:N.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:N.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:L.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:L.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:P.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),20:I.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:p}),21:I.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:k.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:k.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:k.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:k.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:k.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:k.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:P.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),45:_.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:_.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:_.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:_.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:_.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02),50:_.create({parent:this,fieldKey:50,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),51:_.create({parent:this,fieldKey:51,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Qu=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain,l.Automation],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TapeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitTapeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get flutter(){return this.getField(10)}get wow(){return this.getField(11)}get noise(){return this.getField(12)}get saturation(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:_.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:_.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:_.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var jg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ArpeggioDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitArpeggioDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modeIndex(){return this.getField(10)}get numOctaves(){return this.getField(11)}get rateIndex(){return this.getField(12)}get gate(){return this.getField(13)}get repeat(){return this.getField(14)}get velocity(){return this.getField(15)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),11:P.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:5},"oct",1),12:P.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:17},"",9),13:_.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:2,scaling:"linear"},"",1),14:P.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"",1),15:_.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var Kg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PitchDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitPitchDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get semiTones(){return this.getField(10)}get cents(){return this.getField(11)}get octaves(){return this.getField(12)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-36,max:36},"st",0),11:_.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:P.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-7,max:7},"oct",0)}}};var Wg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ZeitgeistDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitZeitgeistDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get groove(){return this.getField(10)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};var Lg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeuralAmpDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modelJson(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mono(){return this.getField(13)}get mix(){return this.getField(14)}get model(){return this.getField(20)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:p}),11:_.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),13:k.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:_.create({parent:this,fieldKey:14,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1,scaling:"linear"},"%",1),20:N.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};var Zg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VocoderDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VocoderDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitVocoderDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get carrierMinFreq(){return this.getField(10)}get carrierMaxFreq(){return this.getField(11)}get modulatorMinFreq(){return this.getField(12)}get modulatorMaxFreq(){return this.getField(13)}get qEnd(){return this.getField(14)}get qStart(){return this.getField(15)}get envRelease(){return this.getField(16)}get mix(){return this.getField(17)}get bandCount(){return this.getField(18)}get modulatorSource(){return this.getField(19)}get envAttack(){return this.getField(20)}get gain(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"carrierMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),11:_.create({parent:this,fieldKey:11,fieldName:"carrierMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),12:_.create({parent:this,fieldKey:12,fieldName:"modulatorMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),13:_.create({parent:this,fieldKey:13,fieldName:"modulatorMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),14:_.create({parent:this,fieldKey:14,fieldName:"qEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",2),15:_.create({parent:this,fieldKey:15,fieldName:"qStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",20),16:_.create({parent:this,fieldKey:16,fieldName:"envRelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",30),17:_.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:P.create({parent:this,fieldKey:18,fieldName:"bandCount",deprecated:!1,pointerRules:p},{values:[8,12,16]},"",16),19:I.create({parent:this,fieldKey:19,fieldName:"modulatorSource",deprecated:!1,pointerRules:p},"noise-pink"),20:_.create({parent:this,fieldKey:20,fieldName:"envAttack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:100,scaling:"exponential"},"ms",5),21:_.create({parent:this,fieldKey:21,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-20,max:20,scaling:"linear"},"dB",0),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Gg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WaveshaperDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WaveshaperDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWaveshaperDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get equation(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"equation",deprecated:!1,pointerRules:p},"hardclip"),11:_.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:40,scaling:"linear"},"dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB",0),13:_.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Hg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWerkstattDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var _a=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get value(){return this.getField(4)}get defaultValue(){return this.getField(5)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:_.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:_.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};var sl=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattSampleBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattSampleBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get file(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Sample,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:N.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};var qg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SpielwerkDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SpielwerkDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitSpielwerkDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var ec=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ApparatDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ApparatDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitApparatDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var tc=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoopInstrumentBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoopInstrumentBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitNoopInstrumentBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};var Jg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitCompositeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get cells(){return this.getField(10)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};var Yg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeCellBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get instrument(){return this.getField(2)}get midiEffects(){return this.getField(3)}get audioEffects(){return this.getField(4)}get index(){return this.getField(5)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:P.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};var Xg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:_.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:_.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var rc=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeCellBox",pointerRules:{accepts:[l.Editing,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get audioEffects(){return this.getField(2)}get index(){return this.getField(3)}get label(){return this.getField(4)}get minimized(){return this.getField(5)}get gain(){return this.getField(40)}get mute(){return this.getField(41)}get solo(){return this.getField(42)}get pan(){return this.getField(43)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.AudioEffectCompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:I.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:_.create({parent:this,fieldKey:40,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),41:k.create({parent:this,fieldKey:41,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:k.create({parent:this,fieldKey:42,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:_.create({parent:this,fieldKey:43,fieldName:"pan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Qg=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:_.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:_.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var ev=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FrequencySplitBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FrequencySplitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFrequencySplitBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}get crossover1(){return this.getField(14)}get crossover2(){return this.getField(15)}get crossover3(){return this.getField(16)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:I.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:_.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:_.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),14:_.create({parent:this,fieldKey:14,fieldName:"crossover1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",200),15:_.create({parent:this,fieldKey:15,fieldName:"crossover2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",1e3),16:_.create({parent:this,fieldKey:16,fieldName:"crossover3",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",5e3)}}};var tv=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModularBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get device(){return this.getField(2)}get editing(){return this.getField(3)}get modules(){return this.getField(11)}get connections(){return this.getField(12)}get label(){return this.getField(13)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:I.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:p})}}};var rv=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleConnectionBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleConnectionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleConnectionBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};var rn=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get collection(){return this.getField(1)}get label(){return this.getField(2)}get x(){return this.getField(3)}get y(){return this.getField(4)}get collapsed(){return this.getField(5)}get removable(){return this.getField(6)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModuleCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:P.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:P.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:k.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:k.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var iv=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioInputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:rn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var nv=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:rn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var av=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleDelayBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleDelayBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(11)}get time(){return this.getField(20)}initializeFields(){return{1:rn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:_.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var ov=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleMultiplierBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleMultiplierBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInputX(){return this.getField(10)}get voltageInputY(){return this.getField(11)}get voltageOutput(){return this.getField(12)}get multiplier(){return this.getField(20)}initializeFields(){return{1:rn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:_.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};var sv=class t extends T{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleGainBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleGainBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(12)}get gain(){return this.getField(20)}initializeFields(){return{1:rn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:_.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var mi;(function(t){t.write=(e,r)=>{if(r.type==="none")e.disconnect(),e.setValue(0);else if(r.type==="linear")e.disconnect(),e.setValue(1);else if(r.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(l.ValueInterpolation).at(0)?.box;U(n)?(x_(n,Zo),n.slope.setValue(r.slope)):Zo.create(e.box.graph,M.generate(),i=>{i.slope.setValue(r.slope),i.event.refer(e)})}},t.read=e=>{let r=e.pointerHub.incoming().at(0)?.box;return U(r)?(x_(r,Zo),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?di.None:e.getValue()===1?di.Linear:K("Unknown Interpolation value")}})(mi||(mi={}));var Yo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},et=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Np,nc,zt,kp,Xo,Bp,fo=class t{constructor(e,r){this.type="value-event",Np.set(this,new X),nc.set(this,void 0),zt.set(this,void 0),kp.set(this,void 0),Xo.set(this,void 0),Bp.set(this,!1),Yo(this,nc,e,"f"),Yo(this,zt,r,"f"),Yo(this,kp,et(this,Np,"f").own(new qh(()=>mi.read(et(this,zt,"f").interpolation))),"f");let n=()=>{et(this,kp,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};et(this,Np,"f").ownAll(et(this,zt,"f").subscribe(ze.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=pe.equals(et(this,zt,"f").index.address.fieldKeys,o),u=pe.equals(et(this,zt,"f").position.address.fieldKeys,o);s||u?a.requestSorting():a.onEventPropertyChanged()}}),et(this,zt,"f").interpolation.subscribe(n),et(this,zt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{et(this,Xo,"f").terminate(),Yo(this,Xo,i.subscribe(ze.Children,n),"f"),n()},onRemoved:()=>{et(this,Xo,"f").terminate(),Yo(this,Xo,fe.Empty,"f"),n()}})),Yo(this,Xo,et(this,zt,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(ze.Children,n)??fe.Empty,"f")}onSelected(){Yo(this,Bp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Yo(this,Bp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){et(this,Xo,"f").terminate(),et(this,Np,"f").terminate()}get box(){return et(this,zt,"f")}get uuid(){return et(this,zt,"f").address.uuid}get address(){return et(this,zt,"f").address}get position(){return et(this,zt,"f").position.getValue()}get index(){return et(this,zt,"f").index.getValue()}set interpolation(e){mi.write(et(this,zt,"f").interpolation,e)}get interpolation(){return et(this,kp,"f").get()}get value(){return et(this,zt,"f").value.getValue()}get isSelected(){return et(this,Bp,"f")}get collection(){return et(this,zt,"f").events.targetVertex.map(e=>et(this,nc,"f").boxAdapters.adapterFor(e.box,Nr))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=Un.create(et(this,nc,"f").boxGraph,M.generate(),a=>{a.position.setValue(r),a.index.setValue(n),a.events.refer(e?.events??this.collection.unwrap("collection").box.events),a.value.setValue(e?.value??this.value)});return mi.write(i.interpolation,e?.interpolation??this.interpolation),et(this,nc,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return et(this,zt,"f").position.setValue(e?.position??this.position),et(this,zt,"f").index.setValue(e?.index??this.index),et(this,zt,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),et(this,zt,"f").value.setValue(e?.value??this.value),mi.write(et(this,zt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Np=new WeakMap,nc=new WeakMap,zt=new WeakMap,kp=new WeakMap,Xo=new WeakMap,Bp=new WeakMap;fo.Comparator=(t,e)=>{if(t===e)return K(`${t} is equal to itself`);let r=t.position-e.position;if(r!==0)return r;let n=t.index-e.index;return n!==0?n:K(`${t} and ${e} are identical in terms of comparison`)};var Ip=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tp,Dp,Qo,nn,ll,ac,mo,Av,Nr=class t{constructor(e,r){Tp.add(this),Dp.set(this,new X),Qo.set(this,void 0),nn.set(this,void 0),ll.set(this,void 0),ac.set(this,void 0),mo.set(this,void 0),Ip(this,Qo,e,"f"),Ip(this,nn,r,"f"),Ip(this,ll,new me,"f"),Ip(this,ac,M.newSet(i=>i.uuid),"f"),Ip(this,mo,Or.create(fo.Comparator),"f");let n=i=>{let a=je(i.accept({visitValueEventBox:o=>Qe(this,Qo,"f").boxAdapters.adapterFor(o,fo)}),`Could not find adapter for ${i}`);Qe(this,ac,"f").add(a)&&(Qe(this,mo,"f").add(a),Qe(this,Tp,"m",Av).call(this))};Qe(this,nn,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Qe(this,Dp,"f").own(Qe(this,nn,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Qe(this,mo,"f").remove(Qe(this,ac,"f").removeByKey(i)),Qe(this,Tp,"m",Av).call(this)}})),Qe(this,Dp,"f").own(Qe(this,nn,"f").owners.pointerHub.subscribe({onAdded:()=>Qe(this,ll,"f").notify(this),onRemoved:()=>Qe(this,ll,"f").notify(this)}))}valueAt(e,r){return pg.valueAt(Qe(this,mo,"f"),e,r)}copy(){let e=Qe(this,Qo,"f").boxGraph,r=jn.create(e,M.generate());return Qe(this,mo,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Qe(this,Qo,"f").boxAdapters.adapterFor(r,t)}cut(e,r=A.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?b.None:b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return b.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return b.wrap(n);if(i.position===e)return b.wrap(i);if(n.interpolation.type==="none")return b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:a}=n,{position:o}=i,s=r.x(n.value),u=r.x(i.value),d=jP(s,u,(e-a)/(o-a));return b.wrap(this.createEvent({position:e,value:r.y(d),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:a}=n,{position:o}=i,s=r.x(n.value),u=r.x(i.value),d=o-a,m=e-a,x=ir.byHalf(d,s,ir.valueAt({slope:n.interpolation.slope,steps:d,y0:s,y1:u},d*.5),u),g=ir.valueAt(x,m),w=ir.slopeByHalf(s,ir.valueAt(x,m*.5),g);return mi.write(n.box.interpolation,di.Curve(w)),b.wrap(this.createEvent({position:e,value:r.y(g),index:0,interpolation:di.Curve(ir.slopeByHalf(g,ir.valueAt(x,(m+d)*.5),u))}))}return K("Unknown interpolation type")}subscribeChange(e){return Qe(this,ll,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=Qe(this,ac,"f").values().find(u=>u.position===a&&u.index===r);if(U(o)&&o.box.isAttached())return o.box.value.setValue(n),mi.write(o.box.interpolation,i),o;let s=Un.create(Qe(this,Qo,"f").boxGraph,M.generate(),u=>{u.position.setValue(e),u.index.setValue(r),u.value.setValue(n),u.events.refer(Qe(this,nn,"f").events)});return mi.write(s.interpolation,i),Qe(this,Qo,"f").boxAdapters.adapterFor(s,fo)}requestSorting(){Qe(this,mo,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Qe(this,Tp,"m",Av).call(this)}terminate(){Qe(this,Dp,"f").terminate()}get box(){return Qe(this,nn,"f")}get uuid(){return Qe(this,nn,"f").address.uuid}get address(){return Qe(this,nn,"f").address}get numOwners(){return Qe(this,nn,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Qe(this,mo,"f")}toString(){return`{ValueEventCollectionBox ${M.toString(Qe(this,nn,"f").address.uuid)}}`}};Dp=new WeakMap,Qo=new WeakMap,nn=new WeakMap,ll=new WeakMap,ac=new WeakMap,mo=new WeakMap,Tp=new WeakSet,Av=function(){Qe(this,ll,"f").notify(this)};var ul=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ue=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},cl,es,dl,or,pl,zp,Rp,Cp,oc,ts=class{constructor(e,r){cl.add(this),this.type="value-clip",es.set(this,new X),dl.set(this,void 0),or.set(this,void 0),pl.set(this,void 0),zp.set(this,void 0),Rp.set(this,void 0),Cp.set(this,fe.Empty),ul(this,dl,e,"f"),ul(this,or,r,"f"),ul(this,Rp,!0,"f"),ul(this,pl,Ue(this,es,"f").own(new en(!1)),"f"),ul(this,zp,Ue(this,es,"f").own(new me),"f"),Ue(this,es,"f").own(Ue(this,or,"f").pointerHub.subscribe({onAdded:()=>Ue(this,cl,"m",oc).call(this),onRemoved:()=>Ue(this,cl,"m",oc).call(this)})),Ue(this,es,"f").own(Ue(this,or,"f").subscribe(ze.Children,n=>Ue(this,cl,"m",oc).call(this))),Ue(this,es,"f").own(Ue(this,or,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ue(this,Cp,"f").terminate(),ul(this,Cp,n.match({none:()=>fe.Empty,some:({box:i})=>Ue(this,dl,"f").boxAdapters.adapterFor(i,Nr).subscribeChange(()=>Ue(this,cl,"m",oc).call(this))}),"f"),Ue(this,cl,"m",oc).call(this)})),ul(this,Rp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return Ue(this,pl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ue(this,zp,"f").subscribe(e)}accept(e){return $(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ue(this,or,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ue(this,or,"f").events.targetVertex.unwrap("events.target");Cu.create(Ue(this,dl,"f").boxGraph,M.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ue(this,or,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ue(this,pl,"f").setValue(!0)}onDeselected(){Ue(this,pl,"f").setValue(!1)}get isSelected(){return Ue(this,pl,"f").getValue()}terminate(){Ue(this,Cp,"f").terminate(),Ue(this,es,"f").terminate()}get box(){return Ue(this,or,"f")}get uuid(){return Ue(this,or,"f").address.uuid}get address(){return Ue(this,or,"f").address}get indexField(){return Ue(this,or,"f").index}get duration(){return Ue(this,or,"f").duration.getValue()}get mute(){return Ue(this,or,"f").mute.getValue()}get hue(){return Ue(this,or,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ue(this,or,"f").events.targetVertex.map(e=>Ue(this,dl,"f").boxAdapters.adapterFor(e.box,Nr))}get label(){return Ue(this,or,"f").label.getValue()}get trackBoxAdapter(){return Ue(this,Rp,"f")?b.None:Ue(this,or,"f").clips.targetVertex.map(e=>Ue(this,dl,"f").boxAdapters.adapterFor(e.box,sr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${M.toString(Ue(this,or,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};es=new WeakMap,dl=new WeakMap,or=new WeakMap,pl=new WeakMap,zp=new WeakMap,Rp=new WeakMap,Cp=new WeakMap,cl=new WeakSet,oc=function(){Ue(this,zp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Ev=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},an=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Op,Sv,fl,Up,Vp,Pv,sc=class{constructor(e){Op.add(this),this.type="transient-marker",Sv.set(this,new X),fl.set(this,void 0),Up.set(this,void 0),Vp.set(this,!1),Ev(this,fl,e,"f"),Ev(this,Up,new me,"f"),an(this,Sv,"f").own(e.subscribe(ze.Children,()=>an(this,Op,"m",Pv).call(this)))}onSelected(){Ev(this,Vp,!0,"f"),an(this,Op,"m",Pv).call(this)}onDeselected(){Ev(this,Vp,!1,"f"),an(this,Op,"m",Pv).call(this)}get box(){return an(this,fl,"f")}get uuid(){return an(this,fl,"f").address.uuid}get address(){return an(this,fl,"f").address}get position(){return an(this,fl,"f").position.getValue()}get isSelected(){return an(this,Vp,"f")}subscribe(e){return an(this,Up,"f").subscribe(e)}terminate(){an(this,Sv,"f").terminate()}};Sv=new WeakMap,fl=new WeakMap,Up=new WeakMap,Vp=new WeakMap,Op=new WeakSet,Pv=function(){an(this,Up,"f").notify()};var jp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$v,Kp,Fa,Wp,lc,Mv,Wn=class t{constructor(e,r){$v.set(this,new X),Kp.set(this,void 0),Fa.set(this,void 0),Wp.set(this,void 0),lc.set(this,void 0),Mv.set(this,void 0),jp(this,Kp,e,"f"),jp(this,Fa,r,"f"),jp(this,Wp,M.newSet(({uuid:n})=>n),"f"),jp(this,lc,Or.create(t.Comparator),"f"),jp(this,Mv,ng.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:a}=Promise.withResolvers(),o=this.getOrCreateLoader(),s=o.subscribe(u=>{u.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(o.data.unwrap("State mismatch"))):u.type==="error"&&(queueMicrotask(()=>s.terminate()),a(new Error(u.reason)))});return n}),"f"),kr(this,$v,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=kr(this,Kp,"f").boxAdapters.adapterFor(n.box,sc);kr(this,Wp,"f").add(i)&&kr(this,lc,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{kr(this,lc,"f").remove(kr(this,Wp,"f").removeByKey(n))}}))}get box(){return kr(this,Fa,"f")}get uuid(){return kr(this,Fa,"f").address.uuid}get address(){return kr(this,Fa,"f").address}get startInSeconds(){return kr(this,Fa,"f").startInSeconds.getValue()}get endInSeconds(){return kr(this,Fa,"f").endInSeconds.getValue()}get transients(){return kr(this,lc,"f")}get fileName(){return kr(this,Fa,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return kr(this,Mv,"f").call(this)}getOrCreateLoader(){return kr(this,Kp,"f").sampleManager.getOrCreate(kr(this,Fa,"f").address.uuid)}terminate(){kr(this,$v,"f").terminate()}};$v=new WeakMap,Kp=new WeakMap,Fa=new WeakMap,Wp=new WeakMap,lc=new WeakMap,Mv=new WeakMap;Wn.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),K("Events at the same position: "+t.position+", "+e.position)):r};var Lp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Zp,Nv,kv,ho,Hp,Gp,Bv,Aa=class{constructor(e,r){Zp.add(this),this.type="warp-marker",Nv.set(this,new X),kv.set(this,void 0),ho.set(this,void 0),Hp.set(this,void 0),Gp.set(this,!1),Lp(this,kv,e,"f"),Lp(this,ho,r,"f"),Lp(this,Hp,new me,"f"),Xr(this,Nv,"f").own(r.subscribe(ze.Children,()=>Xr(this,Zp,"m",Bv).call(this)))}onSelected(){Lp(this,Gp,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Xr(this,Zp,"m",Bv).call(this)}onDeselected(){Lp(this,Gp,!1,"f"),Xr(this,Zp,"m",Bv).call(this)}get box(){return Xr(this,ho,"f")}get uuid(){return Xr(this,ho,"f").address.uuid}get address(){return Xr(this,ho,"f").address}get position(){return Xr(this,ho,"f").position.getValue()}get seconds(){return Xr(this,ho,"f").seconds.getValue()}get isSelected(){return Xr(this,Gp,"f")}get optWarping(){return Xr(this,ho,"f").owner.targetVertex.map(e=>Xr(this,kv,"f").boxAdapters.adapterFor(e.box,Ea.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Xr(this,Hp,"f").subscribe(e)}terminate(){Xr(this,Nv,"f").terminate()}};Nv=new WeakMap,kv=new WeakMap,ho=new WeakMap,Hp=new WeakMap,Gp=new WeakMap,Zp=new WeakSet,Bv=function(){Xr(this,Hp,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var uc=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),K("Events at the same position: "+t.position+", "+e.position)):r};var qp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Iv,Tv,ml,hl,Jp,cc,Sa=class{constructor(e,r){Iv.set(this,new X),Tv.set(this,void 0),ml.set(this,void 0),hl.set(this,void 0),Jp.set(this,void 0),cc.set(this,void 0),qp(this,Tv,e,"f"),qp(this,ml,r,"f"),qp(this,hl,new me,"f"),qp(this,Jp,M.newSet(({uuid:n})=>n),"f"),qp(this,cc,Or.create(uc),"f"),Vr(this,Iv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Vr(this,Tv,"f").boxAdapters.adapterFor(n.box,Aa);Vr(this,Jp,"f").add(i)&&(Vr(this,cc,"f").add(i),Vr(this,hl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Vr(this,cc,"f").remove(Vr(this,Jp,"f").removeByKey(n)),Vr(this,hl,"f").notify()}}))}get box(){return Vr(this,ml,"f")}get uuid(){return Vr(this,ml,"f").address.uuid}get address(){return Vr(this,ml,"f").address}get warpMarkers(){return Vr(this,cc,"f")}clone(){let e=Vu.create(Vr(this,ml,"f").graph,M.generate());return this.warpMarkers.asArray().forEach(r=>xa.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Vr(this,hl,"f").subscribe(e)}onChanged(){Vr(this,hl,"f").notify()}terminate(){Vr(this,Iv,"f").terminate()}};Iv=new WeakMap,Tv=new WeakMap,ml=new WeakMap,hl=new WeakMap,Jp=new WeakMap,cc=new WeakMap;var Yp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},lr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Dv,Rv,Ln,gl,Xp,dc,Pa=class{constructor(e,r){Dv.set(this,new X),Rv.set(this,void 0),Ln.set(this,void 0),gl.set(this,void 0),Xp.set(this,void 0),dc.set(this,void 0),Yp(this,Rv,e,"f"),Yp(this,Ln,r,"f"),Yp(this,gl,new me,"f"),Yp(this,Xp,M.newSet(({uuid:n})=>n),"f"),Yp(this,dc,Or.create(uc),"f"),lr(this,Dv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=lr(this,Rv,"f").boxAdapters.adapterFor(n.box,Aa);lr(this,Xp,"f").add(i)&&(lr(this,dc,"f").add(i),lr(this,gl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{lr(this,dc,"f").remove(lr(this,Xp,"f").removeByKey(n)),lr(this,gl,"f").notify()}}))}get box(){return lr(this,Ln,"f")}get uuid(){return lr(this,Ln,"f").address.uuid}get address(){return lr(this,Ln,"f").address}get warpMarkers(){return lr(this,dc,"f")}get playbackRate(){return lr(this,Ln,"f").playbackRate.getValue()}get cents(){return Math.log2(lr(this,Ln,"f").playbackRate.getValue())*1200}set cents(e){lr(this,Ln,"f").playbackRate.setValue(lt(2**(e/1200),.5,2))}get transientPlayMode(){return to(lr(this,Ln,"f").transientPlayMode.getValue(),gg)}clone(){let e=Uu.create(lr(this,Ln,"f").graph,M.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>xa.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return lr(this,gl,"f").subscribe(e)}onChanged(){lr(this,gl,"f").notify()}terminate(){lr(this,Dv,"f").terminate()}};Dv=new WeakMap,Rv=new WeakMap,Ln=new WeakMap,gl=new WeakMap,Xp=new WeakMap,dc=new WeakMap;var Qp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Gt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Cv,zv,on,vl,ef,pc,$a=class{constructor(e,r){Cv.set(this,new X),zv.set(this,void 0),on.set(this,void 0),vl.set(this,void 0),ef.set(this,void 0),pc.set(this,void 0),Qp(this,zv,e,"f"),Qp(this,on,r,"f"),Qp(this,vl,new me,"f"),Qp(this,ef,M.newSet(({uuid:n})=>n),"f"),Qp(this,pc,Or.create(uc),"f"),Gt(this,Cv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Gt(this,zv,"f").boxAdapters.adapterFor(n.box,Aa);Gt(this,ef,"f").add(i)&&(Gt(this,pc,"f").add(i),Gt(this,vl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Gt(this,pc,"f").remove(Gt(this,ef,"f").removeByKey(n)),Gt(this,vl,"f").notify()}}))}get box(){return Gt(this,on,"f")}get uuid(){return Gt(this,on,"f").address.uuid}get address(){return Gt(this,on,"f").address}get warpMarkers(){return Gt(this,pc,"f")}get transpose(){return Gt(this,on,"f").transpose.getValue()}set transpose(e){Gt(this,on,"f").transpose.setValue(e)}get cents(){return Gt(this,on,"f").transpose.getValue()*100}set cents(e){Gt(this,on,"f").transpose.setValue(e/100)}clone(){let e=ju.create(Gt(this,on,"f").graph,M.generate());return e.transpose.setValue(Gt(this,on,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>xa.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Gt(this,vl,"f").subscribe(e)}onChanged(){Gt(this,vl,"f").notify()}terminate(){Gt(this,Cv,"f").terminate()}};Cv=new WeakMap,zv=new WeakMap,on=new WeakMap,vl=new WeakMap,ef=new WeakMap,pc=new WeakMap;var Ea;(function(t){t.isAudioPlayMode=e=>e instanceof Sa||e instanceof Pa||e instanceof $a})(Ea||(Ea={}));var Ii=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},we=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xl,fc,yl,Ot,wl,bl,tf,nf,rf,rs,mc,hc,gc,vc=class{constructor(e,r){xl.add(this),this.type="audio-clip",fc.set(this,new X),yl.set(this,void 0),Ot.set(this,void 0),wl.set(this,void 0),bl.set(this,void 0),tf.set(this,void 0),nf.set(this,void 0),rf.set(this,void 0),rs.set(this,b.None),mc.set(this,b.None),hc.set(this,fe.Empty),Ii(this,yl,e,"f"),Ii(this,Ot,r,"f"),Ii(this,rf,!0,"f"),Ii(this,wl,new $r,"f"),Ii(this,bl,we(this,fc,"f").own(new en(!1)),"f"),Ii(this,tf,qs.aware(e.tempoMap,r.timeBase,r.duration),"f"),Ii(this,nf,we(this,fc,"f").own(new me),"f"),we(this,fc,"f").ownAll(we(this,Ot,"f").pointerHub.subscribe({onAdded:()=>we(this,xl,"m",gc).call(this),onRemoved:()=>we(this,xl,"m",gc).call(this)}),we(this,Ot,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{we(this,hc,"f").terminate(),n.match({none:()=>we(this,wl,"f").clear(),some:({box:i})=>{let a=we(this,yl,"f").boxAdapters.adapterFor(i,Ea.isAudioPlayMode);Ii(this,hc,a.subscribe(()=>we(this,xl,"m",gc).call(this)),"f"),we(this,wl,"f").wrap(a)}})}),we(this,Ot,"f").file.catchupAndSubscribe(n=>{Ii(this,rs,n.targetVertex.map(i=>we(this,yl,"f").boxAdapters.adapterFor(i.box,Wn)),"f"),we(this,mc,"f").ifSome(i=>i.terminate()),Ii(this,mc,we(this,rs,"f").map(i=>i.getOrCreateLoader().subscribe(()=>we(this,xl,"m",gc).call(this))),"f")}),we(this,Ot,"f").subscribe(ze.Children,n=>we(this,xl,"m",gc).call(this))),Ii(this,rf,!1,"f")}catchupAndSubscribeSelected(e){return we(this,bl,"f").catchupAndSubscribe(e)}subscribeChange(e){return we(this,nf,"f").subscribe(e)}accept(e){return $(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());Ou.create(we(this,yl,"f").boxGraph,M.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.gain.setValue(this.gain.getValue()),n.timeBase.setValue(this.timeBase),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(we(this,Ot,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(we(this,Ot,"f").file.targetVertex.unwrap("file.target")),n.events.refer(we(this,Ot,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){we(this,bl,"f").setValue(!0)}onDeselected(){we(this,bl,"f").setValue(!1)}get isSelected(){return we(this,bl,"f").getValue()}get box(){return we(this,Ot,"f")}get uuid(){return we(this,Ot,"f").address.uuid}get address(){return we(this,Ot,"f").address}get indexField(){return we(this,Ot,"f").index}get duration(){return we(this,tf,"f").toPPQN(0)}set duration(e){we(this,tf,"f").fromPPQN(e,0)}get mute(){return we(this,Ot,"f").mute.getValue()}get hue(){return we(this,Ot,"f").hue.getValue()}get gain(){return we(this,Ot,"f").gain}get file(){return we(this,rs,"f").unwrap("Cannot access file.")}get optFile(){return we(this,rs,"f")}get observableOptPlayMode(){return we(this,wl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return b.None}get timeBase(){return to(we(this,Ot,"f").timeBase.getValue(),Yr)}get waveformOffset(){return we(this,Ot,"f").waveformOffset}get isPlayModeNoStretch(){return we(this,Ot,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>xt(e,Sa)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>xt(e,Pa)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>xt(e,$a)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Ea.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(we(this,rs,"f").isEmpty())return"No Audio File";let e=we(this,rs,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):we(this,Ot,"f").label.getValue()}get trackBoxAdapter(){return we(this,rf,"f")?b.None:we(this,Ot,"f").clips.targetVertex.map(e=>we(this,yl,"f").boxAdapters.adapterFor(e.box,sr))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return we(this,wl,"f").nonEmpty()}terminate(){we(this,mc,"f").ifSome(e=>e.terminate()),Ii(this,mc,b.None,"f"),we(this,hc,"f").terminate(),Ii(this,hc,fe.Empty,"f"),we(this,fc,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${M.toString(we(this,Ot,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};fc=new WeakMap,yl=new WeakMap,Ot=new WeakMap,wl=new WeakMap,bl=new WeakMap,tf=new WeakMap,nf=new WeakMap,rf=new WeakMap,rs=new WeakMap,mc=new WeakMap,hc=new WeakMap,xl=new WeakSet,gc=function(){we(this,nf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var af=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ht=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xc,gr,Ov,of,_l=class t{constructor(e,r){this.type="note-event",xc.set(this,void 0),gr.set(this,void 0),Ov.set(this,void 0),of.set(this,!1),af(this,xc,e,"f"),af(this,gr,r,"f"),af(this,Ov,Ht(this,gr,"f").subscribe(ze.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=pe.equals(Ht(this,gr,"f").pitch.address.fieldKeys,a),s=pe.equals(Ht(this,gr,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){af(this,of,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){af(this,of,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Ht(this,Ov,"f").terminate()}get box(){return Ht(this,gr,"f")}get uuid(){return Ht(this,gr,"f").address.uuid}get address(){return Ht(this,gr,"f").address}get position(){return Ht(this,gr,"f").position.getValue()}get duration(){return Ht(this,gr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Ht(this,gr,"f").velocity.getValue()}get pitch(){return Ht(this,gr,"f").pitch.getValue()}get cent(){return Ht(this,gr,"f").cent.getValue()}get chance(){return Ht(this,gr,"f").chance.getValue()}get playCount(){return Ht(this,gr,"f").playCount.getValue()}get playCurve(){return Ht(this,gr,"f").playCurve.getValue()}get isSelected(){return Ht(this,of,"f")}get collection(){return Ht(this,gr,"f").events.targetVertex.map(e=>Ht(this,xc,"f").boxAdapters.adapterFor(e.box,sn))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:r}=this.collection.unwrap();return e===r?.5:1-(this.pitch-e)/(r-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return Ht(this,xc,"f").boxAdapters.adapterFor(Lo.create(Ht(this,xc,"f").boxGraph,M.generate(),r=>{r.position.setValue(e?.position??this.position),r.duration.setValue(e?.duration??this.duration),r.pitch.setValue(e?.pitch??this.pitch),r.playCount.setValue(e?.playCount??this.playCount),r.events.refer(e?.events??this.collection.unwrap("collection").box.events),r.velocity.setValue(this.velocity),r.cent.setValue(this.cent),r.chance.setValue(this.chance)}),t)}computeCurveValue(e){return Iu.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=pe.create(i=>{let a=Math.floor(this.computeCurveValue(i/e)*this.duration),o=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+a),duration:Math.max(1,o-a),playCount:1,events:r})},e);return Ht(this,gr,"f").delete(),n}};xc=new WeakMap,gr=new WeakMap,Ov=new WeakMap,of=new WeakMap;var Ma=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},go,sf,is,Zn,Fl,lf,hi,Uv,jv,Kv,ns,Vv,uf,sn=class t{constructor(e,r){go.add(this),sf.set(this,new X),is.set(this,void 0),Zn.set(this,void 0),Fl.set(this,void 0),lf.set(this,void 0),hi.set(this,void 0),Uv.set(this,60),jv.set(this,60),Kv.set(this,0),ns.set(this,!1),Ma(this,is,e,"f"),Ma(this,Zn,r,"f"),Ma(this,Fl,new me,"f"),Ma(this,lf,M.newSet(n=>n.uuid),"f"),Ma(this,hi,Or.create(Iu.Comparator),"f"),Pe(this,sf,"f").own(Pe(this,Zn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Pe(this,is,"f").boxAdapters.adapterFor(n,_l);Pe(this,lf,"f").add(i)&&(Pe(this,hi,"f").add(i),Pe(this,go,"m",Vv).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Pe(this,hi,"f").remove(Pe(this,lf,"f").removeByKey(n)),Pe(this,go,"m",Vv).call(this)}})),Pe(this,sf,"f").own(Pe(this,Zn,"f").owners.pointerHub.subscribe({onAdded:()=>Pe(this,Fl,"f").notify(this),onRemoved:()=>Pe(this,Fl,"f").notify(this)}))}copy(){let e=Pe(this,is,"f").boxGraph,r=po.create(e,M.generate());return Pe(this,hi,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Pe(this,is,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Pe(this,is,"f").boxAdapters.adapterFor(Lo.create(Pe(this,is,"f").boxGraph,M.generate(),u=>{u.position.setValue(e),u.duration.setValue(r),u.velocity.setValue(n),u.pitch.setValue(i),u.chance.setValue(a),u.playCount.setValue(o),u.cent.setValue(s),u.events.refer(Pe(this,Zn,"f").events)}),_l)}subscribeChange(e){return Pe(this,Fl,"f").subscribe(e)}selectable(){return Pe(this,hi,"f").asArray()}selectableAt(e){for(let r of Pe(this,hi,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return nr.one(r);return nr.empty()}selectablesBetween(e,r){let n=[],i=Pe(this,hi,"f").asArray(),a=Pe(this,hi,"f").ceilFirstIndex(r.u);for(let o=0;o<a;o++){let s=i[o];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=r.v&&n.push(s)}return n}overlapping(e,r,n){let i=[];for(let a of Pe(this,hi,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Pe(this,hi,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Pe(this,go,"m",Vv).call(this)}terminate(){Pe(this,sf,"f").terminate()}get box(){return Pe(this,Zn,"f")}get uuid(){return Pe(this,Zn,"f").address.uuid}get address(){return Pe(this,Zn,"f").address}get numOwners(){return Pe(this,Zn,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Pe(this,ns,"f")||Pe(this,go,"m",uf).call(this),Pe(this,hi,"f")}get minPitch(){return Pe(this,ns,"f")||Pe(this,go,"m",uf).call(this),Pe(this,Uv,"f")}get maxPitch(){return Pe(this,ns,"f")||Pe(this,go,"m",uf).call(this),Pe(this,jv,"f")}get maxDuration(){return Pe(this,ns,"f")||Pe(this,go,"m",uf).call(this),Pe(this,Kv,"f")}toString(){return`{NoteEventCollectionBox ${M.toString(Pe(this,Zn,"f").address.uuid)}}`}};sf=new WeakMap,is=new WeakMap,Zn=new WeakMap,Fl=new WeakMap,lf=new WeakMap,hi=new WeakMap,Uv=new WeakMap,jv=new WeakMap,Kv=new WeakMap,ns=new WeakMap,go=new WeakSet,Vv=function(){Ma(this,ns,!1,"f"),Pe(this,Fl,"f").notify(this)},uf=function(){let e=127,r=0,n=0;Pe(this,hi,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),Ma(this,Uv,e,"f"),Ma(this,jv,r,"f"),Ma(this,Kv,n,"f"),Ma(this,ns,!0,"f")};var Al=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},We=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},El,yc,Sl,ur,Pl,pf,cf,df,wc,bc=class{constructor(e,r){El.add(this),this.type="note-clip",yc.set(this,new X),Sl.set(this,void 0),ur.set(this,void 0),Pl.set(this,void 0),pf.set(this,void 0),cf.set(this,void 0),df.set(this,fe.Empty),Al(this,Sl,e,"f"),Al(this,ur,r,"f"),Al(this,cf,!0,"f"),Al(this,Pl,We(this,yc,"f").own(new en(!1)),"f"),Al(this,pf,We(this,yc,"f").own(new me),"f"),We(this,yc,"f").ownAll(We(this,ur,"f").pointerHub.subscribe({onAdded:()=>We(this,El,"m",wc).call(this),onRemoved:()=>We(this,El,"m",wc).call(this)}),We(this,ur,"f").subscribe(ze.Children,n=>We(this,El,"m",wc).call(this)),We(this,ur,"f").events.catchupAndSubscribe(({targetVertex:n})=>{We(this,df,"f").terminate(),Al(this,df,n.match({none:()=>fe.Empty,some:({box:i})=>We(this,Sl,"f").boxAdapters.adapterFor(i,sn).subscribeChange(()=>We(this,El,"m",wc).call(this))}),"f"),We(this,El,"m",wc).call(this)})),Al(this,cf,!1,"f")}catchupAndSubscribeSelected(e){return We(this,Pl,"f").catchupAndSubscribe(e)}subscribeChange(e){return We(this,pf,"f").subscribe(e)}accept(e){return $(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&We(this,ur,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:We(this,ur,"f").events.targetVertex.unwrap("events.target");Ru.create(We(this,Sl,"f").boxGraph,M.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(We(this,ur,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){We(this,Pl,"f").setValue(!0)}onDeselected(){We(this,Pl,"f").setValue(!1)}get isSelected(){return We(this,Pl,"f").getValue()}terminate(){We(this,df,"f").terminate(),We(this,yc,"f").terminate()}get box(){return We(this,ur,"f")}get uuid(){return We(this,ur,"f").address.uuid}get address(){return We(this,ur,"f").address}get indexField(){return We(this,ur,"f").index}get duration(){return We(this,ur,"f").duration.getValue()}get mute(){return We(this,ur,"f").mute.getValue()}get hue(){return We(this,ur,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return We(this,ur,"f").events.targetVertex.map(e=>We(this,Sl,"f").boxAdapters.adapterFor(e.box,sn))}get label(){return We(this,ur,"f").label.getValue()}get trackBoxAdapter(){return We(this,cf,"f")?b.None:We(this,ur,"f").clips.targetVertex.map(e=>We(this,Sl,"f").boxAdapters.adapterFor(e.box,sr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${M.toString(We(this,ur,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};yc=new WeakMap,Sl=new WeakMap,ur=new WeakMap,Pl=new WeakMap,pf=new WeakMap,cf=new WeakMap,df=new WeakMap,El=new WeakSet,wc=function(){We(this,pf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var a$={for:(t,e)=>je(e.accept({visitNoteClipBox:r=>t.adapterFor(r,bc),visitValueClipBox:r=>t.adapterFor(r,ts),visitAudioClipBox:r=>t.adapterFor(r,vc)}),"")};var Wv=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},as=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Lv,_c,ff,mf,Zv=class{constructor(e,r){Lv.set(this,void 0),_c.set(this,void 0),ff.set(this,void 0),mf.set(this,void 0),Wv(this,Lv,e,"f"),Wv(this,_c,new X,"f"),Wv(this,ff,as(this,_c,"f").own(new me),"f"),Wv(this,mf,as(this,_c,"f").own(Ct.create(e.box.clips,n=>a$.for(r,n),l.ClipCollection)),"f"),as(this,mf,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return as(this,Lv,"f")}get collection(){return as(this,mf,"f")}dispatchChange(){as(this,ff,"f").notify()}subscribeChanges(e){return as(this,ff,"f").subscribe(e)}terminate(){as(this,_c,"f").terminate()}};Lv=new WeakMap,_c=new WeakMap,ff=new WeakMap,mf=new WeakMap;var VT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ln=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qr,Gv=class{constructor(e){Qr.set(this,void 0),VT(this,Qr,e,"f")}get inField(){return ln(this,Qr,"f").in}get outField(){return ln(this,Qr,"f").out}get inSlopeField(){return ln(this,Qr,"f").inSlope}get outSlopeField(){return ln(this,Qr,"f").outSlope}get in(){return ln(this,Qr,"f").in.getValue()}get out(){return ln(this,Qr,"f").out.getValue()}get inSlope(){return ln(this,Qr,"f").inSlope.getValue()}get outSlope(){return ln(this,Qr,"f").outSlope.getValue()}get hasFading(){return ug.hasFading(this)}copyTo(e){e.in.setValue(this.in),e.out.setValue(this.out),e.inSlope.setValue(this.inSlope),e.outSlope.setValue(this.outSlope)}reset(){ln(this,Qr,"f").in.setValue(0),ln(this,Qr,"f").out.setValue(0),ln(this,Qr,"f").inSlope.setValue(.75),ln(this,Qr,"f").outSlope.setValue(.25)}};Qr=new WeakMap;var wt=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Y=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ti,hf,un,tt,Fc,Ac,Ec,gf,Gn,vf,os,Sc,Pc,$c,Mc,Nc,kc,Bc,cn,Ic=class t{constructor(e,r){Ti.add(this),this.type="audio-region",hf.set(this,void 0),un.set(this,void 0),tt.set(this,void 0),Fc.set(this,void 0),Ac.set(this,void 0),Ec.set(this,void 0),gf.set(this,void 0),Gn.set(this,void 0),vf.set(this,void 0),os.set(this,b.None),Sc.set(this,fe.Empty),Pc.set(this,fe.Empty),$c.set(this,fe.Empty),Mc.set(this,fe.Empty),Nc.set(this,void 0),kc.set(this,Number.NaN),Bc.set(this,Number.NaN),wt(this,un,e,"f"),wt(this,tt,r,"f"),wt(this,hf,new X,"f");let{timeBase:n,duration:i,loopDuration:a}=r;wt(this,Fc,qs.aware(e.tempoMap,n,i),"f"),wt(this,Ac,qs.aware(e.tempoMap,n,a),"f"),wt(this,Ec,new $r,"f"),wt(this,gf,new me,"f"),wt(this,Gn,new Gv(r.fading),"f"),wt(this,Nc,!1,"f"),wt(this,vf,!0,"f"),Y(this,hf,"f").ownAll(Y(this,tt,"f").pointerHub.subscribe({onAdded:()=>Y(this,Ti,"m",cn).call(this),onRemoved:()=>Y(this,Ti,"m",cn).call(this)}),Y(this,tt,"f").file.catchupAndSubscribe(o=>{wt(this,os,o.targetVertex.map(s=>Y(this,un,"f").boxAdapters.adapterFor(s.box,Wn)),"f"),Y(this,Sc,"f").terminate(),wt(this,Sc,Y(this,os,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>Y(this,Ti,"m",cn).call(this)),fe.Empty),"f")}),Y(this,tt,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{Y(this,Pc,"f").terminate(),o.match({none:()=>Y(this,Ec,"f").clear(),some:({box:s})=>{let u=Y(this,un,"f").boxAdapters.adapterFor(s,Ea.isAudioPlayMode);wt(this,Pc,u.subscribe(()=>Y(this,Ti,"m",cn).call(this)),"f"),Y(this,Ec,"f").wrap(u)}})}),Y(this,tt,"f").timeBase.catchupAndSubscribe(o=>{Y(this,$c,"f").terminate(),to(o.getValue(),Yr)===Yr.Seconds&&wt(this,$c,e.tempoMap.subscribe(()=>Y(this,Ti,"m",cn).call(this)),"f")}),Y(this,tt,"f").subscribe(ze.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();Y(this,tt,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),Y(this,Ti,"m",cn).call(this)):Y(this,Ti,"m",cn).call(this)}}),Y(this,tt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Y(this,Mc,"f").terminate(),wt(this,Mc,o.match({none:()=>fe.Empty,some:({box:s})=>Y(this,un,"f").boxAdapters.adapterFor(s,Nr).subscribeChange(()=>Y(this,Ti,"m",cn).call(this))}),"f"),Y(this,Ti,"m",cn).call(this)})),wt(this,vf,!1,"f")}subscribeChange(e){return Y(this,gf,"f").subscribe(e)}accept(e){return $(e.visitAudioRegionBoxAdapter,this)}onSelected(){wt(this,Nc,!0,"f"),Y(this,Ti,"m",cn).call(this)}onDeselected(){wt(this,Nc,!1,"f"),Y(this,Ti,"m",cn).call(this)}get isSelected(){return Y(this,Nc,"f")}get box(){return Y(this,tt,"f")}get uuid(){return Y(this,tt,"f").address.uuid}get address(){return Y(this,tt,"f").address}get position(){return Y(this,tt,"f").position.getValue()}get duration(){return Number.isNaN(Y(this,kc,"f"))&&wt(this,kc,Y(this,Fc,"f").toPPQN(this.position),"f"),Y(this,kc,"f")}get complete(){return this.position+this.duration}get loopOffset(){return Y(this,tt,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(Y(this,Bc,"f"))&&wt(this,Bc,Y(this,Ac,"f").toPPQN(this.position),"f"),Y(this,Bc,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return Y(this,Fc,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return Y(this,Ac,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return Y(this,tt,"f").mute.getValue()}get hue(){return Y(this,tt,"f").hue.getValue()}get gain(){return Y(this,tt,"f").gain}get fading(){return Y(this,Gn,"f")}get file(){return Y(this,os,"f").unwrap("Cannot access file.")}get optFile(){return Y(this,os,"f")}get observableOptPlayMode(){return Y(this,Ec,"f")}get timeBase(){return to(Y(this,tt,"f").timeBase.getValue(),Yr)}get waveformOffset(){return Y(this,tt,"f").waveformOffset}get isPlayModeNoStretch(){return Y(this,tt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>xt(e,Sa)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>xt(e,Pa)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>xt(e,$a)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Ea.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Y(this,os,"f").isEmpty())return"No Audio File";let e=Y(this,os,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Y(this,tt,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}get trackBoxAdapter(){return Y(this,tt,"f").regions.targetVertex.map(e=>Y(this,un,"f").boxAdapters.adapterFor(e.box,sr))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Y(this,tt,"f").events.targetVertex.map(e=>Y(this,un,"f").boxAdapters.adapterFor(e.box,Nr))}set position(e){Y(this,tt,"f").position.setValue(e)}set duration(e){Y(this,Fc,"f").fromPPQN(e,this.position);let r=Y(this,Gn,"f").in+Y(this,Gn,"f").out;if(r>e){let n=e/r;Y(this,Gn,"f").inField.setValue(Y(this,Gn,"f").in*n),Y(this,Gn,"f").outField.setValue(Y(this,Gn,"f").out*n)}}set loopOffset(e){Y(this,tt,"f").loopOffset.setValue(Zs(e,this.loopDuration))}set loopDuration(e){Y(this,Ac,"f").fromPPQN(e,this.position)}moveContentStart(e){let r=this.position,n=r+e;if(this.position=n,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e,this.timeBase===Yr.Seconds){let i=e>=0?Y(this,un,"f").tempoMap.intervalToSeconds(r,n):-Y(this,un,"f").tempoMap.intervalToSeconds(n,r);Y(this,tt,"f").waveformOffset.setValue(this.waveformOffset.getValue()+i)}else this.optWarpMarkers.ifSome(i=>i.asArray().forEach(a=>a.box.position.setValue(a.position-e)))}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners,i=this.observableOptPlayMode.map(o=>o.clone()),a=Y(this,un,"f").boxAdapters.adapterFor(Go.create(Y(this,un,"f").boxGraph,M.generate(),o=>{o.timeBase.setValue(Y(this,tt,"f").timeBase.getValue()),o.position.setValue(e?.position??Y(this,tt,"f").position.getValue()),o.regions.refer(e?.target??Y(this,tt,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(Y(this,tt,"f").file.targetVertex.unwrap("file.target")),o.events.refer(n),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),o.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>o.playMode.refer(s)),Y(this,Gn,"f").copyTo(o.fading)}),t);return a.loopDuration=e?.loopDuration??this.resolveLoopDuration(a.position),a.loopOffset=e?.loopOffset??this.loopOffset,a.duration=e?.duration??this.resolveDuration(a.position),a}consolidate(){}canFlatten(e){return e.length>0&&pe.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){return b.None}terminate(){Y(this,Sc,"f").terminate(),wt(this,Sc,fe.Empty,"f"),Y(this,$c,"f").terminate(),wt(this,$c,fe.Empty,"f"),Y(this,Pc,"f").terminate(),wt(this,Pc,fe.Empty,"f"),Y(this,Mc,"f").terminate(),wt(this,Mc,fe.Empty,"f"),Y(this,hf,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${M.toString(Y(this,tt,"f").address.uuid)}}`}};hf=new WeakMap,un=new WeakMap,tt=new WeakMap,Fc=new WeakMap,Ac=new WeakMap,Ec=new WeakMap,gf=new WeakMap,Gn=new WeakMap,vf=new WeakMap,os=new WeakMap,Sc=new WeakMap,Pc=new WeakMap,$c=new WeakMap,Mc=new WeakMap,Nc=new WeakMap,kc=new WeakMap,Bc=new WeakMap,Ti=new WeakSet,cn=function(){wt(this,kc,Number.NaN,"f"),wt(this,Bc,Number.NaN,"f"),!Y(this,vf,"f")&&(Y(this,gf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var vo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ne=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Na,Hv,ka,bt,wf,xf,Tc,yf,xo,Dc=class t{constructor(e,r){Na.add(this),this.type="note-region",Hv.set(this,new X),ka.set(this,void 0),bt.set(this,void 0),wf.set(this,void 0),xf.set(this,void 0),Tc.set(this,void 0),yf.set(this,fe.Empty),vo(this,ka,e,"f"),vo(this,bt,r,"f"),vo(this,wf,new me,"f"),vo(this,Tc,!1,"f"),vo(this,xf,!0,"f"),Ne(this,Hv,"f").ownAll(Ne(this,bt,"f").pointerHub.subscribe({onAdded:()=>Ne(this,Na,"m",xo).call(this),onRemoved:()=>Ne(this,Na,"m",xo).call(this)}),Ne(this,bt,"f").subscribe(ze.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ne(this,bt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ne(this,Na,"m",xo).call(this)):Ne(this,Na,"m",xo).call(this)}}),Ne(this,bt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ne(this,yf,"f").terminate(),vo(this,yf,n.match({none:()=>fe.Empty,some:({box:i})=>Ne(this,ka,"f").boxAdapters.adapterFor(i,sn).subscribeChange(()=>Ne(this,Na,"m",xo).call(this))}),"f"),Ne(this,Na,"m",xo).call(this)})),vo(this,xf,!1,"f")}set position(e){Ne(this,bt,"f").position.setValue(e)}set duration(e){Ne(this,bt,"f").duration.setValue(e)}set loopOffset(e){Ne(this,bt,"f").loopOffset.setValue(e)}set loopDuration(e){Ne(this,bt,"f").loopDuration.setValue(e)}isNoteRegion(){return!0}isAudioRegion(){return!1}isValueRegion(){return!1}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}subscribeChange(e){return Ne(this,wf,"f").subscribe(e)}accept(e){return $(e.visitNoteRegionBoxAdapter,this)}onSelected(){vo(this,Tc,!0,"f"),Ne(this,Na,"m",xo).call(this)}onDeselected(){vo(this,Tc,!1,"f"),Ne(this,Na,"m",xo).call(this)}get isSelected(){return Ne(this,Tc,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=no.globalToLocal(this,e);for(let a of n.events.iterateFrom(i-n.maxDuration)){if(i<a.position)return;i<a.complete&&(yield a.copyAsNoteEvent())}}terminate(){Ne(this,yf,"f").terminate(),Ne(this,Hv,"f").terminate()}get box(){return Ne(this,bt,"f")}get uuid(){return Ne(this,bt,"f").address.uuid}get address(){return Ne(this,bt,"f").address}get position(){return Ne(this,bt,"f").position.getValue()}get duration(){return Ne(this,bt,"f").duration.getValue()}get loopOffset(){return Ne(this,bt,"f").loopOffset.getValue()}get loopDuration(){return Ne(this,bt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Ne(this,bt,"f").mute.getValue()}get hue(){return Ne(this,bt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Ne(this,bt,"f").events.targetVertex.map(e=>Ne(this,ka,"f").boxAdapters.adapterFor(e.box,sn))}get label(){return Ne(this,bt,"f").label.getValue()}get trackBoxAdapter(){return Ne(this,xf,"f")?b.None:Ne(this,bt,"f").regions.targetVertex.map(e=>Ne(this,ka,"f").boxAdapters.adapterFor(e.box,sr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Ne(this,ka,"f").boxAdapters.adapterFor(nl.create(Ne(this,ka,"f").boxGraph,M.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Ne(this,bt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=Ne(this,ka,"f").boxGraph,n=po.create(r,M.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Ne(this,bt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&pe.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return b.None;let r=Ne(this,ka,"f").boxGraph,n=e.toSorted(zo.Comparator),i=pe.getFirst(n,"Internal error (no first)"),a=pe.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=po.create(r,M.generate()),m=Array.from(u.regions.collection.iterateRange(o,s));return m.filter(x=>x.isSelected).forEach(x=>{let g=x;for(let{resultStart:w,resultEnd:F,rawStart:B}of no.locateLoops(g,g.position,g.complete)){let V=Math.floor(w-B),W=Math.floor(F-B);for(let z of g.optCollection.unwrap("optCollection").events.iterateRange(V,W))z.copyTo({position:z.position+B-i.position,events:d.events})}}),m.forEach(({box:x})=>x.delete()),b.wrap(nl.create(r,M.generate(),x=>{x.position.setValue(o),x.duration.setValue(s-o),x.loopDuration.setValue(s-o),x.loopOffset.setValue(0),x.hue.setValue(this.hue),x.mute.setValue(this.mute),x.label.setValue(this.label),x.events.refer(d.owners),x.regions.refer(u.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${M.toString(Ne(this,bt,"f").address.uuid)} p: ${Te.toString(this.position)}, c: ${Te.toString(this.complete)}}`}};Hv=new WeakMap,ka=new WeakMap,bt=new WeakMap,wf=new WeakMap,xf=new WeakMap,Tc=new WeakMap,yf=new WeakMap,Na=new WeakSet,xo=function(){Ne(this,wf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var yo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ee=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Hn,Rc,Ba,_t,Ff,Cc,bf,_f,Ia,wo=class t{constructor(e,r){Hn.add(this),this.type="value-region",Rc.set(this,new X),Ba.set(this,void 0),_t.set(this,void 0),Ff.set(this,void 0),Cc.set(this,void 0),bf.set(this,void 0),_f.set(this,fe.Empty),yo(this,Ba,e,"f"),yo(this,_t,r,"f"),yo(this,bf,!0,"f"),yo(this,Ff,new me,"f"),yo(this,Cc,!1,"f"),Ee(this,Rc,"f").own(Ee(this,_t,"f").pointerHub.subscribe({onAdded:()=>Ee(this,Hn,"m",Ia).call(this),onRemoved:()=>Ee(this,Hn,"m",Ia).call(this)})),Ee(this,Rc,"f").own(Ee(this,_t,"f").subscribe(ze.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ee(this,_t,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ee(this,Hn,"m",Ia).call(this)):Ee(this,Hn,"m",Ia).call(this)}})),Ee(this,Rc,"f").own(Ee(this,_t,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ee(this,_f,"f").terminate(),yo(this,_f,n.match({none:()=>fe.Empty,some:({box:i})=>Ee(this,Ba,"f").boxAdapters.adapterFor(i,Nr).subscribeChange(()=>Ee(this,Hn,"m",Ia).call(this))}),"f"),Ee(this,Hn,"m",Ia).call(this)})),yo(this,bf,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(no.globalToLocal(this,e),r)}incomingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap().events.greaterEqual(0);return U(n)&&n.position===0?n.value:this.valueAt(this.position,e)}outgoingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(no.globalToLocal(this,this.complete),e)}subscribeChange(e){return Ee(this,Ff,"f").subscribe(e)}accept(e){return $(e.visitValueRegionBoxAdapter,this)}onSelected(){yo(this,Cc,!0,"f"),Ee(this,Hn,"m",Ia).call(this)}onDeselected(){yo(this,Cc,!1,"f"),Ee(this,Hn,"m",Ia).call(this)}get isSelected(){return Ee(this,Cc,"f")}onValuesPropertyChanged(){Ee(this,Hn,"m",Ia).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Ee(this,_f,"f").terminate(),Ee(this,Rc,"f").terminate()}get box(){return Ee(this,_t,"f")}get uuid(){return Ee(this,_t,"f").address.uuid}get address(){return Ee(this,_t,"f").address}get position(){return Ee(this,_t,"f").position.getValue()}get duration(){return Ee(this,_t,"f").duration.getValue()}get loopOffset(){return Ee(this,_t,"f").loopOffset.getValue()}get loopDuration(){return Ee(this,_t,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}isNoteRegion(){return!1}isAudioRegion(){return!1}isValueRegion(){return!0}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Ee(this,_t,"f").mute.getValue()}get hue(){return Ee(this,_t,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ee(this,_t,"f").events.targetVertex.map(e=>Ee(this,Ba,"f").boxAdapters.adapterFor(e.box,Nr))}get label(){return Ee(this,_t,"f").label.getValue()}get trackBoxAdapter(){return Ee(this,bf,"f")?b.None:Ee(this,_t,"f").regions.targetVertex.map(e=>Ee(this,Ba,"f").boxAdapters.adapterFor(e.box,sr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Ee(this,_t,"f").position.setValue(e)}set duration(e){Ee(this,_t,"f").duration.setValue(e)}set loopOffset(e){Ee(this,_t,"f").loopOffset.setValue(e)}set loopDuration(e){Ee(this,_t,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Ee(this,Ba,"f").boxAdapters.adapterFor(al.create(Ee(this,Ba,"f").boxGraph,M.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Ee(this,_t,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=Ee(this,Ba,"f").boxGraph,n=jn.create(r,M.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Ee(this,_t,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&pe.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return b.None;let r=Ee(this,Ba,"f").boxGraph,n=e.toSorted(zo.Comparator),i=pe.getFirst(n,"Internal error (no first)"),a=pe.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Array.from(u.regions.collection.iterateRange(o,s)),m=[];d.filter(F=>F.isSelected).forEach(F=>{let B=F,V=B.optCollection.unwrap("optCollection"),W=V.events;for(let{rawStart:z,regionStart:ee,regionEnd:Q}of no.locateLoops(B,B.position,B.complete)){let xe=ee-z,re=Q-z,_e=W.greaterEqual(xe);if(!U(_e)||_e.position!==xe){let Je=W.lowerEqual(xe);U(Je)&&m.push({position:ee-o,value:V.valueAt(xe,0),interpolation:Je.interpolation})}let be=!1;for(let Je of W.iterateRange(xe,Pr.MAX_VALUE)){let de=Je.position+z;if(de<Q)m.push({position:de-o,value:Je.value,interpolation:Je.interpolation});else if(de===Q){m.push({position:de-o,value:Je.value,interpolation:di.None}),be=!0;break}else{m.push({position:Q-o,value:V.valueAt(re,0),interpolation:di.None}),be=!0;break}}be||m.push({position:Q-o,value:V.valueAt(re,0),interpolation:di.None})}});let x=[];for(let F of m){let B=x.length>0?x[x.length-1]:void 0;U(B)&&B.position===F.position&&B.value===F.value?x[x.length-1]=F:x.push(F)}let g=jn.create(r,M.generate()),w=0;for(;w<x.length;){let F=w+1;for(;F<x.length&&x[F].position===x[w].position;)F++;let B=x[w],V=x[F-1],W=Un.create(r,M.generate(),z=>{z.position.setValue(B.position),z.index.setValue(0),z.value.setValue(B.value),z.events.refer(g.events)});if(mi.write(W.interpolation,F-w>1?di.None:B.interpolation),F-w>1){let z=Un.create(r,M.generate(),ee=>{ee.position.setValue(V.position),ee.index.setValue(1),ee.value.setValue(V.value),ee.events.refer(g.events)});mi.write(z.interpolation,V.interpolation)}w=F}return d.forEach(({box:F})=>F.delete()),b.wrap(al.create(r,M.generate(),F=>{F.position.setValue(o),F.duration.setValue(s-o),F.loopDuration.setValue(s-o),F.loopOffset.setValue(0),F.hue.setValue(this.hue),F.mute.setValue(this.mute),F.label.setValue(this.label),F.events.refer(g.owners),F.regions.refer(u.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${M.toString(Ee(this,_t,"f").address.uuid)} p: ${Te.toString(this.position)}, c: ${Te.toString(this.complete)}}`}};Rc=new WeakMap,Ba=new WeakMap,_t=new WeakMap,Ff=new WeakMap,Cc=new WeakMap,bf=new WeakMap,_f=new WeakMap,Hn=new WeakSet,Ia=function(){Ee(this,Ff,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var o$=(t,e)=>t.position-e.position,s$={for:(t,e)=>je(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,Dc),visitAudioRegionBox:r=>t.adapterFor(r,Ic),visitValueRegionBox:r=>t.adapterFor(r,wo)}),"")};var zc=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},cr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Oc,$l,Af,Vc,ss,Uc,qv=class{constructor(e,r){Oc.set(this,void 0),$l.set(this,void 0),Af.set(this,void 0),Vc.set(this,void 0),ss.set(this,void 0),Uc.set(this,void 0),zc(this,Oc,e,"f"),zc(this,$l,new X,"f"),zc(this,Af,cr(this,$l,"f").own(new me),"f"),zc(this,Vc,cr(this,$l,"f").own(new ar),"f"),zc(this,ss,zo.create(o$),"f"),zc(this,Uc,M.newSet(n=>n.uuid),"f"),cr(this,$l,"f").ownAll(cr(this,Oc,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=s$.for(r,n),a=cr(this,Uc,"f").add(i);ne(a,`Cannot add ${n}`),cr(this,ss,"f").add(i);for(let o of cr(this,ss,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:cr(this,Oc,"f").listIndex,added:{p:i.position,d:i.duration,c:i.complete},existing:{p:o.position,d:o.duration,c:o.complete},stack:new Error().stack});break}cr(this,Vc,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=cr(this,Uc,"f").removeByKey(n);cr(this,ss,"f").remove(i),cr(this,Vc,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return cr(this,Oc,"f")}get collection(){return cr(this,ss,"f")}get adapters(){return cr(this,Uc,"f")}onIndexingChanged(){cr(this,ss,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),cr(this,Vc,"f").subscribe(e)}subscribeChanges(e){return cr(this,Af,"f").subscribe(e)}dispatchChange(){cr(this,Af,"f").notify()}terminate(){cr(this,$l,"f").terminate()}};Oc=new WeakMap,$l=new WeakMap,Af=new WeakMap,Vc=new WeakMap,ss=new WeakMap,Uc=new WeakMap;var ge;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ge||(ge={}));(function(t){t.toLabelString=e=>{switch(e){case t.Audio:return"Audio";case t.Notes:return"Note";case t.Value:return"Automation";case t.Undefined:default:return"N/A"}},t.toIconSymbol=e=>{switch(e){case t.Audio:return Ke.Waveform;case t.Notes:return Ke.Piano;case t.Value:return Ke.Automation;case t.Undefined:return Ke.AudioBus;default:return Ke.Unknown}}})(ge||(ge={}));var Jv;(function(t){t.isDeviceBox=e=>e.tags.type==="device",t.isInstrumentDeviceBox=e=>t.isDeviceBox(e)&&e.tags.deviceType==="instrument",t.isEffectDeviceBox=e=>t.isDeviceBox(e)&&(e.tags.deviceType==="audio-effect"||e.tags.deviceType==="midi-effect"),t.isChainEffectOf=(e,r)=>t.isEffectDeviceBox(e)&&e.host.targetVertex.mapOr(n=>n.box===r,!1),t.lookupHostField=e=>U(e)&&"host"in e&&xt(e.host,N)?e.host:K(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>U(e)&&"label"in e&&xt(e.label,I)?e.label:K(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>U(e)&&"enabled"in e&&xt(e.enabled,k)?e.enabled:K(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>U(e)&&"minimized"in e&&xt(e.minimized,k)?e.minimized:K(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>U(e)&&"index"in e&&xt(e.index,P)?e.index:K(`Could not find 'index' field in '${e?.name}'`)})(Jv||(Jv={}));var l$;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ge.Notes;case"audio":return ge.Audio;default:return K()}}})(l$||(l$={}));var z_;(function(t){t.chainOf=(e,r)=>r==="audio"?e.audioEffects:e.midiEffects,t.chainFieldOf=(e,r)=>r==="audio"?e.audioEffectsField:e.midiEffectsField,t.takesEffect=(e,r)=>t.chainFieldOf(e,r).nonEmpty()&&(r==="audio"||!e.hostsInstrument||e.inputAdapter.mapOr(n=>n.accepts==="midi",!1))})(z_||(z_={}));var te;(function(t){t.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),t.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),t.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",t.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",t.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",t.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",t.deleteEffectDevices=e=>{if(e.length===0)return;ne(pe.satisfy(e,(a,o)=>a.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let r=e[0];z_.chainFieldOf(r.deviceHost(),r.accepts).unwrap(`host takes no ${r.accepts} effects`).pointerHub.filter(r.accepts==="audio"?l.AudioEffectHost:l.MIDIEffectHost).map(({box:a})=>Jv.lookupIndexField(a)).filter(a=>e.some(o=>M.Comparator(o.uuid,a.address.uuid)!==0)).sort((a,o)=>a.getValue()-o.getValue()).forEach((a,o)=>a.setValue(o)),e.forEach(a=>a.box.delete())}})(te||(te={}));var Yv=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ar=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},jc,Xv,qn,Ml,Qv,ex=class{constructor(e,r){jc.set(this,void 0),Xv.set(this,new me),qn.set(this,void 0),Ml.set(this,void 0),Qv.set(this,void 0),Yv(this,jc,e,"f"),Yv(this,qn,Ct.create(e.box.tracks,n=>r.adapterFor(n,sr),l.TrackCollection),"f"),Yv(this,Ml,M.newSet(({uuid:n})=>n),"f"),Yv(this,Qv,Ar(this,qn,"f").catchupAndSubscribe({onAdd:n=>Ar(this,Ml,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Ar(this,Xv,"f").notify())}),onRemove:({uuid:n})=>Ar(this,Ml,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=Ar(this,jc,"f").box.graph,a=Ar(this,jc,"f").box.tracks;fi.create(i,M.generate(),o=>{o.index.setValue(n??Ar(this,qn,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return b.wrap(Ar(this,qn,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=Ar(this,qn,"f").adapters(),n=r.indexOf(e);if(n===-1)return K(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<r.length;i++)r[i].indexField.setValue(i-1);e.box.delete()}get audioUnitBox(){return Ar(this,jc,"f").box}get collection(){return Ar(this,qn,"f")}values(){return Ar(this,qn,"f").adapters()}catchupAndSubscribe(e){return Ar(this,qn,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Ar(this,Xv,"f").subscribe(e)}terminate(){Ar(this,qn,"f").terminate(),Ar(this,Qv,"f").terminate(),Ar(this,Ml,"f").forEach(({subscription:e})=>e.terminate()),Ar(this,Ml,"f").clear()}};jc=new WeakMap,Xv=new WeakMap,qn=new WeakMap,Ml=new WeakMap,Qv=new WeakMap;var ie;(function(t){t.AudioBus="manuals/audio-bus",t.Arpeggio="manuals/devices/midi/arpeggio",t.Pitch="manuals/devices/midi/pitch",t.Spielwerk="manuals/devices/midi/spielwerk",t.Velocity="manuals/devices/midi/velocity",t.Zeitgeist="manuals/devices/midi/zeitgeist",t.Autotune="manuals/devices/audio/autotune",t.StereoTool="manuals/devices/audio/stereo-tool",t.Delay="manuals/devices/audio/delay",t.DattorroReverb="manuals/devices/audio/dattorro-reverb",t.Maximizer="manuals/devices/audio/maximizer",t.Compressor="manuals/devices/audio/compressor",t.Gate="manuals/devices/audio/gate",t.Reverb="manuals/devices/audio/cheap-reverb",t.Crusher="manuals/devices/audio/crusher",t.Fold="manuals/devices/audio/fold",t.Tidal="manuals/devices/audio/tidal",t.Revamp="manuals/devices/audio/revamp",t.Modular="manuals/devices/audio/modular",t.NeuralAmp="manuals/devices/audio/neural-amp",t.Vocoder="manuals/devices/audio/vocoder",t.Waveshaper="manuals/devices/audio/waveshaper",t.Werkstatt="manuals/devices/audio/werkstatt",t.AudioEffectComposite="manuals/devices/audio/effect-composite",t.StereoComposite="manuals/devices/audio/stereo-composite",t.Apparat="manuals/devices/instruments/apparat",t.Tape="manuals/devices/instruments/tape",t.Nano="manuals/devices/instruments/nano",t.Playfield="manuals/devices/instruments/playfield",t.Vaporisateur="manuals/devices/instruments/vaporisateur",t.Neon="manuals/devices/instruments/neon",t.MIDIOutput="manuals/devices/instruments/midi-output",t.Soundfont="manuals/devices/instruments/soundfont",t.FrequencySplit="manuals/devices/audio/frequency-split"})(ie||(ie={}));var u$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tx,Di,Ri=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=ie.AudioBus,tx.set(this,void 0),Di.set(this,void 0),u$(this,tx,e,"f"),u$(this,Di,r,"f")}catchupAndSubscribe(e){return e(this),Jn(this,Di,"f").subscribe(ze.Children,()=>e(this))}get uuid(){return Jn(this,Di,"f").address.uuid}get address(){return Jn(this,Di,"f").address}get box(){return Jn(this,Di,"f")}get enabledField(){return Jn(this,Di,"f").enabled}get minimizedField(){return Jn(this,Di,"f").minimized}get iconField(){return Jn(this,Di,"f").icon}get labelField(){return Jn(this,Di,"f").label}get colorField(){return Jn(this,Di,"f").color}get iconSymbol(){return Ke.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Jn(this,tx,"f").boxAdapters.adapterFor(Jn(this,Di,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};tx=new WeakMap,Di=new WeakMap;var Ef=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},It=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bo,Kc,Wc,Ci,Sf,rx=class{constructor(e,r){bo.set(this,void 0),Kc.set(this,void 0),Wc.set(this,void 0),Ci.set(this,void 0),Sf.set(this,fe.Empty),Ef(this,bo,new X,"f"),Ef(this,Kc,It(this,bo,"f").own(new me),"f"),Ef(this,Wc,It(this,bo,"f").own(new en(Ke.Unknown)),"f"),Ef(this,Ci,It(this,bo,"f").own(new $r),"f"),It(this,bo,"f").own(It(this,Ci,"f").subscribe(n=>{It(this,Sf,"f").terminate(),Ef(this,Sf,n.match({none:()=>(It(this,Kc,"f").notify(b.None),fe.Empty),some:({labelField:i,iconField:a})=>fe.many(a.catchupAndSubscribe(o=>It(this,Wc,"f").setValue(Ke.fromName(o.getValue()))),i.catchupAndSubscribe(o=>It(this,Kc,"f").notify(b.wrap(o.getValue()))))}),"f")})),It(this,bo,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(It(this,Ci,"f").nonEmpty()){let o=It(this,Ci,"f").unwrap();K(`AudioUnitInput already has an input. Existing: ${o.box.name}@${o.box.address.toString()} (type: ${o.type}), Incoming: ${n.name}@${n.address.toString()} (pointerType: ${String(i)})`)}let a=n instanceof Kn?r.adapterFor(n,Ri):r.adapterFor(n,te.isInstrument);It(this,Ci,"f").unwrapOrNull()!==a&&It(this,Ci,"f").wrap(a)},onRemoved:({box:n})=>{ne(It(this,Ci,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),It(this,Ci,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return It(this,Ci,"f")}subscribe(e){return It(this,Ci,"f").subscribe(e)}catchupAndSubscribe(e){return e(It(this,Ci,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),It(this,Kc,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return It(this,Wc,"f").catchupAndSubscribe(e)}set label(e){this.adapter().ifSome(r=>r.labelField.setValue(e))}get label(){return this.adapter().map(e=>e.labelField.getValue())}set icon(e){this.adapter().ifSome(r=>r.iconField.setValue(Ke.toName(e)))}get icon(){return this.adapter().match({none:()=>Ke.Unknown,some:e=>Ke.fromName(e.iconField.getValue())})}get iconValue(){return It(this,Wc,"f")}terminate(){It(this,bo,"f").terminate(),It(this,Sf,"f").terminate()}};bo=new WeakMap,Kc=new WeakMap,Wc=new WeakMap,Ci=new WeakMap,Sf=new WeakMap;var c$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nl=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ix,_o,le=class{constructor(e){ix.set(this,void 0),_o.set(this,void 0),c$(this,ix,e,"f"),c$(this,_o,Be.newSet(r=>r.address),"f")}terminate(){Nl(this,_o,"f").forEach(e=>e.terminate()),Nl(this,_o,"f").clear()}parameters(){return Nl(this,_o,"f").values()}parameterAt(e){return Nl(this,_o,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new kl(Nl(this,ix,"f"),e,r,n,i,a,o),u=Nl(this,_o,"f").add(s);return ne(u,`Could not add adapter for ${e}`),s}removeParameter(e){return Nl(this,_o,"f").removeByKey(e)}};ix=new WeakMap,_o=new WeakMap;var Bl=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Il,dn,ls,Lc,nx,ax,Pf,Zc=class{constructor(e,r){Il.set(this,void 0),dn.set(this,void 0),ls.set(this,void 0),Lc.set(this,void 0),nx.set(this,void 0),ax.set(this,void 0),Pf.set(this,fe.Empty),Bl(this,Il,e,"f"),Bl(this,dn,r,"f"),Bl(this,ls,new X,"f"),Bl(this,Lc,Nt(this,ls,"f").own(new me),"f"),Nt(this,ls,"f").own(r.targetBus.catchupAndSubscribe(()=>{Nt(this,Pf,"f").terminate(),Bl(this,Pf,this.optTargetBus.match({none:()=>(Nt(this,Lc,"f").notify(b.None),fe.Empty),some:n=>n.catchupAndSubscribe(i=>Nt(this,Lc,"f").notify(b.wrap(i)))}),"f")})),Bl(this,nx,Nt(this,ls,"f").own(new kl(Nt(this,Il,"f"),Nt(this,dn,"f").sendPan,A.bipolar(),E.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Bl(this,ax,Nt(this,ls,"f").own(new kl(Nt(this,Il,"f"),Nt(this,dn,"f").sendGain,A.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),Nt(this,Lc,"f").subscribe(e)}get uuid(){return Nt(this,dn,"f").address.uuid}get address(){return Nt(this,dn,"f").address}get box(){return Nt(this,dn,"f")}get indexField(){return Nt(this,dn,"f").index}get sendPan(){return Nt(this,nx,"f")}get sendGain(){return Nt(this,ax,"f")}get targetBus(){return Nt(this,Il,"f").boxAdapters.adapterFor(Nt(this,dn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Ri)}get optTargetBus(){return Nt(this,dn,"f").targetBus.targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Nt(this,Il,"f").boxAdapters.adapterFor(r,Ri)})))}delete(){Nt(this,dn,"f").delete()}terminate(){Nt(this,ls,"f").terminate(),Nt(this,Pf,"f").terminate()}};Il=new WeakMap,dn=new WeakMap,ls=new WeakMap,Lc=new WeakMap,nx=new WeakMap,ax=new WeakMap,Pf=new WeakMap;var $f=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ta=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ox,sx,Gc,Hc,Mf,lx=class{constructor(e,r){ox.set(this,void 0),sx.set(this,void 0),Gc.set(this,void 0),Hc.set(this,void 0),Mf.set(this,fe.Empty),$f(this,ox,e,"f"),$f(this,sx,r,"f"),$f(this,Gc,new X,"f"),$f(this,Hc,Ta(this,Gc,"f").own(new me),"f"),Ta(this,Gc,"f").own(e.catchupAndSubscribe(()=>{Ta(this,Mf,"f").terminate(),$f(this,Mf,this.adapter.match({none:()=>(Ta(this,Hc,"f").notify(b.None),fe.Empty),some:n=>n.catchupAndSubscribe(i=>Ta(this,Hc,"f").notify(b.wrap(i)))}),"f")}))}subscribe(e){return Ta(this,Hc,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Ta(this,ox,"f").targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Ta(this,sx,"f").adapterFor(r,Ri)})))}terminate(){Ta(this,Gc,"f").terminate(),Ta(this,Mf,"f").terminate()}};ox=new WeakMap,sx=new WeakMap,Gc=new WeakMap,Hc=new WeakMap,Mf=new WeakMap;var Fo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ve=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ux,d$,Da,zi,Vt,Dl,qc,Tl,cx,Nf,dx,px,p$,f$,pn=class{constructor(e,r){ux.add(this),this.class="device-host",Da.set(this,new X),zi.set(this,void 0),Vt.set(this,void 0),Dl.set(this,void 0),qc.set(this,void 0),Tl.set(this,void 0),cx.set(this,void 0),Nf.set(this,void 0),dx.set(this,void 0),px.set(this,void 0),Fo(this,zi,e,"f"),Fo(this,Vt,r,"f"),Fo(this,Dl,ve(this,Da,"f").own(new le(ve(this,zi,"f"))),"f"),Fo(this,qc,ve(this,Da,"f").own(new ex(this,ve(this,zi,"f").boxAdapters)),"f"),Fo(this,Tl,ve(this,Da,"f").own(new rx(ve(this,Vt,"f").input.pointerHub,ve(this,zi,"f").boxAdapters)),"f"),Fo(this,cx,ve(this,Da,"f").own(Ct.create(ve(this,Vt,"f").midiEffects,n=>ve(this,zi,"f").boxAdapters.adapterFor(n,te.isMidiEffect),l.MIDIEffectHost)),"f"),Fo(this,Nf,ve(this,Da,"f").own(Ct.create(ve(this,Vt,"f").audioEffects,n=>ve(this,zi,"f").boxAdapters.adapterFor(n,te.isAudioEffect),l.AudioEffectHost)),"f"),Fo(this,dx,ve(this,Da,"f").own(Ct.create(ve(this,Vt,"f").auxSends,n=>ve(this,zi,"f").boxAdapters.adapterFor(n,Zc),l.AuxSend)),"f"),Fo(this,px,ve(this,Da,"f").own(new lx(ve(this,Vt,"f").output,ve(this,zi,"f").boxAdapters)),"f"),this.namedParameter=ve(this,ux,"m",p$).call(this,r),ve(this,ux,"m",f$).call(this)}get box(){return ve(this,Vt,"f")}get uuid(){return ve(this,Vt,"f").address.uuid}get address(){return ve(this,Vt,"f").address}get indexField(){return ve(this,Vt,"f").index}get type(){return ve(this,Vt,"f").type.getValue()}get captureBox(){return ve(this,Vt,"f").capture.targetVertex}get tracks(){return ve(this,qc,"f")}get input(){return ve(this,Tl,"f")}get midiEffects(){return b.wrap(ve(this,cx,"f"))}get audioEffects(){return b.wrap(ve(this,Nf,"f"))}get inputAdapter(){return ve(this,Tl,"f").adapter()}get auxSends(){return ve(this,dx,"f")}get output(){return ve(this,px,"f")}get isBus(){return this.input.adapter().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.adapter().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return ve(this,Vt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ve(this,zi,"f").rootBoxAdapter.address),!1)}get automationCollapsed(){return ve(this,Vt,"f").userInterface.automationCollapsed}get midiEffectsField(){return b.wrap(ve(this,Vt,"f").midiEffects)}get inputField(){return ve(this,Vt,"f").input}get audioEffectsField(){return b.wrap(ve(this,Vt,"f").audioEffects)}get tracksField(){return ve(this,Vt,"f").tracks}get minimizedField(){return ve(this,Tl,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get hostsInstrument(){return!0}get label(){return ve(this,Tl,"f").adapter().mapOr(e=>e.labelField.getValue(),"")}deviceHost(){return this}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.adapter();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let r of ve(this,Nf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>b.None}}indicesLimit(){let e=ve(this,zi,"f").rootBoxAdapter.audioUnits.adapters(),r=this.indexField.getValue(),n=this.type,i=r,a=r;for(;i>0&&e[i-1].type===n;)i--;for(;a<e.length-1&&e[a+1].type===n;)a++;return[i,a+1]}move(e){ve(this,zi,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){ve(this,qc,"f").collection.move(e,r)}deleteTrack(e){ve(this,qc,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ve(this,Da,"f").terminate()}};d$=pn,Da=new WeakMap,zi=new WeakMap,Vt=new WeakMap,Dl=new WeakMap,qc=new WeakMap,Tl=new WeakMap,cx=new WeakMap,Nf=new WeakMap,dx=new WeakMap,px=new WeakMap,ux=new WeakSet,p$=function(e){return{volume:ve(this,Dl,"f").createParameter(e.volume,d$.VolumeMapper,E.decible,"volume"),panning:ve(this,Dl,"f").createParameter(e.panning,A.bipolar(),E.panning,"panning",.5),mute:ve(this,Dl,"f").createParameter(e.mute,A.bool,E.bool,"mute"),solo:ve(this,Dl,"f").createParameter(e.solo,A.bool,E.bool,"solo")}},f$=function(){let e=this.address.toString(),r=ve(this,Vt,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ve(this,Vt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;ne(this.type!==Mt.Instrument||ve(this,Vt,"f").capture.targetAddress.nonEmpty(),n)};pn.VolumeMapper=A.decibel(-96,-9,6);var Jc=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Cl,ti,ei,Rl,fx,mx,kf,m$,h$,hx,sr=class{constructor(e,r){Cl.add(this),ti.set(this,void 0),ei.set(this,void 0),Rl.set(this,void 0),fx.set(this,void 0),mx.set(this,void 0),kf.set(this,void 0),Jc(this,ti,e,"f"),Jc(this,ei,r,"f"),Jc(this,Rl,new X,"f"),Jc(this,kf,qe(this,Rl,"f").own(new en(-1)),"f"),Jc(this,fx,qe(this,Rl,"f").own(new Zv(this,e.boxAdapters)),"f"),Jc(this,mx,qe(this,Rl,"f").own(new qv(this,e.boxAdapters)),"f")}catchupAndSubscribePath(e){let r=[b.None,b.None],n=()=>{r.every(i=>i.nonEmpty())?e(b.wrap(r.map(i=>i.unwrap()))):e(b.None)};return fe.many(qe(this,Cl,"m",m$).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),qe(this,Cl,"m",h$).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return qe(this,ti,"f")}set targetName(e){qe(this,ei,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof Xe){qe(this,ti,"f").boxAdapters.adapterFor(n,pn).input.adapter().ifSome(a=>a.labelField.setValue(e));return}qe(this,ti,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof I&&i.labelField.setValue(e)}),qe(this,Cl,"m",hx).call(this,n).flatMap(i=>qe(this,ti,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof I&&i.labelField.setValue(e)})})}get targetName(){return qe(this,ei,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof Xe)return qe(this,ti,"f").boxAdapters.adapterFor(r,pn).input.label;let n=qe(this,ti,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof I)return b.wrap(a.labelField.getValue())}let i=qe(this,Cl,"m",hx).call(this,r).flatMap(a=>qe(this,ti,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof I)return b.wrap(a.labelField.getValue())}return b.wrap(r.name)})}terminate(){qe(this,Rl,"f").terminate()}get audioUnit(){return Ce(qe(this,ei,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,Xe)}get target(){return qe(this,ei,"f").target}get clips(){return qe(this,fx,"f")}get regions(){return qe(this,mx,"f")}get enabled(){return qe(this,ei,"f").enabled}get indexField(){return qe(this,ei,"f").index}get type(){return qe(this,ei,"f").type.getValue()}get box(){return qe(this,ei,"f")}get uuid(){return qe(this,ei,"f").address.uuid}get address(){return qe(this,ei,"f").address}get listIndex(){return qe(this,kf,"f").getValue()}set listIndex(e){qe(this,kf,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ge.Audio;case"note-clip":return this.type===ge.Notes;case"value-clip":return this.type===ge.Value;case"audio-region":return this.type===ge.Audio;case"note-region":return this.type===ge.Notes;case"value-region":return this.type===ge.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=qe(this,ti,"f").clipSequencing.iterate(this.uuid,e,e+YP);for(let{optClip:a,sectionFrom:o}of i)n=a.match({none:()=>{let s=this.regions.collection.lowerEqual(e,u=>!u.mute);if(s===null){let u=this.regions.collection.optAt(0);return xt(u,wo)?u.incomingValue(r):r}else if(xt(s,wo))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&xt(s,ts)&&!s.mute?s.valueAt(e,r):r});return n}};ti=new WeakMap,ei=new WeakMap,Rl=new WeakMap,fx=new WeakMap,mx=new WeakMap,kf=new WeakMap,Cl=new WeakSet,m$=function(e){let r=qe(this,ei,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof Xe)return qe(this,ti,"f").boxAdapters.adapterFor(n,pn).input.catchupAndSubscribeLabelChange(s=>e(s));let i=qe(this,ti,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof I)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}let a=qe(this,Cl,"m",hx).call(this,n).flatMap(o=>qe(this,ti,"f").boxAdapters.optAdapter(o));if(a.nonEmpty()){let o=a.unwrap();if("labelField"in o&&o.labelField instanceof I)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}return e(b.wrap(n.name)),fe.Empty}return e(b.None),fe.Empty},h$=function(e){let r=this.type;switch(r){case ge.Audio:case ge.Notes:return e(b.wrap(ge[r])),fe.Empty;case ge.Value:{let n=qe(this,ei,"f").target.targetVertex.unwrap("target.target");if(n.isField())e(qe(this,ti,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(b.wrap(n.name));else return K("Illegal State. Vertex is not a field nor box.");return fe.Empty}case ge.Undefined:return e(b.wrap("")),fe.Empty;default:return e(b.None),fe.Empty}},hx=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return b.None};var qt=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},he=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Oi,Vi,gx,vx,xx,zl,Ao,us,cs,ds,ps,Ol,fs,Bf,g$=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],kl=class{constructor(e,r,n,i,a,o,s){Oi.set(this,void 0),Vi.set(this,void 0),gx.set(this,void 0),vx.set(this,void 0),xx.set(this,void 0),zl.set(this,new X),Ao.set(this,void 0),us.set(this,void 0),cs.set(this,void 0),ds.set(this,void 0),ps.set(this,b.None),Ol.set(this,b.None),fs.set(this,null),Bf.set(this,!1),qt(this,Oi,e,"f"),qt(this,Vi,r,"f"),qt(this,cs,n,"f"),qt(this,ds,i,"f"),qt(this,gx,a,"f"),qt(this,vx,o??0,"f"),qt(this,xx,b.wrap(s),"f"),he(this,zl,"f").own(he(this,Oi,"f").parameterFieldAdapters.register(this)),qt(this,Ao,he(this,zl,"f").own(new me),"f"),qt(this,us,new ar,"f"),he(this,zl,"f").own(he(this,Vi,"f").subscribe(()=>he(this,Ao,"f").notify(this))),he(this,zl,"f").own(he(this,Vi,"f").pointerHub.catchupAndSubscribe({onAdded:u=>{he(this,us,"f").proxy.onControlSourceAdd(O_(u.pointerType)),u.box.accept({visitTrackBox:d=>{ne(he(this,ps,"f").isEmpty(),"Already assigned");let m=he(this,Oi,"f").boxAdapters.adapterFor(d,sr);qt(this,ps,b.wrap(m),"f"),he(this,Oi,"f").isMainThread&&qt(this,Ol,b.wrap(he(this,Oi,"f").liveStreamReceiver.subscribeFloat(he(this,Vi,"f").address,x=>{if(isNaN(x)){if(Qi(he(this,fs,"f")))return;qt(this,fs,null,"f"),he(this,Ao,"f").notify(this);return}he(this,fs,"f")!==x&&(qt(this,fs,x,"f"),he(this,Ao,"f").notify(this))})),"f")}})},onRemoved:u=>{he(this,us,"f").proxy.onControlSourceRemove(O_(u.pointerType)),u.box.accept({visitTrackBox:d=>{ne(he(this,ps,"f").unwrapOrNull()?.address?.equals(d.address)===!0,`Unknown ${d}`),qt(this,ps,b.None,"f"),he(this,Oi,"f").isMainThread&&(he(this,Ol,"f").ifSome(m=>m.terminate()),qt(this,Ol,b.None,"f"),qt(this,fs,null,"f"),he(this,Ao,"f").notify(this))}})}},...g$)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return he(this,us,"f").proxy.onControlSourceAdd("midi"),qt(this,Bf,!0,"f"),{terminate:()=>{qt(this,Bf,!1,"f"),he(this,us,"f").proxy.onControlSourceRemove("midi")}}}get field(){return he(this,Vi,"f")}get valueMapping(){return he(this,cs,"f")}get stringMapping(){return he(this,ds,"f")}get name(){return he(this,gx,"f")}get anchor(){return he(this,vx,"f")}get type(){return he(this,Vi,"f").type}get address(){return he(this,Vi,"f").address}get track(){return he(this,ps,"f")}registerTracks(e){return he(this,Oi,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){he(this,Oi,"f").parameterFieldAdapters.touchStart(this.address),he(this,Oi,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){he(this,Oi,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){qt(this,cs,e,"f"),qt(this,ds,r,"f"),he(this,Ao,"f").notify(this)}valueAt(e){let r=he(this,ps,"f");if(r.nonEmpty()){let n=r.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return he(this,Ao,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return he(this,Bf,"f")&&e.onControlSourceAdd("midi"),he(this,Vi,"f").pointerHub.filter(...g$).forEach(r=>e.onControlSourceAdd(O_(r.pointerType))),he(this,us,"f").subscribe(e)}getValue(){return he(this,Vi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();he(this,Vi,"f").setValue(e),he(this,Oi,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(he(this,cs,"f").y(e))}getUnitValue(){return he(this,cs,"f").x(this.getValue())}getControlledValue(){return he(this,cs,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return he(this,fs,"f")??this.getUnitValue()}getControlledPrintValue(){return he(this,ds,"f").x(this.getControlledValue())}getPrintValue(){return he(this,ds,"f").x(this.getValue())}setPrintValue(e){let r=he(this,ds,"f").y(e);r.type==="unitValue"?this.setUnitValue(lt(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(he(this,xx,"f").unwrapOrElse(he(this,Vi,"f").initValue))}terminate(){he(this,Ol,"f").ifSome(e=>e.terminate()),qt(this,Ol,b.None,"f"),he(this,zl,"f").terminate()}};Oi=new WeakMap,Vi=new WeakMap,gx=new WeakMap,vx=new WeakMap,xx=new WeakMap,zl=new WeakMap,Ao=new WeakMap,us=new WeakMap,cs=new WeakMap,ds=new WeakMap,ps=new WeakMap,Ol=new WeakMap,fs=new WeakMap,Bf=new WeakMap;var O_=t=>{switch(t){case l.Automation:return"automated";case l.Modulation:return"modulated";case l.MIDIControl:return"midi";case l.ParameterController:return"external";default:return K(`${t.toString()} is an unknown pointer type`)}};var yx={min:400,max:480,default:440};var V_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Eo,Vl,wx,bx=class{constructor(e,r,n){Eo.set(this,void 0),Vl.set(this,void 0),wx.set(this,void 0),V_(this,Eo,M.newSet(i=>i.uuid),"f"),V_(this,Vl,new ar,"f"),V_(this,wx,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=Yn(this,Eo,"f").add(a);ne(o,`Could not add ${a}`),Yn(this,Vl,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;Yn(this,Vl,"f").proxy.onRemove(Yn(this,Eo,"f").removeByKey(a))}},n),"f")}subscribe(e){return Yn(this,Vl,"f").subscribe(e)}catchupAndSubscribe(e){return Yn(this,Eo,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return Yn(this,Eo,"f").values()}size(){return Yn(this,Eo,"f").size()}isEmpty(){return this.size()===0}terminate(){Yn(this,Eo,"f").clear(),Yn(this,Vl,"f").terminate(),Yn(this,wx,"f").terminate()}};Eo=new WeakMap,Vl=new WeakMap,wx=new WeakMap;var U_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ft=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},j_,gi,If,fn,Br,v$,Xn=class{constructor(e,r){j_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Delay,If.set(this,void 0),fn.set(this,void 0),Br.set(this,void 0),U_(this,If,e,"f"),U_(this,fn,r,"f"),U_(this,Br,new le(Ft(this,If,"f")),"f"),this.namedParameter=Ft(this,j_,"m",v$).call(this,r)}get box(){return Ft(this,fn,"f")}get uuid(){return Ft(this,fn,"f").address.uuid}get address(){return Ft(this,fn,"f").address}get indexField(){return Ft(this,fn,"f").index}get labelField(){return Ft(this,fn,"f").label}get enabledField(){return Ft(this,fn,"f").enabled}get minimizedField(){return Ft(this,fn,"f").minimized}get host(){return Ft(this,fn,"f").host}deviceHost(){return Ft(this,If,"f").boxAdapters.adapterFor(Ft(this,fn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ft(this,Br,"f").terminate()}};gi=Xn,If=new WeakMap,fn=new WeakMap,Br=new WeakMap,j_=new WeakSet,v$=function(e){return{preSyncTimeLeft:Ft(this,Br,"f").createParameter(e.preSyncTimeLeft,A.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:Ft(this,Br,"f").createParameter(e.preMillisTimeLeft,A.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:Ft(this,Br,"f").createParameter(e.preSyncTimeRight,A.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"pre sync R"),preMillisTimeRight:Ft(this,Br,"f").createParameter(e.preMillisTimeRight,A.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:Ft(this,Br,"f").createParameter(e.delayMusical,A.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"delay"),millisTime:Ft(this,Br,"f").createParameter(e.delayMillis,A.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:Ft(this,Br,"f").createParameter(e.feedback,A.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:Ft(this,Br,"f").createParameter(e.cross,A.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:Ft(this,Br,"f").createParameter(e.lfoSpeed,A.exponential(gi.LFO_SPEED_MIN,gi.LFO_SPEED_MAX),E.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:Ft(this,Br,"f").createParameter(e.lfoDepth,A.power(4,0,gi.LFO_DEPTH_MAX),E.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:Ft(this,Br,"f").createParameter(e.filter,A.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:Ft(this,Br,"f").createParameter(e.dry,A.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Ft(this,Br,"f").createParameter(e.wet,A.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};Xn.Fractions=Oo.builder().add([0,1]).add([1,128]).add([1,96]).add([1,64]).add([1,48]).add([1,32]).add([1,24]).add([3,64]).add([1,16]).add([1,12]).add([3,32]).add([1,8]).add([1,6]).add([3,16]).add([1,4]).add([5,16]).add([1,3]).add([3,8]).add([7,16]).add([1,2]).add([1,1]).asAscendingArray();Xn.FractionsStringMapping=E.indices("",gi.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));Xn.MAX_MILLIS_TIME=1e3;Xn.LFO_SPEED_MIN=.1;Xn.LFO_SPEED_MAX=5;Xn.LFO_DEPTH_MAX=50;var K_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},W_,Tf,mn,Ra,x$,_x=class{constructor(e,r){W_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Reverb,Tf.set(this,void 0),mn.set(this,void 0),Ra.set(this,void 0),K_(this,Tf,e,"f"),K_(this,mn,r,"f"),K_(this,Ra,new le(vr(this,Tf,"f")),"f"),this.namedParameter=vr(this,W_,"m",x$).call(this,r)}get box(){return vr(this,mn,"f")}get uuid(){return vr(this,mn,"f").address.uuid}get address(){return vr(this,mn,"f").address}get indexField(){return vr(this,mn,"f").index}get labelField(){return vr(this,mn,"f").label}get enabledField(){return vr(this,mn,"f").enabled}get minimizedField(){return vr(this,mn,"f").minimized}get host(){return vr(this,mn,"f").host}deviceHost(){return vr(this,Tf,"f").boxAdapters.adapterFor(vr(this,mn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){vr(this,Ra,"f").terminate()}};Tf=new WeakMap,mn=new WeakMap,Ra=new WeakMap,W_=new WeakSet,x$=function(e){return{decay:vr(this,Ra,"f").createParameter(e.decay,A.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:vr(this,Ra,"f").createParameter(e.preDelay,A.exponential(.001,.5),E.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:vr(this,Ra,"f").createParameter(e.damp,A.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"damping"),filter:vr(this,Ra,"f").createParameter(e.filter,A.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter"),dry:vr(this,Ra,"f").createParameter(e.dry,A.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:vr(this,Ra,"f").createParameter(e.wet,A.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};var L_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},G_,Df,Ui,Qn,b$,Fx=class{constructor(e,r){G_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Revamp,Df.set(this,void 0),Ui.set(this,void 0),Qn.set(this,void 0),L_(this,Df,e,"f"),L_(this,Ui,r,"f"),L_(this,Qn,new le(Jt(this,Df,"f")),"f"),this.namedParameter=Jt(this,G_,"m",b$).call(this,r)}get box(){return Jt(this,Ui,"f")}get uuid(){return Jt(this,Ui,"f").address.uuid}get address(){return Jt(this,Ui,"f").address}get indexField(){return Jt(this,Ui,"f").index}get labelField(){return Jt(this,Ui,"f").label}get enabledField(){return Jt(this,Ui,"f").enabled}get minimizedField(){return Jt(this,Ui,"f").minimized}get host(){return Jt(this,Ui,"f").host}get spectrum(){return Jt(this,Ui,"f").address.append(4095)}deviceHost(){return Jt(this,Df,"f").boxAdapters.adapterFor(Jt(this,Ui,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Jt(this,Qn,"f").terminate()}};Df=new WeakMap,Ui=new WeakMap,Qn=new WeakMap,G_=new WeakSet,b$=function(e){return{highPass:y$(Jt(this,Qn,"f"),e.highPass,"High-Pass"),lowShelf:w$(Jt(this,Qn,"f"),e.lowShelf,"Low-Shelf"),lowBell:Z_(Jt(this,Qn,"f"),e.lowBell,"Low-Bell"),midBell:Z_(Jt(this,Qn,"f"),e.midBell,"Mid-Bell"),highBell:Z_(Jt(this,Qn,"f"),e.highBell,"High-Bell"),highShelf:w$(Jt(this,Qn,"f"),e.highShelf,"High-Shelf"),lowPass:y$(Jt(this,Qn,"f"),e.lowPass,"Low-Pass")}};var H_=A.exponential(20,2e4),_$=A.linear(-24,24),F$=A.exponential(.01,10),y$=(t,e,r)=>({enabled:t.createParameter(e.enabled,A.bool,E.bool,"enabled"),frequency:t.createParameter(e.frequency,H_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,A.linearInteger(0,3),E.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,F$,E.numeric({fractionDigits:3}),`${r} Q`)}),w$=(t,e,r)=>({enabled:t.createParameter(e.enabled,A.bool,E.bool,"enabled"),frequency:t.createParameter(e.frequency,H_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,_$,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),Z_=(t,e,r)=>({enabled:t.createParameter(e.enabled,A.bool,E.bool,"enabled"),frequency:t.createParameter(e.frequency,H_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,_$,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,F$,E.numeric({fractionDigits:3}),`${r} Q`)});var A$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ax,Ex,xi,ms=class{constructor(e,r){this.type="marker-event",Ax.set(this,new X),Ex.set(this,void 0),xi.set(this,void 0),A$(this,Ex,e,"f"),A$(this,xi,r,"f"),vi(this,Ax,"f").own(vi(this,xi,"f").subscribe(ze.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();vi(this,xi,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return vi(this,xi,"f")}get uuid(){return vi(this,xi,"f").address.uuid}get address(){return vi(this,xi,"f").address}get position(){return vi(this,xi,"f").position.getValue()}get plays(){return vi(this,xi,"f").plays.getValue()}get hue(){return vi(this,xi,"f").hue.getValue()}get label(){return vi(this,xi,"f").label.getValue()}get trackAdapter(){return vi(this,xi,"f").track.targetVertex.map(e=>vi(this,Ex,"f").boxAdapters.adapterFor(e.box,Ca).markerTrack)}terminate(){vi(this,Ax,"f").terminate()}toString(){return`{MarkerBoxAdapter ${M.toString(vi(this,xi,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Ax=new WeakMap,Ex=new WeakMap,xi=new WeakMap;ms.Comparator=(t,e)=>t.position-e.position;var Rf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Cf,Yc,zf,Ul,Sx,Px=class{constructor(e,r){Cf.set(this,void 0),Yc.set(this,void 0),zf.set(this,void 0),Ul.set(this,void 0),Sx.set(this,void 0),Rf(this,Cf,e,"f"),Rf(this,Yc,r,"f"),this.changeNotifier=new me,Rf(this,zf,M.newSet(n=>n.uuid),"f"),Rf(this,Ul,Or.create(ms.Comparator),"f"),Rf(this,Sx,hn(this,Yc,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof Ku){let i=hn(this,Cf,"f").boxAdapters.adapterFor(n,ms),a=hn(this,zf,"f").add(i);ne(a,"Could not add adapter"),hn(this,Ul,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{hn(this,Ul,"f").remove(hn(this,zf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return hn(this,Cf,"f")}get enabled(){return hn(this,Yc,"f").enabled.getValue()}get events(){return hn(this,Ul,"f")}get object(){return hn(this,Yc,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){hn(this,Ul,"f").onIndexingChanged(),this.dispatchChange()}terminate(){hn(this,Sx,"f").terminate()}};Cf=new WeakMap,Yc=new WeakMap,zf=new WeakMap,Ul=new WeakMap,Sx=new WeakMap;var E$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ji=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$x,Mx,Ki,jl=class{constructor(e,r){this.type="signature-event",$x.set(this,new X),Mx.set(this,void 0),Ki.set(this,void 0),E$(this,Mx,e,"f"),E$(this,Ki,r,"f"),ji(this,$x,"f").own(ji(this,Ki,"f").subscribe(ze.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return ji(this,Ki,"f")}get uuid(){return ji(this,Ki,"f").address.uuid}get address(){return ji(this,Ki,"f").address}get index(){return ji(this,Ki,"f").index.getValue()}get indexField(){return ji(this,Ki,"f").index}get relativePosition(){return ji(this,Ki,"f").relativePosition.getValue()}get nominator(){return ji(this,Ki,"f").nominator.getValue()}get denominator(){return ji(this,Ki,"f").denominator.getValue()}get trackAdapter(){return ji(this,Ki,"f").events.targetVertex.map(e=>ji(this,Mx,"f").boxAdapters.adapterFor(e.box,Ca).signatureTrack)}terminate(){ji(this,$x,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};$x=new WeakMap,Mx=new WeakMap,Ki=new WeakMap;jl.Comparator=(t,e)=>t.index-e.index;var Nx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},At=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hs,Of,Vf,Kl,So,gs,S$,Xc,kx=class{constructor(e,r,n){hs.add(this),Of.set(this,new X),Vf.set(this,void 0),Kl.set(this,void 0),So.set(this,void 0),gs.set(this,void 0),Nx(this,Vf,e,"f"),Nx(this,Kl,r,"f"),Nx(this,So,n,"f"),this.changeNotifier=new me,Nx(this,gs,At(this,Of,"f").own(Ct.create(At(this,So,"f").events,i=>e.boxAdapters.adapterFor(i,jl),l.SignatureAutomation)),"f"),At(this,Of,"f").ownAll(At(this,Kl,"f").subscribe(()=>this.dispatchChange()),At(this,So,"f").enabled.subscribe(()=>this.dispatchChange()),At(this,gs,"f").subscribe({onAdd:i=>this.changeNotifier.notify(),onRemove:i=>this.changeNotifier.notify(),onReorder:i=>this.changeNotifier.notify()}))}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return At(this,Vf,"f")}get enabled(){return At(this,So,"f").enabled.getValue()}get object(){return At(this,So,"f")}get size(){return At(this,gs,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=At(this,Kl,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return At(this,gs,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let r=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:a}of this.iterateAll()){if(n>e)break;r=[i,a]}return r}*iterateAll(){let e=0,r=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i},!!At(this,So,"f").enabled.getValue())for(let a of At(this,gs,"f").adapters())e+=Te.fromSignature(n,i)*a.relativePosition,r+=a.relativePosition,n=a.nominator,i=a.denominator,yield{index:a.index,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i}}changeSignature(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.map(u=>u.accumulatedPpqn);At(this,Kl,"f").nominator.setValue(e),At(this,Kl,"f").denominator.setValue(r);let a=0,o=0,s=Te.fromSignature(e,r);for(let u=0;u<n.length;u++){let d=n[u],m=this.adapterAt(d.index);if(m.isEmpty())continue;let g=(i[u]-a)/s,w=Math.floor(g),F=g-w;o+=F;let B=w;o>=1&&(B++,o--),B=Math.max(1,B),m.unwrap().box.relativePosition.setValue(B),a+=B*s,s=Te.fromSignature(d.nominator,d.denominator)}}deleteAdapter(e){let r=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(w=>w.index===r);if(i===-1)return;let a=n.slice(i+1),o=a.map(w=>w.accumulatedPpqn),s=i>0?n[i-1]:null,[u,d]=s!==null?[s.nominator,s.denominator]:this.storageSignature,m=s!==null?s.accumulatedPpqn:0;e.box.delete();let x=m,g=Te.fromSignature(u,d);for(let w=0;w<a.length;w++){let F=a[w],B=this.adapterAt(F.index);if(B.isEmpty())continue;let W=(o[w]-x)/g,z=Math.max(1,Math.round(W));B.unwrap().box.relativePosition.setValue(z),x+=z*g,g=Te.fromSignature(F.nominator,F.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let B=1;B<i.length&&!(i[B].accumulatedPpqn>e);B++)a=i[B],o=B;let s=Te.fromSignature(a.nominator,a.denominator),u=(e-a.accumulatedPpqn)/s,d=Math.max(1,Math.round(u)),m=a.index+1,x=i.slice(o+1),g=a.accumulatedPpqn+d*s,w=Te.fromSignature(r,n),F=x.map(B=>({event:B,adapter:this.adapterAt(B.index)})).filter(({adapter:B})=>B.nonEmpty()).map(({event:B,adapter:V})=>({event:B,adapter:V.unwrap()}));for(let B=0;B<F.length;B++){let{event:V,adapter:W}=F[B];if(W.box.index.setValue(V.index+1),B===0){let z=(V.accumulatedPpqn-g)/w;W.box.relativePosition.setValue(Math.max(1,Math.round(z)))}}zu.create(At(this,Vf,"f").boxGraph,M.generate(),B=>{B.index.setValue(m),B.relativePosition.setValue(d),B.nominator.setValue(r),B.denominator.setValue(n),B.events.refer(At(this,So,"f").events)})}adapterAt(e){return At(this,gs,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(g=>g.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(g=>g.accumulatedBars),s=At(this,hs,"m",S$).call(this,r,a.index);if(s===a.accumulatedBars)return;let u=[...o];u[i]=s;let d=u.map((g,w)=>({bar:g,i:w})).sort((g,w)=>g.bar-w.bar).map(g=>g.i),m=n.map(g=>this.adapterAt(g.index).unwrap("adapterAt"));for(let g=0;g<d.length;g++)m[d[g]].box.index.setValue(g);let x=0;for(let g=0;g<d.length;g++){let w=d[g],F=m[w],B=u[w],V=Math.max(1,B-x);F.box.relativePosition.setValue(V),x=B}}floorToBar(e){let{event:r,barPpqn:n}=At(this,hs,"m",Xc).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=At(this,hs,"m",Xc).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=At(this,hs,"m",Xc).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=At(this,hs,"m",Xc).call(this,e),n=Te.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Te.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=At(this,hs,"m",Xc).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){At(this,Of,"f").terminate()}};Of=new WeakMap,Vf=new WeakMap,Kl=new WeakMap,So=new WeakMap,gs=new WeakMap,hs=new WeakSet,S$=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(Qi(n)){let[o,s]=this.storageSignature,u=Te.fromSignature(o,s);return Math.max(1,Math.round(e/u))}let i=Te.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},Xc=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(Qi(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Te.fromSignature(n,i)}}return{event:r,barPpqn:Te.fromSignature(r.nominator,r.denominator)}};var Uf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},jf,za,Bx,Ix,Po,Kf,Tx,Ca=class{constructor(e,r){jf.set(this,new X),za.set(this,void 0),Bx.set(this,void 0),Ix.set(this,void 0),Po.set(this,void 0),Kf.set(this,void 0),Tx.set(this,()=>{let{tempoTrack:{enabled:s}}=Wt(this,za,"f");return s.getValue()?Wt(this,Po,"f").isEmpty()?b.None:Wt(this,Po,"f").unwrap().events.isEmpty()?b.None:Wt(this,Po,"f"):b.None}),Uf(this,za,r,"f"),Uf(this,Bx,new Px(e,r.markerTrack),"f"),Uf(this,Ix,new kx(e,r.signature,r.signatureTrack),"f"),Uf(this,Po,new $r,"f"),Uf(this,Kf,new me,"f");let n=Wt(this,jf,"f").own(new X),i=()=>Wt(this,Kf,"f").notify(Wt(this,Tx,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;Wt(this,jf,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>Wt(this,Po,"f").clear(),some:({box:u})=>{let d=e.boxAdapters.adapterFor(u,Nr);Wt(this,Po,"f").wrap(d),n.ownAll(d.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(Wt(this,Tx,"f").call(this)),Wt(this,Kf,"f").subscribe(e)}get box(){return Wt(this,za,"f")}get uuid(){return Wt(this,za,"f").address.uuid}get address(){return Wt(this,za,"f").address}get markerTrack(){return Wt(this,Bx,"f")}get signatureTrack(){return Wt(this,Ix,"f")}get tempoTrackEvents(){return Wt(this,Po,"f")}get signature(){let{nominator:e,denominator:r}=Wt(this,za,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=Wt(this,za,"f").signature;return Te.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Wt(this,za,"f").signature.subscribe(()=>e(this.signature))}terminate(){Wt(this,jf,"f").terminate()}};jf=new WeakMap,za=new WeakMap,Bx=new WeakMap,Ix=new WeakMap,Po=new WeakMap,Kf=new WeakMap,Tx=new WeakMap;var UT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},vs,xs=class{constructor(e,r){vs.set(this,void 0),UT(this,vs,r,"f")}get box(){return Wf(this,vs,"f")}get uuid(){return Wf(this,vs,"f").address.uuid}get address(){return Wf(this,vs,"f").address}get source(){return Wf(this,vs,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return Wf(this,vs,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};vs=new WeakMap;var Wl=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Dx,Ll,Zl,Rx,Cx,Lf,vn=class{constructor(e,r){Dx.set(this,void 0),Ll.set(this,void 0),Zl.set(this,void 0),Rx.set(this,void 0),Cx.set(this,void 0),Lf.set(this,!1),Wl(this,Dx,e,"f"),Wl(this,Ll,r,"f"),Wl(this,Zl,new X,"f"),Wl(this,Rx,r.attributes,"f"),Wl(this,Cx,gn(this,Zl,"f").own(new le(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return gn(this,Zl,"f").own(e)}ownAll(...e){gn(this,Zl,"f").ownAll(...e)}onSelected(){Wl(this,Lf,!0,"f")}onDeselected(){Wl(this,Lf,!1,"f")}isSelected(){return gn(this,Lf,"f")}get box(){return gn(this,Ll,"f")}get attributes(){return gn(this,Rx,"f")}get uuid(){return gn(this,Ll,"f").address.uuid}get address(){return gn(this,Ll,"f").address}get parameters(){return gn(this,Cx,"f")}get modular(){return gn(this,Dx,"f").boxAdapters.adapterFor(gn(this,Ll,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,ys)}terminate(){gn(this,Zl,"f").terminate()}};Dx=new WeakMap,Ll=new WeakMap,Zl=new WeakMap,Rx=new WeakMap,Cx=new WeakMap,Lf=new WeakMap;var zx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$o=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ox,ws,Zf,Vx,Ur;(function(t){t.Input="input",t.Output="output"})(Ur||(Ur={}));var jr=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){Ox.set(this,void 0),ws.set(this,void 0),Zf.set(this,void 0),Vx.set(this,void 0),zx(this,Ox,e,"f"),zx(this,ws,r,"f"),zx(this,Zf,n,"f"),zx(this,Vx,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(r=>e.field.pointerRules.accepts.some(n=>n===r))}get connections(){return $o(this,ws,"f").pointerHub.isEmpty()?pe.empty():$o(this,ws,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>$o(this,Ox,"f").adapterFor(e,xs))}get field(){return $o(this,ws,"f")}get address(){return $o(this,ws,"f").address}get direction(){return $o(this,Zf,"f")}get name(){return $o(this,Vx,"f")}toString(){return`{ModuleConnectorAdapter address: ${$o(this,ws,"f").address.toString()}, direction: ${$o(this,Zf,"f")}}`}};Ox=new WeakMap,ws=new WeakMap,Zf=new WeakMap,Vx=new WeakMap;var q_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Gf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ux,Hf,qf,Qc=class extends vn{constructor(e,r){super(e,r),Ux.set(this,void 0),Hf.set(this,void 0),qf.set(this,void 0),q_(this,Ux,this.parameters.createParameter(r.time,A.exponential(1,1e4),E.numeric({unit:"ms"}),"Time"),"f"),q_(this,Hf,jr.create(e.boxAdapters,r.voltageInput,Ur.Input,"Input"),"f"),q_(this,qf,jr.create(e.boxAdapters,r.voltageOutput,Ur.Output,"Output"),"f")}get parameterTime(){return Gf(this,Ux,"f")}get voltageInput(){return Gf(this,Hf,"f")}get voltageOutput(){return Gf(this,qf,"f")}get inputs(){return[Gf(this,Hf,"f")]}get outputs(){return[Gf(this,qf,"f")]}};Ux=new WeakMap,Hf=new WeakMap,qf=new WeakMap;var jT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},P$=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Jf,ed=class extends vn{constructor(e,r){super(e,r),Jf.set(this,void 0),jT(this,Jf,jr.create(e.boxAdapters,r.input,Ur.Input,"Input"),"f")}get voltageInput(){return P$(this,Jf,"f")}get inputs(){return[P$(this,Jf,"f")]}get outputs(){return pe.empty()}};Jf=new WeakMap;var J_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},jx,Xf,Qf,td=class extends vn{constructor(e,r){super(e,r),jx.set(this,void 0),Xf.set(this,void 0),Qf.set(this,void 0),J_(this,jx,this.parameters.createParameter(r.gain,A.DefaultDecibel,E.numeric({unit:"db"}),"Gain"),"f"),J_(this,Xf,jr.create(e.boxAdapters,r.voltageInput,Ur.Input,"Input"),"f"),J_(this,Qf,jr.create(e.boxAdapters,r.voltageOutput,Ur.Output,"Output"),"f")}get parameterGain(){return Yf(this,jx,"f")}get voltageInput(){return Yf(this,Xf,"f")}get voltageOutput(){return Yf(this,Qf,"f")}get inputs(){return[Yf(this,Xf,"f")]}get outputs(){return[Yf(this,Qf,"f")]}};jx=new WeakMap,Xf=new WeakMap,Qf=new WeakMap;var Y_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},X_=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Kx,Wx,Lx,rd=class extends vn{constructor(e,r){super(e,r),Kx.set(this,void 0),Wx.set(this,void 0),Lx.set(this,void 0),Y_(this,Kx,jr.create(e.boxAdapters,r.voltageInputX,Ur.Input,"X"),"f"),Y_(this,Wx,jr.create(e.boxAdapters,r.voltageInputY,Ur.Input,"Y"),"f"),Y_(this,Lx,jr.create(e.boxAdapters,r.voltageOutput,Ur.Output,"Result"),"f")}get inputs(){return[X_(this,Kx,"f"),X_(this,Wx,"f")]}get outputs(){return[X_(this,Lx,"f")]}};Kx=new WeakMap,Wx=new WeakMap,Lx=new WeakMap;var KT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$$=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},em,id=class extends vn{constructor(e,r){super(e,r),em.set(this,void 0),KT(this,em,jr.create(e.boxAdapters,r.output,Ur.Output,"Output"),"f")}get voltageOutput(){return $$(this,em,"f")}get inputs(){return pe.empty()}get outputs(){return[$$(this,em,"f")]}};em=new WeakMap;var nd;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>je(r.accept({visitModuleGainBox:n=>e.adapterFor(n,td),visitModuleDelayBox:n=>e.adapterFor(n,Qc),visitModuleMultiplierBox:n=>e.adapterFor(n,rd),visitModularAudioInputBox:n=>e.adapterFor(n,id),visitModularAudioOutputBox:n=>e.adapterFor(n,ed)}),`Could not find ModuleAdapter for ${r.name}`)})(nd||(nd={}));var M$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Gl=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Zx,Gx,Hl,Q_,ad=class{constructor(e,r){Zx.add(this),Gx.set(this,void 0),Hl.set(this,void 0),M$(this,Gx,e,"f"),M$(this,Hl,r,"f")}get box(){return Gl(this,Hl,"f")}get uuid(){return Gl(this,Hl,"f").address.uuid}get address(){return Gl(this,Hl,"f").address}get moduleAdapter(){return nd.adapterFor(Gl(this,Gx,"f").boxAdapters,Gl(this,Zx,"a",Q_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Gl(this,Zx,"a",Q_).address)}terminate(){}};Gx=new WeakMap,Hl=new WeakMap,Zx=new WeakSet,Q_=function(){return Gl(this,Hl,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var N$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},yi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},od,wi,sd=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Modular,od.set(this,void 0),wi.set(this,void 0),N$(this,od,e,"f"),N$(this,wi,r,"f")}get box(){return yi(this,wi,"f")}get uuid(){return yi(this,wi,"f").address.uuid}get address(){return yi(this,wi,"f").address}get indexField(){return yi(this,wi,"f").index}get labelField(){return yi(this,wi,"f").label}get enabledField(){return yi(this,wi,"f").enabled}get minimizedField(){return yi(this,wi,"f").minimized}get host(){return yi(this,wi,"f").host}parameterAt(e){return K("Not yet implemented")}deviceHost(){return yi(this,od,"f").boxAdapters.adapterFor(yi(this,wi,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return yi(this,od,"f").boxAdapters.adapterFor(yi(this,wi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ys)}elements(){return yi(this,wi,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>yi(this,od,"f").boxAdapters.adapterFor(e.box,ad))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};od=new WeakMap,wi=new WeakMap;var tm=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ut=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ld,bs,ud,Wi,ql,Jl,ys=class{constructor(e,r){ld.set(this,new X),bs.set(this,void 0),ud.set(this,void 0),Wi.set(this,void 0),ql.set(this,void 0),Jl.set(this,void 0),tm(this,ud,e,"f"),tm(this,Wi,r,"f"),tm(this,bs,ut(this,ld,"f").own(new ar),"f"),tm(this,ql,M.newSet(s=>s.uuid),"f"),tm(this,Jl,M.newSet(s=>s.uuid),"f");let n=s=>{let u=nd.adapterFor(ut(this,ud,"f").boxAdapters,s.box);ut(this,ql,"f").add(u)&&ut(this,bs,"f").proxy.onModuleAdded(u)},i=s=>ut(this,bs,"f").proxy.onModuleRemoved(ut(this,ql,"f").removeByKey(s.address.uuid)),a=s=>{let u=ut(this,ud,"f").boxAdapters.adapterFor(s.box,xs);ut(this,Jl,"f").add(u)&&ut(this,bs,"f").proxy.onConnectionAdded(u)},o=s=>ut(this,bs,"f").proxy.onConnectionRemoved(ut(this,Jl,"f").removeByKey(s.address.uuid));ut(this,Wi,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),ut(this,Wi,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),ut(this,ld,"f").own(ut(this,Wi,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),ut(this,ld,"f").own(ut(this,Wi,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return v_(e.onModuleAdded,r=>ut(this,ql,"f").forEach(n=>r(n))),v_(e.onConnectionAdded,r=>ut(this,Jl,"f").forEach(n=>r(n))),ut(this,bs,"f").subscribe(e)}get box(){return ut(this,Wi,"f")}get address(){return ut(this,Wi,"f").address}get uuid(){return ut(this,Wi,"f").address.uuid}get editingField(){return ut(this,Wi,"f").editing}get labelField(){return ut(this,Wi,"f").label}get modules(){return ut(this,ql,"f").values()}get connections(){return ut(this,Jl,"f").values()}get device(){return ut(this,ud,"f").boxAdapters.adapterFor(je(ut(this,Wi,"f").device.pointerHub.incoming().at(0),"No device found").box,sd)}terminate(){console.debug(`terminate ${this}`),ut(this,ld,"f").terminate()}};ld=new WeakMap,bs=new WeakMap,ud=new WeakMap,Wi=new WeakMap,ql=new WeakMap,Jl=new WeakMap;var rm=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ri=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},e0,dd,im,Hx,cd,am,qx,nm,Jx,k$,Oa=class{constructor(e,r){e0.add(this),this.type="groove-adapter",im.set(this,new X),Hx.set(this,void 0),cd.set(this,void 0),am.set(this,void 0),qx.set(this,new cg({duration:()=>ri(this,Jx,"f"),fx:n=>b_(n,ri(this,nm,"f")),fy:n=>b_(n,1-ri(this,nm,"f"))})),nm.set(this,0),Jx.set(this,Te.SemiQuaver*2),rm(this,Hx,e,"f"),rm(this,cd,r,"f"),rm(this,am,ri(this,im,"f").own(new le(ri(this,Hx,"f"))),"f"),this.namedParameter=ri(this,e0,"m",k$).call(this,r),ri(this,im,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>rm(this,Jx,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>rm(this,nm,UP(n.getValue(),.01),"f")))}unwarp(e){return ri(this,qx,"f").unwarp(e)}warp(e){return ri(this,qx,"f").warp(e)}get box(){return ri(this,cd,"f")}get uuid(){return ri(this,cd,"f").address.uuid}get address(){return ri(this,cd,"f").address}terminate(){ri(this,im,"f").terminate()}};dd=Oa,im=new WeakMap,Hx=new WeakMap,cd=new WeakMap,am=new WeakMap,qx=new WeakMap,nm=new WeakMap,Jx=new WeakMap,e0=new WeakSet,k$=function(e){return{duration:ri(this,am,"f").createParameter(e.duration,A.values(dd.DurationPPQNs),E.values("",dd.DurationPPQNs,dd.DurationStrings),"duration"),amount:ri(this,am,"f").createParameter(e.amount,A.unipolar(),E.percent({fractionDigits:0}),"amount")}};Oa.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Oa.DurationPPQNs=dd.Durations.map(([t,e])=>Te.fromSignature(t,e));Oa.DurationStrings=dd.Durations.map(([t,e])=>`${t}/${e}`);var pd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ut=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Va,_s,fd,Yx,Xx,om,sm,t0,Fs=class{constructor(e,r,n,i,a){Va.set(this,void 0),_s.set(this,void 0),fd.set(this,void 0),Yx.set(this,void 0),Xx.set(this,void 0),om.set(this,new X),sm.set(this,void 0),t0.set(this,b.None),pd(this,Va,e,"f"),pd(this,_s,r,"f"),pd(this,fd,n,"f"),pd(this,Yx,i,"f"),pd(this,Xx,a??0,"f"),pd(this,sm,Ut(this,om,"f").own(new me),"f"),Ut(this,om,"f").own(Ut(this,Va,"f").subscribe(()=>Ut(this,sm,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Ut(this,Va,"f")}get valueMapping(){return Ut(this,_s,"f")}get stringMapping(){return Ut(this,fd,"f")}get name(){return Ut(this,Yx,"f")}get anchor(){return Ut(this,Xx,"f")}get type(){return Ut(this,Va,"f").type}get address(){return Ut(this,Va,"f").address}get track(){return Ut(this,t0,"f")}subscribe(e){return Ut(this,sm,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Ut(this,Va,"f").getValue()}setValue(e){Ut(this,Va,"f").setValue(Ut(this,_s,"f").clamp(e))}setUnitValue(e){this.setValue(Ut(this,_s,"f").y(e))}getUnitValue(){return Ut(this,_s,"f").x(this.getValue())}getPrintValue(){return Ut(this,fd,"f").x(this.getValue())}setPrintValue(e){let r=Ut(this,fd,"f").y(e);r.type==="unitValue"?this.setUnitValue(lt(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Ut(this,_s,"f").clamp(Ut(this,Va,"f").initValue))}terminate(){Ut(this,om,"f").terminate()}};Va=new WeakMap,_s=new WeakMap,fd=new WeakMap,Yx=new WeakMap,Xx=new WeakMap,om=new WeakMap,sm=new WeakMap,t0=new WeakMap;var md=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},xn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ua,Qx,ey,ty,ry,iy,ny=class{constructor(e){Ua.set(this,void 0),Qx.set(this,void 0),ey.set(this,void 0),ty.set(this,void 0),ry.set(this,void 0),iy.set(this,void 0),md(this,Ua,e,"f"),md(this,Qx,new Fs(xn(this,Ua,"f").keyboard,A.values([88,76,61,49]),E.numeric({fractionDigits:1}),"Keyboard Type"),"f"),md(this,ey,new Fs(xn(this,Ua,"f").timeRangeInQuarters,A.exponential(1,64),E.numeric({fractionDigits:1}),"Time-Range"),"f"),md(this,ty,new Fs(xn(this,Ua,"f").noteScale,A.exponential(.5,2),E.numeric({fractionDigits:1}),"Note Scale"),"f"),md(this,ry,new Fs(xn(this,Ua,"f").noteLabels,A.bool,E.bool,"Note Labels"),"f"),md(this,iy,new Fs(xn(this,Ua,"f").transpose,A.linearInteger(-48,48),E.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return xn(this,Ua,"f").box.subscribe(ze.Children,()=>e(this))}get object(){return xn(this,Ua,"f")}get keyboard(){return xn(this,Qx,"f")}get timeRangeInQuarters(){return xn(this,ey,"f")}get noteScale(){return xn(this,ty,"f")}get noteLabels(){return xn(this,ry,"f")}get transpose(){return xn(this,iy,"f")}};Ua=new WeakMap,Qx=new WeakMap,ey=new WeakMap,ty=new WeakMap,ry=new WeakMap,iy=new WeakMap;var lm=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},dr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Yl,Li,Xl,ay,oy,sy=class{constructor(e,r){Yl.set(this,void 0),Li.set(this,void 0),Xl.set(this,void 0),ay.set(this,void 0),oy.set(this,void 0),lm(this,Yl,e,"f"),lm(this,Li,r,"f"),lm(this,Xl,Ct.create(dr(this,Li,"f").audioUnits,n=>dr(this,Yl,"f").boxAdapters.adapterFor(n,pn),l.AudioUnits),"f"),lm(this,ay,new bx(dr(this,Li,"f").audioBusses.pointerHub,n=>dr(this,Yl,"f").boxAdapters.adapterFor(n,Ri),l.AudioBusses),"f"),lm(this,oy,new ny(dr(this,Li,"f").pianoMode),"f")}get uuid(){return dr(this,Li,"f").address.uuid}get address(){return dr(this,Li,"f").address}get box(){return dr(this,Li,"f")}get audioBusses(){return dr(this,ay,"f")}get audioUnits(){return dr(this,Xl,"f")}get clips(){return dr(this,Xl,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return dr(this,Yl,"f").boxAdapters.adapterFor(dr(this,Li,"f").groove.targetVertex.unwrap("no groove").box,Oa)}get timeline(){return dr(this,Yl,"f").boxAdapters.adapterFor(dr(this,Li,"f").timeline.targetVertex.unwrap("no timeline").box,Ca)}get pianoMode(){return dr(this,oy,"f")}get created(){return new Date(dr(this,Li,"f").created.getValue())}get midiOutputDevices(){return dr(this,Li,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ce(e,Ho))}*labeledAudioOutputs(){for(let e of dr(this,Xl,"f").adapters())yield{label:e.label,address:e.address,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){dr(this,Xl,"f").terminate()}};Yl=new WeakMap,Li=new WeakMap,Xl=new WeakMap,ay=new WeakMap,oy=new WeakMap;var r0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Kr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},i0,um,ea,As,B$,ly=class{constructor(e,r){i0.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=ie.Tape,um.set(this,void 0),ea.set(this,void 0),As.set(this,void 0),r0(this,um,e,"f"),r0(this,ea,r,"f"),r0(this,As,new le(Kr(this,um,"f")),"f"),this.namedParameter=Kr(this,i0,"m",B$).call(this,r)}get box(){return Kr(this,ea,"f")}get uuid(){return Kr(this,ea,"f").address.uuid}get address(){return Kr(this,ea,"f").address}get labelField(){return Kr(this,ea,"f").label}get iconField(){return Kr(this,ea,"f").icon}get defaultTrackType(){return ge.Audio}get enabledField(){return Kr(this,ea,"f").enabled}get minimizedField(){return Kr(this,ea,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Kr(this,um,"f").boxAdapters.adapterFor(Kr(this,ea,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Kr(this,As,"f").terminate()}};um=new WeakMap,ea=new WeakMap,As=new WeakMap,i0=new WeakSet,B$=function(e){return{flutter:Kr(this,As,"f").createParameter(e.flutter,A.unipolar(),E.percent(),"flutter"),wow:Kr(this,As,"f").createParameter(e.wow,A.unipolar(),E.percent(),"wow"),noise:Kr(this,As,"f").createParameter(e.noise,A.unipolar(),E.percent(),"noise"),saturation:Kr(this,As,"f").createParameter(e.saturation,A.unipolar(),E.percent(),"saturation")}};var Ql=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[ma.sine,ma.triangle,ma.saw,ma.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:A.exponential(20,2e4),CUTOFF_STRING_MAPPING:E.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:A.values(r),FILTER_ORDER_STRING_MAPPING:E.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:A.values(i),LFO_WAVEFORM_STRING_MAPPING:E.values("",i,a)}})();var n0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Le=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},a0,cm,ta,nt,I$,uy=class{constructor(e,r){a0.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Vaporisateur,cm.set(this,void 0),ta.set(this,void 0),nt.set(this,void 0),n0(this,cm,e,"f"),n0(this,ta,r,"f"),n0(this,nt,new le(Le(this,cm,"f")),"f"),this.namedParameter=Le(this,a0,"m",I$).call(this,r)}get box(){return Le(this,ta,"f")}get uuid(){return Le(this,ta,"f").address.uuid}get address(){return Le(this,ta,"f").address}get labelField(){return Le(this,ta,"f").label}get iconField(){return Le(this,ta,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Le(this,ta,"f").enabled}get minimizedField(){return Le(this,ta,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Le(this,cm,"f").boxAdapters.adapterFor(Le(this,ta,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Le(this,nt,"f").terminate()}};cm=new WeakMap,ta=new WeakMap,nt=new WeakMap,a0=new WeakSet,I$=function(e){let r=[ga.Monophonic,ga.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:Le(this,nt,"f").createParameter(n.waveform,A.linearInteger(0,3),E.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Le(this,nt,"f").createParameter(n.volume,A.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Le(this,nt,"f").createParameter(n.octave,A.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),tune:Le(this,nt,"f").createParameter(n.tune,A.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Le(this,nt,"f").createParameter(e.noise.volume,A.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Le(this,nt,"f").createParameter(e.noise.attack,A.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Le(this,nt,"f").createParameter(e.noise.hold,A.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Le(this,nt,"f").createParameter(e.noise.release,A.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Le(this,nt,"f").createParameter(e.filterOrder,Ql.FILTER_ORDER_VALUE_MAPPING,Ql.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Le(this,nt,"f").createParameter(e.cutoff,Ql.CUTOFF_VALUE_MAPPING,Ql.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Le(this,nt,"f").createParameter(e.resonance,A.exponential(.01,10),E.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Le(this,nt,"f").createParameter(e.attack,A.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Le(this,nt,"f").createParameter(e.decay,A.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Le(this,nt,"f").createParameter(e.sustain,A.unipolar(),E.percent({fractionDigits:1}),"Sustain"),release:Le(this,nt,"f").createParameter(e.release,A.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Le(this,nt,"f").createParameter(e.filterEnvelope,A.bipolar(),E.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Le(this,nt,"f").createParameter(e.filterKeyboard,A.bipolar(),E.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Le(this,nt,"f").createParameter(e.voicingMode,A.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:Le(this,nt,"f").createParameter(e.glideTime,A.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),unisonCount:Le(this,nt,"f").createParameter(e.unisonCount,A.values([1,3,5]),E.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:Le(this,nt,"f").createParameter(e.unisonDetune,A.exponential(1,1200),E.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Le(this,nt,"f").createParameter(e.unisonStereo,A.unipolar(),E.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Le(this,nt,"f").createParameter(e.lfo.waveform,Ql.LFO_WAVEFORM_VALUE_MAPPING,Ql.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Le(this,nt,"f").createParameter(e.lfo.rate,A.exponential(1e-4,30),E.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Le(this,nt,"f").createParameter(e.lfo.targetTune,A.bipolar(),E.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Le(this,nt,"f").createParameter(e.lfo.targetVolume,A.bipolar(),E.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Le(this,nt,"f").createParameter(e.lfo.targetCutoff,A.bipolar(),E.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var o0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},xr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s0,cy,dm,yn,ja,T$,eu=class{constructor(e,r){s0.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Arpeggio,dm.set(this,void 0),yn.set(this,void 0),ja.set(this,void 0),o0(this,dm,e,"f"),o0(this,yn,r,"f"),o0(this,ja,new le(xr(this,dm,"f")),"f"),this.namedParameter=xr(this,s0,"m",T$).call(this,r)}get box(){return xr(this,yn,"f")}get uuid(){return xr(this,yn,"f").address.uuid}get address(){return xr(this,yn,"f").address}get indexField(){return xr(this,yn,"f").index}get labelField(){return xr(this,yn,"f").label}get enabledField(){return xr(this,yn,"f").enabled}get minimizedField(){return xr(this,yn,"f").minimized}get host(){return xr(this,yn,"f").host}deviceHost(){return xr(this,dm,"f").boxAdapters.adapterFor(xr(this,yn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){xr(this,ja,"f").terminate()}};cy=eu,dm=new WeakMap,yn=new WeakMap,ja=new WeakMap,s0=new WeakSet,T$=function(e){return{modeIndex:xr(this,ja,"f").createParameter(e.modeIndex,A.linearInteger(0,2),E.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:xr(this,ja,"f").createParameter(e.numOctaves,A.linearInteger(1,5),E.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:xr(this,ja,"f").createParameter(e.rateIndex,A.linearInteger(0,cy.RateFractions.length-1),cy.RateStringMapping,"Rate"),gate:xr(this,ja,"f").createParameter(e.gate,A.linear(0,2),E.percent({fractionDigits:0}),"Gate"),repeat:xr(this,ja,"f").createParameter(e.repeat,A.linearInteger(1,16),E.numeric({fractionDigits:0}),"Repeat"),velocity:xr(this,ja,"f").createParameter(e.velocity,A.bipolar(),E.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};eu.RateFractions=Oo.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();eu.RateStringMapping=E.indices("",cy.RateFractions.map(([t,e])=>`${t}/${e}`));var l0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},u0,pm,wn,tu,D$,dy=class{constructor(e,r){u0.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Pitch,pm.set(this,void 0),wn.set(this,void 0),tu.set(this,void 0),l0(this,pm,e,"f"),l0(this,wn,r,"f"),l0(this,tu,new le(Wr(this,pm,"f")),"f"),this.namedParameter=Wr(this,u0,"m",D$).call(this,r)}get box(){return Wr(this,wn,"f")}get uuid(){return Wr(this,wn,"f").address.uuid}get address(){return Wr(this,wn,"f").address}get indexField(){return Wr(this,wn,"f").index}get labelField(){return Wr(this,wn,"f").label}get enabledField(){return Wr(this,wn,"f").enabled}get minimizedField(){return Wr(this,wn,"f").minimized}get host(){return Wr(this,wn,"f").host}deviceHost(){return Wr(this,pm,"f").boxAdapters.adapterFor(Wr(this,wn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Wr(this,tu,"f").terminate()}};pm=new WeakMap,wn=new WeakMap,tu=new WeakMap,u0=new WeakSet,D$=function(e){return{octaves:Wr(this,tu,"f").createParameter(e.octaves,A.linearInteger(-7,7),E.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Wr(this,tu,"f").createParameter(e.semiTones,A.linearInteger(-36,36),E.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Wr(this,tu,"f").createParameter(e.cents,A.linear(-50,50),E.numeric({unit:"cents",fractionDigits:1}),"cents")}};var WT=/^\/\/ @label .+$/m,R$=/^\/\/ @param .+$/gm,C$=/^\/\/ @sample .+$/gm;var z$=/^\/\/ @(group|param|sample) .+$/gm,O$=/^\/\/ @(?:param|sample) \S+/gm,hd=1e-6,LT=["linear","exp","int","bool"],ZT=new class{x(t){return{value:t>=.5?"On":"Off",unit:""}}y(t){let e=t.trim().toLowerCase();return{type:"explicit",value:e==="on"||e==="true"||e==="yes"?1:0}}},V$=t=>{let e=t.replace(/^\/\/ @param\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(e.length===0)throw new Error(`Malformed @param: '${t}'`);let r=e[0];if(e.length===1)return{label:r,defaultValue:0,min:0,max:1,mapping:"unipolar",unit:""};let n=e[1];if(n==="true"||n==="false")return{label:r,defaultValue:n==="true"?1:0,min:0,max:1,mapping:"bool",unit:""};if(n==="bool")return{label:r,defaultValue:0,min:0,max:1,mapping:"bool",unit:""};let i=parseFloat(n);if(isNaN(i))throw new Error(`Malformed @param: '${t}' \u2014 '${n}' is not a valid number`);if(e.length===2)return{label:r,defaultValue:i,min:0,max:1,mapping:"unipolar",unit:""};if(e.length===3&&e[2]==="bool")return{label:r,defaultValue:i>=.5?1:0,min:0,max:1,mapping:"bool",unit:""};if(e.length===4){let d=parseFloat(e[2]),m=parseFloat(e[3]);if(isNaN(d)||isNaN(m))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(m-d<hd)throw new Error(`Malformed @param: '${t}' \u2014 min (${d}) must be less than max (${m})`);if(i<d-hd||i>m+hd)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${d}, ${m}]`);return{label:r,defaultValue:i,min:d,max:m,mapping:"linear",unit:""}}if(e.length<5)throw new Error(`Malformed @param: '${t}' \u2014 expected: // @param <name> <default> <min> <max> [type] [unit]`);let a=parseFloat(e[2]),o=parseFloat(e[3]),s=e[4],u=e.length>=6?e[5]:"";if(isNaN(a)||isNaN(o))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(!LT.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<hd)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-hd||i>o+hd)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${a}, ${o}]`);return{label:r,defaultValue:i,min:a,max:o,mapping:s,unit:u}},U$=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,GT=(t,e)=>U$(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,Er;(function(t){t.isEqual=GT,t.parseLabel=e=>{let r=WT.exec(e);if(r===null)return b.None;let n=r[0].replace(/^\/\/ @label\s+/,"").trim();if(n.length===0)throw new Error("Malformed @label: expected: // @label <name>");return b.wrap(n)},t.parseParams=e=>{let r=[],n;for(R$.lastIndex=0;(n=R$.exec(e))!==null;)r.push(V$(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(C$.lastIndex=0;(n=C$.exec(e))!==null;){let i=n[0].replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(i.length===0||i[0].length===0)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);if(i.length>1)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);r.push({label:i[0]})}return r},t.parseDeclarationOrder=e=>{let r=new Map,n;O$.lastIndex=0;let i=0;for(;(n=O$.exec(e))!==null;){let a=n[0].replace(/^\/\/ @(?:param|sample)\s+/,"").split(/\s+/)[0];r.has(a)||r.set(a,i++)}return r},t.parseGroups=e=>{let r=[],n=null,i=[];z$.lastIndex=0;let a;for(;(a=z$.exec(e))!==null;){let o=a[0],s=a[1];if(s==="group"){(i.length>0||n!==null)&&r.push({group:n,items:i});let u=o.replace(/^\/\/ @group\s+/,"").trim().split(/\s+/);n={label:u[0],color:u[1]??"dark"},i=[]}else if(s==="param")i.push({type:"param",declaration:V$(o)});else if(s==="sample"){let u=o.replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(u.length===0||u[0].length===0)throw new Error(`Malformed @sample: '${o}' \u2014 expected: // @sample <name>`);i.push({type:"sample",declaration:{label:u[0]}})}}return(i.length>0||n!==null)&&r.push({group:n,items:i}),r},t.resolveValueMapping=e=>{switch(e.mapping){case"unipolar":return A.unipolar();case"linear":return A.linear(e.min,e.max);case"exp":return A.exponential(e.min,e.max);case"int":return A.linearInteger(e.min,e.max);case"bool":return A.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return E.percent();case"linear":return E.numeric({unit:e.unit,fractionDigits:2});case"exp":return E.numeric({unit:e.unit,fractionDigits:2});case"int":return E.numeric({unit:e.unit,fractionDigits:0});case"bool":return ZT}},t.resolveParamMappings=e=>({valueMapping:t.resolveValueMapping(e),stringMapping:t.resolveStringMapping(e)}),t.subscribeScriptParams=(e,r,n)=>{let i=new Map,a=new me;return{terminable:fe.many(n.pointerHub.catchupAndSubscribe({onAdded:(({box:s})=>{let u=Ce(s,_a),d=u.label.getValue(),x=t.parseParams(r.getValue()).find(F=>F.label===d),{valueMapping:g,stringMapping:w}=U(x)?t.resolveParamMappings(x):{valueMapping:A.unipolar(),stringMapping:E.percent({fractionDigits:1})};e.createParameter(u.value,g,w,d,void 0,u.defaultValue.getValue()),U(x)&&i.set(d,x)}),onRemoved:(({box:s})=>{let u=Ce(s,_a);i.delete(u.label.getValue()),e.removeParameter(u.value.address)})}),r.subscribe(()=>{let s=t.parseParams(r.getValue());for(let u of e.parameters()){let d=s.find(w=>w.label===u.name);if(!U(d))continue;let m=i.get(u.name);if(U(m)&&U$(m,d))continue;let{valueMapping:x,stringMapping:g}=t.resolveParamMappings(d);u.updateMappings(x,g),i.set(u.name,d)}a.notify()}),a),codeChanged:a}}})(Er||(Er={}));var py=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ir=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},fm,mm,bn,hm,fy,my=class{constructor(e,r){fm.set(this,new X),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Spielwerk,mm.set(this,void 0),bn.set(this,void 0),hm.set(this,void 0),fy.set(this,void 0),py(this,mm,e,"f"),py(this,bn,r,"f"),py(this,hm,Ir(this,fm,"f").own(new le(Ir(this,mm,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(Ir(this,hm,"f"),r.code,r.parameters);Ir(this,fm,"f").own(n),py(this,fy,i,"f")}get box(){return Ir(this,bn,"f")}get uuid(){return Ir(this,bn,"f").address.uuid}get address(){return Ir(this,bn,"f").address}get indexField(){return Ir(this,bn,"f").index}get labelField(){return Ir(this,bn,"f").label}get enabledField(){return Ir(this,bn,"f").enabled}get minimizedField(){return Ir(this,bn,"f").minimized}get host(){return Ir(this,bn,"f").host}get parameters(){return Ir(this,hm,"f")}get codeChanged(){return Ir(this,fy,"f")}deviceHost(){return Ir(this,mm,"f").boxAdapters.adapterFor(Ir(this,bn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ir(this,fm,"f").terminate()}};fm=new WeakMap,mm=new WeakMap,bn=new WeakMap,hm=new WeakMap,fy=new WeakMap;var hy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Lr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},gm,vm,ra,xm,gy,vy=class{constructor(e,r){gm.set(this,new X),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Apparat,vm.set(this,void 0),ra.set(this,void 0),xm.set(this,void 0),gy.set(this,void 0),hy(this,vm,e,"f"),hy(this,ra,r,"f"),hy(this,xm,Lr(this,gm,"f").own(new le(Lr(this,vm,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(Lr(this,xm,"f"),r.code,r.parameters);Lr(this,gm,"f").own(n),hy(this,gy,i,"f")}get box(){return Lr(this,ra,"f")}get uuid(){return Lr(this,ra,"f").address.uuid}get address(){return Lr(this,ra,"f").address}get labelField(){return Lr(this,ra,"f").label}get iconField(){return Lr(this,ra,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Lr(this,ra,"f").enabled}get minimizedField(){return Lr(this,ra,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Lr(this,xm,"f")}get codeChanged(){return Lr(this,gy,"f")}deviceHost(){return Lr(this,vm,"f").boxAdapters.adapterFor(Lr(this,ra,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Lr(this,gm,"f").terminate()}};gm=new WeakMap,vm=new WeakMap,ra=new WeakMap,xm=new WeakMap,gy=new WeakMap;var c0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Et=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},d0,ym,_n,Tr,j$,Es;(function(t){t.Waves=["Saw","Square","Pulse","Double Sine","Saw-Pulse","Res. Saw","Res. Triangle","Res. Trapezoid"],t.LineSelect=["1","2","1+1'","1+2'"],t.Modulation=["Off","Ring","Noise"],t.VibratoWaves=["Triangle","Saw Up","Saw Down","Square"],t.envelopeIndex=(e,r)=>e*3+(r==="pitch"?0:r==="dcw"?1:2)})(Es||(Es={}));var xy=class{constructor(e,r){d0.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Neon,ym.set(this,void 0),_n.set(this,void 0),Tr.set(this,void 0),c0(this,ym,e,"f"),c0(this,_n,r,"f"),c0(this,Tr,new le(Et(this,ym,"f")),"f"),this.namedParameter=Et(this,d0,"m",j$).call(this,r)}get box(){return Et(this,_n,"f")}get uuid(){return Et(this,_n,"f").address.uuid}get address(){return Et(this,_n,"f").address}get labelField(){return Et(this,_n,"f").label}get iconField(){return Et(this,_n,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Et(this,_n,"f").enabled}get minimizedField(){return Et(this,_n,"f").minimized}get acceptsMidiEvents(){return!0}envelope(e,r){return Et(this,_n,"f").envelopes.fields()[Es.envelopeIndex(e,r)]}deviceHost(){return Et(this,ym,"f").boxAdapters.adapterFor(Et(this,_n,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Et(this,Tr,"f").terminate()}};ym=new WeakMap,_n=new WeakMap,Tr=new WeakMap,d0=new WeakSet,j$=function(e){let r=[ga.Monophonic,ga.Polyphonic],n=(i,a)=>Et(this,Tr,"f").createParameter(i,A.linear(0,99),E.numeric({unit:"",fractionDigits:0}),a);return{lineSelect:Et(this,Tr,"f").createParameter(e.lineSelect,A.linearInteger(0,3),E.indices("",Es.LineSelect),"Line"),modulation:Et(this,Tr,"f").createParameter(e.modulation,A.linearInteger(0,2),E.indices("",Es.Modulation),"Mod"),octave:Et(this,Tr,"f").createParameter(e.octave,A.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),detune:Et(this,Tr,"f").createParameter(e.detune,A.linear(-4800,4800),E.numeric({unit:"ct",fractionDigits:0}),"Detune",.5),tune:Et(this,Tr,"f").createParameter(e.tune,A.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5),glideTime:Et(this,Tr,"f").createParameter(e.glideTime,A.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),voicingMode:Et(this,Tr,"f").createParameter(e.voicingMode,A.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),vibrato:{wave:Et(this,Tr,"f").createParameter(e.vibrato.wave,A.linearInteger(0,3),E.indices("",Es.VibratoWaves),"Vib. Wave"),delay:n(e.vibrato.delay,"Vib. Delay"),rate:n(e.vibrato.rate,"Vib. Rate"),depth:n(e.vibrato.depth,"Vib. Depth")},lines:e.lines.fields().map(i=>({wave1:Et(this,Tr,"f").createParameter(i.wave1,A.linearInteger(0,7),E.indices("",Es.Waves),"Wave 1"),wave2:Et(this,Tr,"f").createParameter(i.wave2,A.linearInteger(0,8),E.indices("",["Off",...Es.Waves]),"Wave 2"),dcwKeyFollow:Et(this,Tr,"f").createParameter(i.dcwKeyFollow,A.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCW Key Follow"),dcaKeyFollow:Et(this,Tr,"f").createParameter(i.dcaKeyFollow,A.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCA Key Follow")}))}};var p0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},bi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},f0,wm,ia,gd,K$,yy=class{constructor(e,r){f0.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Nano,wm.set(this,void 0),ia.set(this,void 0),gd.set(this,void 0),p0(this,wm,e,"f"),p0(this,ia,r,"f"),p0(this,gd,new le(bi(this,wm,"f")),"f"),this.namedParameter=bi(this,f0,"m",K$).call(this,r)}get box(){return bi(this,ia,"f")}get uuid(){return bi(this,ia,"f").address.uuid}get address(){return bi(this,ia,"f").address}get labelField(){return bi(this,ia,"f").label}get iconField(){return bi(this,ia,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return bi(this,ia,"f").enabled}get minimizedField(){return bi(this,ia,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return bi(this,wm,"f").boxAdapters.adapterFor(bi(this,ia,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bi(this,gd,"f").terminate()}};wm=new WeakMap,ia=new WeakMap,gd=new WeakMap,f0=new WeakSet,K$=function(e){return{volume:bi(this,gd,"f").createParameter(e.volume,A.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"volume"),release:bi(this,gd,"f").createParameter(e.release,A.exponential(.001,8),E.numeric({unit:"s",fractionDigits:3}),"release")}};var vd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},se=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},m0,ru,Ss,$e,wy,bm,ii,iu,W$,xd=class{constructor(e,r){m0.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",ru.set(this,new X),Ss.set(this,void 0),$e.set(this,void 0),wy.set(this,void 0),bm.set(this,void 0),ii.set(this,void 0),iu.set(this,b.None),vd(this,Ss,e,"f"),vd(this,$e,r,"f"),vd(this,wy,se(this,ru,"f").own(Ct.create(se(this,$e,"f").midiEffects,n=>se(this,Ss,"f").boxAdapters.adapterFor(n,te.isMidiEffect),l.MIDIEffectHost)),"f"),vd(this,bm,se(this,ru,"f").own(Ct.create(se(this,$e,"f").audioEffects,n=>se(this,Ss,"f").boxAdapters.adapterFor(n,te.isAudioEffect),l.AudioEffectHost)),"f"),vd(this,ii,se(this,ru,"f").own(new le(se(this,Ss,"f"))),"f"),this.namedParameter=se(this,m0,"m",W$).call(this,r),se(this,ru,"f").own(se(this,$e,"f").file.catchupAndSubscribe(n=>{vd(this,iu,n.targetVertex.map(({box:i})=>se(this,Ss,"f").boxAdapters.adapterFor(i,Wn)),"f"),se(this,iu,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,$e,"f")}get uuid(){return se(this,$e,"f").address.uuid}get address(){return se(this,$e,"f").address}get peakAddress(){return se(this,$e,"f").address.append(1001)}get indexField(){return se(this,$e,"f").index}get gate(){return se(this,$e,"f").gate.getValue()}get exclude(){return se(this,$e,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,iu,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,iu,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,$e,"f").icon}get defaultTrackType(){return ge.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return b.wrap(se(this,$e,"f").midiEffects)}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return b.wrap(se(this,$e,"f").audioEffects)}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}get hostsInstrument(){return!0}file(){return se(this,iu,"f")}fileUUID(){return se(this,$e,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){se(this,$e,"f").mute.reset(),se(this,$e,"f").solo.reset(),se(this,$e,"f").exclude.reset(),se(this,$e,"f").polyphone.reset(),se(this,$e,"f").pitch.reset(),se(this,$e,"f").attack.reset(),se(this,$e,"f").release.reset(),se(this,$e,"f").sampleStart.reset(),se(this,$e,"f").sampleEnd.reset(),se(this,$e,"f").gate.reset(),se(this,$e,"f").volume.reset(),se(this,$e,"f").panning.reset()}copyToIndex(e){qo.create(se(this,$e,"f").graph,M.generate(),r=>{r.file.refer(se(this,$e,"f").file.targetVertex.unwrap("file.target")),r.device.refer(se(this,$e,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(se(this,$e,"f").mute.getValue()),r.solo.setValue(se(this,$e,"f").solo.getValue()),r.sampleStart.setValue(se(this,$e,"f").sampleStart.getValue()),r.sampleEnd.setValue(se(this,$e,"f").sampleEnd.getValue()),r.attack.setValue(se(this,$e,"f").attack.getValue()),r.release.setValue(se(this,$e,"f").release.getValue()),r.pitch.setValue(se(this,$e,"f").pitch.getValue()),r.exclude.setValue(se(this,$e,"f").exclude.getValue()),r.gate.setValue(se(this,$e,"f").gate.getValue()),r.volume.setValue(se(this,$e,"f").volume.getValue()),r.panning.setValue(se(this,$e,"f").panning.getValue())})}get midiEffects(){return b.wrap(se(this,wy,"f"))}get inputAdapter(){return b.wrap(this)}get audioEffects(){return b.wrap(se(this,bm,"f"))}get labelField(){return Ce(se(this,$e,"f").file.targetVertex.unwrap("file.target").box,tn).fileName}get enabledField(){return se(this,$e,"f").enabled}get minimizedField(){return se(this,$e,"f").minimized}device(){return se(this,Ss,"f").boxAdapters.adapterFor(se(this,$e,"f").device.targetVertex.unwrap("device.target").box,yd)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>b.None};for(let e of se(this,bm,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,ru,"f").terminate()}};ru=new WeakMap,Ss=new WeakMap,$e=new WeakMap,wy=new WeakMap,bm=new WeakMap,ii=new WeakMap,iu=new WeakMap,m0=new WeakSet,W$=function(e){return{gate:se(this,ii,"f").createParameter(e.gate,A.linearInteger(0,2),E.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,ii,"f").createParameter(e.mute,A.bool,E.bool,"Mute"),solo:se(this,ii,"f").createParameter(e.solo,A.bool,E.bool,"Solo"),polyphone:se(this,ii,"f").createParameter(e.polyphone,A.bool,E.bool,"Polyphone"),exclude:se(this,ii,"f").createParameter(e.exclude,A.bool,E.bool,"Exclude"),pitch:se(this,ii,"f").createParameter(e.pitch,A.linear(-1200,1200),E.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,ii,"f").createParameter(e.sampleStart,A.unipolar(),E.percent(),"Start",0),sampleEnd:se(this,ii,"f").createParameter(e.sampleEnd,A.unipolar(),E.percent(),"End",1),attack:se(this,ii,"f").createParameter(e.attack,A.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,ii,"f").createParameter(e.release,A.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release"),volume:se(this,ii,"f").createParameter(e.volume,A.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Volume"),panning:se(this,ii,"f").createParameter(e.panning,A.bipolar(),E.panning,"Pan",.5)}};var by=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ni=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},wd,na,bd,_y,yd=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=ie.Playfield,wd.set(this,void 0),na.set(this,void 0),bd.set(this,void 0),_y.set(this,void 0),by(this,wd,e,"f"),by(this,na,r,"f"),by(this,bd,Ct.create(r.samples,n=>e.boxAdapters.adapterFor(n,xd),l.Sample),"f"),by(this,_y,new le(ni(this,wd,"f")),"f")}reset(){ni(this,bd,"f").adapters().forEach(e=>e.box.delete())}get box(){return ni(this,na,"f")}get uuid(){return ni(this,na,"f").address.uuid}get address(){return ni(this,na,"f").address}get labelField(){return ni(this,na,"f").label}get iconField(){return ni(this,na,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return ni(this,na,"f").enabled}get minimizedField(){return ni(this,na,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return ni(this,bd,"f")}get context(){return ni(this,wd,"f")}deviceHost(){return ni(this,wd,"f").boxAdapters.adapterFor(ni(this,na,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None};for(let e of ni(this,bd,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){ni(this,_y,"f").terminate()}};wd=new WeakMap,na=new WeakMap,bd=new WeakMap,_y=new WeakMap;var h0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},yr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},g0,_m,Fn,Ka,L$,Fy=class{constructor(e,r){g0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.StereoTool,_m.set(this,void 0),Fn.set(this,void 0),Ka.set(this,void 0),h0(this,_m,e,"f"),h0(this,Fn,r,"f"),h0(this,Ka,new le(yr(this,_m,"f")),"f"),this.namedParameter=yr(this,g0,"m",L$).call(this,r)}get box(){return yr(this,Fn,"f")}get uuid(){return yr(this,Fn,"f").address.uuid}get address(){return yr(this,Fn,"f").address}get indexField(){return yr(this,Fn,"f").index}get labelField(){return yr(this,Fn,"f").label}get enabledField(){return yr(this,Fn,"f").enabled}get minimizedField(){return yr(this,Fn,"f").minimized}get host(){return yr(this,Fn,"f").host}deviceHost(){return yr(this,_m,"f").boxAdapters.adapterFor(yr(this,Fn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){yr(this,Ka,"f").terminate()}};_m=new WeakMap,Fn=new WeakMap,Ka=new WeakMap,g0=new WeakSet,L$=function(e){return{volume:yr(this,Ka,"f").createParameter(e.volume,A.decibel(-72,0,12),E.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:yr(this,Ka,"f").createParameter(e.panning,A.bipolar(),E.panning,"Panning",.5),stereo:yr(this,Ka,"f").createParameter(e.stereo,A.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:yr(this,Ka,"f").createParameter(e.invertL,A.bool,E.bool,"Invert Left"),invertR:yr(this,Ka,"f").createParameter(e.invertR,A.bool,E.bool,"Invert Right"),swap:yr(this,Ka,"f").createParameter(e.swap,A.bool,E.bool,"Swap")}};var Ay=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ct=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},v0,Fm,_d,pr,Am,nu,Z$,Fd=class{constructor(e,r){v0.add(this),this.class="device-host",Fm.set(this,new X),_d.set(this,void 0),pr.set(this,void 0),Am.set(this,void 0),nu.set(this,void 0),Ay(this,_d,e,"f"),Ay(this,pr,r,"f"),Ay(this,Am,ct(this,Fm,"f").own(Ct.create(ct(this,pr,"f").audioEffects,n=>ct(this,_d,"f").boxAdapters.adapterFor(n,te.isAudioEffect),l.AudioEffectHost)),"f"),Ay(this,nu,ct(this,Fm,"f").own(new le(ct(this,_d,"f"))),"f"),this.namedParameter=ct(this,v0,"m",Z$).call(this,r)}get box(){return ct(this,pr,"f")}get uuid(){return ct(this,pr,"f").address.uuid}get address(){return ct(this,pr,"f").address}get indexField(){return ct(this,pr,"f").index}get labelField(){return ct(this,pr,"f").label}get minimizedField(){return ct(this,pr,"f").minimized}get label(){return ct(this,pr,"f").label.getValue()}get audioEffects(){return b.wrap(ct(this,Am,"f"))}get midiEffects(){return b.None}get audioEffectsField(){return b.wrap(ct(this,pr,"f").audioEffects)}get midiEffectsField(){return b.None}get inputAdapter(){return b.None}get hostsInstrument(){return!1}get isAudioUnit(){return!1}get inputField(){return this.audioUnitBoxAdapter().box.input}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}compositeDevice(){return ct(this,_d,"f").boxAdapters.adapterFor(ct(this,pr,"f").composite.targetVertex.unwrap("composite.target").box,Wa)}deviceHost(){return this.compositeDevice().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.label,children:()=>b.None};for(let e of ct(this,Am,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){ct(this,Fm,"f").terminate()}copyToIndex(e){rc.create(ct(this,pr,"f").graph,M.generate(),r=>{r.composite.refer(ct(this,pr,"f").composite.targetVertex.unwrap("composite.target")),r.index.setValue(e),r.label.setValue(ct(this,pr,"f").label.getValue()),r.gain.setValue(ct(this,pr,"f").gain.getValue()),r.pan.setValue(ct(this,pr,"f").pan.getValue()),r.mute.setValue(ct(this,pr,"f").mute.getValue()),r.solo.setValue(ct(this,pr,"f").solo.getValue())})}};Fm=new WeakMap,_d=new WeakMap,pr=new WeakMap,Am=new WeakMap,nu=new WeakMap,v0=new WeakSet,Z$=function(e){return{gain:ct(this,nu,"f").createParameter(e.gain,A.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Gain"),pan:ct(this,nu,"f").createParameter(e.pan,A.bipolar(),E.panning,"Pan",.5),mute:ct(this,nu,"f").createParameter(e.mute,A.bool,E.bool,"Mute"),solo:ct(this,nu,"f").createParameter(e.solo,A.bool,E.bool,"Solo")}};var Ey=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},x0,Em,Ad,_i,Sy,Sm,G$,Wa=class{constructor(e,r){x0.add(this),this.type="audio-effect",this.accepts="audio",Em.set(this,new X),Ad.set(this,void 0),_i.set(this,void 0),Sy.set(this,void 0),Sm.set(this,void 0),Ey(this,Ad,e,"f"),Ey(this,_i,r,"f"),Ey(this,Sy,Yt(this,Em,"f").own(Ct.create(Yt(this,_i,"f").entries,n=>Yt(this,Ad,"f").boxAdapters.adapterFor(n,Fd),l.AudioEffectCompositeCell)),"f"),Ey(this,Sm,Yt(this,Em,"f").own(new le(Yt(this,Ad,"f"))),"f"),this.namedParameter=Yt(this,x0,"m",G$).call(this,r)}get box(){return Yt(this,_i,"f")}get uuid(){return Yt(this,_i,"f").address.uuid}get address(){return Yt(this,_i,"f").address}get indexField(){return Yt(this,_i,"f").index}get labelField(){return Yt(this,_i,"f").label}get enabledField(){return Yt(this,_i,"f").enabled}get minimizedField(){return Yt(this,_i,"f").minimized}get host(){return Yt(this,_i,"f").host}get entries(){return Yt(this,Sy,"f")}get inputField(){return Yt(this,_i,"f").input}deviceHost(){return Yt(this,Ad,"f").boxAdapters.adapterFor(Yt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Yt(this,Em,"f").terminate()}};Em=new WeakMap,Ad=new WeakMap,_i=new WeakMap,Sy=new WeakMap,Sm=new WeakMap,x0=new WeakSet,G$=function(e){return{dry:Yt(this,Sm,"f").createParameter(e.dry,A.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Dry"),wet:Yt(this,Sm,"f").createParameter(e.wet,A.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Wet")}};var Py=class extends Wa{constructor(e,r){super(e,r)}get entriesFixed(){return!1}get manualUrl(){return ie.AudioEffectComposite}};var $y=class extends Wa{constructor(e,r){super(e,r)}get entriesFixed(){return!0}get manualUrl(){return ie.StereoComposite}};var HT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},y0=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ed,w0=A.exponential(20,2e4),b0=E.numeric({unit:"Hz",fractionDigits:0}),Pm=class extends Wa{constructor(e,r){super(e,r),Ed.set(this,void 0),HT(this,Ed,new le(e),"f"),this.crossover=[y0(this,Ed,"f").createParameter(r.crossover1,w0,b0,"Crossover 1"),y0(this,Ed,"f").createParameter(r.crossover2,w0,b0,"Crossover 2"),y0(this,Ed,"f").createParameter(r.crossover3,w0,b0,"Crossover 3")]}get crossoverCount(){return Math.max(0,this.entries.adapters().length-1)}get spectrum(){return this.address.append(4095)}get entriesFixed(){return!0}get manualUrl(){return ie.FrequencySplit}};Ed=new WeakMap;Pm.MAX_BANDS=4;var $m;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})($m||($m={}));var H$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Sd,Ai,My=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Zeitgeist,Sd.set(this,void 0),Ai.set(this,void 0),H$(this,Sd,e,"f"),H$(this,Ai,r,"f"),this.groove()}get box(){return Fi(this,Ai,"f")}get uuid(){return Fi(this,Ai,"f").address.uuid}get address(){return Fi(this,Ai,"f").address}get indexField(){return Fi(this,Ai,"f").index}get labelField(){return Fi(this,Ai,"f").label}get enabledField(){return Fi(this,Ai,"f").enabled}get minimizedField(){return Fi(this,Ai,"f").minimized}get host(){return Fi(this,Ai,"f").host}deviceHost(){return Fi(this,Sd,"f").boxAdapters.adapterFor(Fi(this,Ai,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}groove(){return Fi(this,Sd,"f").boxAdapters.adapterFor(Fi(this,Ai,"f").groove.targetVertex.unwrap("no groove").box,$m.checkType)}catchupAndSubscribeGroove(e){return Fi(this,Ai,"f").groove.catchupAndSubscribe(r=>e(Fi(this,Sd,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,$m.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Sd=new WeakMap,Ai=new WeakMap;var q$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},aa=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ny,Zi,ky=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",Ny.set(this,void 0),Zi.set(this,void 0),q$(this,Ny,e,"f"),q$(this,Zi,r,"f")}get box(){return aa(this,Zi,"f")}get uuid(){return aa(this,Zi,"f").address.uuid}get address(){return aa(this,Zi,"f").address}get indexField(){return aa(this,Zi,"f").index}get labelField(){return aa(this,Zi,"f").label}get enabledField(){return aa(this,Zi,"f").enabled}get minimizedField(){return aa(this,Zi,"f").minimized}get host(){return aa(this,Zi,"f").host}get commentField(){return aa(this,Zi,"f").comment}deviceHost(){return aa(this,Ny,"f").boxAdapters.adapterFor(aa(this,Zi,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Ny=new WeakMap,Zi=new WeakMap;var J$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},oa=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},By,Gi,Iy=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",By.set(this,void 0),Gi.set(this,void 0),J$(this,By,e,"f"),J$(this,Gi,r,"f")}get box(){return oa(this,Gi,"f")}get uuid(){return oa(this,Gi,"f").address.uuid}get address(){return oa(this,Gi,"f").address}get indexField(){return oa(this,Gi,"f").index}get labelField(){return oa(this,Gi,"f").label}get enabledField(){return oa(this,Gi,"f").enabled}get minimizedField(){return oa(this,Gi,"f").minimized}get host(){return oa(this,Gi,"f").host}get commentField(){return oa(this,Gi,"f").comment}deviceHost(){return oa(this,By,"f").boxAdapters.adapterFor(oa(this,Gi,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};By=new WeakMap,Gi=new WeakMap;var Ps=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ze=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_0,F0,Mm,Ei,Ty,Pd,sa,An,$d,Y$,A0,Dy=class{constructor(e,r){_0.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Soundfont,F0.set(this,new X),Mm.set(this,void 0),Ei.set(this,void 0),Ty.set(this,void 0),Pd.set(this,void 0),sa.set(this,void 0),An.set(this,void 0),$d.set(this,fe.Empty),A0.set(this,n=>n.match({none:()=>{Ze(this,An,"f").clear(),Ze(this,sa,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ze(this,An,"f").clear(),Ze(this,sa,"f").clear(),Ze(this,$d,"f").terminate(),Ps(this,$d,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");Ze(this,An,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),Ze(this,sa,"f").wrap(o)}else a.type==="error"?(Ze(this,An,"f").clear(),Ze(this,sa,"f").clear()):a.type==="idle"&&(Ze(this,An,"f").clear(),Ze(this,sa,"f").clear())}),"f")},some:a=>{Ze(this,sa,"f").wrap(a),Ze(this,An,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),Ps(this,Mm,e,"f"),Ps(this,Ei,r,"f"),Ps(this,Ty,new le(Ze(this,Mm,"f")),"f"),this.namedParameter=Ze(this,_0,"m",Y$).call(this,r),Ps(this,Pd,new $r,"f"),Ps(this,sa,new $r,"f"),Ps(this,An,new $r,"f"),Ze(this,F0,"f").ownAll(Ze(this,Pd,"f").subscribe(Ze(this,A0,"f")),Ze(this,Ei,"f").file.catchupAndSubscribe(({targetVertex:n})=>Ze(this,Pd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ze(this,Ei,"f").presetIndex.catchupAndSubscribe(n=>Ze(this,sa,"f").match({none:()=>Ze(this,An,"f").clear(),some:i=>Ze(this,An,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Ze(this,Pd,"f")}get soundfont(){return Ze(this,sa,"f")}get preset(){return Ze(this,An,"f")}get presetIndex(){return Ze(this,Ei,"f").presetIndex.getValue()}get box(){return Ze(this,Ei,"f")}get uuid(){return Ze(this,Ei,"f").address.uuid}get address(){return Ze(this,Ei,"f").address}get labelField(){return Ze(this,Ei,"f").label}get iconField(){return Ze(this,Ei,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Ze(this,Ei,"f").enabled}get minimizedField(){return Ze(this,Ei,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ze(this,Mm,"f").boxAdapters.adapterFor(Ze(this,Ei,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ze(this,$d,"f").terminate(),Ps(this,$d,fe.Empty,"f"),Ze(this,Ty,"f").terminate()}};F0=new WeakMap,Mm=new WeakMap,Ei=new WeakMap,Ty=new WeakMap,Pd=new WeakMap,sa=new WeakMap,An=new WeakMap,$d=new WeakMap,A0=new WeakMap,_0=new WeakSet,Y$=function(e){return{}};var X$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nm=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ry,au,Cy=class{constructor(e,r){Ry.set(this,void 0),au.set(this,void 0),X$(this,Ry,e,"f"),X$(this,au,r,"f")}get box(){return Nm(this,au,"f")}get uuid(){return Nm(this,au,"f").address.uuid}get address(){return Nm(this,au,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Nm(this,Ry,"f").soundfontManager.getOrCreate(Nm(this,au,"f").address.uuid)}terminate(){}};Ry=new WeakMap,au=new WeakMap;var E0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Si=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},S0,km,En,Bm,Q$,zy=class{constructor(e,r){S0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Maximizer,km.set(this,void 0),En.set(this,void 0),Bm.set(this,void 0),E0(this,km,e,"f"),E0(this,En,r,"f"),E0(this,Bm,new le(Si(this,km,"f")),"f"),this.namedParameter=Si(this,S0,"m",Q$).call(this,r)}get box(){return Si(this,En,"f")}get uuid(){return Si(this,En,"f").address.uuid}get address(){return Si(this,En,"f").address}get indexField(){return Si(this,En,"f").index}get labelField(){return Si(this,En,"f").label}get enabledField(){return Si(this,En,"f").enabled}get minimizedField(){return Si(this,En,"f").minimized}get host(){return Si(this,En,"f").host}deviceHost(){return Si(this,km,"f").boxAdapters.adapterFor(Si(this,En,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Si(this,Bm,"f").terminate()}};km=new WeakMap,En=new WeakMap,Bm=new WeakMap,S0=new WeakSet,Q$=function(e){return{threshold:Si(this,Bm,"f").createParameter(e.threshold,A.linear(-24,0),E.decible,"Threshold")}};var P0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},St=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$0,Im,Hi,Zr,eM,Oy=class{constructor(e,r){$0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Compressor,Im.set(this,void 0),Hi.set(this,void 0),Zr.set(this,void 0),P0(this,Im,e,"f"),P0(this,Hi,r,"f"),P0(this,Zr,new le(St(this,Im,"f")),"f"),this.namedParameter=St(this,$0,"m",eM).call(this,r)}get box(){return St(this,Hi,"f")}get uuid(){return St(this,Hi,"f").address.uuid}get address(){return St(this,Hi,"f").address}get indexField(){return St(this,Hi,"f").index}get labelField(){return St(this,Hi,"f").label}get enabledField(){return St(this,Hi,"f").enabled}get minimizedField(){return St(this,Hi,"f").minimized}get host(){return St(this,Hi,"f").host}get sideChain(){return St(this,Hi,"f").sideChain}deviceHost(){return St(this,Im,"f").boxAdapters.adapterFor(St(this,Hi,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){St(this,Zr,"f").terminate()}};Im=new WeakMap,Hi=new WeakMap,Zr=new WeakMap,$0=new WeakSet,eM=function(e){return{lookahead:St(this,Zr,"f").createParameter(e.lookahead,A.bool,E.bool,"Lookahead"),automakeup:St(this,Zr,"f").createParameter(e.automakeup,A.bool,E.bool,"Auto Makeup"),autoattack:St(this,Zr,"f").createParameter(e.autoattack,A.bool,E.bool,"Auto Attack"),autorelease:St(this,Zr,"f").createParameter(e.autorelease,A.bool,E.bool,"Auto Release"),inputgain:St(this,Zr,"f").createParameter(e.inputgain,A.linear(-30,30),E.decible,"Input Gain"),threshold:St(this,Zr,"f").createParameter(e.threshold,A.linear(-60,0),E.decible,"Threshold"),ratio:St(this,Zr,"f").createParameter(e.ratio,A.exponential(1,24),E.numeric({fractionDigits:1}),"Ratio"),knee:St(this,Zr,"f").createParameter(e.knee,A.linear(0,24),E.decible,"Knee"),attack:St(this,Zr,"f").createParameter(e.attack,A.linear(0,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:St(this,Zr,"f").createParameter(e.release,A.linear(5,1500),E.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:St(this,Zr,"f").createParameter(e.makeup,A.linear(-40,40),E.decible,"Makeup Gain"),mix:St(this,Zr,"f").createParameter(e.mix,A.unipolar(),E.percent(),"Dry/Wet")}};var M0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},N0,Tm,qi,la,tM,Vy=class{constructor(e,r){N0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Gate,Tm.set(this,void 0),qi.set(this,void 0),la.set(this,void 0),M0(this,Tm,e,"f"),M0(this,qi,r,"f"),M0(this,la,new le(Xt(this,Tm,"f")),"f"),this.namedParameter=Xt(this,N0,"m",tM).call(this,r)}get box(){return Xt(this,qi,"f")}get uuid(){return Xt(this,qi,"f").address.uuid}get address(){return Xt(this,qi,"f").address}get indexField(){return Xt(this,qi,"f").index}get labelField(){return Xt(this,qi,"f").label}get enabledField(){return Xt(this,qi,"f").enabled}get minimizedField(){return Xt(this,qi,"f").minimized}get host(){return Xt(this,qi,"f").host}get sideChain(){return Xt(this,qi,"f").sideChain}deviceHost(){return Xt(this,Tm,"f").boxAdapters.adapterFor(Xt(this,qi,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Xt(this,la,"f").terminate()}};Tm=new WeakMap,qi=new WeakMap,la=new WeakMap,N0=new WeakSet,tM=function(e){return{inverse:Xt(this,la,"f").createParameter(e.inverse,A.bool,E.bool,"Inverse"),threshold:Xt(this,la,"f").createParameter(e.threshold,A.linear(-80,0),E.decible,"Threshold"),return:Xt(this,la,"f").createParameter(e.return,A.linear(0,24),E.decible,"Return"),attack:Xt(this,la,"f").createParameter(e.attack,A.linear(0,1e3),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Xt(this,la,"f").createParameter(e.hold,A.linear(0,500),E.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Xt(this,la,"f").createParameter(e.release,A.linear(1,2e3),E.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Xt(this,la,"f").createParameter(e.floor,A.decibel(-72,-12,0),E.decible,"Floor")}};var k0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},B0,Dm,Sn,La,rM,Uy=class{constructor(e,r){B0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Autotune,Dm.set(this,void 0),Sn.set(this,void 0),La.set(this,void 0),k0(this,Dm,e,"f"),k0(this,Sn,r,"f"),k0(this,La,new le(wr(this,Dm,"f")),"f"),this.namedParameter=wr(this,B0,"m",rM).call(this,r)}get box(){return wr(this,Sn,"f")}get uuid(){return wr(this,Sn,"f").address.uuid}get address(){return wr(this,Sn,"f").address}get indexField(){return wr(this,Sn,"f").index}get labelField(){return wr(this,Sn,"f").label}get enabledField(){return wr(this,Sn,"f").enabled}get minimizedField(){return wr(this,Sn,"f").minimized}get host(){return wr(this,Sn,"f").host}deviceHost(){return wr(this,Dm,"f").boxAdapters.adapterFor(wr(this,Sn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){wr(this,La,"f").terminate()}};Dm=new WeakMap,Sn=new WeakMap,La=new WeakMap,B0=new WeakSet,rM=function(e){return{key:wr(this,La,"f").createParameter(e.key,A.linearInteger(0,11),E.indices("",["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]),"Key"),scale:wr(this,La,"f").createParameter(e.scale,A.linearInteger(0,7),E.indices("",["Chrom","Major","Minor","MajPent","MinPent","Blues","Dorian","Mixo"]),"Scale"),amount:wr(this,La,"f").createParameter(e.amount,A.unipolar(),E.percent(),"Amount"),retune:wr(this,La,"f").createParameter(e.retune,A.unipolar(),E.percent(),"Retune"),smooth:wr(this,La,"f").createParameter(e.smooth,A.unipolar(),E.percent(),"Smooth"),shift:wr(this,La,"f").createParameter(e.shift,A.linear(-12,12),E.numeric({unit:"st"}),"Shift")}};var I0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Dr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},T0,Rm,Pn,$s,iM,jy=class{constructor(e,r){T0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Crusher,Rm.set(this,void 0),Pn.set(this,void 0),$s.set(this,void 0),I0(this,Rm,e,"f"),I0(this,Pn,r,"f"),I0(this,$s,new le(Dr(this,Rm,"f")),"f"),this.namedParameter=Dr(this,T0,"m",iM).call(this,r)}get box(){return Dr(this,Pn,"f")}get uuid(){return Dr(this,Pn,"f").address.uuid}get address(){return Dr(this,Pn,"f").address}get indexField(){return Dr(this,Pn,"f").index}get labelField(){return Dr(this,Pn,"f").label}get enabledField(){return Dr(this,Pn,"f").enabled}get minimizedField(){return Dr(this,Pn,"f").minimized}get host(){return Dr(this,Pn,"f").host}deviceHost(){return Dr(this,Rm,"f").boxAdapters.adapterFor(Dr(this,Pn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Dr(this,$s,"f").terminate()}};Rm=new WeakMap,Pn=new WeakMap,$s=new WeakMap,T0=new WeakSet,iM=function(e){return{crush:Dr(this,$s,"f").createParameter(e.crush,A.unipolar(),E.percent(),"Crush"),bits:Dr(this,$s,"f").createParameter(e.bits,A.linearInteger(1,16),E.numeric(),"Bits"),boost:Dr(this,$s,"f").createParameter(e.boost,A.linear(0,24),E.decible,"Boost"),mix:Dr(this,$s,"f").createParameter(e.mix,A.exponential(.001,1),E.percent(),"Mix")}};var D0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ai=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},R0,Cm,$n,Md,nM,Ky=class{constructor(e,r){R0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Fold,Cm.set(this,void 0),$n.set(this,void 0),Md.set(this,void 0),D0(this,Cm,e,"f"),D0(this,$n,r,"f"),D0(this,Md,new le(ai(this,Cm,"f")),"f"),this.namedParameter=ai(this,R0,"m",nM).call(this,r)}get box(){return ai(this,$n,"f")}get uuid(){return ai(this,$n,"f").address.uuid}get address(){return ai(this,$n,"f").address}get indexField(){return ai(this,$n,"f").index}get labelField(){return ai(this,$n,"f").label}get enabledField(){return ai(this,$n,"f").enabled}get minimizedField(){return ai(this,$n,"f").minimized}get host(){return ai(this,$n,"f").host}deviceHost(){return ai(this,Cm,"f").boxAdapters.adapterFor(ai(this,$n,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){ai(this,Md,"f").terminate()}};Cm=new WeakMap,$n=new WeakMap,Md=new WeakMap,R0=new WeakSet,nM=function(e){return{drive:ai(this,Md,"f").createParameter(e.drive,A.linear(0,30),E.decible,"Drive"),volume:ai(this,Md,"f").createParameter(e.volume,A.linear(-18,0),E.decible,"Volume")}};var Wy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},fr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zm,Om,Mn,Nd,kd,Ly=class{constructor(e,r){zm.set(this,new X),this.type="instrument",this.accepts="midi",this.manualUrl=ie.MIDIOutput,Om.set(this,void 0),Mn.set(this,void 0),Nd.set(this,void 0),kd.set(this,void 0),Wy(this,Om,e,"f"),Wy(this,Mn,r,"f"),Wy(this,Nd,new $r,"f"),Wy(this,kd,fr(this,zm,"f").own(new le(fr(this,Om,"f"))),"f"),fr(this,zm,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>fr(this,kd,"f").createParameter(Ce(n,ol).value,A.unipolar(),E.percent({fractionDigits:1}),"",0)),onRemoved:(({box:n})=>fr(this,kd,"f").removeParameter(Ce(n,ol).value.address))}),fr(this,Mn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>fr(this,Nd,"f").clear(),some:({box:i})=>fr(this,Nd,"f").wrap(Ce(i,Ho))})))}get box(){return fr(this,Mn,"f")}get uuid(){return fr(this,Mn,"f").address.uuid}get address(){return fr(this,Mn,"f").address}get labelField(){return fr(this,Mn,"f").label}get iconField(){return fr(this,Mn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return fr(this,Mn,"f").enabled}get minimizedField(){return fr(this,Mn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return fr(this,kd,"f")}get midiDevice(){return fr(this,Nd,"f")}deviceHost(){return fr(this,Om,"f").boxAdapters.adapterFor(fr(this,Mn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){fr(this,zm,"f").terminate()}};zm=new WeakMap,Om=new WeakMap,Mn=new WeakMap,Nd=new WeakMap,kd=new WeakMap;var Zy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},C0,Vm,Nn,Za,Um,aM,Gy=class{constructor(e,r){C0.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Velocity,Vm.set(this,void 0),Nn.set(this,void 0),Za.set(this,void 0),Um.set(this,void 0),Zy(this,Vm,e,"f"),Zy(this,Nn,r,"f"),Zy(this,Za,new le(Qt(this,Vm,"f")),"f"),Zy(this,Um,rg.create(),"f"),this.namedParameter=Qt(this,C0,"m",aM).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:u}=this.namedParameter;Qt(this,Um,"f").setSeed(a.valueAt(e)+e);let d=r+(n.valueAt(e)-r)*i.valueAt(e),m=(Qt(this,Um,"f").uniform()*2-1)*o.valueAt(e),x=s.valueAt(e),g=u.valueAt(e);return r*(1-g)+VP(d+m+x)*g}get box(){return Qt(this,Nn,"f")}get uuid(){return Qt(this,Nn,"f").address.uuid}get address(){return Qt(this,Nn,"f").address}get indexField(){return Qt(this,Nn,"f").index}get labelField(){return Qt(this,Nn,"f").label}get enabledField(){return Qt(this,Nn,"f").enabled}get minimizedField(){return Qt(this,Nn,"f").minimized}get host(){return Qt(this,Nn,"f").host}deviceHost(){return Qt(this,Vm,"f").boxAdapters.adapterFor(Qt(this,Nn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Qt(this,Za,"f").terminate()}};Vm=new WeakMap,Nn=new WeakMap,Za=new WeakMap,Um=new WeakMap,C0=new WeakSet,aM=function(e){return{magnetPosition:Qt(this,Za,"f").createParameter(e.magnetPosition,A.unipolar(),E.percent(),"Position"),magnetStrength:Qt(this,Za,"f").createParameter(e.magnetStrength,A.unipolar(),E.percent(),"Strength"),randomSeed:Qt(this,Za,"f").createParameter(e.randomSeed,A.linearInteger(0,65535),E.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Qt(this,Za,"f").createParameter(e.randomAmount,A.unipolar(),E.percent(),"Amount"),offset:Qt(this,Za,"f").createParameter(e.offset,A.bipolar(),E.percent(),"Offset"),mix:Qt(this,Za,"f").createParameter(e.mix,A.unipolar(),E.percent(),"Mix")}};var z0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},br=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},O0,V0,jm,kn,Ga,oM,ou=class{constructor(e,r){O0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Tidal,jm.set(this,void 0),kn.set(this,void 0),Ga.set(this,void 0),z0(this,jm,e,"f"),z0(this,kn,r,"f"),z0(this,Ga,new le(br(this,jm,"f")),"f"),this.namedParameter=br(this,O0,"m",oM).call(this,r)}get box(){return br(this,kn,"f")}get uuid(){return br(this,kn,"f").address.uuid}get address(){return br(this,kn,"f").address}get indexField(){return br(this,kn,"f").index}get labelField(){return br(this,kn,"f").label}get enabledField(){return br(this,kn,"f").enabled}get minimizedField(){return br(this,kn,"f").minimized}get host(){return br(this,kn,"f").host}deviceHost(){return br(this,jm,"f").boxAdapters.adapterFor(br(this,kn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){br(this,Ga,"f").terminate()}};V0=ou,jm=new WeakMap,kn=new WeakMap,Ga=new WeakMap,O0=new WeakSet,oM=function(e){let{RateFractions:r,RateStringMapping:n}=V0;return{slope:br(this,Ga,"f").createParameter(e.slope,A.bipolar(),E.percent({fractionDigits:1}),"Slope",.5),symmetry:br(this,Ga,"f").createParameter(e.symmetry,A.unipolar(),E.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:br(this,Ga,"f").createParameter(e.rate,A.values(r.map((i,a)=>a)),n,"Rate",0),depth:br(this,Ga,"f").createParameter(e.depth,A.unipolar(),E.percent({fractionDigits:1}),"Depth",0),offset:br(this,Ga,"f").createParameter(e.offset,A.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:br(this,Ga,"f").createParameter(e.channelOffset,A.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};ou.RateFractions=Oo.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();ou.RateStringMapping=E.indices("",V0.RateFractions.map(([t,e])=>`${t}/${e}`));var U0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},j0,Km,oi,Pi,sM,Hy=class{constructor(e,r){j0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Vocoder,Km.set(this,void 0),oi.set(this,void 0),Pi.set(this,void 0),U0(this,Km,e,"f"),U0(this,oi,r,"f"),U0(this,Pi,new le(Pt(this,Km,"f")),"f"),this.namedParameter=Pt(this,j0,"m",sM).call(this,r)}get box(){return Pt(this,oi,"f")}get uuid(){return Pt(this,oi,"f").address.uuid}get address(){return Pt(this,oi,"f").address}get indexField(){return Pt(this,oi,"f").index}get labelField(){return Pt(this,oi,"f").label}get enabledField(){return Pt(this,oi,"f").enabled}get minimizedField(){return Pt(this,oi,"f").minimized}get host(){return Pt(this,oi,"f").host}get sideChain(){return Pt(this,oi,"f").sideChain}get modulatorSpectrum(){return Pt(this,oi,"f").address.append(4094)}get carrierSpectrum(){return Pt(this,oi,"f").address.append(4095)}deviceHost(){return Pt(this,Km,"f").boxAdapters.adapterFor(Pt(this,oi,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Pt(this,Pi,"f").terminate()}};Km=new WeakMap,oi=new WeakMap,Pi=new WeakMap,j0=new WeakSet,sM=function(e){let r=A.exponential(20,2e4),n=E.numeric({unit:"Hz",fractionDigits:0}),i=A.exponential(1,60),a=E.numeric({fractionDigits:1});return{carrierMinFreq:Pt(this,Pi,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:Pt(this,Pi,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:Pt(this,Pi,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:Pt(this,Pi,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:Pt(this,Pi,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:Pt(this,Pi,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:Pt(this,Pi,"f").createParameter(e.envAttack,A.exponential(.1,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:Pt(this,Pi,"f").createParameter(e.envRelease,A.exponential(1,1e3),E.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:Pt(this,Pi,"f").createParameter(e.gain,A.linear(-20,20),E.decible,"Gain"),mix:Pt(this,Pi,"f").createParameter(e.mix,A.unipolar(),E.percent(),"Mix")}};var K0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},W0,Wm,Bn,Gr,lM,qy=class{constructor(e,r){W0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.DattorroReverb,Wm.set(this,void 0),Bn.set(this,void 0),Gr.set(this,void 0),K0(this,Wm,e,"f"),K0(this,Bn,r,"f"),K0(this,Gr,new le(kt(this,Wm,"f")),"f"),this.namedParameter=kt(this,W0,"m",lM).call(this,r)}get box(){return kt(this,Bn,"f")}get uuid(){return kt(this,Bn,"f").address.uuid}get address(){return kt(this,Bn,"f").address}get indexField(){return kt(this,Bn,"f").index}get labelField(){return kt(this,Bn,"f").label}get enabledField(){return kt(this,Bn,"f").enabled}get minimizedField(){return kt(this,Bn,"f").minimized}get host(){return kt(this,Bn,"f").host}deviceHost(){return kt(this,Wm,"f").boxAdapters.adapterFor(kt(this,Bn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){kt(this,Gr,"f").terminate()}};Wm=new WeakMap,Bn=new WeakMap,Gr=new WeakMap,W0=new WeakSet,lM=function(e){return{preDelay:kt(this,Gr,"f").createParameter(e.preDelay,A.linear(0,1e3),E.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:kt(this,Gr,"f").createParameter(e.bandwidth,A.unipolar(),E.percent(),"Bandwidth"),inputDiffusion1:kt(this,Gr,"f").createParameter(e.inputDiffusion1,A.unipolar(),E.percent(),"Tank 1"),inputDiffusion2:kt(this,Gr,"f").createParameter(e.inputDiffusion2,A.unipolar(),E.percent(),"Tank 2"),decay:kt(this,Gr,"f").createParameter(e.decay,A.unipolar(),E.percent(),"Decay"),decayDiffusion1:kt(this,Gr,"f").createParameter(e.decayDiffusion1,A.unipolar(),E.percent(),"Tank 1"),decayDiffusion2:kt(this,Gr,"f").createParameter(e.decayDiffusion2,A.unipolar(),E.percent(),"Tank 2"),damping:kt(this,Gr,"f").createParameter(e.damping,A.unipolar(),E.percent(),"Damping"),excursionRate:kt(this,Gr,"f").createParameter(e.excursionRate,A.unipolar(),E.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:kt(this,Gr,"f").createParameter(e.excursionDepth,A.unipolar(),E.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:kt(this,Gr,"f").createParameter(e.wet,A.DefaultDecibel,E.decible,"Wet"),dry:kt(this,Gr,"f").createParameter(e.dry,A.DefaultDecibel,E.decible,"Dry")}};var uM=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Bd=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},L0,Mo,Id=class{constructor(e,r){L0.set(this,void 0),Mo.set(this,void 0),uM(this,L0,e,"f"),uM(this,Mo,r,"f")}get box(){return Bd(this,Mo,"f")}get uuid(){return Bd(this,Mo,"f").address.uuid}get address(){return Bd(this,Mo,"f").address}get labelField(){return Bd(this,Mo,"f").label}get modelField(){return Bd(this,Mo,"f").model}getModelJson(){return Bd(this,Mo,"f").model.getValue()}terminate(){}};L0=new WeakMap,Mo=new WeakMap;var Z0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Lt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},G0,Td,Rr,su,cM,Jy=class{constructor(e,r){G0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.NeuralAmp,Td.set(this,void 0),Rr.set(this,void 0),su.set(this,void 0),Z0(this,Td,e,"f"),Z0(this,Rr,r,"f"),Z0(this,su,new le(Lt(this,Td,"f")),"f"),this.namedParameter=Lt(this,G0,"m",cM).call(this,r)}get box(){return Lt(this,Rr,"f")}get uuid(){return Lt(this,Rr,"f").address.uuid}get address(){return Lt(this,Rr,"f").address}get indexField(){return Lt(this,Rr,"f").index}get labelField(){return Lt(this,Rr,"f").label}get enabledField(){return Lt(this,Rr,"f").enabled}get minimizedField(){return Lt(this,Rr,"f").minimized}get host(){return Lt(this,Rr,"f").host}get modelField(){return Lt(this,Rr,"f").model}get monoField(){return Lt(this,Rr,"f").mono}get spectrum(){return Lt(this,Rr,"f").address.append(4095)}getModelAdapter(){let e=Lt(this,Rr,"f").model.targetVertex;return e.isEmpty()?b.None:b.wrap(Lt(this,Td,"f").boxAdapters.adapterFor(e.unwrap().box,Id))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Lt(this,Rr,"f").modelJson.getValue()}deviceHost(){return Lt(this,Td,"f").boxAdapters.adapterFor(Lt(this,Rr,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Lt(this,su,"f").terminate()}};Td=new WeakMap,Rr=new WeakMap,su=new WeakMap,G0=new WeakSet,cM=function(e){return{inputGain:Lt(this,su,"f").createParameter(e.inputGain,A.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"input"),outputGain:Lt(this,su,"f").createParameter(e.outputGain,A.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"output"),mix:Lt(this,su,"f").createParameter(e.mix,A.linear(0,1),E.percent(),"Mix")}};var H0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Hr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},q0,Lm,In,lu,dM,Yy=class{constructor(e,r){q0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Waveshaper,Lm.set(this,void 0),In.set(this,void 0),lu.set(this,void 0),H0(this,Lm,e,"f"),H0(this,In,r,"f"),H0(this,lu,new le(Hr(this,Lm,"f")),"f"),this.namedParameter=Hr(this,q0,"m",dM).call(this,r)}get box(){return Hr(this,In,"f")}get uuid(){return Hr(this,In,"f").address.uuid}get address(){return Hr(this,In,"f").address}get indexField(){return Hr(this,In,"f").index}get labelField(){return Hr(this,In,"f").label}get enabledField(){return Hr(this,In,"f").enabled}get minimizedField(){return Hr(this,In,"f").minimized}get host(){return Hr(this,In,"f").host}deviceHost(){return Hr(this,Lm,"f").boxAdapters.adapterFor(Hr(this,In,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Hr(this,lu,"f").terminate()}};Lm=new WeakMap,In=new WeakMap,lu=new WeakMap,q0=new WeakSet,dM=function(e){return{inputGain:Hr(this,lu,"f").createParameter(e.inputGain,A.linear(0,40),E.decible,"Input"),outputGain:Hr(this,lu,"f").createParameter(e.outputGain,A.linear(-24,24),E.decible,"Output"),mix:Hr(this,lu,"f").createParameter(e.mix,A.unipolar(),E.percent(),"Mix")}};var Xy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Cr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Zm,Gm,Tn,Hm,Qy,ew=class{constructor(e,r){Zm.set(this,new X),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Werkstatt,Gm.set(this,void 0),Tn.set(this,void 0),Hm.set(this,void 0),Qy.set(this,void 0),Xy(this,Gm,e,"f"),Xy(this,Tn,r,"f"),Xy(this,Hm,Cr(this,Zm,"f").own(new le(Cr(this,Gm,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(Cr(this,Hm,"f"),r.code,r.parameters);Cr(this,Zm,"f").own(n),Xy(this,Qy,i,"f")}get box(){return Cr(this,Tn,"f")}get uuid(){return Cr(this,Tn,"f").address.uuid}get address(){return Cr(this,Tn,"f").address}get indexField(){return Cr(this,Tn,"f").index}get labelField(){return Cr(this,Tn,"f").label}get enabledField(){return Cr(this,Tn,"f").enabled}get minimizedField(){return Cr(this,Tn,"f").minimized}get host(){return Cr(this,Tn,"f").host}get parameters(){return Cr(this,Hm,"f")}get codeChanged(){return Cr(this,Qy,"f")}deviceHost(){return Cr(this,Gm,"f").boxAdapters.adapterFor(Cr(this,Tn,"f").host.targetVertex.unwrap("no device-host").box,te.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Cr(this,Zm,"f").terminate()}};Zm=new WeakMap,Gm=new WeakMap,Tn=new WeakMap,Hm=new WeakMap,Qy=new WeakMap;var ce=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},qT,ue,JT,YT,XT,QT;ue=new WeakMap,JT=new WeakMap,YT=new WeakMap,XT=new WeakMap,qT=new WeakSet,QT=function(e){return je(e.accept({visitArpeggioDeviceBox:r=>new eu(ce(this,ue,"f"),r),visitAudioBusBox:r=>new Ri(ce(this,ue,"f"),r),visitAudioClipBox:r=>new vc(ce(this,ue,"f"),r),visitAudioFileBox:r=>new Wn(ce(this,ue,"f"),r),visitAudioTimeStretchBox:r=>new Pa(ce(this,ue,"f"),r),visitAudioPitchStretchBox:r=>new Sa(ce(this,ue,"f"),r),visitAudioSignalsmithBox:r=>new $a(ce(this,ue,"f"),r),visitTransientMarkerBox:r=>new sc(r),visitWarpMarkerBox:r=>new Aa(ce(this,ue,"f"),r),visitApparatDeviceBox:r=>new vy(ce(this,ue,"f"),r),visitAudioRegionBox:r=>new Ic(ce(this,ue,"f"),r),visitAudioUnitBox:r=>new pn(ce(this,ue,"f"),r),visitAuxSendBox:r=>new Zc(ce(this,ue,"f"),r),visitMaximizerDeviceBox:r=>new zy(ce(this,ue,"f"),r),visitCompressorDeviceBox:r=>new Oy(ce(this,ue,"f"),r),visitGateDeviceBox:r=>new Vy(ce(this,ue,"f"),r),visitAutotuneDeviceBox:r=>new Uy(ce(this,ue,"f"),r),visitCrusherDeviceBox:r=>new jy(ce(this,ue,"f"),r),visitDattorroReverbDeviceBox:r=>new qy(ce(this,ue,"f"),r),visitDelayDeviceBox:r=>new Xn(ce(this,ue,"f"),r),visitDeviceInterfaceKnobBox:r=>new ad(ce(this,ue,"f"),r),visitTidalDeviceBox:r=>new ou(ce(this,ue,"f"),r),visitFoldDeviceBox:r=>new Ky(ce(this,ue,"f"),r),visitGrooveShuffleBox:r=>new Oa(ce(this,ue,"f"),r),visitMarkerBox:r=>new ms(ce(this,ue,"f"),r),visitSignatureEventBox:r=>new jl(ce(this,ue,"f"),r),visitMIDIOutputDeviceBox:r=>new Ly(ce(this,ue,"f"),r),visitModularAudioInputBox:r=>new id(ce(this,ue,"f"),r),visitModularAudioOutputBox:r=>new ed(ce(this,ue,"f"),r),visitModularBox:r=>new ys(ce(this,ue,"f"),r),visitModularDeviceBox:r=>new sd(ce(this,ue,"f"),r),visitModuleConnectionBox:r=>new xs(ce(this,ue,"f"),r),visitModuleDelayBox:r=>new Qc(ce(this,ue,"f"),r),visitModuleGainBox:r=>new td(ce(this,ue,"f"),r),visitModuleMultiplierBox:r=>new rd(ce(this,ue,"f"),r),visitNeonDeviceBox:r=>new xy(ce(this,ue,"f"),r),visitNanoDeviceBox:r=>new yy(ce(this,ue,"f"),r),visitNeuralAmpDeviceBox:r=>new Jy(ce(this,ue,"f"),r),visitNeuralAmpModelBox:r=>new Id(ce(this,ue,"f"),r),visitNoteClipBox:r=>new bc(ce(this,ue,"f"),r),visitNoteEventBox:r=>new _l(ce(this,ue,"f"),r),visitNoteEventCollectionBox:r=>new sn(ce(this,ue,"f"),r),visitNoteRegionBox:r=>new Dc(ce(this,ue,"f"),r),visitPitchDeviceBox:r=>new dy(ce(this,ue,"f"),r),visitPlayfieldDeviceBox:r=>new yd(ce(this,ue,"f"),r),visitPlayfieldSampleBox:r=>new xd(ce(this,ue,"f"),r),visitAudioEffectCompositeBox:r=>new Py(ce(this,ue,"f"),r),visitAudioEffectCompositeCellBox:r=>new Fd(ce(this,ue,"f"),r),visitStereoCompositeBox:r=>new $y(ce(this,ue,"f"),r),visitFrequencySplitBox:r=>new Pm(ce(this,ue,"f"),r),visitRevampDeviceBox:r=>new Fx(ce(this,ue,"f"),r),visitReverbDeviceBox:r=>new _x(ce(this,ue,"f"),r),visitRootBox:r=>new sy(ce(this,ue,"f"),r),visitSoundfontDeviceBox:r=>new Dy(ce(this,ue,"f"),r),visitSoundfontFileBox:r=>new Cy(ce(this,ue,"f"),r),visitSpielwerkDeviceBox:r=>new my(ce(this,ue,"f"),r),visitStereoToolDeviceBox:r=>new Fy(ce(this,ue,"f"),r),visitTapeDeviceBox:r=>new ly(ce(this,ue,"f"),r),visitTimelineBox:r=>new Ca(ce(this,ue,"f"),r),visitTrackBox:r=>new sr(ce(this,ue,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new ky(ce(this,ue,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new Iy(ce(this,ue,"f"),r),visitValueClipBox:r=>new ts(ce(this,ue,"f"),r),visitValueEventBox:r=>new fo(ce(this,ue,"f"),r),visitValueEventCollectionBox:r=>new Nr(ce(this,ue,"f"),r),visitValueRegionBox:r=>new wo(ce(this,ue,"f"),r),visitVaporisateurDeviceBox:r=>new uy(ce(this,ue,"f"),r),visitVocoderDeviceBox:r=>new Hy(ce(this,ue,"f"),r),visitWaveshaperDeviceBox:r=>new Yy(ce(this,ue,"f"),r),visitWerkstattDeviceBox:r=>new ew(ce(this,ue,"f"),r),visitVelocityDeviceBox:r=>new Gy(ce(this,ue,"f"),r),visitZeitgeistDeviceBox:r=>new My(ce(this,ue,"f"),r)}),`Could not find factory for ${e}`)};var qm;(function(t){t.PEAKS=Be.compose(M.Lowest).append(0),t.SPECTRUM=Be.compose(M.Lowest).append(1),t.WAVEFORM=Be.compose(M.Lowest).append(2),t.STEREO=Be.compose(M.Lowest).append(3),t.GONIO=Be.compose(M.Lowest).append(4),t.LOUDNESS=Be.compose(M.Lowest).append(5),t.HEAP=Be.compose(M.Lowest).append(6)})(qm||(qm={}));var tw;(function(t){t.countStems=e=>e.match({none:()=>1,some:r=>U(r.stems)?Object.keys(r.stems).length+(U(r.metronome?.stem)?1:0):1}),t.isMetronomeAudible=e=>e.match({none:()=>!1,some:r=>U(r.stems)?U(r.metronome?.stem):r.metronome?.includeInMixdown===!0}),t.stemFileNames=e=>{let r=Object.values(e.stems??{}).map(({fileName:i})=>i),n=e.metronome?.stem;return U(n)&&r.push(n.fileName),r},t.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),t.sanitizeExportNamesInPlace=e=>{let r=e.metronome?.stem;if(!U(e.stems)&&!U(r))return;let n=e.stems??{},i=new Map,a=o=>{let s=i.get(o)??0,u=o;for(;i.has(u);)s++,u=`${o} ${s}`;return i.set(o,s),i.set(u,1),u};Object.keys(n).forEach(o=>{let s=n[o];s.fileName=a(t.sanitizeFileName(s.fileName))}),U(r)&&(r.fileName=a(t.sanitizeFileName(r.fileName)))}})(tw||(tw={}));var eD=512,pM=ki.createBuilder({position:ki.float,bpm:ki.float,playbackTimestamp:ki.float,countInBeatsRemaining:ki.float,isPlaying:ki.bool,isCountingIn:ki.bool,isRecording:ki.bool,perfIndex:ki.int32,perfBuffer:ki.floats(eD)});var fM;(function(t){t.store=(e,r,n)=>{if(n==="")return K("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof Vn&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};h_(i)?a(i):Vn.create(e.graph,M.generate(),a)},t.read=(e,r)=>{if(r==="")return K("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof Vn&&i.origin.getValue()===r);if(h_(n)){let{status:i,value:a,error:o}=tr(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return K("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof Vn&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return K("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=M.newSet(s=>s.uuid),a=s=>{let{status:u,value:d,error:m}=tr(()=>JSON.parse(s.value.getValue()));u==="success"?n(b.wrap(d)):(console.warn(m),n(b.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof Vn)||s.origin.getValue()!==r)return;let u=s.value.catchupAndSubscribe(()=>a(s));i.add({uuid:s.address.uuid,subscription:u})},onRemoved:({box:s})=>{if(!(s instanceof Vn)||s.origin.getValue()!==r)return;i.removeByKey(s.address.uuid).subscription.terminate(),n(b.None)}},l.MetaData);return{terminate:()=>{o.terminate(),i.forEach(({subscription:s})=>s.terminate()),i.clear()}}}})(fM||(fM={}));var tD,rD,iD,nD;tD=new WeakMap,rD=new WeakMap,iD=new WeakMap,nD=new WeakMap;var Ms;(function(t){let e;(function(r){r[r.NoteOn=144]="NoteOn",r[r.NoteOff=128]="NoteOff",r[r.PitchBend=224]="PitchBend",r[r.Controller=176]="Controller",r[r.Start=250]="Start",r[r.Continue=251]="Continue",r[r.Stop=252]="Stop",r[r.Clock=248]="Clock",r[r.Position=242]="Position"})(e=t.Command||(t.Command={})),t.readCommand=r=>r[0]&240,t.readChannel=r=>r[0]&15,t.readParam1=r=>r.length>1?r[1]&255:0,t.readParam2=r=>r.length>2?r[2]&255:0,t.readPitch=r=>r[1],t.readVelocity=r=>r[2]/127,t.isNoteOn=r=>t.readCommand(r)===e.NoteOn&&t.readVelocity(r)>0,t.isNoteOff=r=>t.readCommand(r)===e.NoteOff||t.readCommand(r)===e.NoteOn&&t.readVelocity(r)===0,t.isPitchWheel=r=>t.readCommand(r)===e.PitchBend,t.isController=r=>t.readCommand(r)===e.Controller,t.isClock=r=>r[0]===e.Clock,t.isStart=r=>r[0]===e.Start,t.isContinue=r=>r[0]===e.Continue,t.isStop=r=>r[0]===e.Stop,t.isPosition=r=>r[0]===e.Position,t.asPitchBend=r=>{let n=t.readParam1(r)&127,i=t.readParam2(r)&127,a=n|i<<7;return 8192>=a?a/8192-1:(a-8191)/8192},t.asValue=r=>{let n=t.readParam2(r);return n>64?.5+(n-63)/128:n<64?n/128:.5},t.Clock=new Uint8Array([e.Clock]),t.Start=new Uint8Array([e.Start]),t.Continue=new Uint8Array([e.Continue]),t.Stop=new Uint8Array([e.Stop]),t.noteOn=(r,n,i)=>new Uint8Array([e.NoteOn|r,n,i]),t.noteOff=(r,n)=>new Uint8Array([e.NoteOff|r,n,0]),t.control=(r,n,i)=>new Uint8Array([e.Controller|r,n&127,i&127]),t.position=(r,n)=>new Uint8Array([e.Position,r&127,n&127]),t.positionInPPQN=r=>{let n=Math.floor(r/96),i=n&127,a=n>>7&127;return new Uint8Array([e.Position,i,a])},t.accept=(r,n)=>{Qi(r)||(t.isNoteOn(r)?$(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?$(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?$(n.pitchBend,t.asPitchBend(r)):t.isController(r)?$(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?$(n.clock):t.isStart(r)?$(n.start):t.isContinue(r)?$(n.continue):t.isStop(r)?$(n.stop):t.isPosition(r)&&$(n.songPos,t.readParam1(r)|t.readParam2(r)<<7))},t.debug=r=>r===null?"null":t.isNoteOn(r)?`NoteOn #${t.readChannel(r)} ${t.readPitch(r)} : ${t.readVelocity(r).toFixed(2)}`:t.isNoteOff(r)?`NoteOff #${t.readChannel(r)} ${t.readPitch(r)}`:t.isPitchWheel(r)?`PitchWheel #${t.readChannel(r)} ${t.asPitchBend(r)}`:t.isController(r)?`Control #${t.readChannel(r)} ${t.asValue(r)}`:t.isClock(r)?"Clock":t.isStart(r)?"Start":t.isContinue(r)?"Continue":t.isStop(r)?"Stop":t.isPosition(r)?`SongPosition ${t.readParam1(r)|t.readParam2(r)<<7}`:"Unknown"})(Ms||(Ms={}));var Jm;(function(t){t.on=(e,r,n)=>({type:"note-on",uuid:e,pitch:r,velocity:n}),t.off=(e,r)=>({type:"note-off",uuid:e,pitch:r}),t.audition=(e,r,n,i)=>({type:"note-audition",uuid:e,pitch:r,duration:n,velocity:i}),t.isOn=e=>e.type==="note-on",t.isOff=e=>e.type==="note-off",t.isAudition=e=>e.type==="note-audition",t.fromEvent=(e,r)=>{let n=e.data;if(Ms.isNoteOn(n)){let i=Ms.readPitch(n),a=Ms.readVelocity(n);return{type:"note-on",uuid:r,pitch:i,velocity:a}}else if(Ms.isNoteOff(n)){let i=Ms.readPitch(n);return{type:"note-off",uuid:r,pitch:i}}return K("Unknown MIDI event")}})(Jm||(Jm={}));var mM;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(Jm.on(r,n,i)),{terminate:()=>{a&&(e(Jm.off(r,n)),a=!1)}}}})(mM||(mM={}));var hM=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},aD,oD,gM,vM,sD,lD;oD=new WeakMap,gM=new WeakMap,vM=new WeakMap,sD=new WeakMap,aD=new WeakSet,lD=function(e,r){return e.subscribeIntegers(r,n=>{hM(this,gM,"f").replace(n.buffer)&&hM(this,vM,"f").notify(this)})};var uD,cD,dD,pD,fD,mD;uD=new WeakMap,cD=new WeakMap,dD=new WeakMap,pD=new WeakMap,fD=new WeakMap,mD=new WeakMap;var ua={isClipBox:t=>t.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:t=>t.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??K("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var rw={min:30,max:1e3,default:120};var iw;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?Sr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?Sr.err("Denominator must be a power of two between 1 and 32"):Sr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?lt(e,rw.min,rw.max):rw.default,t.clampBaseFrequency=e=>Number.isFinite(e)?lt(e,yx.min,yx.max):yx.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of pe.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>ua.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof Go&&i.timeBase.getValue()===Yr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(iw||(iw={}));var xM;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return iw.isTimeSignatureValid(i,a)}})(xM||(xM={}));var yM;(function(t){t.reader=(e,r)=>{let n=`
|
|
4
4
|
onmessage = (event) => {
|