@opendaw/studio-core 0.0.104 → 0.0.106

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.
@@ -1,6 +1,6 @@
1
1
  var mM=Object.defineProperty;var Ho=(r,e)=>{for(var t in e)mM(r,t,{get:e[t],enumerable:!0})};var Da=class r{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#o;#a;#s;#l;#c=0;decay=!1;constructor({size:e,decay:t}={}){e??=r.DEFAULT_SIZE,this.#l=t??r.DEFAULT_DECAY,this.#e=e<<1,this.#r=new ig(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#o=Vp.create(Vp.Type.Blackman,this.#e),this.#t=e,this.#a=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#a.fill(0),this.#i.fill(0),this.#s.fill(0),this.#c=0}reset(){this.#c=0}numBins(){return this.#t}bins(){return this.#a}waveform(){return this.#s}process(e,t,n,i){for(let o=n;o<i;++o)this.#i[this.#c]=e[o]+t[o],++this.#c===this.#e&&this.#u()}#u(){for(let t=0;t<this.#t;++t)this.#s[t]=this.#i[t<<1];for(let t=0;t<this.#e;++t)this.#i[t]*=this.#o[t];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let t=0;t<this.#t;++t){let n=this.#i[t],i=this.#n[t],o=Math.sqrt(n*n+i*i)*e;this.#a[t]<o?this.#a[t]=o:this.decay&&(this.#a[t]*=this.#l)}this.#c=0,this.#n.fill(0),this.decay=!1}};var zp=r=>r,q=r=>r!=null,so=r=>r===null,Ct=r=>r!==null,Nc=r=>r===void 0,Ws=r=>r!==void 0,ng=r=>r==null,K0=(r,e)=>r!=null?e(r):void 0,ve=(r,e="asDefined failed")=>r??D(lo(e)),pt=(r,e)=>r instanceof e,ze=(r,e)=>r instanceof e?r:D(`${r} is not instance of ${e}`),W0=(r,e)=>{r instanceof e||D(`${r} is not instance of ${e}`)};var lo=r=>r instanceof Function?r():r;var P=(r,...e)=>r?.apply(null,e),og=r=>q(r)&&typeof r=="object";var ag=r=>{throw new Error(`Unhandled ${r}`)},D=r=>{throw typeof r=="string"?new Error(r):r},V=(r,e)=>r?void 0:D(lo(e));var Zs=r=>new Proxy({},{get(){return D(r)}});var j0=class{value;status="success";constructor(e){this.value=e}error=Zs("Cannot access error when succeeded")},L0=class{error;status="failure";constructor(e){this.error=e}value=Zs("Cannot access value when failed")},Jo=r=>{try{return new j0(r())}catch(e){return new L0(e)}};var Zi=(r,e)=>Object.keys(e).length===0?D("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(r)?r:D(`Invalid enum value: ${String(r)}`),Qo=()=>{};var Z0;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(Z0||(Z0={}));var U=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,t)=>{e.length=0,e.push(...t)};static consume=(e,t)=>{for(let n=0;n<e.length;)t(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>ve(e.at(0),t);static getLast=(e,t)=>ve(e.at(-1),t);static getPrev=(e,t)=>{let n=e.indexOf(t);return n===-1?D(`${t} not found in ${e}`):ve(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let n=e.indexOf(t);return n===-1?D(`${t} not found in ${e}`):ve(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,t)=>ve(e.pop(),t);static create=(e,t)=>{let n=new Array(t);for(let i=0;i<t;i++)n[i]=e(i);return n};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!t(n,e[i]))return!1;return!0};static remove=(e,t)=>{let n=e.indexOf(t);if(n===-1)return D(`${t} not found in ${e}`);e.splice(n,1)};static removeIf=(e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n])&&e.splice(n,1)};static removeOpt=(e,t)=>{let n=e.indexOf(t);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[t++]=i);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let n=0,i=new Set;for(let o of e){let a=o[t];i.has(a)||(i.add(a),e[n++]=o)}return e.length=n,e};static subtract(e,t,n){return e.filter(i=>!t.some(o=>n(i,o)))}static intersect(e,t,n){return e.filter(i=>t.some(o=>n(i,o)))}static merge(e,t,n){return[...e.filter(i=>!t.some(o=>n(i,o))),...t]}static*iterate(e){for(let t=0;t<e.length;t++)yield e[t]}static*iterateReverse(e){for(let t=e.length-1;t>=0;t--)yield e[t]}static*iterateStateFull(e){let t=e.length-1;for(let n=0;n<=t;n++)yield{value:e[n],isFirst:n===0,isLast:n===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,n=e[0];t<e.length;t++){let i=e[t];yield[n,i],n=i}}static isSorted(e,t=Z0.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let o=e[i];if(Math.sign(n-o)===t)return!1;n=o}return!0}static toRecord(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),{})}static concatArrayBuffers(e,t){let n=new ArrayBuffer(e.byteLength+t.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),n}};var m;(function(r){r.wrap=t=>q(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryCatch=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...n)=>r.wrap(t?.apply(null,n)),r.async=t=>t.then(n=>r.wrap(n),()=>r.None);class e{#e;constructor(n){this.#e=ve(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 r.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()}}r.Some=e,r.None=new class{unwrap=t=>D(q(t)?lo(t):"unwrap failed");unwrapOrElse=t=>lo(t);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=t=>!1;match=t=>t.none();ifSome=t=>{};ifAbsent=t=>t(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=t=>r.None;mapOr=(t,n)=>lo(n);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>D(lo(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(m||(m={}));var co;(function(r){r.async=e=>e.then(t=>r.ok(t),t=>r.err(t)),r.tryGet=e=>{try{return r.ok(e())}catch(t){return r.err(t)}},r.ok=e=>new class{value;constructor(t){this.value=t}asOption=()=>m.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=t=>{try{return r.ok(t(this.value))}catch(n){return r.err(n)}};mapOr=(t,n)=>t(this.value);unwrapOrElse=t=>this.value;flatMap=t=>t(this.value);match=t=>t.ok(this.value);toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),r.Ok=new class{constructor(){}asOption=()=>m.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>r.ok(e());mapOr=(e,t)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},r.err=e=>new class{reason;constructor(t){this.reason=t}asOption=()=>m.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>D(`'${this.reason}'`);map=()=>this;mapOr=(t,n)=>lo(n);unwrapOrElse=t=>lo(t);flatMap=()=>this;match=t=>t.err(this.reason);toVoid=()=>r.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(co||(co={}));var ct;(function(r){r.exact=(e,t,n)=>{let i=0,o=e.length-1;for(;i<=o;){let a=i+o>>>1,s=n(e[a],t);if(s===0)return a;s<0?i=a+1:o=a-1}return-1},r.exactMapped=(e,t,n,i)=>{let o=0,a=e.length-1;for(;o<=a;){let s=o+a>>>1,l=n(i(e[s]),t);if(l===0)return s;l<0?o=s+1:a=s-1}return-1},r.leftMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let a=i+o>>>1;n(e[a],t)<0?i=a+1:o=a}return i},r.rightMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let a=i+o>>>1;n(e[a],t)<=0?i=a+1:o=a}return o-1},r.stableInsert=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let a=i+o>>>1;n(e[a],t)<0?i=a+1:o=a}for(;i<e.length&&n(e[i],t)===0;)i++;return i},r.leftMostMapped=(e,t,n,i)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;n(i(e[s]),t)<0?o=s+1:a=s}return o},r.rightMostMapped=(e,t,n,i)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;n(i(e[s]),t)<=0?o=s+1:a=s}return a-1},r.rangeMapped=(e,t,n,i)=>[r.leftMostMapped(e,t,n,i),r.rightMostMapped(e,t,n,i)]})(ct||(ct={}));var _t=class{static every=(e,t)=>(e&t)===t;static some=(e,t)=>(e&t)>0;#e;#t;constructor(e=32){this.#e=e,this.#t=new Int32Array((e-1>>>5)+1)}getBit(e){let t=e>>>5,n=1<<e-(t<<5);return(this.#t[t]&n)!==0}setBit(e,t){let n=e>>>5,i=1<<e-(n<<5),o=this.#t[n],a=t?o|i:o&~i;return a===o?!1:(this.#t[n]=a,!0)}isEmpty(){return this.#t.every(e=>e===0)}nonEmpty(){return this.#t.some(e=>e>0)}set buffer(e){this.#t.set(new Int32Array(e))}get buffer(){return this.#t.buffer}replace(e){let t=new Int32Array(e),n=!1;for(let i=0;i<t.length;i++)this.#t[i]!==t[i]&&(this.#t[i]=t[i],n=!0);return n}toString(){let e="";for(let t of U.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var sg=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 Ht=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(q(t)&&t.every(n=>!isNaN(n))){if(t.length===3)return[t[0]/255,t[1]/255,t[2]/255,1];if(t.length===4)return[t[0]/255,t[1]/255,t[2]/255,t[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,t,n){let i=l=>(l+e/30)%12,o=t*Math.min(n,1-n),a=l=>n-o*Math.max(-1,Math.min(i(l)-3,Math.min(9-i(l),1))),s=l=>Math.round(l*255).toString(16).padStart(2,"0");return`#${s(a(0))}${s(a(8))}${s(a(4))}`}static hexToHsl(e){let t=e.startsWith("#")?e.slice(1):e,n=parseInt(t.slice(0,2),16)/255,i=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,a=Math.max(n,i,o),s=Math.min(n,i,o),l=(a+s)/2,u=0,p=0;if(a!==s){let d=a-s;switch(p=l>.5?d/(2-a-s):d/(a+s),a){case n:u=((i-o)/d+(i<o?6:0))*60;break;case i:u=((o-n)/d+2)*60;break;case o:u=((n-i)/d+4)*60;break}}return{h:u,s:p,l}}static hslStringToHex(e){let[t,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,n/100,i/100)}#e;#t;#r;#i;constructor(e,t,n,i=1){this.#e=e,this.#t=t,this.#r=n,this.#i=i}opacity(e){return new r(this.#e,this.#t,this.#r,e)}brightness(e){let t=Math.max(0,Math.min(100,this.#r+e));return new r(this.#e,this.#t,t,this.#i)}saturate(e){return new r(this.#e,this.#t*e,this.#r,this.#i)}fade(e){let t=this.#t*(1-Math.sqrt(e)),n=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,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 ka=(r,e)=>r-e;var Bn=Math.PI*2,mC=Math.PI/2,G0=Math.PI/4,gC=1/Math.sqrt(2),we=(r,e,t)=>Math.max(e,Math.min(r,t)),Gi=r=>Math.max(0,Math.min(r,1)),HF=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),Yo=(r,e)=>Math.floor(r/e)*e,Ic=(r,e)=>Math.ceil(r/e)*e;var lg=(r,e,t)=>r+(e-r)*t,JF=(r,e,t)=>r*Math.pow(e/r,t);var Gs=(r,e)=>gM(r/e)*e,gM=r=>r-Math.floor(r),uo=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var q0=(r,e)=>r*e/((2*e-1)*(r-1)+e);var gr;(function(r){r.valueAt=({slope:i,steps:o,y0:a,y1:s},l)=>r.normalizedAt(l/o,i)*(s-a)+a,r.normalizedAt=(i,o)=>{if(o>.499999&&o<.500001)return i;{let a=we(o,1e-15,.999999999999999);return a*a/(1-a*2)*(Math.pow((1-a)/a,2*i)-1)}},r.inverseAt=(i,o)=>{let a=we(o,1e-15,.999999999999999);return Math.log(i*(1-2*a)/(a*a)+1)/(2*Math.log((1-a)/a))},r.coefficients=i=>{let o=r.valueAt(i,1),s=(r.valueAt(i,2)-o)/(o-i.y0),l=o-s*i.y0;return{m:s,q:l}};function*t(i,o,a,s){let{m:l,q:u}=r.coefficients({slope:i,steps:o,y0:a,y1:s});for(let p=0,d=a;p<o;p++)yield d=l*d+u}r.walk=t,r.run=(i,o,a,s,l)=>{let{m:u,q:p}=r.coefficients({slope:i,steps:o,y0:a,y1:s});for(let d=0,h=a;d<o;d++)l(h=u*h+p)};function*n(i,o){let a=1/o,s=r.normalizedAt(a,i),u=(r.normalizedAt(2*a,i)-s)/s;for(let p=0,d=0;p<o;p++)yield d=u*d+s}r.walkNormalized=n,r.byHalf=(i,o,a,s)=>({slope:r.slopeByHalf(o,a,s),steps:i,y0:o,y1:s}),r.slopeByHalf=(i,o,a)=>Math.abs(a-i)<1e-6?.5:(o-i)/(a-i)})(gr||(gr={}));var po=new DataView(new ArrayBuffer(8)),vr;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(po.setInt8(0,e),po.getInt8(0)),r.toShort=e=>(po.setInt16(0,e),po.getInt16(0)),r.toInt=e=>(po.setInt32(0,e),po.getInt32(0))})(vr||(vr={}));var Xo;(function(r){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),o=new Int32Array(n);r.floatToIntBits=a=>{let s=r.floatToRawIntBits(a);return(s&2139095040)===2139095040&&s&8388607?2143289344:s},r.intBitsToFloat=a=>(o[0]=a,i[0]),r.floatToRawIntBits=a=>(i[0]=a,o[0]),r.toFloat32=a=>(po.setFloat32(0,a),po.getFloat32(0))})(Xo||(Xo={}));var QF;(function(r){r.floatToIntBits=e=>{let t=Xo.floatToIntBits(e),n=t>>>16&32768,i=(t&2147483647)+4096;return i>=1199570944?(t&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(t&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(t&2147483647)>>>23,n|(t&8388607|8388608)+(8388608>>>i-102)>>>126-i)},r.intBitsToFloat=e=>{let t=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,t===0&&n>115712)return Xo.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(t!==0){n=115712;do t<<=1,n-=1024;while(!(t&1024));t&=1023}return Xo.intBitsToFloat((e&32768)<<16|(n|t)<<13)}})(QF||(QF={}));var cg;(function(r){let e=9218868437227405312n,t=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),o=new BigInt64Array(n);r.float64ToLongBits=a=>{let s=r.float64ToRawLongBits(a);return(s&e)===e&&(s&t)!==0n?0x7ff8000000000000n:s},r.longBitsToFloat64=a=>(o[0]=a,i[0]),r.float64ToRawLongBits=a=>(i[0]=a,o[0]),r.clamp=a=>(po.setFloat64(0,a),po.getFloat64(0))})(cg||(cg={}));var ht=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let n of e)t++;return t}static some(e,t){for(let n of e)if(t(n))return!0;return!1}static every(e,t){for(let n of e)if(!t(n))return!1;return!0}static reduce(e,t,n){let i=n,o=0;for(let a of e)i=t(i,a,o++);return i}static includes(e,t){for(let n of e)if(n===t)return!0;return!1}static forEach(e,t){for(let n of e)t(n)}static*map(e,t){let n=0;for(let i of e)yield t(i,n++)}static*take(e,t){let n=0;for(let i of e){if(n++>=t)return;yield i}}static filter(e,t){let n=[];for(let i of e)t(i)&&n.push(i);return n}static filterMap(e,t){let n=[];for(let i of e){let o=t(i);q(o)&&n.push(o)}return n}static reverse(e){let t=[];for(let n of e)t.push(n);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:n,value:i}=t.next(),o=i;if(n!==!0)for(;;){let{done:a,value:s}=t.next();if(a===!0){yield[o,null];return}yield[o,s],o=s}}};var nr=class r{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,t=0){return new r(new DataView(e,t))}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?D(`position(${e}) cannot be negative.`):e>this.#e.byteLength?D(`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 t=0;t<e.length;++t)this.#e.setInt8(this.#t++,e[t])}writeString(e){let t=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+t*Int16Array.BYTES_PER_ELEMENT),this.writeInt(t);for(let n=0;n<t;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let n=this.#e;this.#e=new DataView(new ArrayBuffer(uo(t+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},Dc=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}},ug=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((t,n)=>e.#e[n]===t)}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(t=>this.writeByte(t))}writeFloat(e){this.writeInt(Xo.floatToIntBits(e))}writeDouble(e){this.writeLong(cg.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 t=0;t<e.length;t++)this.writeShort(e.charCodeAt(t))}toHexString(){return Array.from(ht.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},It=class{littleEndian=!1;#e;#t=0;constructor(e,t=0){this.#e=new DataView(e,t)}get position(){return this.#t}set position(e){e<0?D(`position(${e}) cannot be negative.`):e>this.#e.byteLength?D(`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 t=0;t<e.length;t++)e[t]=this.readByte()}readString(){let e=this.readInt(),t="";for(let n=0;n<e;n++)t+=String.fromCharCode(this.readShort());return t}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var vM=r=>q(r)?r.value!==void 0?"value":r.get!==void 0?"get":D(`Cannot resolve method key of ${r}`):D("Cannot resolve method key of undefined descriptor"),kc=(r,e,t)=>{if(!q(t))return function(o,a){if(a&&a.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!q(s?.get))return D(`Cannot find getter for property '${e}'`);let l=s.get.apply(this);return Object.defineProperty(this,e,{value:l,configurable:!1,writable:!1,enumerable:!1}),l}};let n=vM(t),i=ve(t[n]);return{[n]:function(...o){if(o.length>0)return D("lazy accessory must not have any construction parameters");let a=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?a:()=>a,configurable:!1,writable:!1,enumerable:!1}),a}}};var ea;(function(r){function*e(){}r.empty=e;function*t(...n){for(let i of n)for(let o of i)yield o}r.flatten=t})(ea||(ea={}));var or=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?P(i[t],...n):i[t]?.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 YF=(r,...e)=>new Proxy([],{get(t,n){if(typeof n=="string"){let i=Number(n);if(!isNaN(i)&&i>=0&&Number.isInteger(i))return new r(...e)}return n===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[n]},has(t,n){if(typeof n=="string"){let i=Number(n);if(!isNaN(i)&&i>=0)return!0}return n in t}});var qs=class{static createIfAbsent(e,t,n){let i=e.get(t);return i===void 0&&(i=n(t),e.set(t,i)),i}};var Up=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var dg=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=m.wrap(t),this.#t.ifSome(n=>Array.from(this.#e.values()).forEach(i=>i.sort(n)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return ht.some(this.#e.entries(),n=>e===n[0]&&n[1].includes(t))}containsKey(e){return ht.includes(this.#e.keys(),e)}containsValue(e){return ht.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??U.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let n=qs.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())n.push(t);else{let i=ct.stableInsert(n,t,this.#t.unwrap());n.splice(i,0,t)}}addAll(e,t){let n=qs.createIfAbsent(this.#e,e,()=>[]);n.push(...t),this.#t.nonEmpty()&&n.sort(this.#t.unwrap())}remove(e,t){let n=this.#e.get(e);if(n===void 0)return!1;{let i=n.indexOf(t);return i===-1?!1:(n.splice(i,1),n.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let n=this.#e.get(e);if(n===void 0)return null;{let i=n.findIndex(t);if(i===-1)return null;{let o=n.splice(i,1)[0];return n.length===0&&this.#e.delete(e),o}}}removeValueIf(e){let t=[];for(let[n,i]of this.#e.entries())for(let o of i.filter(a=>e(a)))t.push([n,o]);for(let[n,i]of t)this.remove(n,i);return new Set(t.map(([,n])=>n))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??U.empty()}forEach(e){ht.forEach(this.#e.entries(),t=>e(t[0],t[1]))}keyCount(){return this.#e.size}keys(){return this.#e.keys()}sortKeys(e){let t=this.clone(),n=Array.from(this.keys()).sort(e);this.#e.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.#e.forEach((t,n)=>{e.#e.set(n,t.map(i=>i))}),e}},Mc=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let n=t[0],i=t[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,t){return ht.some(this.map.entries(),n=>e===n[0]&&n[1].has(t))}containsKey(e){return ht.includes(this.map.keys(),e)}containsValue(e){return ht.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??Up.empty()}isEmpty(){return this.keyCount()===0}add(e,t){qs.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let n=qs.createIfAbsent(this.map,e,()=>new Set);for(let i of t)n.add(i)}remove(e,t){let n=this.map.get(e);return n===void 0?!1:n.delete(t)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[n,i]of this.map.entries()){for(let o of i)e(o)&&(i.delete(o),t.add(o));i.size===0&&this.map.delete(n)}return t}removeFromKeyIf(e,t){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(t(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Up.empty()}forEach(e){ht.forEach(this.map.entries(),t=>e(t[0],t[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let t=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.map.forEach((t,n)=>{e.map.set(n,new Set(Array.from(t)))}),e}};var re=Object.freeze({Empty:{terminate:Qo},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),j=class r{#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 t of e)this.#e.push(t)}spawn(){let e=new r;return e.own({terminate:()=>U.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var ce=class{static subscribeMany(e,...t){return re.many(...t.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(t=>t(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var Ai;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,n)=>{let i=new Set(Object.keys(t));for(let o of Object.keys(n))if(i.has(o))return D(`'${o}' is an overlapping key`);return{...t,...n}},r.include=(t,...n)=>{let i={};for(let o of n)i[o]=t[o];return i},r.exclude=(t,...n)=>{let i=new Set(n);return Object.entries(t).reduce((o,[a,s])=>(i.has(a)||(o[a]=s),o),{})},r.overwrite=(t,n)=>Object.assign(t,n),r.entries=t=>Object.entries(t)})(Ai||(Ai={}));var XF;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return re.Empty}catchupAndSubscribe(t){return t(this),re.Empty}}})(XF||(XF={}));var eB;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return re.Empty}catchupAndSubscribe(e){return e(this),re.Empty}},r.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(t){e.setValue(!t)}subscribe(t){return e.subscribe(t)}catchupAndSubscribe(t){return t(this),this.subscribe(t)}}})(eB||(eB={}));var Dr=class{#e;#t=m.None;constructor(e){this.#e=new ce,this.wrap(e)}wrap(e){this.wrapOption(m.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(q(e)&&e(this.#t.unwrap()),this.#t=m.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,t){return this.#t.mapOr(e,t)}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 qi=class{#e;#t=m.None;#r;constructor(e,t){this.#e=new ce,this.#r=t?.guard(e)??e,this.#t=m.wrap(t)}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 H0=class{#e;#t;constructor(e,t){V(e<t,"Linear is inverse"),this.#e=e,this.#t=t}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 we(e,this.#e,this.#t)}floating(){return!0}},J0=class{#e;#t;#r;constructor(e,t){this.#e=we(Math.round(e),vr.MIN_VALUE,vr.MAX_VALUE),this.#t=we(Math.round(t),vr.MIN_VALUE,vr.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(we(e,0,1)*this.#r)}clamp(e){return we(Math.round(e),this.#e,this.#t)}floating(){return!1}},Q0=class{#e;#t;constructor(e,t){V(e<t,"Exponential is inverse"),this.#e=e,this.#t=t}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}},pg=class{#e;#t;#r;#i;constructor(e,t,n){V(t!==n,"Power min === max"),this.#e=e,this.#t=t,this.#r=n,this.#i=n-t}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}},Y0=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(n=>n===e);return t===-1?D(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(we(e,0,1)*(this.#e.length-1));return t>-1?ve(this.#e.at(t),`Could not find value for ${e}`):D(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},X0=class{#e;#t;#r;#i;#n;constructor(e,t,n){this.#e=e,this.#t=n;let i=e*e,o=n*n,a=t*t,s=e+n-2*t,l=n-t;this.#r=((2*n-t)*e-t*n)/s,this.#i=(l*i+(a-o)*e+t*o-a*n)/(i+(2*n-4*t)*e+o-4*t*n+4*a),this.#n=-l/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}},w;(function(r){r.linear=(o,a)=>new H0(o,a),r.linearInteger=(o,a)=>new J0(o,a),r.exponential=(o,a)=>new Q0(o,a),r.power=(o,a,s)=>new pg(o,a,s),r.powerByCenter=(o,a,s)=>{let l=Math.log((s-a)/(o-a))/Math.log(2);if(Number.isNaN(l))throw new Error(`powerByCenter: invalid center=${o}, min=${a}, max=${s}`);return new pg(l,a,s)},r.values=o=>new Y0(o),r.decibel=(o,a,s)=>new X0(o,a,s);let e=new class{x(o){return o?1:0}y(o){return o>=.5}clamp(o){return o}floating(){return!1}},t=r.linear(0,1),n=r.linear(-1,1);r.bool=e;let i=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>n,r.DefaultDecibel=i})(w||(w={}));var _;(function(r){r.percent=({bipolar:o,fractionDigits:a}={})=>new e("%",a,!1,o),r.numeric=({unit:o,fractionDigits:a,unitPrefix:s,bipolar:l}={})=>new e(o,a,s,l),r.indices=(o,a)=>new class{x(s){return{unit:o,value:a[s]}}y(s){let l=a.indexOf(s);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:l}}},r.values=(o,a,s)=>new class{x(l){return{unit:o,value:s.at(a.indexOf(l))??"N/A"}}y(l){let u=s.indexOf(l);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:a[u]}}},r.bool=new class{y(o){switch(o.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(o){return{value:o?"On":"Off",unit:""}}},r.boolValues=(o,a)=>new class{y(s){switch(s.trim()){case a:case"on":case"yes":case"true":return{type:"explicit",value:!0};case o:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(a,s,l,u){this.#e=a??"",this.#t=s??0,this.#r=l??!1,this.#i=u??!1}y(a){let s=a.trim(),l=parseFloat(s);if(isNaN(l))return{type:"unknown",value:s};if(this.#e==="%")return{type:"explicit",value:l/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?we(l/200+.5,0,1):we(l/100,0,1)};{s.endsWith(this.#e)&&this.#e.length>0&&(s=s.slice(0,-this.#e.length));let d=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(q(d)){let h=t.indexOf(d);if(h>-1)return{type:"explicit",value:l*Math.pow(10,(h-4)*3)}}return{type:"explicit",value:l}}}x(a){if(Number.isNaN(a))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(a)){if(this.#e==="%")return this.#i?{value:(a*200-100).toFixed(this.#t),unit:this.#e}:{value:(a*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:l}=i(a);return{value:s.toFixed(this.#t),unit:`${l}${this.#e}`}}else return{value:a.toFixed(this.#t),unit:this.#e}}else return{value:a===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=o=>Math.log(o)/Math.log(9.999999999999998),i=o=>{let a=Math.floor(n(o)/3),s=t[a+4];return q(s)?{value:o*Math.pow(10,a*-3),prefix:s}:{value:o,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:2}),r.panning=r.percent({unit:"%",fractionDigits:0})})(_||(_={}));var $c;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})($c||($c={}));var Tc;(function(r){r.create=(e=252854082)=>new eA(e),r.monotoneAscending=(e,t=128,n=r.create())=>{let i=e.length;if(i<2)return D("Array must have at least 2 elements");let o=0;for(let s=1;s<i;s++){let l=Math.floor(n.uniform()*(1+t))+1;e[s]=l,o+=l}let a=0;e[0]=0;for(let s=1;s<i;s++)a+=e[s],e[s]=a/o;return e}})(Tc||(Tc={}));var eA=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,t){return e+this.uniform()*(t-e)}nextInt(e,t){return e+Math.floor(this.uniform()*(t-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 yr;(function(r){class e{}r.createBuilder=n=>{let i=o=>{let a=o instanceof Array?[]:{};return Object.entries(o).forEach(([s,l])=>{l instanceof e?a[s]=l.initialValue():typeof l=="object"&&(a[s]=i(l))}),a};return()=>new t(n,Object.seal(i(n)))},r.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},r.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},r.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},r.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},r.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},r.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},r.floats=n=>new class extends e{read(i,o){for(let a=0;a<o.length;a++)o[a]=i.readFloat();return o}write(i,o){for(let a=0;a<o.length;a++)i.writeFloat(o[a])}initialValue(){return new Float32Array(n)}},r.doubles=n=>new class extends e{read(i,o){for(let a=0;a<o.length;a++)o[a]=i.readDouble();return o}write(i,o){for(let a=0;a<o.length;a++)i.writeDouble(o[a])}initialValue(){return new Float64Array(n)}};class t{#e;#t;#r;constructor(i,o){this.#e=i,this.#t=o,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let o=(a,s)=>{Object.entries(a).forEach(([l,u])=>{let p=s;u instanceof e?p[l]=u.read(i,p[l]):typeof u=="object"&&o(u,p[l])})};o(this.#e,this.#t)}write(i){let o=(a,s)=>{Object.entries(a).forEach(([l,u])=>{let p=s;u instanceof e?u.write(i,p[l]):typeof u=="object"&&o(u,p[l])})};o(this.#e,this.#t)}#i(){let i=new Dc;return this.write(i),i.count}}})(yr||(yr={}));var Rc=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let n=this.#e(e),i=ct.leftMostMapped(this.#r,n,this.#t,this.#e),o=this.#r[i];return q(o)&&this.#t(this.#e(o),n)===0?t?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,t){let n=ct.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(q(i)&&this.#t(this.#e(i),e)===0)return i;let o=t(e);return this.#r.splice(n,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,n)=>{let i=this.#t(this.#e(t),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(t){if(t==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,o)=>this.#t(this.#e(i),this.#e(o))),!1}return D(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=ct.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[t];return q(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(t,1),n):D(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=ct.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[t];return q(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(t,1),n):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),t++);return t}get(e){return ve(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let n=this.#i(e);if(q(n))return n;throw t()}opt(e){return m.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return q(this.#i(e))}hasValue(e){return q(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(){U.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=ct.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[t];return q(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var Cc=(()=>{let r=m.None;return{info:e=>r.match({none:()=>Promise.resolve(),some:t=>t.info(e)}),approve:e=>r.match({none:()=>Promise.resolve(!0),some:t=>t.approve(e)}),progress:e=>r.match({none:()=>({message:"",terminate:Qo}),some:t=>t.progress(e)}),install:e=>{V(r.isEmpty(),"RuntimeNotification already installed"),r=m.wrap(e)}}})();var jp=class r{static createEstimator=()=>{let e=performance.now(),t=r.millis(Number.POSITIVE_INFINITY),n=0;return i=>{if(i===0)return r.POSITIVE_INFINITY;if(i>=1)return r.millis(0);let o=performance.now()-e;return o>n*1e3&&(t=r.millis(o/i-o),n++),t}};static POSITIVE_INFINITY=new r(Number.POSITIVE_INFINITY);static millis=e=>new r(e);static seconds=e=>new r(e*r.#e);static minutes=e=>new r(e*r.#t);static hours=e=>new r(e*r.#r);static days=e=>new r(e*r.#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)/r.#e}absMinutes(){return Math.abs(this.#n)/r.#t}absHours(){return Math.abs(this.#n)/r.#r}absDays(){return Math.abs(this.#n)/r.#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,t,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),o=Math.floor(i/60),a=Math.floor(o/24);return n<60?(e=n,t="second"):i<60?(e=i,t="minute"):o<24?(e=o,t="hour"):(e=a,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),t)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:t,m:n,s:i}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):t>0?[r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):n>0?[r.#o("m",n),r.#o("s",i)].join(", "):i>0?r.#o("s",i):"now"}static#o=(e,t)=>{switch(e){case"d":return`${t} ${t<2?"day":"days"}`;case"h":return`${t} ${t<2?"hour":"hours"}`;case"m":return`${t} ${t<2?"minute":"minutes"}`;case"s":return`${t} ${t<2?"second":"seconds"}`;default:return ag(e)}}};var Oc;(function(r){let e;(function(t){t[t.READING=0]="READING",t[t.READ=1]="READ",t[t.WRITING=2]="WRITING",t[t.WRITTEN=3]="WRITTEN"})(e||(e={})),r.writer=(t,n,i)=>{if(t.bytesTotal+1>n.byteLength)return D("Insufficient memory allocated.");let o=new Uint8Array(n),a=nr.use(n,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(i(t.object),a.position=0,t.write(a),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,n)=>{let i=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(i),a=new It(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(a.position=0,t.read(a),n(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(Oc||(Oc={}));var A;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let n=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",n?new Uint8Array(t.slice(0)):t).then(i=>e(new Uint8Array(i.slice(0,r.length))))},r.validateBytes=t=>r.parse(r.toString(t)),r.validateString=t=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t),r.asString=t=>r.validateString(t)?t:D(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let n=new Uint8Array(r.length);return t.readBytes(new Int8Array(n.buffer)),n},r.toDataOutput=(t,n)=>t.writeBytes(new Int8Array(n.buffer)),r.toString=t=>{let n=U.create(i=>(i+256).toString(16).substring(1),256);return n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]},r.parse=t=>{let n=t.replace(/-/g,"").toLowerCase();if(n.length!==32)return D("Invalid UUID format");let i=new Uint8Array(r.length);for(let o=0,a=0;o<32;o+=2,a++)i[a]=parseInt(n.slice(o,o+2),16);return i},r.Comparator=(t,n)=>{if(t.length!==r.length||n.length!==r.length)return D("Unexpected array length for uuid(v4)");for(let i=0;i<r.length;i++){let o=t[i]-n[i];if(o!==0)return o}return 0},r.equals=(t,n)=>r.Comparator(t,n)===0,r.newSet=t=>new Rc(t,r.Comparator),r.Lowest=r.parse("00000000-0000-4000-8000-000000000000"),r.Highest=r.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),r.fromInt=t=>{let n=new Uint8Array(r.Lowest),i=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)n[o]=i[o];return n},r.zType=t=>t.string().refine(n=>r.validateString(n),{message:"Invalid UUID format"}).transform(n=>n);let e=t=>(V(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(A||(A={}));var hg=class{#e=new j;#t;#r;#i;constructor(e){this.#r=e,this.#t=this.#e.own(new ce),this.#i=this.#a(e,[])}get data(){return this.#r}get proxy(){return this.#i}subscribe(e,...t){let n=()=>t.reduce((i,o)=>i[o],this.#i);return this.#t.subscribe(i=>{this.#n(i,t)&&e(n())})}catchupAndSubscribe(e,...t){return e(t.reduce((i,o)=>i[o],this.#i)),this.subscribe(e,...t)}subscribeAll(e){return this.#t.subscribe(t=>e(t[0]))}createMutableObservableValue(...e){let t=this.#e.own(new j),n=t.own(new ce),i=()=>e.slice(0,-1).reduce((s,l)=>s[l],this.#i),o=e[e.length-1],a={getValue:()=>e.reduce((s,l)=>s[l],this.#i),setValue:s=>i()[o]=s,subscribe:s=>n.subscribe(s),catchupAndSubscribe:s=>(s(a),n.subscribe(s)),terminate:()=>t.terminate()};return t.own(this.subscribe(()=>n.notify(a),...e)),a}update(e){let t=new Set;this.#o(this.#r,e,t);for(let n of t)this.#t.notify([n])}terminate(){this.#e.terminate(),this.#t.terminate()}#n=(e,t)=>{let n=Math.min(e.length,t.length);for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0};#o=(e,t,n,i)=>{for(let o of Object.keys(t)){let a=i??o,s=t[o],l=e[o];s!==null&&typeof s=="object"&&!Array.isArray(s)?this.#o(e[o],s,n,a):l!==s&&(e[o]=s,n.add(a))}};#a=(e,t)=>new Proxy(e,{get:(n,i)=>{let o=n[i];return o!==null&&typeof o=="object"&&!Array.isArray(o)?this.#a(o,[...t,i]):o},set:(n,i,o)=>(n[i]=o,this.#t.notify([...t,i]),!0),preventExtensions:()=>!1})};var fg=class{#e=new Set;add(e){this.#e.add(new WeakRef(e))}forEach(e){for(let t of this.#e){let n=t.deref();n===void 0?this.#e.delete(t):e(n)}}count(){let e=0;for(let t of this.#e)t.deref()===void 0?this.#e.delete(t):e++;return e}clear(){this.#e.clear()}};var tA=(r,e)=>Math.floor(3840/e)*r,tB=(r,e=4,t=4)=>{let n=tA(1,t),i=Math.floor(r/n),o=Math.floor(i/e),s=(Math.floor(r)-tA(o*e,t))%n,l=Math.floor(s/240),u=s%240;return{bars:o,beats:i-o*e,semiquavers:l,ticks:u}},rB=(r,e)=>r*e/60*960,iB=(r,e)=>r*60/960/e,yM=(r,e)=>e*60/960/r,xM=(r,e,t)=>rB(r/t,e),bM=(r,e,t)=>iB(r,e)*t,Q={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:tA,toParts:tB,secondsToPulses:rB,pulsesToSeconds:iB,secondsToBpm:yM,samplesToPulses:xM,pulsesToSamples:bM,toString:(r,e=4,t=4)=>{let{bars:n,beats:i,semiquavers:o,ticks:a}=tB(r|0,e,t);return`${n+1}.${i+1}.${o+1}:${a}`}};var he=128,ta=Q.fromSignature(1,48),mg=1e-4;var Ae=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=U.create(()=>new Float32Array(he),e)}clear(e,t){this.#e.forEach(n=>n.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){V(!this.#e.some(e=>e.some(t=>isNaN(t))),"AudioBuffer is invalid (NaN)")}channels(){return this.#e}replace(e){this.replaceInto(e.#e)}replaceInto(e){V(e.length===2,"mixLayout: target.length must be 2"),V(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2"),this.#e.length===1?(e[0].set(this.#e[0]),e[1].set(this.#e[0])):(e[0].set(this.#e[0]),e[1].set(this.#e[1]))}mixInto(e){V(e.length===2,"mixLayout: target.length must be 2"),V(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,n]=e;if(this.#e.length===1){let[i]=this.#e;for(let o=0;o<he;o++)t[o]+=i[o],n[o]+=i[o]}else{let[i,o]=this.#e;for(let a=0;a<he;a++)t[a]+=i[a],n[a]+=o[a]}}};var Mt;(function(r){r[r.Idle=0]="Idle",r[r.Attack=1]="Attack",r[r.Decay=2]="Decay",r[r.Sustain=3]="Sustain",r[r.Release=4]="Release"})(Mt||(Mt={}));var Vc=class{#e;#t=Mt.Idle;#r=0;#i=0;#n=0;#o=0;#a=0;#s=0;#l=0;#c=0;#u=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==Mt.Idle&&this.#t!==Mt.Release}get complete(){return this.#t===Mt.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,n,i){this.#n=e,this.#o=t,this.#a=n,this.#s=i,this.#p()}#p(){switch(this.#t){case Mt.Attack:{let e=1-this.#r;this.#l=e*this.#e/Math.max(this.#n,1e-6);break}case Mt.Decay:{let e=this.#r-this.#a;this.#c=e*this.#e/Math.max(this.#o,1e-6);break}case Mt.Release:{let e=this.#r;this.#u=e*this.#e/Math.max(this.#s,1e-6);break}case Mt.Sustain:case Mt.Idle:{this.#l=this.#e/Math.max(this.#n,1e-6),this.#c=(1-this.#a)*this.#e/Math.max(this.#o,1e-6),this.#u=this.#a*this.#e/Math.max(this.#s,1e-6);break}}}gateOn(){this.#t=Mt.Attack}gateOff(){this.#t!==Mt.Idle&&(this.#t=Mt.Release,this.#p())}forceStop(){this.#t=Mt.Idle,this.#r=0}process(e,t,n){for(let i=t;i<n;)switch(this.#t){case Mt.Attack:for(;i<n;){if(this.#r+=this.#l,this.#r>=1){this.#r=1,this.#i=1,e[i++]=this.#r,this.#t=Mt.Decay,this.#p();break}e[i++]=this.#i=this.#r}break;case Mt.Decay:for(;i<n;){if(this.#r-=this.#c,this.#r<=this.#a){this.#r=this.#a,this.#i=2,e[i++]=this.#r,this.#t=Mt.Sustain,this.#p();break}this.#i=1+(1-this.#r)/(1-this.#a),e[i++]=this.#r}break;case Mt.Sustain:e.fill(this.#a,i,n);return;case Mt.Release:for(;i<n;){if(this.#r-=this.#u,this.#r<=0){this.#r=0,this.#i=0,e[i++]=this.#r,this.#t=Mt.Idle,this.#p();break}this.#i=3+(1-this.#r/this.#a),e[i++]=this.#r}break;case Mt.Idle:e.fill(0,i,n);return}}};var gg;(function(r){let e=new fg;r.count=()=>e.count(),r.create=(t,n,i)=>{let o=n*Float32Array.BYTES_PER_ELEMENT,a=o*i,s=new SharedArrayBuffer(a),l=U.create(u=>new Float32Array(s,u*o,n),i);return e.add(s),{sampleRate:t,numberOfFrames:n,numberOfChannels:i,frames:l}}})(gg||(gg={}));var ho=class{a1=0;a2=0;b0=0;b1=0;b2=0;constructor(){this.identity()}identity(){this.setNormalizedCoefficients(1,0,0,1,0,0)}setLowpassParams(e,t=Math.SQRT1_2){if(e=we(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=Bn*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=(1-o)/2,s=a,l=2*a,u=a,p=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,l,u,p,d,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=we(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let n=Bn*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=(1+o)/2,s=a,l=-2*a,u=a,p=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,l,u,p,d,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,n,i,o,a){let s=1/i;return this.b0=e*s,this.b1=t*s,this.b2=n*s,this.a1=o*s,this.a2=a*s,this}setLowShelfParams(e,t){e=we(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(n*n,0,0,1,0,0);else if(e>0){let i=Bn*e,a=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),l=2*Math.sqrt(n)*a,u=n+1,p=n-1,d=n*(u-p*s+l),h=2*n*(p-u*s),g=n*(u-p*s-l),v=u+p*s+l,y=-2*(p+u*s),x=u+p*s-l;this.setNormalizedCoefficients(d,h,g,v,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=we(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=Bn*e,a=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),l=2*Math.sqrt(n)*a,u=n+1,p=n-1,d=n*(u+p*s+l),h=-2*n*(p+u*s),g=n*(u+p*s-l),v=u-p*s+l,y=2*(p-u*s),x=u-p*s-l;this.setNormalizedCoefficients(d,h,g,v,y,x)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);return this}setPeakingParams(e,t,n){e=we(e,0,1),t=Math.max(0,t);let i=Math.pow(10,n/40);if(e>0&&e<1)if(t>0){let o=Bn*e,a=Math.sin(o)/(2*t),s=Math.cos(o),l=1+a*i,u=-2*s,p=1-a*i,d=1+a/i,h=-2*s,g=1-a/i;this.setNormalizedCoefficients(l,u,p,d,h,g)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,t){if(e=we(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=Bn*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=1-i,s=-2*o,l=1+i,u=1+i,p=-2*o,d=1-i;this.setNormalizedCoefficients(a,s,l,u,p,d)}else this.setNormalizedCoefficients(-1,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNotchParams(e,t){if(e=we(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=Bn*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=1,s=-2*o,l=1,u=1+i,p=-2*o,d=1-i;this.setNormalizedCoefficients(a,s,l,u,p,d)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,t){if(e=Math.max(0,e),t=Math.max(0,t),e>0&&e<1){let n=Bn*e;if(t>0){let i=Math.sin(n)/(2*t),o=Math.cos(n),a=i,s=0,l=-i,u=1+i,p=-2*o,d=1-i;this.setNormalizedCoefficients(a,s,l,u,p,d)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,n){V(e.length===t.length&&e.length===n.length,"Array lengths do not match");let i=this.b0,o=this.b1,a=this.b2,s=this.a1,l=this.a2;for(let u=0;u<e.length;++u){let p=-Math.PI*2*e[u],d=Math.cos(p),h=Math.sin(p),g=i+((o+a*d)*d-a*h*h),v=(o+a*d)*h+a*h*d,y=1+((s+l*d)*d-l*h*h),x=(s+l*d)*h+l*h*d,F=y*y+x*x,I=(g*y+v*x)/F,O=(v*y-g*x)/F;t[u]=Math.sqrt(I*I+O*O),n[u]=Math.atan2(O,I)}}};var Jt=class{#e=0;#t=0;#r=0;#i=0;reset(){this.#e=0,this.#t=0,this.#r=0,this.#i=0}process({a1:e,a2:t,b0:n,b1:i,b2:o},a,s,l,u){let p=this.#e,d=this.#t,h=this.#r,g=this.#i;for(let v=l;v<u;v++){let y=a[v],x=s[v]=n*y+i*p+o*d-e*h-t*g+1e-18-1e-18;d=p,p=y,g=h,h=x}this.#e=p,this.#t=d,this.#r=h,this.#i=g}processFrame({a1:e,a2:t,b0:n,b1:i,b2:o},a){let s=n*a+i*this.#e+o*this.#t-e*this.#r-t*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=a,this.#i=this.#r,this.#r=s,s}},Ma=class{#e;#t;constructor(e){this.#e=U.create(()=>new Jt,e),this.#t=this.#e.length}get order(){return this.#t}set order(e){this.#t!==e&&(this.#t=e,this.reset())}reset(){this.#e.forEach(e=>e.reset())}process(e,t,n,i,o){for(let a=0;a<this.#t;a++)this.#e[a].process(e,t,n,i,o),t=n}processFrame(e,t){for(let n=0;n<this.#t;n++)t=this.#e[n].processFrame(e,t);return t}},Lp=512,vg=class{#e;#t=new ho;#r;#i=-1;constructor(e,t,n){this.#r=new Ma(4),this.#e=new Float32Array(Lp+1);let i=Math.log(t/e),o=1/n;for(let a=0;a<=Lp;a++)this.#e[a]=e*Math.exp(a/Lp*i)*o}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,n,i,o,a){let s=this.#e,l=this.#r,u=this.#t,p=i/l.order**1.25,d=o,h=this.#i;for(;d<a;){let g=Math.floor(Gi(n[d])*Lp),v=d+1;for(;v<a&&Math.floor(Gi(n[v])*Lp)===g;)++v;g!==h&&(h=g,u.setLowpassParams(s[g],p)),l.process(u,e,t,d,v),d=v}this.#i=h}};var nB=Math.log(10)/20,Kp=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Pe=r=>Math.exp(r*nB),fo=r=>Math.log(r)/nB,zc=r=>Pe(20*Math.log10(r));var wM=.02,oB=1e3,yg=class{#e;#t;#r;#i;#n;#o;#a=NaN;#s=NaN;#l=0;#c=0;#u=0;#p=8;#d=0;#f=1;#h=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*wM)|0,this.#r=new ho,this.#r.setLowpassParams(.5),this.#i=[new Jt,new Jt],this.#n=[new Float32Array(he),new Float32Array(he)],this.#o=new Float32Array(2)}process(e,t,n,i){let[o,a]=e,[s,l]=t,[u,p]=this.#n;this.#i[0].process(this.#r,o,u,n,i),this.#i[1].process(this.#r,a,p,n,i);let d=Pe(this.#d),h=Pe(-this.#d/2),g=this.#e/this.#a,v=Math.pow(2,this.#p)-1,y=1/v;for(let x=n;x<i;x++)this.#c>0&&(this.#a+=this.#l,--this.#c===0&&(this.#l=0,this.#a=this.#s),this.#r.setLowpassParams(Math.max(this.#a,oB)/this.#e)),this.#u+=1,this.#u>=g&&(this.#u-=g,this.#o[0]=we(Math.round(u[x]*d*v)*y,-1,1),this.#o[1]=we(Math.round(p[x]*d*v)*y,-1,1)),s[x]=(o[x]*(1-this.#f)+this.#o[0]*this.#f)*h,l[x]=(a[x]*(1-this.#f)+this.#o[1]*this.#f)*h;this.#h=!0}setCrush(e){let t=JF(20,this.#e*.5,e);this.#h&&isFinite(this.#a)?(this.#s=t,this.#l=(t-this.#a)/this.#t,this.#c=this.#t):(this.#a=t,this.#r.setLowpassParams(Math.max(this.#a,oB)/this.#e))}setBitDepth(e){this.#p=we(e,1,16)}setBoost(e){this.#d=e}setMix(e){this.#f=Gi(e)}reset(){this.#h=!1,this.#s=NaN,this.#l=0,this.#c=0,this.#u=0,this.#o.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Wp=class{#e;#t;#r;#i;#n=0;#o=0;#a=0;#s=0;#l=0;#c=!1;#u=!1;constructor(e,t){let n=uo(e);this.#e=n,this.#t=n-1,this.#r=new Float32Array(n),this.#i=t}clear(){this.#n=0,this.#c&&(this.#r.fill(0),this.#c=!1),this.#p()}set offset(e){if(e<0||e>=this.#e)throw new Error(`MonoDelay offset ${e} out of bounds [0, ${this.#e})`);this.#a=e,this.#c?this.#d():this.#p()}get offset(){return this.#a}process(e,t,n,i){this.#u?this.#h(e,t,n,i):this.#f(e,t,n,i),this.#c=!0}#p(){this.#o=this.#a,this.#l=0,this.#u=!1}#d(){this.#a!==this.#o&&(this.#l=this.#i,this.#s=(this.#a-this.#o)/this.#l,this.#u=!0)}#f(e,t,n,i){let o=this.#r,a=this.#t,s=this.#n,l=s-Math.floor(this.#o);l<0&&(l+=this.#e);for(let u=n;u<i;++u)o[s]=t[u],e[u]=o[l],l=l+1&a,s=s+1&a;this.#n=s}#h(e,t,n,i){let o=this.#r,a=this.#t,s=this.#n;for(let l=n;l<i;++l){this.#l>0?(this.#o+=this.#s,this.#l--):(this.#o=this.#a,this.#u=!1),o[s]=t[l];let u=s-this.#o;u<0&&(u+=this.#e);let p=Math.floor(u),d=u-p,h=o[p];e[l]=h+d*(o[p+1&a]-h),s=s+1&a}this.#n=s}};var xg=class r{static#e=10;#t=1;#r=0;#i=0;#n=0;#o=0;#a=0;set(e,t,n){this.#t=e,this.#r=t*r.#e,this.#i=lg(1e-5,1-1e-5,n),this.#n=2**Math.abs(this.#r),this.#o=1/this.#i,this.#a=1/(1-this.#i)}compute(e){let t=e-Math.floor(e),n,i,o,a;return this.#r<0?(n=1-t,i=1-this.#i,o=this.#a,a=this.#o):(n=t,i=this.#i,o=this.#o,a=this.#a),n<=i?1-(1-n*o)**this.#n*this.#t:((1-n)*a)**this.#n*this.#t-this.#t+1}};var Zp;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Zp||(Zp={}));var Hs;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(Hs||(Hs={}));var kr;(function(r){r.globalToLocal=(t,n)=>Gs(n-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:n,loopOffset:i,loopDuration:o},a,s)=>{let l=t-i,u=l+o;if(l>=s||u<=a)return m.None;let p=Math.max(l,a),d=Math.min(u,s);return m.wrap({index:0,rawStart:l,rawEnd:u,regionStart:Math.max(l,t),regionEnd:Math.min(u,n),resultStart:p,resultEnd:d,resultStartValue:l<p?(p-l)/o:0,resultEndValue:u>d?(d-l)/o:1})};function*e({position:t,complete:n,loopOffset:i,loopDuration:o},a,s){let l=t-i,u=Math.max(t,a),p=Math.min(n,s),d=Math.floor((u-l)/o),h=l+d*o;for(;h<p;){let g=h+o,v=Math.max(h,t),y=Math.min(g,n),x=Math.max(h,u),F=Math.min(g,p),I=h<x?(x-h)/o:0,O=g>F?(F-h)/o:1;yield{index:d++,rawStart:h,rawEnd:g,regionStart:v,regionEnd:y,resultStart:x,resultEnd:F,resultStartValue:I,resultEndValue:O},h=g}}r.locateLoops=e})(kr||(kr={}));var oi=class r{static DefaultComparator=(e,t)=>e.position-t.position;static create(e){return new r(e??r.DefaultComparator)}#e;constructor(e){this.#e=new bg(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,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?ea.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,n){return this.#e.isEmpty()?ea.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,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()}},$a=class r{static Comparator=(e,t)=>e.position-t.position;static create(e){return new r(e)}#e;constructor(e=r.Comparator){this.#e=new bg(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,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?ea.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return ea.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return ea.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=t)return ea.empty();return this.#e.iterate(n,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},Js=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=ct.leftMost(this.#e,e,Hs.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let n=this.#e.filter(i=>i.position<=e&&e<i.position+i.duration);yield*q(t)?n.sort(t):n}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let n=this.#e[t];if(Hs.complete(n)<e)this.#e.splice(t,1),yield n;else return}}*release(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let n=this.#e[t];e(n)&&(this.#e.splice(t,1),yield n)}}*releaseAll(){if(this.#e.length!==0)for(let e=this.#e.length-1;e>=0;e--){let t=this.#e[e];Number.POSITIVE_INFINITY>t.duration&&(this.#e.splice(e,1),yield t)}}isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}clear(){U.clear(this.#e)}},bg=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 t=this.#e.indexOf(e);return t===-1?!1:(this.#e.splice(t,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let n=e.position,i=ct.leftMostMapped(this.#e,n,ka,Zp.PositionExtractor);for(let o=i;o<this.#e.length;o++){let a=this.#e[o];if(a===e)return!0;if(a.position!==n)return!1}return!1}clear(){++this.modCount,U.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,t){if(t===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(t(i))return i}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(t(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),ct.rightMostMapped(this.#e,e,ka,Zp.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),ct.leftMostMapped(this.#e,e,ka,Zp.PositionExtractor)}iterateFrom(e,t){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,vr.MAX_VALUE,t);for(;i>=0;){let o=this.optAt(i);if(o!==null&&t!==void 0&&t(o))return this.iterate(i,vr.MAX_VALUE,t);i--}return this.iterate(n,vr.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,n=$c.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=t)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var Ta;(function(r){r.hasFading=e=>e.in>0||e.out>0,r.gainAt=(e,t,n)=>{let{in:i,out:o,inSlope:a,outSlope:s}=n,l=1,u=1;i>0&&e<i&&(l=gr.normalizedAt(e/i,a));let p=t-o;if(o>0&&e>p){let d=(e-p)/o;u=1-gr.normalizedAt(d,s)}return Math.min(l,u)},r.fillGainBuffer=(e,t,n,i,o,a)=>{let{in:s,out:l,inSlope:u,outSlope:p}=a;if(e.fill(1,0,o),s<=0&&l<=0)return;let d=i-l;if(t>=s&&n<=d)return;let h=(n-t)/o;if(s>0&&t<s){let g=Math.min(n,s),v=Math.min(o,Math.ceil((g-t)/h));if(v>0){let y=t/s,x=g/s,F=gr.walk(u,v,y,x);for(let I=0;I<v;I++)e[I]=F.next().value}}if(l>0&&n>d){let g=Math.max(t,d),v=Math.max(0,Math.floor((g-t)/h)),y=o-v;if(y>0){let x=(g-d)/l,F=(n-d)/l,I=gr.walk(p,y,1-x,1-F);for(let O=v;O<o;O++)e[O]=Math.min(e[O],I.next().value)}}}})(Ta||(Ta={}));var ig=class r{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 t=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(t),this.#i=new Float32Array(t);for(let n=0;n<t;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,t){let n,i,o,a;for(let u=0;u<this.#e;++u)i=r.reverse(u)>>>this.#t,i>u&&(a=e[u],e[u]=e[i],e[i]=a,a=t[u],t[u]=t[i],t[i]=a);let s=this.#r,l=this.#i;for(let u=2;u<=this.#e;u<<=1){let p=u>>1,d=this.#e/u;for(n=0;n<this.#e;n+=u){let h=n+p;for(i=n,o=0;i<h;i++,o=o+d|0){let g=i+p|0,v=s[o],y=l[o],x=e[g],F=t[g],I=x*v+F*y,O=F*v-x*y,z=e[i],$=t[i];e[g]=z-I,t[g]=$-O,e[i]=z+I,t[i]=$+O}}if(u===this.#e)break}}inverse(e,t){let n=this.#e;for(let o=0;o<n;o++)t[o]=-t[o];this.process(e,t);let i=1/n;for(let o=0;o<n;o++)e[o]*=i,t[o]=-t[o]*i}};var rA=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var xr;(function(r){r.builder=()=>new e,r.toDouble=([t,n])=>t/n,r.toPPQN=([t,n])=>Q.fromSignature(t,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>r.toDouble(n)-r.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>r.toDouble(i)-r.toDouble(n))}}})(xr||(xr={}));var Ra=class{static*iterate(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield o,o=++i*n}static*iterateWithIndex(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield{position:o,index:i},o=++i*n}};var Uc=class{#e=0;#t=NaN;#r=NaN;#i=0;#n=0;constructor(){}reset(){this.#e=0,this.#t=NaN,this.#r=NaN,this.#i=0,this.#n=0}init(e){this.#e=e,isNaN(this.#t)&&(this.#t=this.#e)}currentFrequency(){return this.#t}glideTo(e,t){if(t===0){this.#e=e;return}this.#e=this.#t,this.#r=e,this.#i=0,this.#n=t}process(e,t,n,i){if(isNaN(this.#r)){for(let o=n;o<i;o++)e[o]*=this.#e;this.#t=this.#e}else{let o=Q.samplesToPulses(1,t,sampleRate);for(let a=n;a<i;a++){if(this.#i+=o/this.#n,this.#i>=1){this.#i=1,this.#e=this.#r,this.#r=NaN;for(let s=a;s<i;s++)e[s]*=this.#e;break}e[a]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,n){if(isNaN(this.#r))this.#t=this.#e;else{let i=Q.samplesToPulses(n-t,e,sampleRate);this.#i+=i/this.#n,this.#i>=1?(this.#i=1,this.#e=this.#t=this.#r,this.#r=NaN):this.#t=this.#e+(this.#r-this.#e)*this.#i}}};var wg=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){V(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),V(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){U.remove(this.#e,e);let t=this.#t.delete(e);V(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??U.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){ve(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`).push(e)}removeEdge([e,t]){let n=ve(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);V(n.includes(e),`${e} is not marked.`),U.remove(n,e)}isEmpty(){return this.#e.length===0}},Ag=class{#e;#t;#r;#i;#n;constructor(e){this.#e=e,this.#t=[],this.#r=new Set,this.#i=new Set,this.#n=new Map}update(){this.#o(),this.#e.vertices().forEach(e=>this.#a(e))}sorted(){return this.#t}hasLoops(){return this.#i.size!==0}#o(){this.#s();let e=new Map;for(let n of this.#e.vertices())this.#n.set(n,new Set),e.set(n,new Set);for(let n of this.#e.vertices())for(let i of this.#e.getPredecessors(n))ve(this.#n.get(i),`Could not find Successor for ${i}`).add(n);let t;do{t=!1;for(let n of this.#e.vertices()){ve(e.get(n)).clear();for(let i of ve(this.#n.get(n)))for(let o of ve(this.#n.get(i)))this.#n.get(n)?.has(o)||(t=!0,ve(e.get(n)).add(o))}for(let n of this.#e.vertices()){let i=ve(this.#n.get(n));ve(e.get(n)).forEach(o=>i.add(o))}}while(t)}#a(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(ve(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#a(t)}this.#t.push(e)}}#s(){U.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var Gp;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(Gp||(Gp={}));var _g=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,t){let n=this.#e.duration(),i=Yo(t,n),o=(t-i)/n,a=e?this.#e.fx(o):this.#e.fy(o);return i+a*n}};var ut;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(ut||(ut={}));var Pg=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,n,i,o){let a=n/this.sampleRate;switch(t){case ut.sine:{for(let s=i;s<o;s++)e[s]=Math.sin(this.#e*Math.PI*2),this.#e+=a,this.#e>=1&&(this.#e-=1);break}case ut.triangle:{for(let s=i;s<o;s++){let l=this.#e%1;e[s]=4*Math.abs(l-.5)-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case ut.saw:{for(let s=i;s<o;s++){let l=this.#e%1;e[s]=2*l-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case ut.square:{for(let s=i;s<o;s++){let l=this.#e%1;e[s]=l<.5?1:-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}}}reset(){this.#e=0}};var mo;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(mo||(mo={}));var Sg;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,n)=>t|=1<<n,0),r.Names={English:["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],German:["C","Cis","D","Dis","E","F","Fis","G","Gis","A","Ais","H"],Solfege:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],French:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Spanish:["Do","Do#","Re","Re#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Japanese:["\u30C9","\u30C9\u266F","\u30EC","\u30EC\u266F","\u30DF","\u30D5\u30A1","\u30D5\u30A1\u266F","\u30BD","\u30BD\u266F","\u30E9","\u30E9\u266F","\u30B7"]},r.isBlackKey=t=>(r.BlackKeyBits&1<<t%12)!==0,r.toFullString=t=>`${r.Names.English[t%12]}${Math.floor(t/12)-2}`,r.keyboardTracking=(t,n)=>Gi((t-60)*n);class e{#e;#t;constructor(n,...i){this.#e=n,this.#t=i.reduce((o,a)=>o|=1<<a,0)}get name(){return this.#e}get bits(){return this.#t}has(n){return(this.#t&1<<n%12)!==0}equals(n){return this.#t===n.bits}}r.StockScales=[new e("Major",0,2,4,5,7,9,11),new e("Natural Minor",0,2,3,5,7,8,10),new e("Harmonic Minor",0,2,3,5,7,8,11),new e("Melodic Minor",0,2,3,5,7,9,11),new e("Dorian",0,2,3,5,7,9,10),new e("Phrygian",0,1,3,5,7,8,10),new e("Lydian",0,2,4,6,7,9,11),new e("Mixolydian",0,2,4,5,7,9,10),new e("Locrian",0,1,3,5,6,8,10),new e("Pentatonic Major",0,2,4,7,9),new e("Pentatonic Minor",0,3,5,7,10),new e("Blues",0,3,5,6,7,10),new e("Whole Tone",0,2,4,6,8,10),new e("Diminished",0,2,3,5,6,8,9,11),new e("Augmented",0,3,4,7,8,11)]})(Sg||(Sg={}));var Mr;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let n=e.position-t.position;if(n!==0)return n;let i=e.pitch-t.pitch;return i!==0?i:0},r.curveFunc=(e,t)=>t<0?e**2**-t:1-(1-e)**2**t,r.inverseCurveFunc=(e,t)=>t<0?e**2**t:1-Math.max(0,1-e)**2**-t,r.CompleteComparator=(e,t)=>{let n=Hs.complete(e)-Hs.complete(t);return n!==0?n:e.pitch-t.pitch}})(Mr||(Mr={}));var qp=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,n,i,o){let a=t*this.#e;switch(n){case ut.sine:this.#i(e,a,i,o);break;case ut.saw:this.#n(e,a,i,o);break;case ut.square:this.#o(e,a,i,o);break;case ut.triangle:this.#a(e,a,i,o);break}}generateFromFrequencies(e,t,n,i,o){switch(n){case ut.sine:this.#s(e,t,i,o);break;case ut.saw:this.#l(e,t,i,o);break;case ut.square:this.#c(e,t,i,o);break;case ut.triangle:this.#u(e,t,i,o);break}}#i(e,t,n,i){let o=this.#t;for(let a=n;a<i;a++)e[a]=Math.sin(2*Math.PI*(o%1)),o+=t;this.#t=o}#n(e,t,n,i){let o=this.#t;for(let a=n;a<i;a++){let s=o%1;e[a]=2*s-1-go(s,t),o+=t}this.#t=o}#o(e,t,n,i){let o=this.#t;for(let a=n;a<i;a++){let s=o%1;e[a]=(s<.5?1:-1)+go(s,t)-go((s+.5)%1,t),o+=t}this.#t=o}#a(e,t,n,i){let o=this.#t,a=this.#r,s=4*t;for(let l=n;l<i;l++){let u=o%1,p=(u<.5?1:-1)+go(u,t)-go((u+.5)%1,t);a=a*.9995+p*s,e[l]=a,o+=t}this.#t=o,this.#r=a}#s(e,t,n,i){let o=this.#e,a=this.#t;for(let s=n;s<i;s++)e[s]=Math.sin(2*Math.PI*(a%1)),a+=t[s]*o;this.#t=a}#l(e,t,n,i){let o=this.#e,a=this.#t;for(let s=n;s<i;s++){let l=t[s]*o,u=a%1;e[s]=2*u-1-go(u,l),a+=l}this.#t=a}#c(e,t,n,i){let o=this.#e,a=this.#t;for(let s=n;s<i;s++){let l=t[s]*o,u=a%1;e[s]=(u<.5?1:-1)+go(u,l)-go((u+.5)%1,l),a+=l}this.#t=a}#u(e,t,n,i){let o=this.#e,a=this.#t,s=this.#r;for(let l=n;l<i;l++){let u=t[l]*o,p=a%1,d=(p<.5?1:-1)+go(p,u)-go((p+.5)%1,u);s=s*.9995+d*(4*u),e[l]=s,a+=u}this.#t=a,this.#r=s}},go=(r,e)=>r<e?(r/=e,r+r-r*r-1):r>1-e?(r=(r-1)/e,r*r+r+r+1):0;var ra;(function(r){r.zero=()=>({ll:0,lr:0,rl:0,rr:0}),r.identity=()=>({ll:1,lr:0,rl:0,rr:1}),r.update=(e,{gain:t,panning:n,invertL:i,invertR:o,stereo:a,swap:s},l=mo.EqualPower)=>{let[u,p]=r.panningToGains(n,l),d=u*t,h=p*t;i&&(d*=-1),o&&(h*=-1);let g=Math.max(0,-a),v=Math.max(0,a),y=1-v,x=1+v,F=g*.5,I=1-g,O=(y+x)*.5,z=(y-x)*.5,$=(y-x)*.5,J=(y+x)*.5,te=d*(F+I)*O+h*F*z,ae=d*(F+I)*$+h*F*J,K=d*F*O+h*(F+I)*z,ge=d*F*$+h*(F+I)*J;s?(e.ll=ae,e.rl=te,e.lr=ge,e.rr=K):(e.ll=te,e.lr=K,e.rl=ae,e.rr=ge)},r.panningToGains=(e,t)=>{let n=we(e,-1,1);switch(t){case mo.Linear:return[Math.min(1-n,1),Math.min(n+1,1)];case mo.EqualPower:return[Math.cos((n+1)*G0),Math.sin((n+1)*G0)]}},r.applyFrame=(e,t,n)=>[e.ll*t+e.rl*n,e.lr*t+e.rr*n],r.processFrames=(e,t,n,i,o)=>{let[a,s]=t,[l,u]=n;for(let p=i;p<o;p++){let d=a[p],h=s[p];l[p]=e.ll*d+e.rl*h,u[p]=e.lr*d+e.rr*h}},r.replaceFrames=(e,[t,n],i,o)=>{for(let a=i;a<o;a++){let s=t[a],l=n[a];t[a]=e.ll*s+e.rl*l,n[a]=e.lr*s+e.rr*l}}})(ra||(ra={}));var hr;(function(r){r.linear=(n,i=.005)=>new e(Math.ceil(n*i)|0),r.stereoMatrix=(n,i=.005)=>new t(Math.ceil(n*i)|0);class e{#e;#t=0;#r=0;#i=0;#n=0;constructor(i){this.#e=i}set(i,o){this.#t!==i&&(o===!0?(this.#r=i,this.#i=(i-this.#t)/this.#e,this.#n=this.#e):(this.#t=this.#r=i,this.#i=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t+=this.#i,--this.#n===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(i){return this.#t===i&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#e;#t=ra.zero();#r=ra.zero();#i=ra.zero();#n=0;constructor(i){this.#e=i}update(i,o,a){ra.update(this.#r,i,o),a===!0?(this.#i.ll=(this.#r.ll-this.#t.ll)/this.#e,this.#i.lr=(this.#r.lr-this.#t.lr)/this.#e,this.#i.rl=(this.#r.rl-this.#t.rl)/this.#e,this.#i.rr=(this.#r.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0)}processFrames(i,o,a,s){let[l,u]=i,[p,d]=o;if(this.isInterpolating())for(let h=a;h<s;h++){let g=l[h],v=u[h],y=this.moveAndGet();p[h]=y.ll*g+y.rl*v,d[h]=y.lr*g+y.rr*v}else{let h=this.#r;for(let g=a;g<s;g++){let v=l[g],y=u[g];p[g]=h.ll*v+h.rl*y,d[g]=h.lr*v+h.rr*y}}}set(i,o){this.#o(i)||(o===!0?(this.#r.ll=i.ll,this.#r.lr=i.lr,this.#r.rl=i.rl,this.#r.rr=i.rr,this.#i.ll=(i.ll-this.#t.ll)/this.#e,this.#i.lr=(i.lr-this.#t.lr)/this.#e,this.#i.rl=(i.rl-this.#t.rl)/this.#e,this.#i.rr=(i.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll=i.ll,this.#t.lr=this.#r.lr=i.lr,this.#t.rl=this.#r.rl=i.rl,this.#t.rr=this.#r.rr=i.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t.ll+=this.#i.ll,this.#t.lr+=this.#i.lr,this.#t.rl+=this.#i.rl,this.#t.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr)),this.#t}isFixed(i){return this.#o(i)&&this.#n===0}isInterpolating(){return this.#n>0}#o(i){return this.#t.ll===i.ll&&this.#t.lr===i.lr&&this.#t.rl===i.rl&&this.#t.rr===i.rr}}r.StereoMatrixRamp=t})(hr||(hr={}));var Hp=new Float32Array([-.00048076361,0,.00174689293,0,-.00421638042,0,.00854519755,0,-.01627072692,0,.03203375191,0,-.08251235634,0,.31203505397,.5,.31203505397,0,-.08251235634,0,.03203375191,0,-.01627072692,0,.00854519755,0,-.00421638042,0,.00174689293,0,-.00048076361]),iA=new Float32Array(12),aB=new Float32Array(11);for(let r=0,e=0,t=0;r<Hp.length;r++)r%2===0?iA[e++]=Hp[r]:aB[t++]=Hp[r];var nA=class{#e=new Float32Array(iA.length);#t=new Float32Array(Hp.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,n,i){let o=this.#e,a=iA,s=aB;for(let l=n;l<i;l++){let u=e[l],p=(l-n)*2;o[this.#r]=u;let d=0;for(let g=0;g<a.length;g++){let v=(this.#r-g+o.length)%o.length;d+=o[v]*a[g]}t[p]=d*2;let h=0;for(let g=0;g<s.length;g++){let v=(this.#r-g+o.length-1)%o.length;h+=o[v]*s[g]}t[p+1]=h*2,this.#r=(this.#r+1)%o.length}}downsample(e,t,n,i){let o=this.#t,a=Hp;for(let s=n;s<i;s++){let l=(s-n)*2;o[this.#i]=e[l],this.#i=(this.#i+1)%o.length,o[this.#i]=e[l+1],this.#i=(this.#i+1)%o.length;let u=0;for(let p=0;p<a.length;p++){let d=(this.#i-1-p+o.length)%o.length;u+=o[d]*a[p]}t[s]=u}}},Eg=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=U.create(()=>new nA,t),this.#r=U.create(n=>new Float32Array(he*(2<<n)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,n,i){let o=i-n,a=e,s=n,l=i;for(let u=0;u<this.#t.length;u++){let d=u===this.#t.length-1?t:this.#r[u];this.#t[u].upsample(a,d,s,l),a=d,s=0,l=o*(2<<u)}}downsample(e,t,n,i){let o=i-n,a=e,s=o*this.#e;for(let l=this.#t.length-1;l>=0;l--){let u=l===0,p=u?t:this.#r[l-1],d=u?n:0,h=u?i:s/2;this.#t[l].downsample(a,p,d,h),a=p,s=h}}},Fg=class{#e;#t;constructor(e){this.#e=new Eg(e),this.#t=new Eg(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,n,i){this.#e.upsample(e[0],t[0],n,i),this.#t.upsample(e[1],t[1],n,i)}downsample(e,t,n,i){this.#e.downsample(e[0],t[0],n,i),this.#t.downsample(e[1],t[1],n,i)}};var jc=class{#e;#t;#r;#i;constructor(e){this.#e=new Float32Array(e),this.#t=1/e,this.#r=0,this.#i=0}pushPop(e){let t=e*e;return this.#i-=this.#e[this.#r],this.#i+=t,this.#e[this.#r]=t,++this.#r===this.#e.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#t)}processBlock(e,t,n){let i=this.#e,o=i.length,a=this.#r,s=this.#i;for(let l=t;l<n;l++){let u=e[l]*e[l];s+=u-i[a],i[a]=u,++a===o&&(a=0)}return this.#r=a,this.#i=s,s<=0?0:Math.sqrt(s*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var Bg=class r{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(r.#e*e)),this.#i=Math.pow(.01,1/(r.#t*e))}clear(){this.#n=0}replace(e,t,n){let i=this.#r,o=this.#i,[a,s]=e.channels(),l=this.#n;for(let u=t;u<n;++u){let p=a[u],d=s[u],h=Math.max(Math.abs(p),Math.abs(d));if(l=h>l?i*(l-h)+h:o*(l-h)+h,l>1){let g=1/l;a[u]=p*g,s[u]=d*g}}this.#n=l}};var _i=class{#e;value=0;constructor(e,t){this.#e=1-Math.exp(-1/(e*t))}process(e){return this.value+=this.#e*(e-this.value),this.value}};var Kr;(function(r){r.Musical="musical",r.Seconds="seconds"})(Kr||(Kr={}));var Qs;(function(r){function e(t,n,i){return new oA(t,n,i)}r.aware=e})(Qs||(Qs={}));var oA=class{#e;#t;#r;constructor(e,t,n){this.#r=n,this.#t=t,this.#e=e}toPPQN(e){let t=this.#r.getValue();if(this.getTimeBase()===Kr.Musical)return t;let n=this.#e.ppqnToSeconds(e),i=n+t;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,t){if(this.getTimeBase()===Kr.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(t,t+e);this.#r.setValue(n)}}toSeconds(e){let t=this.#r.getValue();return this.getTimeBase()===Kr.Seconds?t:this.#e.intervalToSeconds(e,e+t)}toSamples(e,t){return this.toSeconds(e)*t}rawValue(){return this.#r.getValue()}getTimeBase(){return Zi(this.#t.getValue(),Kr)}};var Ng=Q.fromSignature(1,384);var ai={None:{type:"none"},Linear:{type:"linear"},Curve:r=>r===.5?ai.Linear:{type:"curve",slope:r}},Ig;(function(r){r.Comparator=(i,o)=>{let a=i.position-o.position;if(a!==0)return a;let s=i.index-o.index;return s!==0?s:i===o?0:D(`${i} and ${o} are identical in terms of comparison`)};function*e(i,o,a){if(i.isEmpty())return ht.empty();for(let s of i.iterateFrom(o))if(yield s,s.position>=a)return}r.iterateWindow=e,r.nextEvent=(i,o)=>{let a=i.asArray(),s=ct.rightMost(a,o,r.Comparator);return s===-1?null:a[s+1]??null},r.valueAt=(i,o,a)=>{if(i.isEmpty())return a;let s=i.iterateFrom(o),{done:l,value:u}=s.next();if(l)return a;if(u.position<=o){let{done:p,value:d}=s.next();if(p)return u.value;if(o<d.position)return n(u,d,o);if(u.interpolation===ai.None)return u.value}return u.value};function*t(i,o,a,s){if(i.isEmpty())return;let l=i.iterateFrom(o),{done:u,value:p}=l.next();if(u)return;let d=a/s,h=p;if(h.position>o){for(;o<h.position;)if(yield{position:o,value:h.value},o+=d,o>a)return;h.position<=a&&(yield h)}for(;o<=a;){let{done:g,value:v}=l.next();if(g)break;for(;o<v.position;){if(o>a)return;yield{position:o,value:n(h,v,o)},o+=d}v.position<a&&(h.interpolation===ai.None&&(yield{position:v.position,value:h.value}),yield v),h=v}for(;o<=a;)yield{position:o,value:h.value},o+=d}r.quantise=t;let n=({value:i,position:o,interpolation:a},s,l)=>a.type==="none"?i:a.type==="linear"?i+(l-o)/(s.position-o)*(s.value-i):a.type==="curve"?gr.valueAt({slope:a.slope,steps:s.position-o,y0:i,y1:s.value},l-o):D("Unknown interpolation")})(Ig||(Ig={}));var Vp;(function(r){let e;(function(t){t[t.Bartlett=0]="Bartlett",t[t.Blackman=1]="Blackman",t[t.BlackmanHarris=2]="BlackmanHarris",t[t.Hamming=3]="Hamming",t[t.Hanning=4]="Hanning"})(e=r.Type||(r.Type={})),r.create=(t,n)=>{let i=new Float32Array(n),o=Math.PI/(n-1);switch(t){case e.Bartlett:{let a=(n>>1)-1,s=0;for(;s<=a;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let a=2*o,s=4*o;for(let l=0;l<n;++l)i[l]=.42323-.49755*Math.cos(a*l)+.07922*Math.cos(s*l);return i}case e.BlackmanHarris:{let a=2*o,s=4*o,l=6*o;for(let u=0;u<n;++u)i[u]=.35875-.48829*Math.cos(a*u)+.14128*Math.cos(s*u)-.01168*Math.cos(l*u);return i}case e.Hamming:{let a=2*o;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(a*s);return i}case e.Hanning:{let a=2*o;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(a*s);return i}}}})(Vp||(Vp={}));var Dg=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:n,valueDecay:i}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=U.create(()=>new jc(sampleRate*n),t);let o=yr.createBuilder({peak:yr.floats(t),rms:yr.floats(t)})();this.#n=Oc.writer(o,e,a=>{let s=Math.exp(-(128*this.#o)/(sampleRate*i));for(let l=0;l<t;++l){let u=this.#t[l],p=this.#r[l];a.peak[l]=u,a.rms[l]=Math.sqrt(p),this.#t[l]=u*s,this.#r[l]=p*s}this.#o=0})}process([e]){for(let t=0;t<this.#e;++t){let n=e[t];if(n===void 0)this.#t[t]=0,this.#r[t]=0;else{let i=this.#i[t],o=this.#t[t],a=this.#r[t];for(let s=0;s<he;++s){let l=n[s];o=Math.max(o,Math.abs(l)),a=Math.max(a,i.pushPop(l*l))}this.#t[t]=o,this.#r[t]=a}}return this.#o++,this.#n.tryWrite(),!0}};var ke=class r{static newSet(e){return new Rc(e,r.Comparator)}static compose=(e,...t)=>{let n=t.length===0?this.#e:new Int16Array(t);return V(n.every((i,o)=>i===t[o]),`fieldKeys (${n.join(",")}) only allows i16`),new r(e,n)};static decode(e){let t=e.split("/");return V(t.length>0,"Unable to parse Address"),r.compose(A.parse(t[0]),...t.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,n){let i=e.values(),o=ct.leftMostMapped(i,t,A.Comparator,n),a=i.length;if(o<0||o>=a)return null;for(let s=o;s<a;s++)if(A.Comparator(n(i[s]),t)!==0)return o<s?[o,s]:null;return[o,a]}static Comparator=(e,t)=>{let n=A.Comparator(e.#t,t.#t);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let n=A.Comparator(e.#t,t.#t);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return 0};static LengthComparator=(e,t)=>{let n=A.Comparator(e.#t,t.#t);return n!==0?n:t.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,t){this.#t=e,this.#r=t}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return r.Comparator(this,e)===0}compareTo(e){return r.Comparator(this,e)}append(e){return new r(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return A.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,n)=>this.#r[n]===t)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(t=>e.writeShort(t))}moveTo(e){return new r(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(A.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,A.length),e.buffer}toString(){return[A.toString(this.#t),...this.#r].join("/")}static read(e){let t=A.fromDataInput(e),n=e.readByte();return r.compose(t,...U.create(()=>e.readShort(),n))}},Ys;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>ke.Comparator(e,t),r.equals=(e,t)=>{let[n,i]=ct.rangeMapped(t,e,ke.Comparator,r.AddressReader);return t.slice(n,i+1)},r.startsWith=(e,t)=>{let[n,i]=ct.rangeMapped(t,e,ke.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let n=ct.leftMostMapped(t,e,ke.LengthComparator,r.AddressReader),i=ct.rightMostMapped(t,e,ke.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>e.startsWith(o.address))}})(Ys||(Ys={}));var vo=class r{static validate(e,t){if(e.address.equals(t.address))return m.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(n=>n===e.pointerType)){let n=t.pointerRules.accepts.join(", ");return m.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return m.None}#e;#t;constructor(e){this.#e=e,this.#t=new or}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let n=ke.newSet(i=>i.address);return n.addMany(this.filter(...t)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{n.removeByKey(i.address),e.onRemoved(i)}},...t)}filter(...e){return e.length===0?this.incoming():ht.filter(this.incoming().values(),t=>e.some(n=>n===t.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(t=>e.address.equals(t.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let t=r.validate(e,this.#e);if(t.nonEmpty())return D(t.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,t,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onRemoved(i)}})}};var aA=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Lc=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},X=class r{static hook(e){return new r(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:t,fieldName:n,pointerRules:i,deprecated:o}){this.#e=e,this.#t=t,this.#r=n,this.#i=i,this.#n=o,(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}accept(e){return P(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 vo(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 U.empty()}record(){return Ai.empty()}getField(e){return D()}optField(e){return m.None}read(e){}write(e){}toJSON(){}fromJSON(e){return D("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(t=>{t.defer(),(t.mandatory||this.pointerRules.mandatory&&e.length===1)&&(console.warn(`[Field.disconnect] Deleting ${t.box} because pointer.mandatory=${t.mandatory} or (field.mandatory=${this.pointerRules.mandatory} and lastPointer=${e.length===1})`),t.box.delete())})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};aA([kc,Lc("design:type",vo),Lc("design:paramtypes",[])],X.prototype,"pointerHub",null);aA([kc,Lc("design:type",ke),Lc("design:paramtypes",[])],X.prototype,"address",null);aA([kc,Lc("design:type",String),Lc("design:paramtypes",[])],X.prototype,"debugPath",null);var f=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var kg=class r extends X{static create(e,t,n){return new r(e,t,n)}#e;constructor(e,t,n){super(e),this.#e=U.create(i=>t({parent:this,fieldKey:i,fieldName:String(i),pointerRules:f,deprecated:e.deprecated}),n)}accept(e){return P(e.visitArrayField,this)}fields(){return this.#e}record(){return U.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return ve(this.#e[e])}optField(e){return m.wrap(this.#e[e])}read(e){this.#e.forEach(t=>t.read(e))}write(e){this.#e.filter(t=>!t.deprecated).forEach(t=>t.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((t,n)=>this.#e[n].fromJSON(t));else return D("Type mismatch")}};var Ca;(function(r){r.writeFields=(t,n)=>{let i=Object.entries(n).filter(([o,a])=>!a.deprecated);t.writeInt(1179403347),t.writeShort(i.length),i.forEach(([o,a])=>{let s=nr.create();a.write(s);let l=new Int8Array(s.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(l.length),t.writeBytes(l)})},r.readFields=(t,n)=>{V(t.readInt()===1179403347,"Serializer header is corrupt");let i=t.readShort();for(let o=0;o<i;o++){let a=t.readShort();if(Nc(n[a]))continue;let s=t.readInt(),l=new Int8Array(s);t.readBytes(l);let{status:u,error:p}=Jo(()=>n[a]?.read(new It(l.buffer)));u==="failure"&&console.warn(n,p)}}})(Ca||(Ca={}));var AM=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},sB=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},k=class r{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#o;#a;#s=r.Index++;constructor({uuid:e,graph:t,name:n,pointerRules:i,resource:o,ephemeral:a}){this.#e=ke.compose(e),this.#t=t,this.#r=n,this.#i=i,this.#n=o,this.#o=a===!0,this.#a=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#a)}record(){return this.#a}getField(e){return ve(this.#a[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return m.wrap(this.#a[e])}subscribe(e,t){return this.graph.subscribeVertexUpdates(e,this.address,t)}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.#o}get creationIndex(){return this.#s}get pointerHub(){return new vo(this)}estimateMemory(){let e=new Dc;return this.write(e),e.count}isBox(){return!0}asBox(e){return ze(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Ca.readFields(e,this.#a)}write(e){Ca.writeFields(e,this.#a)}serialize(){let e=nr.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=nr.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#a).reduce((e,[t,n])=>{let i=n.toJSON();return q(i)&&(e[t]=i),e},{})}fromJSON(e){if(og(e))Object.entries(e).forEach(([t,n])=>{let i=this.#a[parseInt(t)];q(n)&&i.fromJSON(n)});else return D("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return U.empty();let n=this.getField(t[0]),i=[e(n)];for(let o=1;o<t.length;o++)n=n.getField(t[o]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return m.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return m.None;for(let n=1;n<e.length;n++)if(t=t.unwrap().optField(e[n]),t.isEmpty())return m.None;return t}delete(){if(!this.isAttached())return;let{boxes:e,pointers:t}=this.graph.dependenciesOf(this);r.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...t].map(n=>n.toString()).join(`
2
2
  `)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
3
- `),this));for(let n of t)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=t=>t.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()}`}};AM([kc,sB("design:type",vo),sB("design:paramtypes",[])],k.prototype,"pointerHub",null);var Jp;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Jp||(Jp={}));var Ue;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(Ue||(Ue={}));var Mg;(function(r){r.create=()=>new sA})(Mg||(Mg={}));var sA=class{#e=new Qp(Ys.equals);#t=new Qp(Ys.startsWith);#r=new Qp(Ys.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,n){let i=new lA(t,e,this.#n++,n);if(this.#o){let o=new cA(i,e);return this.#i.push(o),o}else return this.subscribeMonitor(i,e)}dispatch(e){this.#o=!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.#o=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case Ue.This:return this.#e.subscribe(e);case Ue.Parent:return this.#t.subscribe(e);case Ue.Children:return this.#r.subscribe(e);default:return ag(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},lA=class{address;propagation;order;procedure;constructor(e,t,n,i){this.address=e,this.propagation=t,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${Ue[this.propagation]}, order: ${this.order} }`}},Qp=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 t=this.#e.length;for(;--t>=0;)this.#e[t]===e&&this.#e.splice(t,1)}}}stations(){return this.#t||(this.#e.sort(Ys.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},cA=class{monitor;propagation;#e=new j;#t=!1;constructor(e,t){this.monitor=e,this.propagation=t}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var Ot;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(Ot||(Ot={}));var el={[Ot.Boolean]:{type:Ot.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[Ot.Float32]:{type:Ot.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[Ot.Int32]:{type:Ot.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[Ot.String]:{type:Ot.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[Ot.Bytes]:{type:Ot.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},Xs=class extends X{#e;#t;#r;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#r=this.#t}accept(e){return P(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ue.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){V(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let t=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,t,n))}writeValue(e,t){V(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,t)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?D("not implemented"):e}fromJSON(e){return D("Type mismatch")}reset(){this.setValue(this.#t)}},M=class r extends Xs{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,Ot.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return el[Ot.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){V(!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()))}},b=class r extends Xs{static create(e,t,n,i=0){return new r(e,t,n,i)}#e;#t;constructor(e,t,n,i){super(e,Ot.Float32,i),this.#e=t,this.#t=n}serialization(){return el[Ot.Float32]}equals(e){return this.getValue()===e}clamp(e){return Jp.clampFloat32(this.#e,Xo.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){V(!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()))}},E=class r extends Xs{static create(e,t,n,i=0){return new r(e,t,n,i)}#e;#t;constructor(e,t,n,i){super(e,Ot.Int32,i),this.#e=t,this.#t=n}serialization(){return el[Ot.Int32]}equals(e){return this.getValue()===e}clamp(e){return Jp.clampInt32(this.#e,vr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){V(!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>=vr.MIN_VALUE&&e<=vr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends Xs{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,Ot.String,t)}serialization(){return el[Ot.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){V(!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()))}},lB=class r extends Xs{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,Ot.Bytes,t)}serialization(){return el[Ot.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){V(!this.deprecated,"ByteArrayField.write: deprecated field");let t=this.getValue();e.writeInt(t.length),e.writeBytes(t)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(t=>typeof t=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var cB;(function(r){r.decode=e=>{let t=e.readInt();return U.create(()=>{switch(e.readString()){case"new":{let i=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new tl(i,o,a.buffer)}case"pointer":{let i=ke.read(e),o=e.readBoolean()?m.wrap(ke.read(e)):m.None,a=e.readBoolean()?m.wrap(ke.read(e)):m.None;return new Xp(i,o,a)}case"primitive":{let i=ke.read(e),o=e.readString(),a=el[o],s=a.decode(e),l=a.decode(e);return new Yp(i,a,s,l)}case"delete":{let i=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new rl(i,o,a.buffer)}}},t)}})(cB||(cB={}));var tl=class{type="new";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,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,t=>t.read(new It(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Yp=class{type="primitive";#e;#t;#r;#i;constructor(e,t,n,i){this.#e=e,this.#t=t,this.#r=n,this.#i=i}get address(){return this.#e}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}`}},Xp=class{type="pointer";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,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:t=>{e.writeBoolean(!0),t.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},rl=class{type="delete";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,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,t=>t.read(new It(this.#r)))}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var ez=Symbol("Unreferenceable"),N=class r extends X{static create(e,t,n){return new r(e,t,n)}static encodeWith(e,t){V(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=m.wrap(e);let n=Jo(t);if(this.#e=m.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,t){V(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=m.wrap(e);let n=Jo(t);if(this.#t=m.None,n.status==="failure")throw n.error;return n.value}static#e=m.None;static#t=m.None;#r;#i;#n=m.None;#o=m.None;constructor(e,t,n){super(e),this.#r=t,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return D(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return P(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ue.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=m.wrap(e)}defer(){this.targetVertex=m.None}get targetVertex(){return this.graph.inTransaction()?this.#o.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let t=vo.validate(this,e.unwrap());t.nonEmpty()&&D(t.unwrap())}this.targetAddress=e.map(t=>t.address)}get targetAddress(){return this.#o}set targetAddress(e){let t=this.#o;t.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&t.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#o=e,this.graph.onPointerAddressUpdated(this,t,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap())}resolvedTo(e){this.#n=e}read(e){let t=e.readBoolean()?m.wrap(ke.read(e)):m.None;this.targetAddress=r.#t.match({none:()=>t,some:n=>n.map(this,t)})}write(e){V(!this.deprecated,"PointerField.write: deprecated field"),r.#e.match({none:()=>this.#o,some:t=>t.map(this)}).match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toJSON(){if(!this.deprecated)return r.#e.match({none:()=>this.#o,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(so(e)||typeof e=="string"){let t=m.wrap(so(e)?null:ke.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:n=>n.map(this,t)})}else return D(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var $g=class{#e;#t;#r;#i;#n;constructor(){this.#e=ke.newSet(e=>e.address),this.#t=ke.newSet(e=>e.address),this.#r=ke.newSet(e=>e.address),this.#i=ke.newSet(([e])=>e),this.#n=ke.newSet(([e])=>e.address)}watchVertex(e){if(pt(e,N)){if(!e.mandatory)return D("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:t,exclusive:n}=e.pointerRules;if(!t&&!n)return D("watchVertex called but has no edge requirement");t&&this.#t.add(e),n&&this.#r.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#a(this.#e,n,t),this.#a(this.#t,n,t),this.#a(this.#r,n,t);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return D(`${n} has outgoing edges: ${i.map(([a,s])=>`[${a.toString()}, ${s.toString()}]`)}`);let o=this.incomingEdgesOf(n);if(o.length>0)return D(`${n} has incoming edges from: ${o.map(a=>a.toString())}`)}}connect(e,t){this.#n.add([e,t]),this.#i.opt(t).match({none:()=>this.#i.add([t,[e]]),some:([,n])=>n.push(e)})}disconnect(e){let[,t]=this.#n.removeByKey(e.address),[,n]=this.#i.get(t);U.remove(n,e),n.length===0&&this.#i.removeByKey(t)}isConnected(e,t){return this.#n.opt(e.address).mapOr(([,n])=>n.equals(t),!1)}outgoingEdgesOf(e){return this.#o(this.#n,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#i,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,n])=>n):this.#i.opt(e.address).mapOr(([t,n])=>n,U.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),D(`Pointer ${e.toString()} requires an edge.`)):D(`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.`),D(`Target ${e.toString()} requires an edge.`)):D(`Illegal state: ${e} has no edge requirements.`)}),this.#r.forEach(e=>{let t=e.pointerHub.size();if(t>1)return console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} is exclusive but has ${t} incoming pointers.`),D(`Target ${e.toString()} is exclusive but has ${t} incoming pointers.`)})}#o(e,t,n){let i=ke.boxRange(e,t,n);return q(i)?e.values().slice(i[0],i[1]):U.empty()}#a(e,t,n){let i=ke.boxRange(e,t,n);q(i)&&e.removeRange(i[0],i[1])}};var il=class{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u;#p=!1;#d=!1;constructor(e=m.None){this.#e=e,this.#t=A.newSet(t=>t.address.uuid),this.#r=[],this.#a=Mg.create(),this.#i=new or,this.#n=new or,this.#o=new or,this.#s=new $g,this.#l=ke.newSet(({pointer:t})=>t.address),this.#c=[],this.#u=A.newSet(t=>t.uuid)}beginTransaction(){V(!this.#p,"Transaction already in progress"),this.#p=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(V(this.#p,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#f(e,t)),this.#r.length=0),this.#l.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:n})=>{t.equals(n)||(t.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#l.clear(),this.#p=!1;this.#c.length>0;)this.#c.splice(0).forEach(e=>e()),this.#c.length>0&&console.debug(`${this.#c.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#p}constructingBox(){return this.#d}createBox(e,t,n){return this.#e.unwrap("No box-factory installed")(e,this,t,n)}stageBox(e,t){this.#g(),V(!this.#d,"Cannot construct box while other box is constructing"),q(t)&&(this.#d=!0,t(e),this.#d=!1);let n=this.#t.add(e);V(n,()=>`${e.name} ${e.address.toString()} already staged`);let i=new tl(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#n.subscribe(e)}subscribeVertexUpdates(e,t,n){return this.#a.subscribe(e,t,n)}subscribeEndTransaction(e){this.#c.push(e)}subscribeDeletion(e,t){let n=this.#u.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(t),{terminate:()=>{n.listeners.delete(t),n.listeners.size===0&&this.#u.removeByKeyIfExist(e)}}}unstageBox(e){this.#g();let t=this.#t.removeByKey(e.address.uuid);V(t===e,`${e} could not be found to unstage`),this.#s.unwatchVerticesOf(e);let n=new rl(e.address.uuid,e.name,e.toArrayBuffer());this.#u.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(t=>t.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#s}checksum(){let e=new ug;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,n){if(this.#g(),e.isAttached()&&!this.#d){let i=new Yp(e.address,e.serialization(),t,n);this.#a.dispatch(i),this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}}onPointerAddressUpdated(e,t,n){this.#g(),t.nonEmpty()&&this.#s.disconnect(e),n.nonEmpty()&&this.#s.connect(e,n.unwrap());let i=new Xp(e.address,t,n);this.#d?this.#r.push({pointerField:e,update:i}):(this.#f(e,i),this.#n.proxy.onUpdate(i))}#f(e,t){let{oldAddress:n,newAddress:i}=t;e.resolvedTo(i.flatMap(a=>this.findVertex(a))),this.#l.opt(e.address).match({none:()=>this.#l.add({pointer:e,initial:n,final:i,index:this.#l.size()}),some:a=>a.final=i}),this.#a.dispatch(t),this.#i.proxy.onUpdate(t)}findOrphans(e){let t=this.#h(e);return this.boxes().filter(n=>!t.has(n))}#h(e){let t=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!t.has(i)){t.add(i),this.#m(i).forEach(o=>{o.targetAddress.ifSome(a=>{this.findBox(a.uuid).ifSome(s=>{t.has(s)||n.push(s)})})});for(let o of i.incomingEdges())t.has(o.box)||n.push(o.box)}}return t}#m(e){let t=[],n=i=>{for(let o of i)o.accept({visitPointerField:a=>t.push(a),visitObjectField:a=>n(a.fields()),visitArrayField:a=>n(a.fields())})};return n(e.fields()),t}dependenciesOf(e,t={}){let n=q(t.excludeBox)?t.excludeBox:$c.alwaysFalse,i=q(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,o=q(t.stopAtResources)?t.stopAtResources:!1,a=new Set,s=new Set,l=(u,p=!1)=>{if(!(a.has(u)||!p&&n(u))){if(a.add(u),o&&q(u.resource)){u.incomingEdges().forEach(d=>{s.add(d);let h=d.targetAddress.mapOr(g=>!g.isBox(),!1);d.mandatory&&h&&l(d.box)});return}u.outgoingEdges().filter(([d])=>!s.has(d)).forEach(([d,h])=>{let g=this.findVertex(h).unwrap(`Could not find target of ${d.toString()}`);if(s.add(d),g.pointerRules.mandatory&&(i||g.pointerHub.incoming().filter(v=>v.targetAddress.mapOr(y=>y.equals(h),!1)).every(v=>s.has(v))))return l(g.box)}),u.incomingEdges().forEach(d=>{s.add(d),d.mandatory&&l(d.box)})}};return l(e,!0),a.delete(e),{boxes:a,pointers:Array.from(s).reverse()}}verifyPointers(){this.#s.validateRequirements();let e=0,t=n=>{for(let i of n.fields())i.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let a=o.targetVertex.nonEmpty(),s=this.findVertex(o.targetAddress.unwrap()).nonEmpty();V(a,`pointer ${o.address} is broken`),V(s,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#t.forEach(n=>t(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[A.toString(t.address.uuid)]={class:t.name,"incoming links":t.incomingEdges().length,"outgoing links":t.outgoingEdges().length,"est. memory (bytes)":t.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let t of this.dependenciesOf(e).boxes)console.debug(` ${t}`)})}addressToDebugPath(e){return e.flatMap(t=>t.isBox()?this.findBox(t.uuid).map(n=>n.name):this.findBox(t.uuid).flatMap(n=>n.searchVertex(t.fieldKeys).map(i=>i.isField()?i.debugPath:D("Unknown address"))))}toArrayBuffer(){let e=nr.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e){V(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new It(e),n=t.readInt();this.beginTransaction();let i=[];for(let o=0;o<n;o++){let a=t.readInt(),s=new Int8Array(a);t.readBytes(s);let l=new It(s.buffer),u=l.readInt(),p=l.readString(),d=A.fromDataInput(l);i.push({creationIndex:u,name:p,uuid:d,boxStream:l})}i.sort((o,a)=>o.creationIndex-a.creationIndex).forEach(({name:o,uuid:a,boxStream:s})=>this.createBox(o,a,l=>l.read(s))),this.endTransaction()}toJSON(){let e={};for(let t of this.#t.values())e[t.address.toString()]={name:t.name,fields:ve(t.toJSON())};return e}fromJSON(e){if(typeof e!="object"||e===null||Array.isArray(e))return D("Expected object");this.beginTransaction();let t=Object.entries(e);for(let[n,{name:i,fields:o}]of t)this.createBox(i,A.parse(n),a=>a.fromJSON(o));this.endTransaction()}#g(){V(this.#p,()=>"Modification only prohibited in transaction mode.")}};var Kc;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let n=r.collectIndexedBoxes(e),i=we(t,0,n.length);if(i<n.length)for(let o=i;o<n.length;o++)n[o].index.setValue(o+1);return i},r.removeOrder=(e,t)=>{let n=r.collectIndexedBoxes(e);if(t<n.length)for(let i=t+1;i<n.length;i++)n[i].index.setValue(i-1)},r.moveIndex=(e,t,n)=>{let i=r.collectIndexedBoxes(e),o=i[t];if(n<0){let a=we(t+n,0,i.length-1);for(let s=a;s<t;s++)i[s].index.setValue(s+1);o.index.setValue(a)}else if(n>1){let a=we(t+(n-1),0,i.length-1);for(let s=t;s<a;s++)i[s+1].index.setValue(s);o.index.setValue(a)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${n}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof E,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:n})=>r.isIndexedBox(n)&&(t===void 0||n instanceof t)?n:D(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(Kc||(Kc={}));var qe=class extends X{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return P(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return ve(this.#e[e])}optField(e){return m.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Ue.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Ca.readFields(e,this.#e)}write(e){Ca.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,n])=>(e[t]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(og(e))Object.entries(e).forEach(([t,n])=>{let i=this.#e[parseInt(t)];q(n)&&i.fromJSON(n)});else return D("Type mismatch")}};var Nn;(function(r){class e{value;constructor(s){this.value=s}}r.Transfer=e,r.makeTransferable=a=>new e(a),r.sender=(a,s)=>s(new i(a)),r.executor=(a,s)=>new o(a,s);let t=a=>{let s=[];for(let l of a)l instanceof e?s.push(l.value):(l instanceof MessagePort||typeof ImageBitmap<"u"&&l instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&l instanceof OffscreenCanvas)&&s.push(l);return s},n=a=>a instanceof e?a.value:a;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,...l)=>{let u=t(l);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(ht.map(l,p=>({value:n(p)})))},u)};dispatchAndReturn=(s,...l)=>new Promise((u,p)=>{let d=ht.reduce(l,(g,v,y)=>(typeof v=="function"&&g.push([y,v]),g),[]);this.#t.set(this.#i,{executorTuple:{resolve:u,reject:p},callbacks:new Map(d)});let h=t(l);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(ht.map(l,(g,v)=>typeof g=="function"?{callback:v}:{value:n(g)}))},h),this.#i++});#n=s=>{let l=this.#t.get(s.returnId);q(l)?s.type==="resolve"?(l.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(l.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&l.callbacks?.get(s.funcAt).apply(this,s.args):D(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class o{#e;#t;#r;constructor(s,l){this.#e=s,this.#t=l,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{V(s.type==="send",()=>"Message type must be 'send'");let l=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),u=ve(l[s.func],`${s.func.toString()} does not exists on ${this.#t}`),p=s.returnId;if(p===!1)u.apply(this.#t,s.args.map(d=>"value"in d?d.value:D(`${s.func.toString()} has no promise.`)));else try{u.apply(this.#t,s.args.map(h=>"callback"in h?(...g)=>this.#a(p,h.callback,g):h.value)).then(h=>{try{this.#n(p,h)}catch(g){this.#o(p,g)}},h=>this.#o(p,h))}catch(d){this.#o(p,d)}};#n=(s,l)=>this.#e.send({type:"resolve",returnId:s,resolve:l});#o=(s,l)=>this.#e.send({type:"reject",returnId:s,reject:l});#a=(s,l,u)=>this.#e.send({type:"callback",returnId:s,funcAt:l,args:u})}r.Executor=o})(Nn||(Nn={}));var uB={for:r=>new uA(r)},_M=[],uA=class{#e;#t=new ce;constructor(e){if(this.#e=e,q(e.onmessage)||q(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=t=>this.#t.notify(t.data),e.onmessageerror=t=>{throw new Error(t.type)}}send(e,t){this.#e.postMessage(e,t??_M)}channel(e){return new dA(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},dA=class r{#e;#t;#r=new ce;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(n=>{"__id__"in n&&n.__id__==="42"&&"message"in n&&"channel"in n&&n.channel===t&&this.#r.notify(n.message)})}send(e,t){this.#e.send({__id__:"42",channel:this.#t,message:e},t)}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var eh;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let n=e,i=()=>{--n<=0?t():requestAnimationFrame(i)};requestAnimationFrame(i)}),r.timeSpan=(e,...t)=>new Promise(n=>setTimeout(n,e.millis(),...t)),r.event=(e,t)=>new Promise(n=>e.addEventListener(t,n,{once:!0})),r.observable=e=>new Promise(t=>{let n=e.subscribe(()=>{n.terminate(),t()})}),r.complete=e=>new Promise((t,n)=>{let i=setInterval(()=>{let{status:o,value:a,error:s}=Jo(()=>e.next());if(o==="success"){let{done:l,value:u}=a;l&&(clearInterval(i),t(u))}else clearInterval(i),n(s)},0)})})(eh||(eh={}));var pA=class{maxRetry;timeSpan;#e=0;constructor(e,t){this.maxRetry=e,this.timeSpan=t}retry(e,t){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(t,this.timeSpan.millis()),!0)}},Tg;(function(r){class e{value;status="resolved";constructor(s){this.value=s}error=Zs("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(s){this.error=s}value=Zs("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(a,s)=>{let l=!0;return a.own(re.create(()=>l=!1)),new Promise((u,p)=>s.then(d=>{l&&u(d)},d=>{l&&p(d)}))},r.tryCatch=a=>a.then(s=>new e(s),s=>new t(s));let n=new pA(3,jp.seconds(3));r.retry=(a,s=n)=>a().catch(l=>new Promise((u,p)=>{let d=h=>{s.retry(h,()=>a().then(g=>u(g),d))||p(h)};d(l)})),r.guardedRetry=(a,s)=>{let l=async(u=0)=>{try{return await a()}catch(p){if(s(p,++u))return console.debug(`retry after failure (online: ${navigator.onLine}):`,p),await eh.timeSpan(jp.seconds(1)),l(u);throw new Error(`Failed after ${u} retries: ${p}`)}};return l()},r.approvedRetry=(a,s)=>{let l=async()=>{try{return await a()}catch(u){if(await Cc.approve(s(u)))return l();throw u}};return l()},r.delay=(a,s)=>Promise.all([a,eh.timeSpan(s)]).then(([l])=>l),r.fail=(a,s="fail")=>Promise.reject(s),r.timeout=(a,s,l)=>new Promise((u,p)=>{let d=!0,h=setTimeout(()=>{d=!1,p(new Error(l??"timeout"))},s.millis());a.then(g=>{d&&u(g)},g=>{d&&p(g)}).finally(()=>clearTimeout(h))}),r.sequentialAll=a=>a.reduce((s,l)=>s.then(async u=>[...u,await l()]),Promise.resolve([])),r.sequentialize=a=>{let s=Promise.resolve();return l=>{let u=()=>a(l),p=s.then(u,u);return s=p.catch(()=>{}),p}},r.memoizeAsync=(a,s)=>{let l=null,u=Date.now();return()=>{let p=Date.now();return(so(l)||q(s)&&p-u>s.millis())&&(u=p,l=a(),l.catch(d=>(l=null,d))),l}},r.allWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,p=!1,d=async()=>{for(;u<a.length&&!p;){let h=u++;try{let g=await a[h]();p||(l[h]=g)}catch(g){throw p=!0,g}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},d)),l},r.allSettledWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,p=async()=>{for(;u<a.length;){let d=u++;try{let h=await a[d]();l[d]={status:"fulfilled",value:h}}catch(h){l[d]={status:"rejected",reason:h}}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},p)),l};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 l=Promise.withResolvers();return this.#e.push([s,l]),l.promise.finally(()=>this.#r())}}#r(){if(V(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:l,reject:u}]=this.#e.shift();this.#t++,s().then(l,u)}}}r.Limit=i;class o{#e;#t;#r;#i=m.None;constructor(s,l,u){this.#e=s,this.#t=l,this.#r=u}update(s){this.#i=m.wrap(s),s.then(l=>{this.#i.contains(s)&&this.#e(l)}).catch(l=>{this.#i.contains(s)&&this.#t(l)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),P(this.#r))})}terminate(){this.#i=m.None}}r.Latest=o})(Tg||(Tg={}));var dB=(r,e)=>Nn.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(n=>{let i=n.type;i==="new"?r.createBox(n.name,n.uuid,o=>o.read(new It(n.buffer))):i==="update-primitive"?r.findVertex(ke.reconstruct(n.address)).unwrap(()=>`Could not find primitive field ${n.address}`).setValue(n.value):i==="update-pointer"?r.findVertex(ke.reconstruct(n.address)).unwrap(()=>`Could not find pointer field ${n.address}`).targetAddress=q(n.target)?m.wrap(ke.reconstruct(n.target)):m.None:n.type==="delete"&&r.unstageBox(r.findBox(n.uuid).unwrap(()=>`Could not find box ${A.toString(n.uuid)}`))}),r.endTransaction()}checksum(t){return U.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var nl;(function(r){r.create=(e,t,n,i)=>{switch(e){case"MetaDataBox":return ia.create(t,n,i);case"RootBox":return Wc.create(t,n,i);case"SelectionBox":return ol.create(t,n,i);case"UserInterfaceBox":return al.create(t,n,i);case"UploadFileBox":return Rg.create(t,n,i);case"ShadertoyBox":return Cg.create(t,n,i);case"MIDIControllerBox":return Og.create(t,n,i);case"TimelineBox":return sl.create(t,n,i);case"TrackBox":return Wr.create(t,n,i);case"NoteEventBox":return Oa.create(t,n,i);case"NoteEventRepeatBox":return Vg.create(t,n,i);case"NoteEventCollectionBox":return na.create(t,n,i);case"NoteRegionBox":return ll.create(t,n,i);case"NoteClipBox":return Zc.create(t,n,i);case"ValueEventBox":return In.create(t,n,i);case"ValueEventCollectionBox":return Dn.create(t,n,i);case"ValueEventCurveBox":return Va.create(t,n,i);case"ValueRegionBox":return cl.create(t,n,i);case"ValueClipBox":return Gc.create(t,n,i);case"SignatureEventBox":return qc.create(t,n,i);case"AudioRegionBox":return za.create(t,n,i);case"AudioClipBox":return Hc.create(t,n,i);case"AudioPitchStretchBox":return Jc.create(t,n,i);case"AudioTimeStretchBox":return Qc.create(t,n,i);case"TransientMarkerBox":return zg.create(t,n,i);case"WarpMarkerBox":return Ua.create(t,n,i);case"MarkerBox":return Yc.create(t,n,i);case"AudioFileBox":return br.create(t,n,i);case"SoundfontFileBox":return yo.create(t,n,i);case"NeuralAmpModelBox":return Ug.create(t,n,i);case"AudioUnitBox":return Pt.create(t,n,i);case"CaptureAudioBox":return ja.create(t,n,i);case"CaptureMidiBox":return La.create(t,n,i);case"AudioBusBox":return kn.create(t,n,i);case"AuxSendBox":return Xc.create(t,n,i);case"GrooveShuffleBox":return eu.create(t,n,i);case"UnknownAudioEffectDeviceBox":return jg.create(t,n,i);case"UnknownMidiEffectDeviceBox":return Lg.create(t,n,i);case"DeviceInterfaceKnobBox":return Kg.create(t,n,i);case"ModularDeviceBox":return Wg.create(t,n,i);case"StereoToolDeviceBox":return Zg.create(t,n,i);case"MaximizerDeviceBox":return Gg.create(t,n,i);case"CompressorDeviceBox":return tu.create(t,n,i);case"GateDeviceBox":return qg.create(t,n,i);case"DelayDeviceBox":return Hg.create(t,n,i);case"CrusherDeviceBox":return Jg.create(t,n,i);case"DattorroReverbDeviceBox":return Qg.create(t,n,i);case"VelocityDeviceBox":return Yg.create(t,n,i);case"FoldDeviceBox":return Xg.create(t,n,i);case"TidalDeviceBox":return ev.create(t,n,i);case"RevampDeviceBox":return tv.create(t,n,i);case"ReverbDeviceBox":return rv.create(t,n,i);case"VaporisateurDeviceBox":return ru.create(t,n,i);case"MIDIOutputDeviceBox":return iu.create(t,n,i);case"MIDIOutputBox":return Mn.create(t,n,i);case"MIDIOutputParameterBox":return $n.create(t,n,i);case"SoundfontDeviceBox":return nu.create(t,n,i);case"NanoDeviceBox":return ou.create(t,n,i);case"PlayfieldDeviceBox":return au.create(t,n,i);case"PlayfieldSampleBox":return Ka.create(t,n,i);case"TapeDeviceBox":return su.create(t,n,i);case"ArpeggioDeviceBox":return iv.create(t,n,i);case"PitchDeviceBox":return nv.create(t,n,i);case"ZeitgeistDeviceBox":return ov.create(t,n,i);case"NeuralAmpDeviceBox":return av.create(t,n,i);case"ModularBox":return sv.create(t,n,i);case"ModuleConnectionBox":return lv.create(t,n,i);case"ModularAudioInputBox":return cv.create(t,n,i);case"ModularAudioOutputBox":return uv.create(t,n,i);case"ModuleDelayBox":return dv.create(t,n,i);case"ModuleMultiplierBox":return pv.create(t,n,i);case"ModuleGainBox":return hv.create(t,n,i);default:return D(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let n=new It(t),i=n.readString(),o=A.fromDataInput(n),a=r.create(i,e,o);return a.read(n),a}})(nl||(nl={}));var pB;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(pB||(pB={}));var hB;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(hB||(hB={}));var Qt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(Qt||(Qt={}));var Wa={white:new Ht(0,0,100),blue:new Ht(189,100,65),green:new Ht(150,77,69),yellow:new Ht(60,100,84),cream:new Ht(65,20,83),orange:new Ht(31,100,73),red:new Ht(354,100,65),purple:new Ht(314,100,78),bright:new Ht(197,5,95),gray:new Ht(197,31,80),dark:new Ht(197,15,60),shadow:new Ht(197,10,45),black:new Ht(197,10,16),background:new Ht(197,6,7),panelBackground:new Ht(197,14,10),panelBackgroundBright:new Ht(197,10,17),panelBackgroundDark:new Ht(197,14,9)};var He;(function(r){r[r.Add=0]="Add",r[r.Adsr=1]="Adsr",r[r.ArrayDown=2]="ArrayDown",r[r.AudioBus=3]="AudioBus",r[r.AudioDevice=4]="AudioDevice",r[r.AudioFile=5]="AudioFile",r[r.AutoGain=6]="AutoGain",r[r.Automation=7]="Automation",r[r.BassGuitar=8]="BassGuitar",r[r.Book=9]="Book",r[r.Box=10]="Box",r[r.Browse=11]="Browse",r[r.Maximizer=12]="Maximizer",r[r.Bug=13]="Bug",r[r.Fold=14]="Fold",r[r.Checkbox=15]="Checkbox",r[r.Clips=16]="Clips",r[r.Close=17]="Close",r[r.CloudFolder=18]="CloudFolder",r[r.CollapseDown=19]="CollapseDown",r[r.Compressor=20]="Compressor",r[r.Connected=21]="Connected",r[r.Cube=22]="Cube",r[r.Cursor=23]="Cursor",r[r.Curve=24]="Curve",r[r.Dattorro=25]="Dattorro",r[r.Delete=26]="Delete",r[r.Dial=27]="Dial",r[r.DinSlot=28]="DinSlot",r[r.Disconnected=29]="Disconnected",r[r.Divide=30]="Divide",r[r.DragConnections=31]="DragConnections",r[r.Dropdown=32]="Dropdown",r[r.Dropbox=33]="Dropbox",r[r.DrumSet=34]="DrumSet",r[r.Tidal=35]="Tidal",r[r.Duration=36]="Duration",r[r.EditBox=37]="EditBox",r[r.Effects=38]="Effects",r[r.Embed=39]="Embed",r[r.EQ=40]="EQ",r[r.Eraser=41]="Eraser",r[r.Exclude=42]="Exclude",r[r.Exit=43]="Exit",r[r.ExpandWidth=44]="ExpandWidth",r[r.FileList=45]="FileList",r[r.Film=46]="Film",r[r.Flask=47]="Flask",r[r.Focus=48]="Focus",r[r.Gate=49]="Gate",r[r.Generator=50]="Generator",r[r.GoogleDrive=51]="GoogleDrive",r[r.Groove=52]="Groove",r[r.Guitar=53]="Guitar",r[r.GuitarTab=54]="GuitarTab",r[r.Headphone=55]="Headphone",r[r.Heart=56]="Heart",r[r.Help=57]="Help",r[r.HighPass=58]="HighPass",r[r.HighShelf=59]="HighShelf",r[r.Insert=60]="Insert",r[r.Invert=61]="Invert",r[r.Info=62]="Info",r[r.Loop=63]="Loop",r[r.LoopEnd=64]="LoopEnd",r[r.LoopStart=65]="LoopStart",r[r.LowPass=66]="LowPass",r[r.LowShelf=67]="LowShelf",r[r.Magnet=68]="Magnet",r[r.MainMenu=69]="MainMenu",r[r.Maximized=70]="Maximized",r[r.Menu=71]="Menu",r[r.Merge=72]="Merge",r[r.Metronome=73]="Metronome",r[r.Microphone=74]="Microphone",r[r.Midi=75]="Midi",r[r.Minimized=76]="Minimized",r[r.Mix=77]="Mix",r[r.Mixing=78]="Mixing",r[r.Mute=79]="Mute",r[r.NanoWave=80]="NanoWave",r[r.NeuralAmp=81]="NeuralAmp",r[r.New=82]="New",r[r.NoAudio=83]="NoAudio",r[r.Note=84]="Note",r[r.NotePad=85]="NotePad",r[r.OpenDAW=86]="OpenDAW",r[r.Panel=87]="Panel",r[r.Peak=88]="Peak",r[r.Pencil=89]="Pencil",r[r.Piano=90]="Piano",r[r.Play=91]="Play",r[r.Playfield=92]="Playfield",r[r.PlayOnce=93]="PlayOnce",r[r.PlayRepeat=94]="PlayRepeat",r[r.PlayAlternate=95]="PlayAlternate",r[r.Pointer=96]="Pointer",r[r.Popout=97]="Popout",r[r.Primary=98]="Primary",r[r.Random=99]="Random",r[r.Record=100]="Record",r[r.Rectangle=101]="Rectangle",r[r.Redo=102]="Redo",r[r.Region=103]="Region",r[r.Robot=104]="Robot",r[r.RoundDown=105]="RoundDown",r[r.RoundUp=106]="RoundUp",r[r.Run=107]="Run",r[r.Sawtooth=108]="Sawtooth",r[r.Saxophone=109]="Saxophone",r[r.Scissors=110]="Scissors",r[r.Search=111]="Search",r[r.Shadertoy=112]="Shadertoy",r[r.Shutdown=113]="Shutdown",r[r.Sine=114]="Sine",r[r.Solo=115]="Solo",r[r.SoundFont=116]="SoundFont",r[r.Speaker=117]="Speaker",r[r.SpeakerHeadphone=118]="SpeakerHeadphone",r[r.Square=119]="Square",r[r.Stack=120]="Stack",r[r.Start=121]="Start",r[r.Stereo=122]="Stereo",r[r.Stop=123]="Stop",r[r.Subtract=124]="Subtract",r[r.Sun=125]="Sun",r[r.Swap=126]="Swap",r[r.System=127]="System",r[r.Table=128]="Table",r[r.Tape=129]="Tape",r[r.TapeReel=130]="TapeReel",r[r.Time=131]="Time",r[r.Timeline=132]="Timeline",r[r.Tool=133]="Tool",r[r.Triangle=134]="Triangle",r[r.Undo=135]="Undo",r[r.Unknown=136]="Unknown",r[r.UserFolder=137]="UserFolder",r[r.Velocity=138]="Velocity",r[r.Vinyl=139]="Vinyl",r[r.Volume=140]="Volume",r[r.VUMeter=141]="VUMeter",r[r.Waveform=142]="Waveform",r[r.Zeitgeist=143]="Zeitgeist"})(He||(He={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(He||(He={}));var c;(function(r){r[r.Deprecated=NaN]="Deprecated",r[r.MetaData=0]="MetaData",r[r.AudioBusses=1]="AudioBusses",r[r.AudioConnection=2]="AudioConnection",r[r.AudioEffectHost=3]="AudioEffectHost",r[r.AudioFile=4]="AudioFile",r[r.AudioOutput=5]="AudioOutput",r[r.AudioPlayMode=6]="AudioPlayMode",r[r.AudioUnit=7]="AudioUnit",r[r.AudioUnits=8]="AudioUnits",r[r.Automation=9]="Automation",r[r.AuxSend=10]="AuxSend",r[r.Capture=11]="Capture",r[r.ClipCollection=12]="ClipCollection",r[r.ConnectionCollection=13]="ConnectionCollection",r[r.Device=14]="Device",r[r.DeviceUserInterface=15]="DeviceUserInterface",r[r.Editing=16]="Editing",r[r.FileUploadState=17]="FileUploadState",r[r.Groove=18]="Groove",r[r.InstrumentHost=19]="InstrumentHost",r[r.MarkerEvents=20]="MarkerEvents",r[r.MarkerTrack=21]="MarkerTrack",r[r.MIDIControl=22]="MIDIControl",r[r.MIDIControllers=23]="MIDIControllers",r[r.MIDIDevice=24]="MIDIDevice",r[r.MIDIEffectHost=25]="MIDIEffectHost",r[r.ModularSetup=26]="ModularSetup",r[r.Modulation=27]="Modulation",r[r.ModuleCollection=28]="ModuleCollection",r[r.NoteEventCollection=29]="NoteEventCollection",r[r.NoteEventFeature=30]="NoteEventFeature",r[r.NoteEvents=31]="NoteEvents",r[r.NotesConnection=32]="NotesConnection",r[r.Parameter=33]="Parameter",r[r.ParameterController=34]="ParameterController",r[r.PianoMode=35]="PianoMode",r[r.RegionCollection=36]="RegionCollection",r[r.Sample=37]="Sample",r[r.Selection=38]="Selection",r[r.Shadertoy=39]="Shadertoy",r[r.SideChain=40]="SideChain",r[r.SignatureAutomation=41]="SignatureAutomation",r[r.SoundfontFile=42]="SoundfontFile",r[r.StepAutomation=43]="StepAutomation",r[r.Timeline=44]="Timeline",r[r.TrackCollection=45]="TrackCollection",r[r.TransientMarkers=46]="TransientMarkers",r[r.User=47]="User",r[r.ValueEventCollection=48]="ValueEventCollection",r[r.ValueEvents=49]="ValueEvents",r[r.ValueInterpolation=50]="ValueInterpolation",r[r.VoltageConnection=51]="VoltageConnection",r[r.WarpMarkers=52]="WarpMarkers",r[r.NeuralAmpModel=53]="NeuralAmpModel"})(c||(c={}));var Za;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(Za||(Za={}));var xo;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(xo||(xo={}));var ia=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:f,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 P(e.visitMetaDataBox,this)}get tags(){return r.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:f},c.MetaData,!0),2:C.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:f})}}};var fv=class r extends qe{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:f},{length:4},"",0),2:b.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:f},{min:1,max:64,scaling:"linear"},"",8),3:b.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:f},{min:.5,max:2,scaling:"linear"},"",1),4:M.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:f},!1),5:E.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:f},{min:-48,max:48},"st",0)}}};var Wc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:{accepts:[c.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 P(e.visitRootBox,this)}get tags(){return r.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 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 editingChannel(){return this.getField(111)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:f},c.Timeline,!0),2:X.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[c.User],mandatory:!0,exclusive:!1}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:f}),4:N.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0),10:X.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!1,exclusive:!1}}),20:X.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[c.AudioUnits],mandatory:!1,exclusive:!1}}),21:X.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[c.AudioBusses],mandatory:!1,exclusive:!1}}),30:X.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!0,exclusive:!1}}),35:X.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!1,exclusive:!1}}),40:fv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:f}),100:N.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:f},c.Shadertoy,!1),111:N.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:f},c.Editing,!1)}}};var ol=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:f,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 P(e.visitSelectionBox,this)}get tags(){return r.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:f},c.Selection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:f},c.Selection,!0)}}};var al=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[c.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 P(e.visitUserInterfaceBox,this)}get tags(){return r.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:f},c.User,!0),10:X.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[c.Selection],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[c.FileUploadState],mandatory:!1,exclusive:!1}}),21:N.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:f},c.Editing,!1),22:N.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:f},c.Editing,!1),23:N.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:f},c.Editing,!1),30:X.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[c.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var Rg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:f,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 P(e.visitUploadFileBox,this)}get tags(){return r.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:f},c.FileUploadState,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.FileUploadState,!0)}}};var Cg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[c.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 P(e.visitShadertoyBox,this)}get tags(){return r.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:f}),2:M.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:f},!0)}}};var Og=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIControllerBox",pointerRules:f,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 P(e.visitMIDIControllerBox,this)}get tags(){return r.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:f},c.MIDIControllers,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.MIDIControl,!0),3:C.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:f}),4:E.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:f},{min:0,max:127},""),5:E.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:f},{min:0,max:127},"")}}};var mv=class r extends qe{static create(e){return new r(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4),2:E.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4)}}};var gv=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),2:E.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:f},"any","ppqn",0),3:E.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:f},"any","ppqn",15360)}}};var vv=class r extends qe{static create(e){return new r(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:X.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1,exclusive:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var yv=class r extends qe{static create(e){return new r(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:f},c.ValueEventCollection,!1),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",2),15:E.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:f},{min:30,max:999},"bpm",60),16:E.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:f},{min:31,max:1e3},"bpm",240),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var xv=class r extends qe{static create(e){return new r(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:X.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",1),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var sl=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:{accepts:[c.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 P(e.visitTimelineBox,this)}get tags(){return r.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:X.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[c.Timeline],mandatory:!0,exclusive:!1}}),10:mv.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:f}),11:gv.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:f}),20:X.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1,exclusive:!1}}),21:vv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:f}),22:yv.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:f}),23:xv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:f}),30:E.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:f},"positive","ppqn",491520),31:b.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:f},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var Wr=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[c.Selection,c.PianoMode,c.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 P(e.visitTrackBox,this)}get tags(){return r.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:f},c.TrackCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:f},c.Automation,!0),3:X.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[c.RegionCollection],mandatory:!1,exclusive:!1}}),4:X.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[c.ClipCollection],mandatory:!1,exclusive:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),11:E.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:f},{values:[0,1,2,3]},""),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),30:M.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:f},!1)}}};var Oa=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[c.Selection,c.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 P(e.visitNoteEventBox,this)}get tags(){return r.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:f},c.NoteEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn",240),20:E.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),21:b.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:f},"unipolar","%",.7874015748031497),22:E.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),23:b.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:f},"bipolar","%",0),24:b.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:f},{min:-50,max:50,scaling:"linear"},"ct",0),25:E.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:f},{min:0,max:100},"",100)}}};var Vg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:f,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 P(e.visitNoteEventRepeatBox,this)}get tags(){return r.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:f},c.NoteEventFeature,!0),2:E.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),3:b.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:f},"bipolar","%",0),4:b.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:f},"unipolar","%",1)}}};var na=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventCollectionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return P(e.visitNoteEventCollectionBox,this)}get tags(){return r.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.NoteEvents],mandatory:!1,exclusive:!1}}),2:X.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var ll=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitNoteRegionBox,this)}get tags(){return r.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:f},c.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:E.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:f},"any","ppqn"),15:M.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:f}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:f}),17:E.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Ga=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:f},!0),2:M.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:f}),3:M.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:f}),4:E.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:f},"non-negative",""),5:E.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:f},"non-negative",""),6:E.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:f},"non-negative","")}}};var Zc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitNoteClipBox,this)}get tags(){return r.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:f},c.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:Ga.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var In=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[c.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 P(e.visitValueEventBox,this)}get tags(){return r.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:f},c.ValueEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:E.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[c.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:b.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:f},"any",""),14:b.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:f},"any","",NaN)}}};var Dn=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventCollectionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return P(e.visitValueEventCollectionBox,this)}get tags(){return r.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.ValueEvents],mandatory:!1,exclusive:!1}}),2:X.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Va=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:f,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 P(e.visitValueEventCurveBox,this)}get tags(){return r.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:f},c.ValueInterpolation,!0),2:b.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:f},"unipolar","%",.5)}}};var cl=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitValueRegionBox,this)}get tags(){return r.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:f},c.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Gc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitValueClipBox,this)}get tags(){return r.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:f},c.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:Ga.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var qc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[c.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 P(e.visitSignatureEventBox,this)}get tags(){return r.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:f},c.SignatureAutomation,!0),9:E.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),10:E.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:f},"positive","bars",1),21:E.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:f},"positive","",4),22:E.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:f},"positive","",4)}}};var bv=class r extends qe{static create(e){return new r(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:b.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:f},"positive","ppqn",0),2:b.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:f},"positive","ppqn",0),3:b.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:f},"unipolar","ratio",.75),4:b.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:f},"unipolar","ratio",.25)}}};var za=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitAudioRegionBox,this)}get tags(){return r.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:f},c.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:f}),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical"),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:b.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"any","mixed"),12:b.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","mixed"),13:b.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"any","mixed"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db"),18:bv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:f})}}};var Hc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitAudioClipBox,this)}get tags(){return r.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:f},c.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:Ga.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:b.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),14:b.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db"),20:C.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:f}),21:C.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical")}}};var Jc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[c.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 P(e.visitAudioPitchStretchBox,this)}get tags(){return r.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[c.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var Qc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[c.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 P(e.visitAudioTimeStretchBox,this)}get tags(){return r.Tags}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[c.WarpMarkers],mandatory:!0,exclusive:!1}}),2:E.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:f},"positive","enum",2),3:b.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:f},"positive","ratio",1)}}};var zg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[c.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 P(e.visitTransientMarkerBox,this)}get tags(){return r.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:f},c.TransientMarkers,!0),2:b.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var Ua=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[c.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 P(e.visitWarpMarkerBox,this)}get tags(){return r.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:f},c.WarpMarkers,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:b.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var Yc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[c.Selection,c.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 P(e.visitMarkerBox,this)}get tags(){return r.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:f},c.MarkerTrack,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:E.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:f},"non-negative","",1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:E.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var br=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[c.AudioFile,c.FileUploadState,c.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 P(e.visitAudioFileBox,this)}get tags(){return r.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:b.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),2:b.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[c.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var yo=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[c.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 P(e.visitSoundfontFileBox,this)}get tags(){return r.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:f})}}};var Ug=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NeuralAmpModelBox",pointerRules:{accepts:[c.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 P(e.visitNeuralAmpModelBox,this)}get tags(){return r.Tags}get label(){return this.getField(1)}get model(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:f})}}};var Pt=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[c.Selection,c.Automation,c.MetaData,c.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 P(e.visitAudioUnitBox,this)}get tags(){return r.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)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:f},"instrument"),2:N.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:f},c.AudioUnits,!0),3:X.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1,exclusive:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:b.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),20:X.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[c.TrackCollection],mandatory:!1,exclusive:!1}}),21:X.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:X.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.InstrumentHost,c.AudioOutput],mandatory:!1,exclusive:!0}}),23:X.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:X.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[c.AuxSend],mandatory:!1,exclusive:!1}}),25:N.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!1),26:N.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:f},c.Capture,!1)}}};var ja=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[c.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 P(e.visitCaptureAudioBox,this)}get tags(){return r.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)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:f},"any","",2),11:b.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:f},"decibel","dB",0)}}};var La=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[c.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 P(e.visitCaptureMidiBox,this)}get tags(){return r.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:f},"any","",-1)}}};var kn=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:{accepts:[c.SideChain,c.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 P(e.visitAudioBusBox,this)}get tags(){return r.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:f},c.AudioBusses,!0),2:N.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:X.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!1,exclusive:!1}}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:f}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:f}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:f},"red"),8:M.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:f})}}};var Xc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:{accepts:[c.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 P(e.visitAuxSendBox,this)}get tags(){return r.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:f},c.AuxSend,!0),2:N.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:E.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1),5:b.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:b.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var eu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[c.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 P(e.visitGrooveShuffleBox,this)}get tags(){return r.Tags}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:f}),10:b.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"non-negative","ppqn",480)}}};var jg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitUnknownAudioEffectDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var Lg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitUnknownMidiEffectDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var Kg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:f,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 P(e.visitDeviceInterfaceKnobBox,this)}get tags(){return r.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:f},c.DeviceUserInterface,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.ParameterController,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),10:b.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:f},"unipolar","%"),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:f})}}};var wv=class r extends qe{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[c.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var Wg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitModularDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:f},c.ModularSetup,!0),11:wv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:f})}}};var Zg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitStereoToolDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:b.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:b.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:M.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),14:M.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1)}}};var Gg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitMaximizerDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:M.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:f},!0),11:b.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:0,scaling:"linear"},"dB",0)}}};var tu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitCompressorDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:M.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:M.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:M.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:M.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:b.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:b.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:b.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:b.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:b.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:b.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:b.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:b.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:f},c.SideChain,!1)}}};var qg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"GateDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitGateDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-6),11:b.create({parent:this,fieldKey:11,fieldName:"return",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),12:b.create({parent:this,fieldKey:12,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",1),13:b.create({parent:this,fieldKey:13,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:500,scaling:"linear"},"ms",50),14:b.create({parent:this,fieldKey:14,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:2e3,scaling:"linear"},"ms",100),15:b.create({parent:this,fieldKey:15,fieldName:"floor",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,max:0,scaling:"linear"},"dB",-72),16:M.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:f},c.SideChain,!1)}}};var Hg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitDelayDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:b.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:b.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),16:b.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:b.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:b.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:b.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:b.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:b.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:b.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:f},"any","")}}};var Jg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitCrusherDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:E.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"bits",16),12:b.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:b.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Qg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitDattorroReverbDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:b.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:b.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:b.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:b.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:b.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:b.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:b.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:b.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:b.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:b.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),21:b.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Yg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitVelocityDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:E.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:f},"any","",2048),13:b.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:b.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:b.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Xg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitFoldDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:E.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:f},{length:3},"",0),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var ev=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitTidalDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:b.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:b.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",3),21:b.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:b.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:b.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var th=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:E.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var rh=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var lu=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var tv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitRevampDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:th.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:f}),11:rh.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:f}),12:lu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:f}),13:lu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:f}),14:lu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:f}),15:rh.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:f}),16:th.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:f}),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var rv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitReverbDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:b.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Av=class r extends qe{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",-1/0),3:E.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),4:b.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var _v=class r extends qe{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:M.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:b.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var Pv=class r extends qe{static create(e){return new r(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:b.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:b.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:b.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:b.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",.001)}}};var ru=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitVaporisateurDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),11:E.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:b.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:E.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:b.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:b.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:b.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:b.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:b.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:b.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:b.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:b.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:E.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),23:E.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,3,5]},"",1),24:b.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:b.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:E.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,2,3,4]},"",1),27:b.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:_v.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:f}),40:kg.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:f},e=>Av.create(e),2),50:Pv.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:f}),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:f},"any","")}}};var Sv=class r extends qe{static create(e){return new r(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f})}}};var iu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitMIDIOutputDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:Sv.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:f}),11:E.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:f},{min:0,max:15},"ch"),12:E.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:f},"any","ms",10),13:X.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[c.Parameter],mandatory:!1,exclusive:!1}}),14:N.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:f},c.MIDIDevice,!1)}}};var Mn=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:f,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 P(e.visitMIDIOutputBox,this)}get tags(){return r.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:f},c.MIDIDevice,!0),2:X.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!0,exclusive:!1}}),3:C.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:f}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:E.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:f},{min:0,max:500},"ms",10),6:M.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:f},!0)}}};var $n=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:f,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 P(e.visitMIDIOutputParameterBox,this)}get tags(){return r.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:f},c.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f},""),3:E.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:f},{min:0,max:127},"#",64),4:b.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var nu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitSoundfontDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:N.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:f},c.SoundfontFile,!1),11:E.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:f},{min:0,max:65535},"")}}};var ou=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitNanoDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:N.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!1),20:b.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var au=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitPlayfieldDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:X.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[c.Sample],mandatory:!1,exclusive:!1}})}}};var Ka=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[c.Editing,c.SideChain,c.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 P(e.visitPlayfieldSampleBox,this)}get tags(){return r.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)}initializeFields(){return{10:N.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:f},c.Sample,!0),11:N.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),12:X.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:X.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:E.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:f}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:f}),22:M.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),23:M.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),40:M.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:f}),41:M.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:f}),42:M.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:f}),43:M.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:f}),44:E.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:f},{length:3},"",0),45:b.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:b.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:b.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:b.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:b.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var su=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain,c.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 P(e.visitTapeDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:b.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var iv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitArpeggioDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:E.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),11:E.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:5},"oct",1),12:E.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{length:17},"",9),13:b.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:2,scaling:"linear"},"",1),14:E.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"",1),15:b.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var nv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitPitchDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:E.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-36,max:36},"st",0),11:b.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:E.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-7,max:7},"oct",0)}}};var ov=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitZeitgeistDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:N.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0)}}};var av=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NeuralAmpDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitNeuralAmpDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:f}),11:b.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),12:b.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),13:M.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:f},!0),14:b.create({parent:this,fieldKey:14,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1,scaling:"linear"},"%",1),20:N.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:f},c.NeuralAmpModel,!1)}}};var sv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:f,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 P(e.visitModularBox,this)}get tags(){return r.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:f},c.ModularSetup,!0),2:X.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!0,exclusive:!1}}),3:X.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[c.ModuleCollection],mandatory:!1,exclusive:!1}}),12:X.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[c.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:f})}}};var lv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:f,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 P(e.visitModuleConnectionBox,this)}get tags(){return r.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:f},c.ConnectionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:f},c.VoltageConnection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:f},c.VoltageConnection,!0)}}};var Hi=class r extends qe{static create(e){return new r(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:f},c.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:E.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:f},"any","x"),4:E.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:f},"any","y"),5:M.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:f},!1),6:M.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:f},!0)}}};var cv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[c.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 P(e.visitModularAudioInputBox,this)}get tags(){return r.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var uv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[c.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 P(e.visitModularAudioOutputBox,this)}get tags(){return r.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var dv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[c.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 P(e.visitModuleDelayBox,this)}get tags(){return r.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:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var pv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[c.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 P(e.visitModuleMultiplierBox,this)}get tags(){return r.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:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),12:X.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:f},"unipolar","%")}}};var hv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[c.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 P(e.visitModuleGainBox,this)}get tags(){return r.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:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),12:X.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var Ev=class{#e=0;#t=!1;#r=!1;isRecording=!1;isCountingIn=!1;metronomeEnabled=!1;getLeapStateAndReset(){let e=this.#r;return this.#r=!1,e}get position(){return this.#e}set position(e){this.#e=e,this.#r=!0}get transporting(){return this.#t}set transporting(e){this.#t!==e&&(this.#t=e)}pause(){this.#t=!1,this.isRecording=!1,this.isCountingIn=!1}advanceTo(e){this.#e=e}};var fB=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?D(`Indices cannot be equal (${r}, ${e})`):t};var oa=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},wr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fv,Tn,qa,Bv,aa,ar=class r{static create(e,t,n){return new r(e,t,n)}constructor(e,t,n){Fv.set(this,void 0),Tn.set(this,void 0),qa.set(this,void 0),Bv.set(this,void 0),aa.set(this,null),oa(this,Fv,e,"f"),oa(this,Tn,A.newSet(i=>i.adapter.uuid),"f"),oa(this,qa,new or,"f"),oa(this,Bv,e.pointerHub.catchupAndSubscribe({onAdded:i=>{oa(this,aa,null,"f");let o=t(i.box),a=o.indexField.subscribe(()=>{oa(this,aa,null,"f"),wr(this,qa,"f").proxy.onReorder(o)}),s=wr(this,Tn,"f").add({adapter:o,subscription:a});V(s,`Could not add ${o}`),wr(this,qa,"f").proxy.onAdd(o)},onRemoved:i=>{oa(this,aa,null,"f");let o=i.box.address.uuid,{adapter:a,subscription:s}=wr(this,Tn,"f").removeByKey(o);s.terminate(),wr(this,qa,"f").proxy.onRemove(a)}},n),"f")}field(){return wr(this,Fv,"f")}subscribe(e){return wr(this,qa,"f").subscribe(e)}catchupAndSubscribe(e){return wr(this,Tn,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=ct.exactMapped(this.adapters(),e,fB,n=>n.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return wr(this,Tn,"f").opt(e).map(({adapter:t})=>t)}getMinFreeIndex(){let e=this.adapters();for(let t=0;t<e.length;t++)if(e[t].indexField.getValue()>t)return t;return e.length}adapters(){return wr(this,aa,"f")===null&&oa(this,aa,wr(this,Tn,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),wr(this,aa,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let n=this.adapters(),i=n[e];if(t<0){let o=we(e+t,0,n.length-1);for(let a=o;a<e;a++)n[a].indexField.setValue(a+1);i.indexField.setValue(o)}else if(t>1){let o=we(e+(t-1),0,n.length-1);for(let a=e;a<o;a++)n[a+1].indexField.setValue(a);i.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return wr(this,Tn,"f").size()}isEmpty(){return this.size()===0}terminate(){oa(this,aa,null,"f"),wr(this,Tn,"f").forEach(({subscription:e})=>e.terminate()),wr(this,Tn,"f").clear(),wr(this,qa,"f").terminate(),wr(this,Bv,"f").terminate()}};Fv=new WeakMap,Tn=new WeakMap,qa=new WeakMap,Bv=new WeakMap,aa=new WeakMap;var si;(function(r){r.write=(e,t)=>{if(t.type==="none")e.disconnect(),e.setValue(0);else if(t.type==="linear")e.disconnect(),e.setValue(1);else if(t.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(c.ValueInterpolation).at(0)?.box;q(n)?(W0(n,Va),n.slope.setValue(t.slope)):Va.create(e.box.graph,A.generate(),i=>{i.slope.setValue(t.slope),i.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return q(t)?(W0(t,Va),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?ai.None:e.getValue()===1?ai.Linear:D("Unknown Interpolation value")}})(si||(si={}));var Ha=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xe=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ih,cu,$t,nh,Ja,oh,sa=class r{constructor(e,t){this.type="value-event",ih.set(this,new j),cu.set(this,void 0),$t.set(this,void 0),nh.set(this,void 0),Ja.set(this,void 0),oh.set(this,!1),Ha(this,cu,e,"f"),Ha(this,$t,t,"f"),Ha(this,nh,Xe(this,ih,"f").own(new sg(()=>si.read(Xe(this,$t,"f").interpolation))),"f");let n=()=>{Xe(this,nh,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Xe(this,ih,"f").ownAll(Xe(this,$t,"f").subscribe(Ue.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let o=this.collection.unwrap(),a=i.address.fieldKeys,s=U.equals(Xe(this,$t,"f").index.address.fieldKeys,a),l=U.equals(Xe(this,$t,"f").position.address.fieldKeys,a);s||l?o.requestSorting():o.onEventPropertyChanged()}}),Xe(this,$t,"f").interpolation.subscribe(n),Xe(this,$t,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Xe(this,Ja,"f").terminate(),Ha(this,Ja,i.subscribe(Ue.Children,n),"f"),n()},onRemoved:()=>{Xe(this,Ja,"f").terminate(),Ha(this,Ja,re.Empty,"f"),n()}})),Ha(this,Ja,Xe(this,$t,"f").interpolation.pointerHub.filter(c.ValueInterpolation).at(0)?.box.subscribe(Ue.Children,n)??re.Empty,"f")}onSelected(){Ha(this,oh,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Ha(this,oh,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Xe(this,Ja,"f").terminate(),Xe(this,ih,"f").terminate()}get box(){return Xe(this,$t,"f")}get uuid(){return Xe(this,$t,"f").address.uuid}get address(){return Xe(this,$t,"f").address}get position(){return Xe(this,$t,"f").position.getValue()}get index(){return Xe(this,$t,"f").index.getValue()}set interpolation(e){si.write(Xe(this,$t,"f").interpolation,e)}get interpolation(){return Xe(this,nh,"f").get()}get value(){return Xe(this,$t,"f").value.getValue()}get isSelected(){return Xe(this,oh,"f")}get collection(){return Xe(this,$t,"f").events.targetVertex.map(e=>Xe(this,cu,"f").boxAdapters.adapterFor(e.box,Ar))}copyTo(e){let t=e?.position??this.position,n=e?.index??this.index,i=In.create(Xe(this,cu,"f").boxGraph,A.generate(),o=>{o.position.setValue(t),o.index.setValue(n),o.events.refer(e?.events??this.collection.unwrap().box.events),o.value.setValue(e?.value??this.value)});return si.write(i.interpolation,e?.interpolation??this.interpolation),Xe(this,cu,"f").boxAdapters.adapterFor(i,r)}copyFrom(e){return Xe(this,$t,"f").position.setValue(e?.position??this.position),Xe(this,$t,"f").index.setValue(e?.index??this.index),Xe(this,$t,"f").events.refer(e?.events??this.collection.unwrap().box.events),Xe(this,$t,"f").value.setValue(e?.value??this.value),si.write(Xe(this,$t,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};ih=new WeakMap,cu=new WeakMap,$t=new WeakMap,nh=new WeakMap,Ja=new WeakMap,oh=new WeakMap;sa.Comparator=(r,e)=>{if(r===e)return D(`${r} is equal to itself`);let t=r.position-e.position;if(t!==0)return t;let n=r.index-e.index;return n!==0?n:D(`${r} and ${e} are identical in terms of comparison`)};var ah=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Qe=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},sh,lh,Qa,Ji,ul,uu,la,Nv,Ar=class r{constructor(e,t){sh.add(this),lh.set(this,new j),Qa.set(this,void 0),Ji.set(this,void 0),ul.set(this,void 0),uu.set(this,void 0),la.set(this,void 0),ah(this,Qa,e,"f"),ah(this,Ji,t,"f"),ah(this,ul,new ce,"f"),ah(this,uu,A.newSet(i=>i.uuid),"f"),ah(this,la,oi.create(sa.Comparator),"f");let n=i=>{let o=ve(i.accept({visitValueEventBox:a=>Qe(this,Qa,"f").boxAdapters.adapterFor(a,sa)}),`Could not find adapter for ${i}`);Qe(this,uu,"f").add(o)&&(Qe(this,la,"f").add(o),Qe(this,sh,"m",Nv).call(this))};Qe(this,Ji,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Qe(this,lh,"f").own(Qe(this,Ji,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Qe(this,la,"f").remove(Qe(this,uu,"f").removeByKey(i)),Qe(this,sh,"m",Nv).call(this)}})),Qe(this,lh,"f").own(Qe(this,Ji,"f").owners.pointerHub.subscribe({onAdded:()=>Qe(this,ul,"f").notify(this),onRemoved:()=>Qe(this,ul,"f").notify(this)}))}valueAt(e,t){return Ig.valueAt(Qe(this,la,"f"),e,t)}copy(){let e=Qe(this,Qa,"f").boxGraph,t=Dn.create(e,A.generate());return Qe(this,la,"f").asArray().forEach(n=>n.copyTo({events:t.events})),Qe(this,Qa,"f").boxAdapters.adapterFor(t,r)}cut(e,t=w.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?m.None:m.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return m.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return m.wrap(n);if(i.position===e)return m.wrap(i);if(n.interpolation.type==="none")return m.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:o}=n,{position:a}=i,s=t.x(n.value),l=t.x(i.value),u=lg(s,l,(e-o)/(a-o));return m.wrap(this.createEvent({position:e,value:t.y(u),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:o}=n,{position:a}=i,s=t.x(n.value),l=t.x(i.value),u=a-o,p=e-o,d=gr.byHalf(u,s,gr.valueAt({slope:n.interpolation.slope,steps:u,y0:s,y1:l},u*.5),l),h=gr.valueAt(d,p),g=gr.slopeByHalf(s,gr.valueAt(d,p*.5),h);return si.write(n.box.interpolation,ai.Curve(g)),m.wrap(this.createEvent({position:e,value:t.y(h),index:0,interpolation:ai.Curve(gr.slopeByHalf(h,gr.valueAt(d,(p+u)*.5),l))}))}return D("Unknown interpolation type")}subscribeChange(e){return Qe(this,ul,"f").subscribe(e)}createEvent({position:e,index:t,value:n,interpolation:i}){let o=Math.trunc(e),a=Qe(this,uu,"f").values().find(l=>l.position===o&&l.index===t);if(q(a)&&a.box.isAttached())return a.box.value.setValue(n),si.write(a.box.interpolation,i),a;let s=In.create(Qe(this,Qa,"f").boxGraph,A.generate(),l=>{l.position.setValue(e),l.index.setValue(t),l.value.setValue(n),l.events.refer(Qe(this,Ji,"f").events)});return si.write(s.interpolation,i),Qe(this,Qa,"f").boxAdapters.adapterFor(s,sa)}requestSorting(){Qe(this,la,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Qe(this,sh,"m",Nv).call(this)}terminate(){Qe(this,lh,"f").terminate()}get box(){return Qe(this,Ji,"f")}get uuid(){return Qe(this,Ji,"f").address.uuid}get address(){return Qe(this,Ji,"f").address}get numOwners(){return Qe(this,Ji,"f").owners.pointerHub.filter(c.ValueEventCollection).length}get events(){return Qe(this,la,"f")}toString(){return`{ValueEventCollectionBox ${A.toString(Qe(this,Ji,"f").address.uuid)}}`}};lh=new WeakMap,Qa=new WeakMap,Ji=new WeakMap,ul=new WeakMap,uu=new WeakMap,la=new WeakMap,sh=new WeakSet,Nv=function(){Qe(this,ul,"f").notify(this)};var dl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ve=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},pl,Ya,hl,Yt,fl,dh,ch,uh,du,Xa=class{constructor(e,t){pl.add(this),this.type="value-clip",Ya.set(this,new j),hl.set(this,void 0),Yt.set(this,void 0),fl.set(this,void 0),dh.set(this,void 0),ch.set(this,void 0),uh.set(this,re.Empty),dl(this,hl,e,"f"),dl(this,Yt,t,"f"),dl(this,ch,!0,"f"),dl(this,fl,Ve(this,Ya,"f").own(new qi(!1)),"f"),dl(this,dh,Ve(this,Ya,"f").own(new ce),"f"),Ve(this,Ya,"f").own(Ve(this,Yt,"f").pointerHub.subscribe({onAdded:()=>Ve(this,pl,"m",du).call(this),onRemoved:()=>Ve(this,pl,"m",du).call(this)})),Ve(this,Ya,"f").own(Ve(this,Yt,"f").subscribe(Ue.Children,n=>Ve(this,pl,"m",du).call(this))),Ve(this,Ya,"f").own(Ve(this,Yt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ve(this,uh,"f").terminate(),dl(this,uh,n.match({none:()=>re.Empty,some:({box:i})=>Ve(this,hl,"f").boxAdapters.adapterFor(i,Ar).subscribeChange(()=>Ve(this,pl,"m",du).call(this))}),"f"),Ve(this,pl,"m",du).call(this)})),dl(this,ch,!1,"f")}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return Ve(this,fl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ve(this,dh,"f").subscribe(e)}accept(e){return P(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ve(this,Yt,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ve(this,Yt,"f").events.targetVertex.unwrap();Gc.create(Ve(this,hl,"f").boxGraph,A.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(Ve(this,Yt,"f").clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){Ve(this,fl,"f").setValue(!0)}onDeselected(){Ve(this,fl,"f").setValue(!1)}get isSelected(){return Ve(this,fl,"f").getValue()}terminate(){Ve(this,uh,"f").terminate(),Ve(this,Ya,"f").terminate()}get box(){return Ve(this,Yt,"f")}get uuid(){return Ve(this,Yt,"f").address.uuid}get address(){return Ve(this,Yt,"f").address}get indexField(){return Ve(this,Yt,"f").index}get duration(){return Ve(this,Yt,"f").duration.getValue()}get mute(){return Ve(this,Yt,"f").mute.getValue()}get hue(){return Ve(this,Yt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ve(this,Yt,"f").events.targetVertex.map(e=>Ve(this,hl,"f").boxAdapters.adapterFor(e.box,Ar))}get label(){return Ve(this,Yt,"f").label.getValue()}get trackBoxAdapter(){return Ve(this,ch,"f")?m.None:Ve(this,Yt,"f").clips.targetVertex.map(e=>Ve(this,hl,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${A.toString(Ve(this,Yt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Ya=new WeakMap,hl=new WeakMap,Yt=new WeakMap,fl=new WeakMap,dh=new WeakMap,ch=new WeakMap,uh=new WeakMap,pl=new WeakSet,du=function(){Ve(this,dh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var mB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},pu=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},hA,ml,Iv,hu=class{constructor(e){this.type="transient-marker",hA.set(this,new j),ml.set(this,void 0),Iv.set(this,void 0),mB(this,ml,e,"f"),mB(this,Iv,new ce,"f")}get box(){return pu(this,ml,"f")}get uuid(){return pu(this,ml,"f").address.uuid}get address(){return pu(this,ml,"f").address}get position(){return pu(this,ml,"f").position.getValue()}subscribe(e){return pu(this,Iv,"f").subscribe(e)}terminate(){pu(this,hA,"f").terminate()}};hA=new WeakMap,ml=new WeakMap,Iv=new WeakMap;var ph=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_r=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Dv,hh,bo,fh,fu,kv,Rn=class r{constructor(e,t){Dv.set(this,new j),hh.set(this,void 0),bo.set(this,void 0),fh.set(this,void 0),fu.set(this,void 0),kv.set(this,void 0),ph(this,hh,e,"f"),ph(this,bo,t,"f"),ph(this,fh,A.newSet(({uuid:n})=>n),"f"),ph(this,fu,oi.create(r.Comparator),"f"),ph(this,kv,Tg.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:o}=Promise.withResolvers(),a=this.getOrCreateLoader(),s=a.subscribe(l=>{l.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(a.data.unwrap("State mismatch"))):l.type==="error"&&(queueMicrotask(()=>s.terminate()),o(new Error(l.reason)))});return n}),"f"),_r(this,Dv,"f").ownAll(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=_r(this,hh,"f").boxAdapters.adapterFor(n.box,hu);_r(this,fh,"f").add(i)&&_r(this,fu,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{_r(this,fu,"f").remove(_r(this,fh,"f").removeByKey(n))}}))}get box(){return _r(this,bo,"f")}get uuid(){return _r(this,bo,"f").address.uuid}get address(){return _r(this,bo,"f").address}get startInSeconds(){return _r(this,bo,"f").startInSeconds.getValue()}get endInSeconds(){return _r(this,bo,"f").endInSeconds.getValue()}get transients(){return _r(this,fu,"f")}get fileName(){return _r(this,bo,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return _r(this,kv,"f").call(this)}getOrCreateLoader(){return _r(this,hh,"f").sampleManager.getOrCreate(_r(this,bo,"f").address.uuid)}terminate(){_r(this,Dv,"f").terminate()}};Dv=new WeakMap,hh=new WeakMap,bo=new WeakMap,fh=new WeakMap,fu=new WeakMap,kv=new WeakMap;Rn.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),D("Events at the same position: "+r.position+", "+e.position)):t};var mh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gh,Mv,$v,ca,yh,vh,Tv,es=class{constructor(e,t){gh.add(this),this.type="warp-marker",Mv.set(this,new j),$v.set(this,void 0),ca.set(this,void 0),yh.set(this,void 0),vh.set(this,!1),mh(this,$v,e,"f"),mh(this,ca,t,"f"),mh(this,yh,new ce,"f"),Zr(this,Mv,"f").own(t.subscribe(Ue.Children,()=>Zr(this,gh,"m",Tv).call(this)))}onSelected(){mh(this,vh,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Zr(this,gh,"m",Tv).call(this)}onDeselected(){mh(this,vh,!1,"f"),Zr(this,gh,"m",Tv).call(this)}get box(){return Zr(this,ca,"f")}get uuid(){return Zr(this,ca,"f").address.uuid}get address(){return Zr(this,ca,"f").address}get position(){return Zr(this,ca,"f").position.getValue()}get seconds(){return Zr(this,ca,"f").seconds.getValue()}get isSelected(){return Zr(this,vh,"f")}get optWarping(){return Zr(this,ca,"f").owner.targetVertex.map(e=>Zr(this,$v,"f").boxAdapters.adapterFor(e.box,wo.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Zr(this,yh,"f").subscribe(e)}terminate(){Zr(this,Mv,"f").terminate()}};Mv=new WeakMap,$v=new WeakMap,ca=new WeakMap,yh=new WeakMap,vh=new WeakMap,gh=new WeakSet,Tv=function(){Zr(this,yh,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var Rv=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),D("Events at the same position: "+r.position+", "+e.position)):t};var xh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$r=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Cv,Ov,gl,vl,bh,mu,Ao=class{constructor(e,t){Cv.set(this,new j),Ov.set(this,void 0),gl.set(this,void 0),vl.set(this,void 0),bh.set(this,void 0),mu.set(this,void 0),xh(this,Ov,e,"f"),xh(this,gl,t,"f"),xh(this,vl,new ce,"f"),xh(this,bh,A.newSet(({uuid:n})=>n),"f"),xh(this,mu,oi.create(Rv),"f"),$r(this,Cv,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=$r(this,Ov,"f").boxAdapters.adapterFor(n.box,es);$r(this,bh,"f").add(i)&&($r(this,mu,"f").add(i),$r(this,vl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{$r(this,mu,"f").remove($r(this,bh,"f").removeByKey(n)),$r(this,vl,"f").notify()}}))}get box(){return $r(this,gl,"f")}get uuid(){return $r(this,gl,"f").address.uuid}get address(){return $r(this,gl,"f").address}get warpMarkers(){return $r(this,mu,"f")}clone(){let e=Jc.create($r(this,gl,"f").graph,A.generate());return this.warpMarkers.asArray().forEach(t=>Ua.create(e.graph,A.generate(),n=>{n.position.setValue(t.position),n.seconds.setValue(t.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return $r(this,vl,"f").subscribe(e)}onChanged(){$r(this,vl,"f").notify()}terminate(){$r(this,Cv,"f").terminate()}};Cv=new WeakMap,Ov=new WeakMap,gl=new WeakMap,vl=new WeakMap,bh=new WeakMap,mu=new WeakMap;var wh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Vv,zv,Cn,yl,Ah,gu,_o=class{constructor(e,t){Vv.set(this,new j),zv.set(this,void 0),Cn.set(this,void 0),yl.set(this,void 0),Ah.set(this,void 0),gu.set(this,void 0),wh(this,zv,e,"f"),wh(this,Cn,t,"f"),wh(this,yl,new ce,"f"),wh(this,Ah,A.newSet(({uuid:n})=>n),"f"),wh(this,gu,oi.create(Rv),"f"),Xt(this,Vv,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Xt(this,zv,"f").boxAdapters.adapterFor(n.box,es);Xt(this,Ah,"f").add(i)&&(Xt(this,gu,"f").add(i),Xt(this,yl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Xt(this,gu,"f").remove(Xt(this,Ah,"f").removeByKey(n)),Xt(this,yl,"f").notify()}}))}get box(){return Xt(this,Cn,"f")}get uuid(){return Xt(this,Cn,"f").address.uuid}get address(){return Xt(this,Cn,"f").address}get warpMarkers(){return Xt(this,gu,"f")}get playbackRate(){return Xt(this,Cn,"f").playbackRate.getValue()}get cents(){return Math.log2(Xt(this,Cn,"f").playbackRate.getValue())*1200}set cents(e){Xt(this,Cn,"f").playbackRate.setValue(we(2**(e/1200),.5,2))}get transientPlayMode(){return Zi(Xt(this,Cn,"f").transientPlayMode.getValue(),Za)}clone(){let e=Qc.create(Xt(this,Cn,"f").graph,A.generate(),t=>{t.transientPlayMode.setValue(this.transientPlayMode),t.playbackRate.setValue(this.playbackRate),t.warpMarkers});return this.warpMarkers.asArray().forEach(t=>Ua.create(e.graph,A.generate(),n=>{n.position.setValue(t.position),n.seconds.setValue(t.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Xt(this,yl,"f").subscribe(e)}onChanged(){Xt(this,yl,"f").notify()}terminate(){Xt(this,Vv,"f").terminate()}};Vv=new WeakMap,zv=new WeakMap,Cn=new WeakMap,yl=new WeakMap,Ah=new WeakMap,gu=new WeakMap;var wo;(function(r){r.isAudioPlayMode=e=>e instanceof Ao||e instanceof _o})(wo||(wo={}));var Pi=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ye=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},xl,vu,bl,Tt,wl,Al,_h,Sh,Ph,_l,yu,xu,bu,ts=class{constructor(e,t){xl.add(this),this.type="audio-clip",vu.set(this,new j),bl.set(this,void 0),Tt.set(this,void 0),wl.set(this,void 0),Al.set(this,void 0),_h.set(this,void 0),Sh.set(this,void 0),Ph.set(this,void 0),_l.set(this,m.None),yu.set(this,m.None),xu.set(this,re.Empty),Pi(this,bl,e,"f"),Pi(this,Tt,t,"f"),Pi(this,Ph,!0,"f"),Pi(this,wl,new Dr,"f"),Pi(this,Al,ye(this,vu,"f").own(new qi(!1)),"f"),Pi(this,_h,Qs.aware(e.tempoMap,t.timeBase,t.duration),"f"),Pi(this,Sh,ye(this,vu,"f").own(new ce),"f"),ye(this,vu,"f").ownAll(ye(this,Tt,"f").pointerHub.subscribe({onAdded:()=>ye(this,xl,"m",bu).call(this),onRemoved:()=>ye(this,xl,"m",bu).call(this)}),ye(this,Tt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{ye(this,xu,"f").terminate(),n.match({none:()=>ye(this,wl,"f").clear(),some:({box:i})=>{let o=ye(this,bl,"f").boxAdapters.adapterFor(i,wo.isAudioPlayMode);Pi(this,xu,o.subscribe(()=>ye(this,xl,"m",bu).call(this)),"f"),ye(this,wl,"f").wrap(o)}})}),ye(this,Tt,"f").file.catchupAndSubscribe(n=>{Pi(this,_l,n.targetVertex.map(i=>ye(this,bl,"f").boxAdapters.adapterFor(i.box,Rn)),"f"),ye(this,yu,"f").ifSome(i=>i.terminate()),Pi(this,yu,ye(this,_l,"f").map(i=>i.getOrCreateLoader().subscribe(()=>ye(this,xl,"m",bu).call(this))),"f")}),ye(this,Tt,"f").subscribe(Ue.Children,n=>ye(this,xl,"m",bu).call(this))),Pi(this,Ph,!1,"f")}catchupAndSubscribeSelected(e){return ye(this,Al,"f").catchupAndSubscribe(e)}subscribeChange(e){return ye(this,Sh,"f").subscribe(e)}accept(e){return P(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let t=this.observableOptPlayMode.map(n=>n.clone());Hc.create(ye(this,bl,"f").boxGraph,A.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(ye(this,Tt,"f").clips.targetVertex.unwrap()),n.file.refer(ye(this,Tt,"f").file.targetVertex.unwrap()),n.events.refer(ye(this,Tt,"f").events.targetVertex.unwrap()),t.ifSome(i=>n.playMode.refer(i))})}onSelected(){ye(this,Al,"f").setValue(!0)}onDeselected(){ye(this,Al,"f").setValue(!1)}get isSelected(){return ye(this,Al,"f").getValue()}get box(){return ye(this,Tt,"f")}get uuid(){return ye(this,Tt,"f").address.uuid}get address(){return ye(this,Tt,"f").address}get indexField(){return ye(this,Tt,"f").index}get duration(){return ye(this,_h,"f").toPPQN(0)}set duration(e){ye(this,_h,"f").fromPPQN(e,0)}get mute(){return ye(this,Tt,"f").mute.getValue()}get hue(){return ye(this,Tt,"f").hue.getValue()}get gain(){return ye(this,Tt,"f").gain}get file(){return ye(this,_l,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return ye(this,wl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get timeBase(){return Zi(ye(this,Tt,"f").timeBase.getValue(),Kr)}get waveformOffset(){return ye(this,Tt,"f").waveformOffset}get isPlayModeNoStretch(){return ye(this,Tt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>pt(e,Ao)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>pt(e,_o)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>wo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ye(this,_l,"f").isEmpty())return"No Audio File";let e=ye(this,_l,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ye(this,Tt,"f").label.getValue()}get trackBoxAdapter(){return ye(this,Ph,"f")?m.None:ye(this,Tt,"f").clips.targetVertex.map(e=>ye(this,bl,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return ye(this,wl,"f").nonEmpty()}terminate(){ye(this,yu,"f").ifSome(e=>e.terminate()),Pi(this,yu,m.None,"f"),ye(this,xu,"f").terminate(),Pi(this,xu,re.Empty,"f"),ye(this,vu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${A.toString(ye(this,Tt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};vu=new WeakMap,bl=new WeakMap,Tt=new WeakMap,wl=new WeakMap,Al=new WeakMap,_h=new WeakMap,Sh=new WeakMap,Ph=new WeakMap,_l=new WeakMap,yu=new WeakMap,xu=new WeakMap,xl=new WeakSet,bu=function(){ye(this,Sh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Eh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Wt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wu,sr,Uv,Fh,Pl=class r{constructor(e,t){this.type="note-event",wu.set(this,void 0),sr.set(this,void 0),Uv.set(this,void 0),Fh.set(this,!1),Eh(this,wu,e,"f"),Eh(this,sr,t,"f"),Eh(this,Uv,Wt(this,sr,"f").subscribe(Ue.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),o=n.address.fieldKeys,a=U.equals(Wt(this,sr,"f").pitch.address.fieldKeys,o),s=U.equals(Wt(this,sr,"f").position.address.fieldKeys,o);a||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Eh(this,Fh,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Eh(this,Fh,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Wt(this,Uv,"f").terminate()}get box(){return Wt(this,sr,"f")}get uuid(){return Wt(this,sr,"f").address.uuid}get address(){return Wt(this,sr,"f").address}get position(){return Wt(this,sr,"f").position.getValue()}get duration(){return Wt(this,sr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Wt(this,sr,"f").velocity.getValue()}get pitch(){return Wt(this,sr,"f").pitch.getValue()}get cent(){return Wt(this,sr,"f").cent.getValue()}get chance(){return Wt(this,sr,"f").chance.getValue()}get playCount(){return Wt(this,sr,"f").playCount.getValue()}get playCurve(){return Wt(this,sr,"f").playCurve.getValue()}get isSelected(){return Wt(this,Fh,"f")}get collection(){return Wt(this,sr,"f").events.targetVertex.map(e=>Wt(this,wu,"f").boxAdapters.adapterFor(e.box,Qi))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:t}=this.collection.unwrap();return e===t?.5:1-(this.pitch-e)/(t-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return Wt(this,wu,"f").boxAdapters.adapterFor(Oa.create(Wt(this,wu,"f").boxGraph,A.generate(),t=>{t.position.setValue(e?.position??this.position),t.duration.setValue(e?.duration??this.duration),t.pitch.setValue(e?.pitch??this.pitch),t.playCount.setValue(e?.playCount??this.playCount),t.events.refer(e?.events??this.collection.unwrap().box.events),t.velocity.setValue(this.velocity),t.cent.setValue(this.cent),t.chance.setValue(this.chance)}),r)}computeCurveValue(e){return Mr.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,n=U.create(i=>{let o=Math.floor(this.computeCurveValue(i/e)*this.duration),a=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+o),duration:Math.max(1,a-o),playCount:1,events:t})},e);return Wt(this,sr,"f").delete(),n}};wu=new WeakMap,sr=new WeakMap,Uv=new WeakMap,Fh=new WeakMap;var Po=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ne=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ua,Bh,rs,On,Sl,Nh,Si,Lv,Kv,Wv,is,jv,Ih,Qi=class r{constructor(e,t){ua.add(this),Bh.set(this,new j),rs.set(this,void 0),On.set(this,void 0),Sl.set(this,void 0),Nh.set(this,void 0),Si.set(this,void 0),Lv.set(this,60),Kv.set(this,60),Wv.set(this,0),is.set(this,!1),Po(this,rs,e,"f"),Po(this,On,t,"f"),Po(this,Sl,new ce,"f"),Po(this,Nh,A.newSet(n=>n.uuid),"f"),Po(this,Si,oi.create(Mr.Comparator),"f"),Ne(this,Bh,"f").own(Ne(this,On,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Ne(this,rs,"f").boxAdapters.adapterFor(n,Pl);Ne(this,Nh,"f").add(i)&&(Ne(this,Si,"f").add(i),Ne(this,ua,"m",jv).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Ne(this,Si,"f").remove(Ne(this,Nh,"f").removeByKey(n)),Ne(this,ua,"m",jv).call(this)}})),Ne(this,Bh,"f").own(Ne(this,On,"f").owners.pointerHub.subscribe({onAdded:()=>Ne(this,Sl,"f").notify(this),onRemoved:()=>Ne(this,Sl,"f").notify(this)}))}copy(){let e=Ne(this,rs,"f").boxGraph,t=na.create(e,A.generate());return Ne(this,Si,"f").asArray().forEach(n=>n.copyTo({events:t.events})),Ne(this,rs,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:n,pitch:i,chance:o,playCount:a,cent:s}){return Ne(this,rs,"f").boxAdapters.adapterFor(Oa.create(Ne(this,rs,"f").boxGraph,A.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(n),l.pitch.setValue(i),l.chance.setValue(o),l.playCount.setValue(a),l.cent.setValue(s),l.events.refer(Ne(this,On,"f").events)}),Pl)}subscribeChange(e){return Ne(this,Sl,"f").subscribe(e)}selectable(){return Ne(this,Si,"f").asArray()}selectableAt(e){for(let t of Ne(this,Si,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return ht.one(t);return ht.empty()}selectablesBetween(e,t){let n=[],i=Ne(this,Si,"f").asArray(),o=Ne(this,Si,"f").ceilFirstIndex(t.u);for(let a=0;a<o;a++){let s=i[a];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=t.v&&n.push(s)}return n}requestSorting(){Ne(this,Si,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ne(this,ua,"m",jv).call(this)}terminate(){Ne(this,Bh,"f").terminate()}get box(){return Ne(this,On,"f")}get uuid(){return Ne(this,On,"f").address.uuid}get address(){return Ne(this,On,"f").address}get numOwners(){return Ne(this,On,"f").owners.pointerHub.filter(c.NoteEventCollection).length}get events(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Si,"f")}get minPitch(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Lv,"f")}get maxPitch(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Kv,"f")}get maxDuration(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Wv,"f")}toString(){return`{NoteEventCollectionBox ${A.toString(Ne(this,On,"f").address.uuid)}}`}};Bh=new WeakMap,rs=new WeakMap,On=new WeakMap,Sl=new WeakMap,Nh=new WeakMap,Si=new WeakMap,Lv=new WeakMap,Kv=new WeakMap,Wv=new WeakMap,is=new WeakMap,ua=new WeakSet,jv=function(){Po(this,is,!1,"f"),Ne(this,Sl,"f").notify(this)},Ih=function(){let e=127,t=0,n=0;Ne(this,Si,"f").asArray().forEach(({pitch:i,duration:o})=>{e=Math.min(e,i),t=Math.max(t,i),n=Math.max(n,o)}),Po(this,Lv,e,"f"),Po(this,Kv,t,"f"),Po(this,Wv,n,"f"),Po(this,is,!0,"f")};var El=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ke=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fl,Au,Bl,er,Nl,Mh,Dh,kh,_u,Pu=class{constructor(e,t){Fl.add(this),this.type="note-clip",Au.set(this,new j),Bl.set(this,void 0),er.set(this,void 0),Nl.set(this,void 0),Mh.set(this,void 0),Dh.set(this,void 0),kh.set(this,re.Empty),El(this,Bl,e,"f"),El(this,er,t,"f"),El(this,Dh,!0,"f"),El(this,Nl,Ke(this,Au,"f").own(new qi(!1)),"f"),El(this,Mh,Ke(this,Au,"f").own(new ce),"f"),Ke(this,Au,"f").ownAll(Ke(this,er,"f").pointerHub.subscribe({onAdded:()=>Ke(this,Fl,"m",_u).call(this),onRemoved:()=>Ke(this,Fl,"m",_u).call(this)}),Ke(this,er,"f").subscribe(Ue.Children,n=>Ke(this,Fl,"m",_u).call(this)),Ke(this,er,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ke(this,kh,"f").terminate(),El(this,kh,n.match({none:()=>re.Empty,some:({box:i})=>Ke(this,Bl,"f").boxAdapters.adapterFor(i,Qi).subscribeChange(()=>Ke(this,Fl,"m",_u).call(this))}),"f"),Ke(this,Fl,"m",_u).call(this)})),El(this,Dh,!1,"f")}catchupAndSubscribeSelected(e){return Ke(this,Nl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ke(this,Mh,"f").subscribe(e)}accept(e){return P(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ke(this,er,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ke(this,er,"f").events.targetVertex.unwrap();Zc.create(Ke(this,Bl,"f").boxGraph,A.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(Ke(this,er,"f").clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){Ke(this,Nl,"f").setValue(!0)}onDeselected(){Ke(this,Nl,"f").setValue(!1)}get isSelected(){return Ke(this,Nl,"f").getValue()}terminate(){Ke(this,kh,"f").terminate(),Ke(this,Au,"f").terminate()}get box(){return Ke(this,er,"f")}get uuid(){return Ke(this,er,"f").address.uuid}get address(){return Ke(this,er,"f").address}get indexField(){return Ke(this,er,"f").index}get duration(){return Ke(this,er,"f").duration.getValue()}get mute(){return Ke(this,er,"f").mute.getValue()}get hue(){return Ke(this,er,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ke(this,er,"f").events.targetVertex.map(e=>Ke(this,Bl,"f").boxAdapters.adapterFor(e.box,Qi))}get label(){return Ke(this,er,"f").label.getValue()}get trackBoxAdapter(){return Ke(this,Dh,"f")?m.None:Ke(this,er,"f").clips.targetVertex.map(e=>Ke(this,Bl,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${A.toString(Ke(this,er,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Au=new WeakMap,Bl=new WeakMap,er=new WeakMap,Nl=new WeakMap,Mh=new WeakMap,Dh=new WeakMap,kh=new WeakMap,Fl=new WeakSet,_u=function(){Ke(this,Mh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Zv={for:(r,e)=>ve(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Pu),visitValueClipBox:t=>r.adapterFor(t,Xa),visitAudioClipBox:t=>r.adapterFor(t,ts)}),"")};var Gv=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ns=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qv,Su,$h,Th,Hv=class{constructor(e,t){qv.set(this,void 0),Su.set(this,void 0),$h.set(this,void 0),Th.set(this,void 0),Gv(this,qv,e,"f"),Gv(this,Su,new j,"f"),Gv(this,$h,ns(this,Su,"f").own(new ce),"f"),Gv(this,Th,ns(this,Su,"f").own(ar.create(e.box.clips,n=>Zv.for(t,n),c.ClipCollection)),"f"),ns(this,Th,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return ns(this,qv,"f")}get collection(){return ns(this,Th,"f")}dispatchChange(){ns(this,$h,"f").notify()}subscribeChanges(e){return ns(this,$h,"f").subscribe(e)}terminate(){ns(this,Su,"f").terminate()}};qv=new WeakMap,Su=new WeakMap,$h=new WeakMap,Th=new WeakMap;var PM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Yi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Gr,Jv=class{constructor(e){Gr.set(this,void 0),PM(this,Gr,e,"f")}get inField(){return Yi(this,Gr,"f").in}get outField(){return Yi(this,Gr,"f").out}get inSlopeField(){return Yi(this,Gr,"f").inSlope}get outSlopeField(){return Yi(this,Gr,"f").outSlope}get in(){return Yi(this,Gr,"f").in.getValue()}get out(){return Yi(this,Gr,"f").out.getValue()}get inSlope(){return Yi(this,Gr,"f").inSlope.getValue()}get outSlope(){return Yi(this,Gr,"f").outSlope.getValue()}get hasFading(){return Ta.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(){Yi(this,Gr,"f").in.setValue(0),Yi(this,Gr,"f").out.setValue(0),Yi(this,Gr,"f").inSlope.setValue(.75),Yi(this,Gr,"f").outSlope.setValue(.25)}};Gr=new WeakMap;var zt=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ee=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ei,Rh,Xi,et,Eu,Fu,Bu,Ch,Vn,Oh,Il,Nu,Iu,Du,ku,Mu,en,da=class r{constructor(e,t){Ei.add(this),this.type="audio-region",Rh.set(this,void 0),Xi.set(this,void 0),et.set(this,void 0),Eu.set(this,void 0),Fu.set(this,void 0),Bu.set(this,void 0),Ch.set(this,void 0),Vn.set(this,void 0),Oh.set(this,void 0),Il.set(this,m.None),Nu.set(this,re.Empty),Iu.set(this,re.Empty),Du.set(this,re.Empty),ku.set(this,re.Empty),Mu.set(this,void 0),zt(this,Xi,e,"f"),zt(this,et,t,"f"),zt(this,Rh,new j,"f");let{timeBase:n,duration:i,loopDuration:o}=t;zt(this,Eu,Qs.aware(e.tempoMap,n,i),"f"),zt(this,Fu,Qs.aware(e.tempoMap,n,o),"f"),zt(this,Bu,new Dr,"f"),zt(this,Ch,new ce,"f"),zt(this,Vn,new Jv(t.fading),"f"),zt(this,Mu,!1,"f"),zt(this,Oh,!0,"f"),ee(this,Rh,"f").ownAll(ee(this,et,"f").pointerHub.subscribe({onAdded:()=>ee(this,Ei,"m",en).call(this),onRemoved:()=>ee(this,Ei,"m",en).call(this)}),ee(this,et,"f").file.catchupAndSubscribe(a=>{zt(this,Il,a.targetVertex.map(s=>ee(this,Xi,"f").boxAdapters.adapterFor(s.box,Rn)),"f"),ee(this,Nu,"f").terminate(),zt(this,Nu,ee(this,Il,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>ee(this,Ei,"m",en).call(this)),re.Empty),"f")}),ee(this,et,"f").playMode.catchupAndSubscribe(({targetVertex:a})=>{ee(this,Iu,"f").terminate(),a.match({none:()=>ee(this,Bu,"f").clear(),some:({box:s})=>{let l=ee(this,Xi,"f").boxAdapters.adapterFor(s,wo.isAudioPlayMode);zt(this,Iu,l.subscribe(()=>ee(this,Ei,"m",en).call(this)),"f"),ee(this,Bu,"f").wrap(l)}})}),ee(this,et,"f").timeBase.catchupAndSubscribe(a=>{ee(this,Du,"f").terminate(),Zi(a.getValue(),Kr)===Kr.Seconds&&zt(this,Du,e.tempoMap.subscribe(()=>ee(this,Ei,"m",en).call(this)),"f")}),ee(this,et,"f").subscribe(Ue.Children,a=>{if(!this.trackBoxAdapter.isEmpty()&&(a.type==="primitive"||a.type==="pointer")){let s=this.trackBoxAdapter.unwrap();ee(this,et,"f").position.address.equals(a.address)?(s.regions.onIndexingChanged(),ee(this,Ei,"m",en).call(this)):ee(this,Ei,"m",en).call(this)}}),ee(this,et,"f").events.catchupAndSubscribe(({targetVertex:a})=>{ee(this,ku,"f").terminate(),zt(this,ku,a.match({none:()=>re.Empty,some:({box:s})=>ee(this,Xi,"f").boxAdapters.adapterFor(s,Ar).subscribeChange(()=>ee(this,Ei,"m",en).call(this))}),"f"),ee(this,Ei,"m",en).call(this)})),zt(this,Oh,!1,"f")}subscribeChange(e){return ee(this,Ch,"f").subscribe(e)}accept(e){return P(e.visitAudioRegionBoxAdapter,this)}onSelected(){zt(this,Mu,!0,"f"),ee(this,Ei,"m",en).call(this)}onDeselected(){zt(this,Mu,!1,"f"),ee(this,Ei,"m",en).call(this)}get isSelected(){return ee(this,Mu,"f")}get box(){return ee(this,et,"f")}get uuid(){return ee(this,et,"f").address.uuid}get address(){return ee(this,et,"f").address}get position(){return ee(this,et,"f").position.getValue()}get duration(){return ee(this,Eu,"f").toPPQN(this.position)}get complete(){return this.position+this.duration}get loopOffset(){return ee(this,et,"f").loopOffset.getValue()}get loopDuration(){return ee(this,Fu,"f").toPPQN(this.position)}resolveDuration(e){return ee(this,Eu,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return ee(this,Fu,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return ee(this,et,"f").mute.getValue()}get hue(){return ee(this,et,"f").hue.getValue()}get gain(){return ee(this,et,"f").gain}get fading(){return ee(this,Vn,"f")}get file(){return ee(this,Il,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return ee(this,Bu,"f")}get timeBase(){return Zi(ee(this,et,"f").timeBase.getValue(),Kr)}get waveformOffset(){return ee(this,et,"f").waveformOffset}get isPlayModeNoStretch(){return ee(this,et,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>pt(e,Ao)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>pt(e,_o)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>wo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ee(this,Il,"f").isEmpty())return"No Audio File";let e=ee(this,Il,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ee(this,et,"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 ee(this,et,"f").regions.targetVertex.map(e=>ee(this,Xi,"f").boxAdapters.adapterFor(e.box,Vt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return ee(this,et,"f").events.targetVertex.map(e=>ee(this,Xi,"f").boxAdapters.adapterFor(e.box,Ar))}set position(e){ee(this,et,"f").position.setValue(e)}set duration(e){ee(this,Eu,"f").fromPPQN(e,this.position);let t=ee(this,Vn,"f").in+ee(this,Vn,"f").out;if(t>e){let n=e/t;ee(this,Vn,"f").inField.setValue(ee(this,Vn,"f").in*n),ee(this,Vn,"f").outField.setValue(ee(this,Vn,"f").out*n)}}set loopOffset(e){ee(this,et,"f").loopOffset.setValue(Gs(e,this.loopDuration))}set loopDuration(e){ee(this,Fu,"f").fromPPQN(e,this.position)}moveContentStart(e){let t=this.position,n=t+e;if(this.position=n,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e,this.timeBase===Kr.Seconds){let i=e>=0?ee(this,Xi,"f").tempoMap.intervalToSeconds(t,n):-ee(this,Xi,"f").tempoMap.intervalToSeconds(n,t);ee(this,et,"f").waveformOffset.setValue(this.waveformOffset.getValue()+i)}else this.optWarpMarkers.ifSome(i=>i.asArray().forEach(o=>o.box.position.setValue(o.position-e)))}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners,i=this.observableOptPlayMode.map(a=>a.clone()),o=ee(this,Xi,"f").boxAdapters.adapterFor(za.create(ee(this,Xi,"f").boxGraph,A.generate(),a=>{a.timeBase.setValue(ee(this,et,"f").timeBase.getValue()),a.position.setValue(e?.position??ee(this,et,"f").position.getValue()),a.regions.refer(e?.target??ee(this,et,"f").regions.targetVertex.unwrap()),a.file.refer(ee(this,et,"f").file.targetVertex.unwrap()),a.events.refer(n),a.mute.setValue(this.mute),a.hue.setValue(this.hue),a.label.setValue(this.label),a.gain.setValue(this.gain.getValue()),a.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>a.playMode.refer(s)),ee(this,Vn,"f").copyTo(a.fading)}),r);return o.loopDuration=e?.loopDuration??this.resolveLoopDuration(o.position),o.loopOffset=e?.loopOffset??this.loopOffset,o.duration=e?.duration??this.resolveDuration(o.position),o}consolidate(){}canFlatten(e){return e.length>0&&U.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){return m.None}terminate(){ee(this,Nu,"f").terminate(),zt(this,Nu,re.Empty,"f"),ee(this,Du,"f").terminate(),zt(this,Du,re.Empty,"f"),ee(this,Iu,"f").terminate(),zt(this,Iu,re.Empty,"f"),ee(this,ku,"f").terminate(),zt(this,ku,re.Empty,"f"),ee(this,Rh,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${A.toString(ee(this,et,"f").address.uuid)}}`}};Rh=new WeakMap,Xi=new WeakMap,et=new WeakMap,Eu=new WeakMap,Fu=new WeakMap,Bu=new WeakMap,Ch=new WeakMap,Vn=new WeakMap,Oh=new WeakMap,Il=new WeakMap,Nu=new WeakMap,Iu=new WeakMap,Du=new WeakMap,ku=new WeakMap,Mu=new WeakMap,Ei=new WeakSet,en=function(){ee(this,Oh,"f")||(ee(this,Ch,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var pa=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ie=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},So,Qv,Eo,xt,Uh,Vh,$u,zh,ha,os=class r{constructor(e,t){So.add(this),this.type="note-region",Qv.set(this,new j),Eo.set(this,void 0),xt.set(this,void 0),Uh.set(this,void 0),Vh.set(this,void 0),$u.set(this,void 0),zh.set(this,re.Empty),pa(this,Eo,e,"f"),pa(this,xt,t,"f"),pa(this,Uh,new ce,"f"),pa(this,$u,!1,"f"),pa(this,Vh,!0,"f"),Ie(this,Qv,"f").ownAll(Ie(this,xt,"f").pointerHub.subscribe({onAdded:()=>Ie(this,So,"m",ha).call(this),onRemoved:()=>Ie(this,So,"m",ha).call(this)}),Ie(this,xt,"f").subscribe(Ue.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ie(this,xt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ie(this,So,"m",ha).call(this)):Ie(this,So,"m",ha).call(this)}}),Ie(this,xt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ie(this,zh,"f").terminate(),pa(this,zh,n.match({none:()=>re.Empty,some:({box:i})=>Ie(this,Eo,"f").boxAdapters.adapterFor(i,Qi).subscribeChange(()=>Ie(this,So,"m",ha).call(this))}),"f"),Ie(this,So,"m",ha).call(this)})),pa(this,Vh,!1,"f")}set position(e){Ie(this,xt,"f").position.setValue(e)}set duration(e){Ie(this,xt,"f").duration.setValue(e)}set loopOffset(e){Ie(this,xt,"f").loopOffset.setValue(e)}set loopDuration(e){Ie(this,xt,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(t=>t.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 Ie(this,Uh,"f").subscribe(e)}accept(e){return P(e.visitNoteRegionBoxAdapter,this)}onSelected(){pa(this,$u,!0,"f"),Ie(this,So,"m",ha).call(this)}onDeselected(){pa(this,$u,!1,"f"),Ie(this,So,"m",ha).call(this)}get isSelected(){return Ie(this,$u,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let n=t.unwrap(),i=kr.globalToLocal(this,e);for(let o of n.events.iterateFrom(i-n.maxDuration)){if(i<o.position)return;i<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){Ie(this,zh,"f").terminate(),Ie(this,Qv,"f").terminate()}get box(){return Ie(this,xt,"f")}get uuid(){return Ie(this,xt,"f").address.uuid}get address(){return Ie(this,xt,"f").address}get position(){return Ie(this,xt,"f").position.getValue()}get duration(){return Ie(this,xt,"f").duration.getValue()}get loopOffset(){return Ie(this,xt,"f").loopOffset.getValue()}get loopDuration(){return Ie(this,xt,"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 Ie(this,xt,"f").mute.getValue()}get hue(){return Ie(this,xt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Ie(this,xt,"f").events.targetVertex.map(e=>Ie(this,Eo,"f").boxAdapters.adapterFor(e.box,Qi))}get label(){return Ie(this,xt,"f").label.getValue()}get trackBoxAdapter(){return Ie(this,Vh,"f")?m.None:Ie(this,xt,"f").regions.targetVertex.map(e=>Ie(this,Eo,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return Ie(this,Eo,"f").boxAdapters.adapterFor(ll.create(Ie(this,Eo,"f").boxGraph,A.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??Ie(this,xt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=Ie(this,Eo,"f").boxGraph,n=na.create(t,A.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Ie(this,xt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&U.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=Ie(this,Eo,"f").boxGraph,n=e.toSorted($a.Comparator),i=U.getFirst(n,"Internal error (no first)"),o=U.getLast(n,"Internal error (no last)"),a=i.position,s=o.position+o.duration,l=i.trackBoxAdapter.unwrap(),u=na.create(t,A.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let h=d;for(let{resultStart:g,resultEnd:v,rawStart:y}of kr.locateLoops(h,h.position,h.complete)){let x=Math.floor(g-y),F=Math.floor(v-y);for(let I of h.optCollection.unwrap().events.iterateRange(x,F))I.copyTo({position:I.position+y-i.position,events:u.events})}}),p.forEach(({box:d})=>d.delete()),m.wrap(ll.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(u.owners),d.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${A.toString(Ie(this,xt,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Qv=new WeakMap,Eo=new WeakMap,xt=new WeakMap,Uh=new WeakMap,Vh=new WeakMap,$u=new WeakMap,zh=new WeakMap,So=new WeakSet,ha=function(){Ie(this,Uh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var fa=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Se=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zn,Tu,Fo,bt,Kh,Ru,jh,Lh,Bo,ma=class r{constructor(e,t){zn.add(this),this.type="value-region",Tu.set(this,new j),Fo.set(this,void 0),bt.set(this,void 0),Kh.set(this,void 0),Ru.set(this,void 0),jh.set(this,void 0),Lh.set(this,re.Empty),fa(this,Fo,e,"f"),fa(this,bt,t,"f"),fa(this,jh,!0,"f"),fa(this,Kh,new ce,"f"),fa(this,Ru,!1,"f"),Se(this,Tu,"f").own(Se(this,bt,"f").pointerHub.subscribe({onAdded:()=>Se(this,zn,"m",Bo).call(this),onRemoved:()=>Se(this,zn,"m",Bo).call(this)})),Se(this,Tu,"f").own(Se(this,bt,"f").subscribe(Ue.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Se(this,bt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Se(this,zn,"m",Bo).call(this)):Se(this,zn,"m",Bo).call(this)}})),Se(this,Tu,"f").own(Se(this,bt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Se(this,Lh,"f").terminate(),fa(this,Lh,n.match({none:()=>re.Empty,some:({box:i})=>Se(this,Fo,"f").boxAdapters.adapterFor(i,Ar).subscribeChange(()=>Se(this,zn,"m",Bo).call(this))}),"f"),Se(this,zn,"m",Bo).call(this)})),fa(this,jh,!1,"f")}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(kr.globalToLocal(this,e),t)}incomingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let n=t.unwrap().events.greaterEqual(0);return q(n)&&n.position===0?n.value:this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let n=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(kr.globalToLocal(this,this.complete),e)}subscribeChange(e){return Se(this,Kh,"f").subscribe(e)}accept(e){return P(e.visitValueRegionBoxAdapter,this)}onSelected(){fa(this,Ru,!0,"f"),Se(this,zn,"m",Bo).call(this)}onDeselected(){fa(this,Ru,!1,"f"),Se(this,zn,"m",Bo).call(this)}get isSelected(){return Se(this,Ru,"f")}onValuesPropertyChanged(){Se(this,zn,"m",Bo).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Se(this,Lh,"f").terminate(),Se(this,Tu,"f").terminate()}get box(){return Se(this,bt,"f")}get uuid(){return Se(this,bt,"f").address.uuid}get address(){return Se(this,bt,"f").address}get position(){return Se(this,bt,"f").position.getValue()}get duration(){return Se(this,bt,"f").duration.getValue()}get loopOffset(){return Se(this,bt,"f").loopOffset.getValue()}get loopDuration(){return Se(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 Se(this,bt,"f").mute.getValue()}get hue(){return Se(this,bt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Se(this,bt,"f").events.targetVertex.map(e=>Se(this,Fo,"f").boxAdapters.adapterFor(e.box,Ar))}get label(){return Se(this,bt,"f").label.getValue()}get trackBoxAdapter(){return Se(this,jh,"f")?m.None:Se(this,bt,"f").regions.targetVertex.map(e=>Se(this,Fo,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Se(this,bt,"f").position.setValue(e)}set duration(e){Se(this,bt,"f").duration.setValue(e)}set loopOffset(e){Se(this,bt,"f").loopOffset.setValue(e)}set loopDuration(e){Se(this,bt,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(t=>t.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 t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return Se(this,Fo,"f").boxAdapters.adapterFor(cl.create(Se(this,Fo,"f").boxGraph,A.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??Se(this,bt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=Se(this,Fo,"f").boxGraph,n=Dn.create(t,A.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Se(this,bt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&U.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=Se(this,Fo,"f").boxGraph,n=e.toSorted($a.Comparator),i=U.getFirst(n,"Internal error (no first)"),o=U.getLast(n,"Internal error (no last)"),a=i.position,s=o.position+o.duration,l=i.trackBoxAdapter.unwrap(),u=Array.from(l.regions.collection.iterateRange(a,s)),p=[];u.filter(v=>v.isSelected).forEach(v=>{let y=v,x=y.optCollection.unwrap(),F=x.events;for(let{rawStart:I,regionStart:O,regionEnd:z}of kr.locateLoops(y,y.position,y.complete)){let $=O-I,J=z-I,te=F.greaterEqual($);if(!q(te)||te.position!==$){let K=F.lowerEqual($);q(K)&&p.push({position:O-a,value:x.valueAt($,0),interpolation:K.interpolation})}let ae=!1;for(let K of F.iterateRange($,vr.MAX_VALUE)){let ge=K.position+I;if(ge<z)p.push({position:ge-a,value:K.value,interpolation:K.interpolation});else if(ge===z){p.push({position:ge-a,value:K.value,interpolation:ai.None}),ae=!0;break}else{p.push({position:z-a,value:x.valueAt(J,0),interpolation:ai.None}),ae=!0;break}}ae||p.push({position:z-a,value:x.valueAt(J,0),interpolation:ai.None})}});let d=[];for(let v of p){let y=d.length>0?d[d.length-1]:void 0;q(y)&&y.position===v.position&&y.value===v.value?d[d.length-1]=v:d.push(v)}let h=Dn.create(t,A.generate()),g=0;for(;g<d.length;){let v=g+1;for(;v<d.length&&d[v].position===d[g].position;)v++;let y=d[g],x=d[v-1],F=In.create(t,A.generate(),I=>{I.position.setValue(y.position),I.index.setValue(0),I.value.setValue(y.value),I.events.refer(h.events)});if(si.write(F.interpolation,v-g>1?ai.None:y.interpolation),v-g>1){let I=In.create(t,A.generate(),O=>{O.position.setValue(x.position),O.index.setValue(1),O.value.setValue(x.value),O.events.refer(h.events)});si.write(I.interpolation,x.interpolation)}g=v}return u.forEach(({box:v})=>v.delete()),m.wrap(cl.create(t,A.generate(),v=>{v.position.setValue(a),v.duration.setValue(s-a),v.loopDuration.setValue(s-a),v.loopOffset.setValue(0),v.hue.setValue(this.hue),v.mute.setValue(this.mute),v.label.setValue(this.label),v.events.refer(h.owners),v.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${A.toString(Se(this,bt,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Tu=new WeakMap,Fo=new WeakMap,bt=new WeakMap,Kh=new WeakMap,Ru=new WeakMap,jh=new WeakMap,Lh=new WeakMap,zn=new WeakSet,Bo=function(){Se(this,Kh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var gB=(r,e)=>r.position-e.position,vB={for:(r,e)=>ve(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,os),visitAudioRegionBox:t=>r.adapterFor(t,da),visitValueRegionBox:t=>r.adapterFor(t,ma)}),"")};var Cu=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Wh,Dl,Zh,Ou,kl,Vu,Yv=class{constructor(e,t){Wh.set(this,void 0),Dl.set(this,void 0),Zh.set(this,void 0),Ou.set(this,void 0),kl.set(this,void 0),Vu.set(this,void 0),Cu(this,Wh,e,"f"),Cu(this,Dl,new j,"f"),Cu(this,Zh,fr(this,Dl,"f").own(new ce),"f"),Cu(this,Ou,fr(this,Dl,"f").own(new or),"f"),Cu(this,kl,$a.create(gB),"f"),Cu(this,Vu,A.newSet(n=>n.uuid),"f"),fr(this,Dl,"f").ownAll(fr(this,Wh,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=vB.for(t,n),o=fr(this,Vu,"f").add(i);V(o,`Cannot add ${n}`),fr(this,kl,"f").add(i),fr(this,Ou,"f").forEach(a=>a.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=fr(this,Vu,"f").removeByKey(n);fr(this,kl,"f").remove(i),fr(this,Ou,"f").forEach(o=>o.onRemoved(i)),this.dispatchChange()}},c.RegionCollection))}get trackBoxAdapter(){return fr(this,Wh,"f")}get collection(){return fr(this,kl,"f")}get adapters(){return fr(this,Vu,"f")}onIndexingChanged(){fr(this,kl,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),fr(this,Ou,"f").subscribe(e)}subscribeChanges(e){return fr(this,Zh,"f").subscribe(e)}dispatchChange(){fr(this,Zh,"f").notify()}terminate(){fr(this,Dl,"f").terminate()}};Wh=new WeakMap,Dl=new WeakMap,Zh=new WeakMap,Ou=new WeakMap,kl=new WeakMap,Vu=new WeakMap;var fe;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(fe||(fe={}));(function(r){r.toLabelString=e=>{switch(e){case r.Audio:return"Audio";case r.Notes:return"Note";case r.Value:return"Automation";case r.Undefined:default:return"N/A"}},r.toIconSymbol=e=>{switch(e){case r.Audio:return He.Waveform;case r.Notes:return He.Piano;case r.Value:return He.Automation;case r.Undefined:return He.AudioBus;default:return He.Unknown}}})(fe||(fe={}));var Xv;(function(r){r.isDeviceBox=e=>e.tags.type==="device",r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.tags.deviceType==="instrument",r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&(e.tags.deviceType==="audio-effect"||e.tags.deviceType==="midi-effect"),r.lookupHostField=e=>q(e)&&"host"in e&&pt(e.host,N)?e.host:D(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>q(e)&&"label"in e&&pt(e.label,C)?e.label:D(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>q(e)&&"enabled"in e&&pt(e.enabled,M)?e.enabled:D(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>q(e)&&"minimized"in e&&pt(e.minimized,M)?e.minimized:D(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>q(e)&&"index"in e&&pt(e.index,E)?e.index:D(`Could not find 'index' field in '${e?.name}'`)})(Xv||(Xv={}));var yB;(function(r){r.toTrackType=e=>{switch(e){case"midi":return fe.Notes;case"audio":return fe.Audio;default:return D()}}})(yB||(yB={}));var de;(function(r){r.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),r.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),r.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",r.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",r.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",r.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",r.deleteEffectDevices=e=>{if(e.length===0)return;V(U.satisfy(e,(i,o)=>i.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(c.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(c.MIDIEffectHost):D("unknown type")).map(({box:i})=>Xv.lookupIndexField(i)).filter(i=>e.some(o=>A.Comparator(o.uuid,i.address.uuid)!==0)).sort((i,o)=>i.getValue()-o.getValue()).forEach((i,o)=>i.setValue(o)),e.forEach(i=>i.box.delete())}})(de||(de={}));var ey=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Pr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Gh,ty,Un,Ml,ry,iy=class{constructor(e,t){Gh.set(this,void 0),ty.set(this,new ce),Un.set(this,void 0),Ml.set(this,void 0),ry.set(this,void 0),ey(this,Gh,e,"f"),ey(this,Un,ar.create(e.box.tracks,n=>t.adapterFor(n,Vt),c.TrackCollection),"f"),ey(this,Ml,A.newSet(({uuid:n})=>n),"f"),ey(this,ry,Pr(this,Un,"f").catchupAndSubscribe({onAdd:n=>Pr(this,Ml,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Pr(this,ty,"f").notify())}),onRemove:({uuid:n})=>Pr(this,Ml,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,t,n){let i=Pr(this,Gh,"f").box.graph,o=Pr(this,Gh,"f").box.tracks;Wr.create(i,A.generate(),a=>{a.index.setValue(n??Pr(this,Un,"f").getMinFreeIndex()),a.type.setValue(e),a.tracks.refer(o),a.target.refer(t)})}controls(e){return m.wrap(Pr(this,Un,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=Pr(this,Un,"f").adapters(),n=t.indexOf(e);if(n===-1)return D(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<t.length;i++)t[i].indexField.setValue(i-1);e.box.delete()}get collection(){return Pr(this,Un,"f")}values(){return Pr(this,Un,"f").adapters()}catchupAndSubscribe(e){return Pr(this,Un,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Pr(this,ty,"f").subscribe(e)}terminate(){Pr(this,Un,"f").terminate(),Pr(this,ry,"f").terminate(),Pr(this,Ml,"f").forEach(({subscription:e})=>e.terminate()),Pr(this,Ml,"f").clear()}};Gh=new WeakMap,ty=new WeakMap,Un=new WeakMap,Ml=new WeakMap,ry=new WeakMap;var pe;(function(r){r.AudioBus="manuals/audio-bus",r.Arpeggio="manuals/devices/midi/arpeggio",r.Pitch="manuals/devices/midi/pitch",r.Velocity="manuals/devices/midi/velocity",r.Zeitgeist="manuals/devices/midi/zeitgeist",r.StereoTool="manuals/devices/audio/stereo-tool",r.Delay="manuals/devices/audio/delay",r.DattorroReverb="manuals/devices/audio/dattorro-reverb",r.Maximizer="manuals/devices/audio/maximizer",r.Compressor="manuals/devices/audio/compressor",r.Gate="manuals/devices/audio/gate",r.Reverb="manuals/devices/audio/cheap-reverb",r.Crusher="manuals/devices/audio/crusher",r.Fold="manuals/devices/audio/fold",r.Tidal="manuals/devices/audio/tidal",r.Revamp="manuals/devices/audio/revamp",r.Modular="manuals/devices/audio/modular",r.NeuralAmp="manuals/devices/audio/neural-amp",r.Tape="manuals/devices/instruments/tape",r.Nano="manuals/devices/instruments/nano",r.Playfield="manuals/devices/instruments/playfield",r.Vaporisateur="manuals/devices/instruments/vaporisateur",r.MIDIOutput="manuals/devices/instruments/midi-output",r.Soundfont="manuals/devices/instruments/soundfont"})(pe||(pe={}));var xB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ny,Fi,qr=class{constructor(e,t){this.type="bus",this.accepts="audio",this.manualUrl=pe.AudioBus,ny.set(this,void 0),Fi.set(this,void 0),xB(this,ny,e,"f"),xB(this,Fi,t,"f")}catchupAndSubscribe(e){return e(this),jn(this,Fi,"f").subscribe(Ue.Children,()=>e(this))}get uuid(){return jn(this,Fi,"f").address.uuid}get address(){return jn(this,Fi,"f").address}get box(){return jn(this,Fi,"f")}get enabledField(){return jn(this,Fi,"f").enabled}get minimizedField(){return jn(this,Fi,"f").minimized}get iconField(){return jn(this,Fi,"f").icon}get labelField(){return jn(this,Fi,"f").label}get colorField(){return jn(this,Fi,"f").color}get iconSymbol(){return He.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return jn(this,ny,"f").boxAdapters.adapterFor(jn(this,Fi,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};ny=new WeakMap,Fi=new WeakMap;var qh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Dt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ga,zu,Uu,Bi,Hh,oy=class{constructor(e,t){ga.set(this,void 0),zu.set(this,void 0),Uu.set(this,void 0),Bi.set(this,void 0),Hh.set(this,re.Empty),qh(this,ga,new j,"f"),qh(this,zu,Dt(this,ga,"f").own(new ce),"f"),qh(this,Uu,Dt(this,ga,"f").own(new qi(He.Unknown)),"f"),qh(this,Bi,Dt(this,ga,"f").own(new Dr),"f"),Dt(this,ga,"f").own(Dt(this,Bi,"f").subscribe(n=>{Dt(this,Hh,"f").terminate(),qh(this,Hh,n.match({none:()=>(Dt(this,zu,"f").notify(m.None),re.Empty),some:({labelField:i,iconField:o})=>re.many(o.catchupAndSubscribe(a=>Dt(this,Uu,"f").setValue(He.fromName(a.getValue()))),i.catchupAndSubscribe(a=>Dt(this,zu,"f").notify(m.wrap(a.getValue()))))}),"f")})),Dt(this,ga,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(Dt(this,Bi,"f").nonEmpty()){let a=Dt(this,Bi,"f").unwrap();D(`AudioUnitInput already has an input. Existing: ${a.box.name}@${a.box.address.toString()} (type: ${a.type}), Incoming: ${n.name}@${n.address.toString()} (pointerType: ${String(i)})`)}let o=n instanceof kn?t.adapterFor(n,qr):t.adapterFor(n,de.isInstrument);Dt(this,Bi,"f").unwrapOrNull()!==o&&Dt(this,Bi,"f").wrap(o)},onRemoved:({box:n})=>{V(Dt(this,Bi,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),Dt(this,Bi,"f").clear()}},c.InstrumentHost,c.AudioOutput))}adapter(){return Dt(this,Bi,"f")}subscribe(e){return Dt(this,Bi,"f").subscribe(e)}catchupAndSubscribe(e){return e(Dt(this,Bi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),Dt(this,zu,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return Dt(this,Uu,"f").catchupAndSubscribe(e)}set label(e){this.adapter().ifSome(t=>t.labelField.setValue(e))}get label(){return this.adapter().map(e=>e.labelField.getValue())}set icon(e){this.adapter().ifSome(t=>t.iconField.setValue(He.toName(e)))}get icon(){return this.adapter().match({none:()=>He.Unknown,some:e=>He.fromName(e.iconField.getValue())})}get iconValue(){return Dt(this,Uu,"f")}terminate(){Dt(this,ga,"f").terminate(),Dt(this,Hh,"f").terminate()}};ga=new WeakMap,zu=new WeakMap,Uu=new WeakMap,Bi=new WeakMap,Hh=new WeakMap;var bB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$l=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ay,va,be=class{constructor(e){ay.set(this,void 0),va.set(this,void 0),bB(this,ay,e,"f"),bB(this,va,ke.newSet(t=>t.address),"f")}terminate(){$l(this,va,"f").forEach(e=>e.terminate()),$l(this,va,"f").clear()}parameters(){return $l(this,va,"f").values()}parameterAt(e){return $l(this,va,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,n,i,o){let a=new Tl($l(this,ay,"f"),e,t,n,i,o),s=$l(this,va,"f").add(a);return V(s,`Could not add adapter for ${e}`),a}removeParameter(e){return $l(this,va,"f").removeByKey(e)}};ay=new WeakMap,va=new WeakMap;var Rl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},St=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Cl,tn,as,ju,sy,ly,Jh,Lu=class{constructor(e,t){Cl.set(this,void 0),tn.set(this,void 0),as.set(this,void 0),ju.set(this,void 0),sy.set(this,void 0),ly.set(this,void 0),Jh.set(this,re.Empty),Rl(this,Cl,e,"f"),Rl(this,tn,t,"f"),Rl(this,as,new j,"f"),Rl(this,ju,St(this,as,"f").own(new ce),"f"),St(this,as,"f").own(t.targetBus.catchupAndSubscribe(()=>{St(this,Jh,"f").terminate(),Rl(this,Jh,this.optTargetBus.match({none:()=>(St(this,ju,"f").notify(m.None),re.Empty),some:n=>n.catchupAndSubscribe(i=>St(this,ju,"f").notify(m.wrap(i)))}),"f")})),Rl(this,sy,St(this,as,"f").own(new Tl(St(this,Cl,"f"),St(this,tn,"f").sendPan,w.bipolar(),_.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Rl(this,ly,St(this,as,"f").own(new Tl(St(this,Cl,"f"),St(this,tn,"f").sendGain,w.DefaultDecibel,_.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),St(this,ju,"f").subscribe(e)}get uuid(){return St(this,tn,"f").address.uuid}get address(){return St(this,tn,"f").address}get box(){return St(this,tn,"f")}get indexField(){return St(this,tn,"f").index}get sendPan(){return St(this,sy,"f")}get sendGain(){return St(this,ly,"f")}get targetBus(){return St(this,Cl,"f").boxAdapters.adapterFor(St(this,tn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,qr)}get optTargetBus(){return St(this,tn,"f").targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>St(this,Cl,"f").boxAdapters.adapterFor(t,qr)})))}delete(){St(this,tn,"f").delete()}terminate(){St(this,as,"f").terminate(),St(this,Jh,"f").terminate()}};Cl=new WeakMap,tn=new WeakMap,as=new WeakMap,ju=new WeakMap,sy=new WeakMap,ly=new WeakMap,Jh=new WeakMap;var Qh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},No=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},cy,uy,Ku,Wu,Yh,dy=class{constructor(e,t){cy.set(this,void 0),uy.set(this,void 0),Ku.set(this,void 0),Wu.set(this,void 0),Yh.set(this,re.Empty),Qh(this,cy,e,"f"),Qh(this,uy,t,"f"),Qh(this,Ku,new j,"f"),Qh(this,Wu,No(this,Ku,"f").own(new ce),"f"),No(this,Ku,"f").own(e.catchupAndSubscribe(()=>{No(this,Yh,"f").terminate(),Qh(this,Yh,this.adapter.match({none:()=>(No(this,Wu,"f").notify(m.None),re.Empty),some:n=>n.catchupAndSubscribe(i=>No(this,Wu,"f").notify(m.wrap(i)))}),"f")}))}subscribe(e){return No(this,Wu,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return No(this,cy,"f").targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>No(this,uy,"f").adapterFor(t,qr)})))}terminate(){No(this,Ku,"f").terminate(),No(this,Yh,"f").terminate()}};cy=new WeakMap,uy=new WeakMap,Ku=new WeakMap,Wu=new WeakMap,Yh=new WeakMap;var ya=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},me=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},py,wB,Io,Ni,Ut,Vl,Zu,Ol,hy,Xh,fy,my,AB,_B,rn=class{constructor(e,t){py.add(this),this.class="device-host",Io.set(this,new j),Ni.set(this,void 0),Ut.set(this,void 0),Vl.set(this,void 0),Zu.set(this,void 0),Ol.set(this,void 0),hy.set(this,void 0),Xh.set(this,void 0),fy.set(this,void 0),my.set(this,void 0),ya(this,Ni,e,"f"),ya(this,Ut,t,"f"),ya(this,Vl,me(this,Io,"f").own(new be(me(this,Ni,"f"))),"f"),ya(this,Zu,me(this,Io,"f").own(new iy(this,me(this,Ni,"f").boxAdapters)),"f"),ya(this,Ol,me(this,Io,"f").own(new oy(me(this,Ut,"f").input.pointerHub,me(this,Ni,"f").boxAdapters)),"f"),ya(this,hy,me(this,Io,"f").own(ar.create(me(this,Ut,"f").midiEffects,n=>me(this,Ni,"f").boxAdapters.adapterFor(n,de.isMidiEffect),c.MIDIEffectHost)),"f"),ya(this,Xh,me(this,Io,"f").own(ar.create(me(this,Ut,"f").audioEffects,n=>me(this,Ni,"f").boxAdapters.adapterFor(n,de.isAudioEffect),c.AudioEffectHost)),"f"),ya(this,fy,me(this,Io,"f").own(ar.create(me(this,Ut,"f").auxSends,n=>me(this,Ni,"f").boxAdapters.adapterFor(n,Lu),c.AuxSend)),"f"),ya(this,my,me(this,Io,"f").own(new dy(me(this,Ut,"f").output,me(this,Ni,"f").boxAdapters)),"f"),this.namedParameter=me(this,py,"m",AB).call(this,t),me(this,py,"m",_B).call(this)}get box(){return me(this,Ut,"f")}get uuid(){return me(this,Ut,"f").address.uuid}get address(){return me(this,Ut,"f").address}get indexField(){return me(this,Ut,"f").index}get type(){return me(this,Ut,"f").type.getValue()}get captureBox(){return me(this,Ut,"f").capture.targetVertex}get tracks(){return me(this,Zu,"f")}get input(){return me(this,Ol,"f")}get midiEffects(){return me(this,hy,"f")}get audioEffects(){return me(this,Xh,"f")}get inputAdapter(){return me(this,Ol,"f").adapter()}get auxSends(){return me(this,fy,"f")}get output(){return me(this,my,"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 me(this,Ut,"f").output.targetVertex.mapOr(e=>e.box.address.equals(me(this,Ni,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return me(this,Ut,"f").midiEffects}get inputField(){return me(this,Ut,"f").input}get audioEffectsField(){return me(this,Ut,"f").audioEffects}get tracksField(){return me(this,Ut,"f").tracks}get minimizedField(){return me(this,Ol,"f").adapter().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return me(this,Ol,"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 t of me(this,Xh,"f").adapters())yield*t.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>m.None}}indicesLimit(){let e=me(this,Ni,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),n=this.type,i=t,o=t;for(;i>0&&e[i-1].type===n;)i--;for(;o<e.length-1&&e[o+1].type===n;)o++;return[i,o+1]}move(e){me(this,Ni,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){me(this,Zu,"f").collection.move(e,t)}deleteTrack(e){me(this,Zu,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){me(this,Io,"f").terminate()}};wB=rn,Io=new WeakMap,Ni=new WeakMap,Ut=new WeakMap,Vl=new WeakMap,Zu=new WeakMap,Ol=new WeakMap,hy=new WeakMap,Xh=new WeakMap,fy=new WeakMap,my=new WeakMap,py=new WeakSet,AB=function(e){return{volume:me(this,Vl,"f").createParameter(e.volume,wB.VolumeMapper,_.decible,"volume"),panning:me(this,Vl,"f").createParameter(e.panning,w.bipolar(),_.panning,"panning",.5),mute:me(this,Vl,"f").createParameter(e.mute,w.bool,_.bool,"mute"),solo:me(this,Vl,"f").createParameter(e.solo,w.bool,_.bool,"solo")}},_B=function(){let e=this.address.toString(),t=me(this,Ut,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${me(this,Ut,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;V(this.type!==Qt.Instrument||me(this,Ut,"f").capture.targetAddress.nonEmpty(),n)};rn.VolumeMapper=w.decibel(-96,-9,6);var Gu=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gy,nn,Hr,zl,vy,yy,ef,PB,SB,Vt=class{constructor(e,t){gy.add(this),nn.set(this,void 0),Hr.set(this,void 0),zl.set(this,void 0),vy.set(this,void 0),yy.set(this,void 0),ef.set(this,void 0),Gu(this,nn,e,"f"),Gu(this,Hr,t,"f"),Gu(this,zl,new j,"f"),Gu(this,vy,rt(this,zl,"f").own(new Hv(this,e.boxAdapters)),"f"),Gu(this,yy,rt(this,zl,"f").own(new Yv(this,e.boxAdapters)),"f"),Gu(this,ef,rt(this,zl,"f").own(new qi(-1)),"f")}catchupAndSubscribePath(e){let t=[m.None,m.None],n=()=>{t.every(i=>i.nonEmpty())?e(m.wrap(t.map(i=>i.unwrap()))):e(m.None)};return re.many(rt(this,gy,"m",PB).call(this,i=>{t[0].equals(i)||(t[0]=i,n())}),rt(this,gy,"m",SB).call(this,i=>{t[1].equals(i)||(t[1]=i,n())}))}get context(){return rt(this,nn,"f")}set targetName(e){rt(this,Hr,"f").target.targetVertex.ifSome(t=>{let n=t.box;if(n instanceof Pt){rt(this,nn,"f").boxAdapters.adapterFor(n,rn).input.adapter().ifSome(o=>o.labelField.setValue(e));return}rt(this,nn,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof C&&i.labelField.setValue(e)})})}get targetName(){return rt(this,Hr,"f").target.targetVertex.flatMap(e=>{let t=e.box;if(t instanceof Pt)return rt(this,nn,"f").boxAdapters.adapterFor(t,rn).input.label;let n=rt(this,nn,"f").boxAdapters.optAdapter(t);if(n.nonEmpty()){let i=n.unwrap();if("labelField"in i&&i.labelField instanceof C)return m.wrap(i.labelField.getValue())}return m.wrap(t.name)})}terminate(){rt(this,zl,"f").terminate()}get audioUnit(){return ze(rt(this,Hr,"f").tracks.targetVertex.unwrap().box,Pt)}get target(){return rt(this,Hr,"f").target}get clips(){return rt(this,vy,"f")}get regions(){return rt(this,yy,"f")}get enabled(){return rt(this,Hr,"f").enabled}get indexField(){return rt(this,Hr,"f").index}get type(){return rt(this,Hr,"f").type.getValue()}get box(){return rt(this,Hr,"f")}get uuid(){return rt(this,Hr,"f").address.uuid}get address(){return rt(this,Hr,"f").address}get listIndex(){return rt(this,ef,"f").getValue()}set listIndex(e){rt(this,ef,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===fe.Audio;case"note-clip":return this.type===fe.Notes;case"value-clip":return this.type===fe.Value;case"audio-region":return this.type===fe.Audio;case"note-region":return this.type===fe.Notes;case"value-region":return this.type===fe.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let n=t,i=rt(this,nn,"f").clipSequencing.iterate(this.uuid,e,e+Ng);for(let{optClip:o,sectionFrom:a}of i)n=o.match({none:()=>{let s=this.regions.collection.lowerEqual(e,l=>!l.mute);if(s===null){let l=this.regions.collection.optAt(0);return pt(l,ma)?l.incomingValue(t):t}else if(pt(s,ma))return e<s.complete?s.valueAt(e,t):s.outgoingValue(t);return t},some:s=>a===e&&pt(s,Xa)?s.valueAt(e,t):t});return n}};nn=new WeakMap,Hr=new WeakMap,zl=new WeakMap,vy=new WeakMap,yy=new WeakMap,ef=new WeakMap,gy=new WeakSet,PB=function(e){let t=rt(this,Hr,"f").target.targetVertex;if(t.nonEmpty()){let n=t.unwrap().box;if(n instanceof Pt)return rt(this,nn,"f").boxAdapters.adapterFor(n,rn).input.catchupAndSubscribeLabelChange(a=>e(a));let i=rt(this,nn,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof C)return o.labelField.catchupAndSubscribe(a=>e(m.wrap(a.getValue())))}return e(m.wrap(n.name)),re.Empty}return e(m.None),re.Empty},SB=function(e){let t=this.type;switch(t){case fe.Audio:case fe.Notes:return e(m.wrap(fe[t])),re.Empty;case fe.Value:{let n=rt(this,Hr,"f").target.targetVertex.unwrap();if(n.isField())e(rt(this,nn,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(m.wrap(n.name));else return D("Illegal State. Vertex is not a field nor box.");return re.Empty}case fe.Undefined:return e(m.wrap("")),re.Empty;default:return e(m.None),re.Empty}};var Sr=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_e=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},xa,Ii,ss,Ul,xy,by,jl,Ll,ls,cs,Kl,qu,tf,EB=[c.Automation,c.Modulation,c.MIDIControl,c.ParameterController],Tl=class{constructor(e,t,n,i,o,a){xa.set(this,void 0),Ii.set(this,void 0),ss.set(this,void 0),Ul.set(this,void 0),xy.set(this,void 0),by.set(this,void 0),jl.set(this,new j),Ll.set(this,void 0),ls.set(this,void 0),cs.set(this,m.None),Kl.set(this,m.None),qu.set(this,null),tf.set(this,!1),Sr(this,xa,e,"f"),Sr(this,Ii,t,"f"),Sr(this,ss,n,"f"),Sr(this,Ul,i,"f"),Sr(this,xy,o,"f"),Sr(this,by,a??0,"f"),_e(this,jl,"f").own(_e(this,xa,"f").parameterFieldAdapters.register(this)),Sr(this,Ll,_e(this,jl,"f").own(new ce),"f"),Sr(this,ls,new or,"f"),_e(this,jl,"f").own(_e(this,Ii,"f").subscribe(()=>_e(this,Ll,"f").notify(this))),_e(this,jl,"f").own(_e(this,Ii,"f").pointerHub.catchupAndSubscribe({onAdded:s=>{_e(this,ls,"f").proxy.onControlSourceAdd(fA(s.pointerType)),s.box.accept({visitTrackBox:l=>{V(_e(this,cs,"f").isEmpty(),"Already assigned");let u=_e(this,xa,"f").boxAdapters.adapterFor(l,Vt);Sr(this,cs,m.wrap(u),"f"),_e(this,xa,"f").isMainThread&&Sr(this,Kl,m.wrap(_e(this,xa,"f").liveStreamReceiver.subscribeFloat(_e(this,Ii,"f").address,p=>{_e(this,qu,"f")!==p&&(Sr(this,qu,p,"f"),_e(this,Ll,"f").notify(this))})),"f")}})},onRemoved:s=>{_e(this,ls,"f").proxy.onControlSourceRemove(fA(s.pointerType)),s.box.accept({visitTrackBox:l=>{V(_e(this,cs,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),Sr(this,cs,m.None,"f"),_e(this,xa,"f").isMainThread&&(_e(this,Kl,"f").ifSome(u=>u.terminate()),Sr(this,Kl,m.None,"f"),Sr(this,qu,null,"f"),_e(this,Ll,"f").notify(this))}})}},...EB)),t.getValue(),n.clamp(t.getValue())}registerMidiControl(){return _e(this,ls,"f").proxy.onControlSourceAdd("midi"),Sr(this,tf,!0,"f"),{terminate:()=>{Sr(this,tf,!1,"f"),_e(this,ls,"f").proxy.onControlSourceRemove("midi")}}}get field(){return _e(this,Ii,"f")}get valueMapping(){return _e(this,ss,"f")}get stringMapping(){return _e(this,Ul,"f")}get name(){return _e(this,xy,"f")}get anchor(){return _e(this,by,"f")}get type(){return _e(this,Ii,"f").type}get address(){return _e(this,Ii,"f").address}get track(){return _e(this,cs,"f")}valueAt(e){let t=_e(this,cs,"f");if(t.nonEmpty()){let n=t.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return _e(this,Ll,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return _e(this,tf,"f")&&e.onControlSourceAdd("midi"),_e(this,Ii,"f").pointerHub.filter(...EB).forEach(t=>e.onControlSourceAdd(fA(t.pointerType))),_e(this,ls,"f").subscribe(e)}getValue(){return _e(this,Ii,"f").getValue()}setValue(e){let t=this.getUnitValue();_e(this,Ii,"f").setValue(e),_e(this,xa,"f").parameterFieldAdapters.notifyWrite(this,t)}setUnitValue(e){this.setValue(_e(this,ss,"f").y(e))}getUnitValue(){return _e(this,ss,"f").x(this.getValue())}getControlledValue(){return _e(this,ss,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return _e(this,qu,"f")??this.getUnitValue()}getControlledPrintValue(){return _e(this,Ul,"f").x(this.getControlledValue())}getPrintValue(){return _e(this,Ul,"f").x(this.getValue())}setPrintValue(e){let t=_e(this,Ul,"f").y(e);t.type==="unitValue"?this.setUnitValue(we(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(_e(this,ss,"f").clamp(_e(this,Ii,"f").initValue))}terminate(){_e(this,Kl,"f").ifSome(e=>e.terminate()),Sr(this,Kl,m.None,"f"),_e(this,jl,"f").terminate()}};xa=new WeakMap,Ii=new WeakMap,ss=new WeakMap,Ul=new WeakMap,xy=new WeakMap,by=new WeakMap,jl=new WeakMap,Ll=new WeakMap,ls=new WeakMap,cs=new WeakMap,Kl=new WeakMap,qu=new WeakMap,tf=new WeakMap;var fA=r=>{switch(r){case c.Automation:return"automated";case c.Modulation:return"modulated";case c.MIDIControl:return"midi";case c.ParameterController:return"external";default:return D(`${r.toString()} is an unknown pointer type`)}};var mA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ln=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ba,Wl,wy,Ay=class{constructor(e,t,n){ba.set(this,void 0),Wl.set(this,void 0),wy.set(this,void 0),mA(this,ba,A.newSet(i=>i.uuid),"f"),mA(this,Wl,new or,"f"),mA(this,wy,e.catchupAndSubscribe({onAdded:i=>{let o=t(i.box),a=Ln(this,ba,"f").add(o);V(a,`Could not add ${o}`),Ln(this,Wl,"f").proxy.onAdd(o)},onRemoved:i=>{let o=i.box.address.uuid;Ln(this,Wl,"f").proxy.onRemove(Ln(this,ba,"f").removeByKey(o))}},n),"f")}subscribe(e){return Ln(this,Wl,"f").subscribe(e)}catchupAndSubscribe(e){return Ln(this,ba,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return Ln(this,ba,"f").values()}size(){return Ln(this,ba,"f").size()}isEmpty(){return this.size()===0}terminate(){Ln(this,ba,"f").clear(),Ln(this,Wl,"f").terminate(),Ln(this,wy,"f").terminate()}};ba=new WeakMap,Wl=new WeakMap,wy=new WeakMap;var gA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},wt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},vA,li,rf,on,Er,FB,tr=class{constructor(e,t){vA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Delay,rf.set(this,void 0),on.set(this,void 0),Er.set(this,void 0),gA(this,rf,e,"f"),gA(this,on,t,"f"),gA(this,Er,new be(wt(this,rf,"f")),"f"),this.namedParameter=wt(this,vA,"m",FB).call(this,t)}get box(){return wt(this,on,"f")}get uuid(){return wt(this,on,"f").address.uuid}get address(){return wt(this,on,"f").address}get indexField(){return wt(this,on,"f").index}get labelField(){return wt(this,on,"f").label}get enabledField(){return wt(this,on,"f").enabled}get minimizedField(){return wt(this,on,"f").minimized}get host(){return wt(this,on,"f").host}deviceHost(){return wt(this,rf,"f").boxAdapters.adapterFor(wt(this,on,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){wt(this,Er,"f").terminate()}};li=tr,rf=new WeakMap,on=new WeakMap,Er=new WeakMap,vA=new WeakSet,FB=function(e){return{preSyncTimeLeft:wt(this,Er,"f").createParameter(e.preSyncTimeLeft,w.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:wt(this,Er,"f").createParameter(e.preMillisTimeLeft,w.powerByCenter(100,0,li.MAX_MILLIS_TIME),_.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:wt(this,Er,"f").createParameter(e.preSyncTimeRight,w.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync R"),preMillisTimeRight:wt(this,Er,"f").createParameter(e.preMillisTimeRight,w.powerByCenter(100,0,li.MAX_MILLIS_TIME),_.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:wt(this,Er,"f").createParameter(e.delayMusical,w.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"delay"),millisTime:wt(this,Er,"f").createParameter(e.delayMillis,w.powerByCenter(100,0,li.MAX_MILLIS_TIME),_.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:wt(this,Er,"f").createParameter(e.feedback,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:wt(this,Er,"f").createParameter(e.cross,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:wt(this,Er,"f").createParameter(e.lfoSpeed,w.exponential(li.LFO_SPEED_MIN,li.LFO_SPEED_MAX),_.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:wt(this,Er,"f").createParameter(e.lfoDepth,w.power(4,0,li.LFO_DEPTH_MAX),_.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:wt(this,Er,"f").createParameter(e.filter,w.bipolar(),_.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:wt(this,Er,"f").createParameter(e.dry,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"dry"),wet:wt(this,Er,"f").createParameter(e.wet,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"wet")}};tr.Fractions=xr.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();tr.FractionsStringMapping=_.indices("",li.Fractions.map(([r,e])=>r===0?"Off":`${r}/${e}`));tr.MAX_MILLIS_TIME=1e3;tr.LFO_SPEED_MIN=.1;tr.LFO_SPEED_MAX=5;tr.LFO_DEPTH_MAX=50;var yA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},lr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},xA,nf,an,Do,BB,Hu=class{constructor(e,t){xA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Reverb,nf.set(this,void 0),an.set(this,void 0),Do.set(this,void 0),yA(this,nf,e,"f"),yA(this,an,t,"f"),yA(this,Do,new be(lr(this,nf,"f")),"f"),this.namedParameter=lr(this,xA,"m",BB).call(this,t)}get box(){return lr(this,an,"f")}get uuid(){return lr(this,an,"f").address.uuid}get address(){return lr(this,an,"f").address}get indexField(){return lr(this,an,"f").index}get labelField(){return lr(this,an,"f").label}get enabledField(){return lr(this,an,"f").enabled}get minimizedField(){return lr(this,an,"f").minimized}get host(){return lr(this,an,"f").host}deviceHost(){return lr(this,nf,"f").boxAdapters.adapterFor(lr(this,an,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){lr(this,Do,"f").terminate()}};nf=new WeakMap,an=new WeakMap,Do=new WeakMap,xA=new WeakSet,BB=function(e){return{decay:lr(this,Do,"f").createParameter(e.decay,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:lr(this,Do,"f").createParameter(e.preDelay,w.exponential(.001,.5),_.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:lr(this,Do,"f").createParameter(e.damp,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"damping"),filter:lr(this,Do,"f").createParameter(e.filter,w.bipolar(),_.numeric({unit:"%",fractionDigits:0}),"filter"),dry:lr(this,Do,"f").createParameter(e.dry,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"dry"),wet:lr(this,Do,"f").createParameter(e.wet,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"wet")}};var bA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},AA,of,Di,Kn,DB,Ju=class{constructor(e,t){AA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Revamp,of.set(this,void 0),Di.set(this,void 0),Kn.set(this,void 0),bA(this,of,e,"f"),bA(this,Di,t,"f"),bA(this,Kn,new be(Zt(this,of,"f")),"f"),this.namedParameter=Zt(this,AA,"m",DB).call(this,t)}get box(){return Zt(this,Di,"f")}get uuid(){return Zt(this,Di,"f").address.uuid}get address(){return Zt(this,Di,"f").address}get indexField(){return Zt(this,Di,"f").index}get labelField(){return Zt(this,Di,"f").label}get enabledField(){return Zt(this,Di,"f").enabled}get minimizedField(){return Zt(this,Di,"f").minimized}get host(){return Zt(this,Di,"f").host}get spectrum(){return Zt(this,Di,"f").address.append(4095)}deviceHost(){return Zt(this,of,"f").boxAdapters.adapterFor(Zt(this,Di,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Zt(this,Kn,"f").terminate()}};of=new WeakMap,Di=new WeakMap,Kn=new WeakMap,AA=new WeakSet,DB=function(e){return{highPass:NB(Zt(this,Kn,"f"),e.highPass,"High-Pass"),lowShelf:IB(Zt(this,Kn,"f"),e.lowShelf,"Low-Shelf"),lowBell:wA(Zt(this,Kn,"f"),e.lowBell,"Low-Bell"),midBell:wA(Zt(this,Kn,"f"),e.midBell,"Mid-Bell"),highBell:wA(Zt(this,Kn,"f"),e.highBell,"High-Bell"),highShelf:IB(Zt(this,Kn,"f"),e.highShelf,"High-Shelf"),lowPass:NB(Zt(this,Kn,"f"),e.lowPass,"Low-Pass")}};var _A=w.exponential(20,2e4),kB=w.linear(-24,24),MB=w.exponential(.01,10),NB=(r,e,t)=>({enabled:r.createParameter(e.enabled,w.bool,_.bool,"enabled"),frequency:r.createParameter(e.frequency,_A,_.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,w.linearInteger(0,3),_.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,MB,_.numeric({fractionDigits:3}),`${t} Q`)}),IB=(r,e,t)=>({enabled:r.createParameter(e.enabled,w.bool,_.bool,"enabled"),frequency:r.createParameter(e.frequency,_A,_.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,kB,_.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),wA=(r,e,t)=>({enabled:r.createParameter(e.enabled,w.bool,_.bool,"enabled"),frequency:r.createParameter(e.frequency,_A,_.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,kB,_.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,MB,_.numeric({fractionDigits:3}),`${t} Q`)});var $B=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ci=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},_y,Py,ui,us=class{constructor(e,t){this.type="marker-event",_y.set(this,new j),Py.set(this,void 0),ui.set(this,void 0),$B(this,Py,e,"f"),$B(this,ui,t,"f"),ci(this,_y,"f").own(ci(this,ui,"f").subscribe(Ue.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();ci(this,ui,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return ci(this,ui,"f")}get uuid(){return ci(this,ui,"f").address.uuid}get address(){return ci(this,ui,"f").address}get position(){return ci(this,ui,"f").position.getValue()}get plays(){return ci(this,ui,"f").plays.getValue()}get hue(){return ci(this,ui,"f").hue.getValue()}get label(){return ci(this,ui,"f").label.getValue()}get trackAdapter(){return ci(this,ui,"f").track.targetVertex.map(e=>ci(this,Py,"f").boxAdapters.adapterFor(e.box,sn).markerTrack)}terminate(){ci(this,_y,"f").terminate()}toString(){return`{MarkerBoxAdapter ${A.toString(ci(this,ui,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};_y=new WeakMap,Py=new WeakMap,ui=new WeakMap;us.Comparator=(r,e)=>r.position-e.position;var af=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ln=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},sf,Qu,lf,Zl,Sy,Ey=class{constructor(e,t){sf.set(this,void 0),Qu.set(this,void 0),lf.set(this,void 0),Zl.set(this,void 0),Sy.set(this,void 0),af(this,sf,e,"f"),af(this,Qu,t,"f"),this.changeNotifier=new ce,af(this,lf,A.newSet(n=>n.uuid),"f"),af(this,Zl,oi.create(us.Comparator),"f"),af(this,Sy,ln(this,Qu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof Yc){let i=ln(this,sf,"f").boxAdapters.adapterFor(n,us),o=ln(this,lf,"f").add(i);V(o,"Could not add adapter"),ln(this,Zl,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{ln(this,Zl,"f").remove(ln(this,lf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return ln(this,sf,"f")}get enabled(){return ln(this,Qu,"f").enabled.getValue()}get events(){return ln(this,Zl,"f")}get object(){return ln(this,Qu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){ln(this,Zl,"f").onIndexingChanged(),this.dispatchChange()}terminate(){ln(this,Sy,"f").terminate()}};sf=new WeakMap,Qu=new WeakMap,lf=new WeakMap,Zl=new WeakMap,Sy=new WeakMap;var TB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ki=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fy,By,Mi,Gl=class{constructor(e,t){this.type="signature-event",Fy.set(this,new j),By.set(this,void 0),Mi.set(this,void 0),TB(this,By,e,"f"),TB(this,Mi,t,"f"),ki(this,Fy,"f").own(ki(this,Mi,"f").subscribe(Ue.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return ki(this,Mi,"f")}get uuid(){return ki(this,Mi,"f").address.uuid}get address(){return ki(this,Mi,"f").address}get index(){return ki(this,Mi,"f").index.getValue()}get indexField(){return ki(this,Mi,"f").index}get relativePosition(){return ki(this,Mi,"f").relativePosition.getValue()}get nominator(){return ki(this,Mi,"f").nominator.getValue()}get denominator(){return ki(this,Mi,"f").denominator.getValue()}get trackAdapter(){return ki(this,Mi,"f").events.targetVertex.map(e=>ki(this,By,"f").boxAdapters.adapterFor(e.box,sn).signatureTrack)}terminate(){ki(this,Fy,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Fy=new WeakMap,By=new WeakMap,Mi=new WeakMap;Gl.Comparator=(r,e)=>r.index-e.index;var Ny=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Et=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ql,cf,uf,Hl,wa,ds,RB,df,Iy=class{constructor(e,t,n){ql.add(this),cf.set(this,new j),uf.set(this,void 0),Hl.set(this,void 0),wa.set(this,void 0),ds.set(this,void 0),Ny(this,uf,e,"f"),Ny(this,Hl,t,"f"),Ny(this,wa,n,"f"),this.changeNotifier=new ce,Ny(this,ds,Et(this,cf,"f").own(ar.create(Et(this,wa,"f").events,i=>e.boxAdapters.adapterFor(i,Gl),c.SignatureAutomation)),"f"),Et(this,cf,"f").ownAll(Et(this,Hl,"f").subscribe(()=>this.dispatchChange()),Et(this,wa,"f").enabled.subscribe(()=>this.dispatchChange()),Et(this,ds,"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 Et(this,uf,"f")}get enabled(){return Et(this,wa,"f").enabled.getValue()}get object(){return Et(this,wa,"f")}get size(){return Et(this,ds,"f").size()}get storageSignature(){let{nominator:e,denominator:t}=Et(this,Hl,"f");return[e.getValue(),t.getValue()]}nonEmpty(){return Et(this,ds,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let t=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:o}of this.iterateAll()){if(n>e)break;t=[i,o]}return t}*iterateAll(){let e=0,t=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:t,nominator:n,denominator:i},!!Et(this,wa,"f").enabled.getValue())for(let o of Et(this,ds,"f").adapters())e+=Q.fromSignature(n,i)*o.relativePosition,t+=o.relativePosition,n=o.nominator,i=o.denominator,yield{index:o.index,accumulatedPpqn:e,accumulatedBars:t,nominator:n,denominator:i}}changeSignature(e,t){let n=Array.from(this.iterateAll()).slice(1),i=n.map(l=>l.accumulatedPpqn);Et(this,Hl,"f").nominator.setValue(e),Et(this,Hl,"f").denominator.setValue(t);let o=0,a=0,s=Q.fromSignature(e,t);for(let l=0;l<n.length;l++){let u=n[l],p=this.adapterAt(u.index);if(p.isEmpty())continue;let h=(i[l]-o)/s,g=Math.floor(h),v=h-g;a+=v;let y=g;a>=1&&(y++,a--),y=Math.max(1,y),p.unwrap().box.relativePosition.setValue(y),o+=y*s,s=Q.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let t=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(g=>g.index===t);if(i===-1)return;let o=n.slice(i+1),a=o.map(g=>g.accumulatedPpqn),s=i>0?n[i-1]:null,[l,u]=s!==null?[s.nominator,s.denominator]:this.storageSignature,p=s!==null?s.accumulatedPpqn:0;e.box.delete();let d=p,h=Q.fromSignature(l,u);for(let g=0;g<o.length;g++){let v=o[g],y=this.adapterAt(v.index);if(y.isEmpty())continue;let F=(a[g]-d)/h,I=Math.max(1,Math.round(F));y.unwrap().box.relativePosition.setValue(I),d+=I*h,h=Q.fromSignature(v.nominator,v.denominator)}}createEvent(e,t,n){let i=Array.from(this.iterateAll()),o=i[0],a=0;for(let y=1;y<i.length&&!(i[y].accumulatedPpqn>e);y++)o=i[y],a=y;let s=Q.fromSignature(o.nominator,o.denominator),l=(e-o.accumulatedPpqn)/s,u=Math.max(1,Math.round(l)),p=o.index+1,d=i.slice(a+1),h=o.accumulatedPpqn+u*s,g=Q.fromSignature(t,n),v=d.map(y=>({event:y,adapter:this.adapterAt(y.index)})).filter(({adapter:y})=>y.nonEmpty()).map(({event:y,adapter:x})=>({event:y,adapter:x.unwrap()}));for(let y=0;y<v.length;y++){let{event:x,adapter:F}=v[y];if(F.box.index.setValue(x.index+1),y===0){let I=(x.accumulatedPpqn-h)/g;F.box.relativePosition.setValue(Math.max(1,Math.round(I)))}}qc.create(Et(this,uf,"f").boxGraph,A.generate(),y=>{y.index.setValue(p),y.relativePosition.setValue(u),y.nominator.setValue(t),y.denominator.setValue(n),y.events.refer(Et(this,wa,"f").events)})}adapterAt(e){return Et(this,ds,"f").getAdapterByIndex(e)}moveEvent(e,t){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(h=>h.index===e.index);if(i===-1)return;let o=n[i];if(t===o.accumulatedPpqn)return;let a=n.map(h=>h.accumulatedBars),s=Et(this,ql,"m",RB).call(this,t,o.index);if(s===o.accumulatedBars)return;let l=[...a];l[i]=s;let u=l.map((h,g)=>({bar:h,i:g})).sort((h,g)=>h.bar-g.bar).map(h=>h.i),p=n.map(h=>this.adapterAt(h.index).unwrap());for(let h=0;h<u.length;h++)p[u[h]].box.index.setValue(h);let d=0;for(let h=0;h<u.length;h++){let g=u[h],v=p[g],y=l[g],x=Math.max(1,y-d);v.box.relativePosition.setValue(x),d=y}}floorToBar(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}ceilToBar(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.ceil((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}roundToBar(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.round((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}barLengthAt(e){let[t,n]=this.signatureAt(e);return Q.fromSignature(t,n)}getBarInterval(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/n),o=t.accumulatedPpqn+i*n;return{position:o,complete:o+n}}terminate(){Et(this,cf,"f").terminate()}};cf=new WeakMap,uf=new WeakMap,Hl=new WeakMap,wa=new WeakMap,ds=new WeakMap,ql=new WeakSet,RB=function(e,t){let n=null;for(let a of this.iterateAll())if(a.index!==t){if(a.accumulatedPpqn>e)break;n=a}if(so(n)){let[a,s]=this.storageSignature,l=Q.fromSignature(a,s);return Math.max(1,Math.round(e/l))}let i=Q.fromSignature(n.nominator,n.denominator),o=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+o)},df=function(e){let t=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;t=n}if(so(t)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Q.fromSignature(n,i)}}return{event:t,barPpqn:Q.fromSignature(t.nominator,t.denominator)}};var pf=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},hf,ko,Dy,ky,Aa,ff,My,sn=class{constructor(e,t){hf.set(this,new j),ko.set(this,void 0),Dy.set(this,void 0),ky.set(this,void 0),Aa.set(this,void 0),ff.set(this,void 0),My.set(this,()=>{let{tempoTrack:{enabled:s}}=jt(this,ko,"f");return s.getValue()?jt(this,Aa,"f").isEmpty()?m.None:jt(this,Aa,"f").unwrap().events.isEmpty()?m.None:jt(this,Aa,"f"):m.None}),pf(this,ko,t,"f"),pf(this,Dy,new Ey(e,t.markerTrack),"f"),pf(this,ky,new Iy(e,t.signature,t.signatureTrack),"f"),pf(this,Aa,new Dr,"f"),pf(this,ff,new ce,"f");let n=jt(this,hf,"f").own(new j),i=()=>jt(this,ff,"f").notify(jt(this,My,"f").call(this)),{tempoTrack:{events:o,enabled:a}}=t;jt(this,hf,"f").own(o.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>jt(this,Aa,"f").clear(),some:({box:l})=>{let u=e.boxAdapters.adapterFor(l,Ar);jt(this,Aa,"f").wrap(u),n.ownAll(u.subscribeChange(i),a.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(jt(this,My,"f").call(this)),jt(this,ff,"f").subscribe(e)}get box(){return jt(this,ko,"f")}get uuid(){return jt(this,ko,"f").address.uuid}get address(){return jt(this,ko,"f").address}get markerTrack(){return jt(this,Dy,"f")}get signatureTrack(){return jt(this,ky,"f")}get tempoTrackEvents(){return jt(this,Aa,"f")}get signature(){let{nominator:e,denominator:t}=jt(this,ko,"f").signature;return[e.getValue(),t.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=jt(this,ko,"f").signature;return Q.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),jt(this,ko,"f").signature.subscribe(()=>e(this.signature))}terminate(){jt(this,hf,"f").terminate()}};hf=new WeakMap,ko=new WeakMap,Dy=new WeakMap,ky=new WeakMap,Aa=new WeakMap,ff=new WeakMap,My=new WeakMap;var SM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},mf=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ps,hs=class{constructor(e,t){ps.set(this,void 0),SM(this,ps,t,"f")}get box(){return mf(this,ps,"f")}get uuid(){return mf(this,ps,"f").address.uuid}get address(){return mf(this,ps,"f").address}get source(){return mf(this,ps,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return mf(this,ps,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};ps=new WeakMap;var Jl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},cn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$y,Ql,Yl,Ty,Ry,gf,un=class{constructor(e,t){$y.set(this,void 0),Ql.set(this,void 0),Yl.set(this,void 0),Ty.set(this,void 0),Ry.set(this,void 0),gf.set(this,!1),Jl(this,$y,e,"f"),Jl(this,Ql,t,"f"),Jl(this,Yl,new j,"f"),Jl(this,Ty,t.attributes,"f"),Jl(this,Ry,cn(this,Yl,"f").own(new be(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return cn(this,Yl,"f").own(e)}ownAll(...e){cn(this,Yl,"f").ownAll(...e)}onSelected(){Jl(this,gf,!0,"f")}onDeselected(){Jl(this,gf,!1,"f")}isSelected(){return cn(this,gf,"f")}get box(){return cn(this,Ql,"f")}get attributes(){return cn(this,Ty,"f")}get uuid(){return cn(this,Ql,"f").address.uuid}get address(){return cn(this,Ql,"f").address}get parameters(){return cn(this,Ry,"f")}get modular(){return cn(this,$y,"f").boxAdapters.adapterFor(cn(this,Ql,"f").attributes.collection.targetVertex.unwrap().box,fs)}terminate(){cn(this,Yl,"f").terminate()}};$y=new WeakMap,Ql=new WeakMap,Yl=new WeakMap,Ty=new WeakMap,Ry=new WeakMap,gf=new WeakMap;var Cy=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_a=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Oy,ms,vf,Vy,Tr;(function(r){r.Input="input",r.Output="output"})(Tr||(Tr={}));var Rr=class r{static create(e,t,n,i){return new r(e,t,n,i??t.fieldName)}constructor(e,t,n,i){Oy.set(this,void 0),ms.set(this,void 0),vf.set(this,void 0),Vy.set(this,void 0),Cy(this,Oy,e,"f"),Cy(this,ms,t,"f"),Cy(this,vf,n,"f"),Cy(this,Vy,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(n=>n===t))}get connections(){return _a(this,ms,"f").pointerHub.isEmpty()?U.empty():_a(this,ms,"f").pointerHub.filter(c.VoltageConnection).map(({box:e})=>_a(this,Oy,"f").adapterFor(e,hs))}get field(){return _a(this,ms,"f")}get address(){return _a(this,ms,"f").address}get direction(){return _a(this,vf,"f")}get name(){return _a(this,Vy,"f")}toString(){return`{ModuleConnectorAdapter address: ${_a(this,ms,"f").address.toString()}, direction: ${_a(this,vf,"f")}}`}};Oy=new WeakMap,ms=new WeakMap,vf=new WeakMap,Vy=new WeakMap;var PA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},yf=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zy,xf,bf,Yu=class extends un{constructor(e,t){super(e,t),zy.set(this,void 0),xf.set(this,void 0),bf.set(this,void 0),PA(this,zy,this.parameters.createParameter(t.time,w.exponential(1,1e4),_.numeric({unit:"ms"}),"Time"),"f"),PA(this,xf,Rr.create(e.boxAdapters,t.voltageInput,Tr.Input,"Input"),"f"),PA(this,bf,Rr.create(e.boxAdapters,t.voltageOutput,Tr.Output,"Output"),"f")}get parameterTime(){return yf(this,zy,"f")}get voltageInput(){return yf(this,xf,"f")}get voltageOutput(){return yf(this,bf,"f")}get inputs(){return[yf(this,xf,"f")]}get outputs(){return[yf(this,bf,"f")]}};zy=new WeakMap,xf=new WeakMap,bf=new WeakMap;var EM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},CB=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wf,Xu=class extends un{constructor(e,t){super(e,t),wf.set(this,void 0),EM(this,wf,Rr.create(e.boxAdapters,t.input,Tr.Input,"Input"),"f")}get voltageInput(){return CB(this,wf,"f")}get inputs(){return[CB(this,wf,"f")]}get outputs(){return U.empty()}};wf=new WeakMap;var SA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Af=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Uy,_f,Pf,ed=class extends un{constructor(e,t){super(e,t),Uy.set(this,void 0),_f.set(this,void 0),Pf.set(this,void 0),SA(this,Uy,this.parameters.createParameter(t.gain,w.DefaultDecibel,_.numeric({unit:"db"}),"Gain"),"f"),SA(this,_f,Rr.create(e.boxAdapters,t.voltageInput,Tr.Input,"Input"),"f"),SA(this,Pf,Rr.create(e.boxAdapters,t.voltageOutput,Tr.Output,"Output"),"f")}get parameterGain(){return Af(this,Uy,"f")}get voltageInput(){return Af(this,_f,"f")}get voltageOutput(){return Af(this,Pf,"f")}get inputs(){return[Af(this,_f,"f")]}get outputs(){return[Af(this,Pf,"f")]}};Uy=new WeakMap,_f=new WeakMap,Pf=new WeakMap;var EA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},FA=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},jy,Ly,Ky,td=class extends un{constructor(e,t){super(e,t),jy.set(this,void 0),Ly.set(this,void 0),Ky.set(this,void 0),EA(this,jy,Rr.create(e.boxAdapters,t.voltageInputX,Tr.Input,"X"),"f"),EA(this,Ly,Rr.create(e.boxAdapters,t.voltageInputY,Tr.Input,"Y"),"f"),EA(this,Ky,Rr.create(e.boxAdapters,t.voltageOutput,Tr.Output,"Result"),"f")}get inputs(){return[FA(this,jy,"f"),FA(this,Ly,"f")]}get outputs(){return[FA(this,Ky,"f")]}};jy=new WeakMap,Ly=new WeakMap,Ky=new WeakMap;var FM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},OB=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Sf,rd=class extends un{constructor(e,t){super(e,t),Sf.set(this,void 0),FM(this,Sf,Rr.create(e.boxAdapters,t.output,Tr.Output,"Output"),"f")}get voltageOutput(){return OB(this,Sf,"f")}get inputs(){return U.empty()}get outputs(){return[OB(this,Sf,"f")]}};Sf=new WeakMap;var id;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>ve(t.accept({visitModuleGainBox:n=>e.adapterFor(n,ed),visitModuleDelayBox:n=>e.adapterFor(n,Yu),visitModuleMultiplierBox:n=>e.adapterFor(n,td),visitModularAudioInputBox:n=>e.adapterFor(n,rd),visitModularAudioOutputBox:n=>e.adapterFor(n,Xu)}),`Could not find ModuleAdapter for ${t.name}`)})(id||(id={}));var VB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xl=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Wy,Zy,ec,BA,nd=class{constructor(e,t){Wy.add(this),Zy.set(this,void 0),ec.set(this,void 0),VB(this,Zy,e,"f"),VB(this,ec,t,"f")}get box(){return Xl(this,ec,"f")}get uuid(){return Xl(this,ec,"f").address.uuid}get address(){return Xl(this,ec,"f").address}get moduleAdapter(){return id.adapterFor(Xl(this,Zy,"f").boxAdapters,Xl(this,Wy,"a",BA).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Xl(this,Wy,"a",BA).address)}terminate(){}};Zy=new WeakMap,ec=new WeakMap,Wy=new WeakSet,BA=function(){return Xl(this,ec,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var zB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},di=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},od,pi,gs=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Modular,od.set(this,void 0),pi.set(this,void 0),zB(this,od,e,"f"),zB(this,pi,t,"f")}get box(){return di(this,pi,"f")}get uuid(){return di(this,pi,"f").address.uuid}get address(){return di(this,pi,"f").address}get indexField(){return di(this,pi,"f").index}get labelField(){return di(this,pi,"f").label}get enabledField(){return di(this,pi,"f").enabled}get minimizedField(){return di(this,pi,"f").minimized}get host(){return di(this,pi,"f").host}parameterAt(e){return D("Not yet implemented")}deviceHost(){return di(this,od,"f").boxAdapters.adapterFor(di(this,pi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return di(this,od,"f").boxAdapters.adapterFor(di(this,pi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,fs)}elements(){return di(this,pi,"f").userInterface.elements.pointerHub.filter(c.DeviceUserInterface).map(e=>di(this,od,"f").boxAdapters.adapterFor(e.box,nd))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};od=new WeakMap,pi=new WeakMap;var Ef=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ot=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ad,vs,sd,$i,tc,rc,fs=class{constructor(e,t){ad.set(this,new j),vs.set(this,void 0),sd.set(this,void 0),$i.set(this,void 0),tc.set(this,void 0),rc.set(this,void 0),Ef(this,sd,e,"f"),Ef(this,$i,t,"f"),Ef(this,vs,ot(this,ad,"f").own(new or),"f"),Ef(this,tc,A.newSet(s=>s.uuid),"f"),Ef(this,rc,A.newSet(s=>s.uuid),"f");let n=s=>{let l=id.adapterFor(ot(this,sd,"f").boxAdapters,s.box);ot(this,tc,"f").add(l)&&ot(this,vs,"f").proxy.onModuleAdded(l)},i=s=>ot(this,vs,"f").proxy.onModuleRemoved(ot(this,tc,"f").removeByKey(s.address.uuid)),o=s=>{let l=ot(this,sd,"f").boxAdapters.adapterFor(s.box,hs);ot(this,rc,"f").add(l)&&ot(this,vs,"f").proxy.onConnectionAdded(l)},a=s=>ot(this,vs,"f").proxy.onConnectionRemoved(ot(this,rc,"f").removeByKey(s.address.uuid));ot(this,$i,"f").modules.pointerHub.filter(c.ModuleCollection).forEach(n),ot(this,$i,"f").connections.pointerHub.filter(c.ConnectionCollection).forEach(o),ot(this,ad,"f").own(ot(this,$i,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},c.ModuleCollection)),ot(this,ad,"f").own(ot(this,$i,"f").connections.pointerHub.subscribe({onAdded:o,onRemoved:a},c.ConnectionCollection))}catchupAndSubscribe(e){return K0(e.onModuleAdded,t=>ot(this,tc,"f").forEach(n=>t(n))),K0(e.onConnectionAdded,t=>ot(this,rc,"f").forEach(n=>t(n))),ot(this,vs,"f").subscribe(e)}get box(){return ot(this,$i,"f")}get address(){return ot(this,$i,"f").address}get uuid(){return ot(this,$i,"f").address.uuid}get editingField(){return ot(this,$i,"f").editing}get labelField(){return ot(this,$i,"f").label}get modules(){return ot(this,tc,"f").values()}get connections(){return ot(this,rc,"f").values()}get device(){return ot(this,sd,"f").boxAdapters.adapterFor(ve(ot(this,$i,"f").device.pointerHub.incoming().at(0),"No device found").box,gs)}terminate(){console.debug(`terminate ${this}`),ot(this,ad,"f").terminate()}};ad=new WeakMap,vs=new WeakMap,sd=new WeakMap,$i=new WeakMap,tc=new WeakMap,rc=new WeakMap;var Ff=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Jr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},NA,cd,Bf,Gy,ld,If,qy,Nf,Hy,UB,Mo=class{constructor(e,t){NA.add(this),this.type="groove-adapter",Bf.set(this,new j),Gy.set(this,void 0),ld.set(this,void 0),If.set(this,void 0),qy.set(this,new _g({duration:()=>Jr(this,Hy,"f"),fx:n=>q0(n,Jr(this,Nf,"f")),fy:n=>q0(n,1-Jr(this,Nf,"f"))})),Nf.set(this,0),Hy.set(this,Q.SemiQuaver*2),Ff(this,Gy,e,"f"),Ff(this,ld,t,"f"),Ff(this,If,Jr(this,Bf,"f").own(new be(Jr(this,Gy,"f"))),"f"),this.namedParameter=Jr(this,NA,"m",UB).call(this,t),Jr(this,Bf,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>Ff(this,Hy,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>Ff(this,Nf,HF(n.getValue(),.01),"f")))}unwarp(e){return Jr(this,qy,"f").unwarp(e)}warp(e){return Jr(this,qy,"f").warp(e)}get box(){return Jr(this,ld,"f")}get uuid(){return Jr(this,ld,"f").address.uuid}get address(){return Jr(this,ld,"f").address}terminate(){Jr(this,Bf,"f").terminate()}};cd=Mo,Bf=new WeakMap,Gy=new WeakMap,ld=new WeakMap,If=new WeakMap,qy=new WeakMap,Nf=new WeakMap,Hy=new WeakMap,NA=new WeakSet,UB=function(e){return{duration:Jr(this,If,"f").createParameter(e.duration,w.values(cd.DurationPPQNs),_.values("",cd.DurationPPQNs,cd.DurationStrings),"duration"),amount:Jr(this,If,"f").createParameter(e.amount,w.unipolar(),_.percent({fractionDigits:0}),"amount")}};Mo.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Mo.DurationPPQNs=cd.Durations.map(([r,e])=>Q.fromSignature(r,e));Mo.DurationStrings=cd.Durations.map(([r,e])=>`${r}/${e}`);var ud=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Rt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$o,ys,dd,Jy,Qy,Df,kf,IA,xs=class{constructor(e,t,n,i,o){$o.set(this,void 0),ys.set(this,void 0),dd.set(this,void 0),Jy.set(this,void 0),Qy.set(this,void 0),Df.set(this,new j),kf.set(this,void 0),IA.set(this,m.None),ud(this,$o,e,"f"),ud(this,ys,t,"f"),ud(this,dd,n,"f"),ud(this,Jy,i,"f"),ud(this,Qy,o??0,"f"),ud(this,kf,Rt(this,Df,"f").own(new ce),"f"),Rt(this,Df,"f").own(Rt(this,$o,"f").subscribe(()=>Rt(this,kf,"f").notify(this))),e.getValue(),t.clamp(e.getValue())}get field(){return Rt(this,$o,"f")}get valueMapping(){return Rt(this,ys,"f")}get stringMapping(){return Rt(this,dd,"f")}get name(){return Rt(this,Jy,"f")}get anchor(){return Rt(this,Qy,"f")}get type(){return Rt(this,$o,"f").type}get address(){return Rt(this,$o,"f").address}get track(){return Rt(this,IA,"f")}subscribe(e){return Rt(this,kf,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Rt(this,$o,"f").getValue()}setValue(e){Rt(this,$o,"f").setValue(Rt(this,ys,"f").clamp(e))}setUnitValue(e){this.setValue(Rt(this,ys,"f").y(e))}getUnitValue(){return Rt(this,ys,"f").x(this.getValue())}getPrintValue(){return Rt(this,dd,"f").x(this.getValue())}setPrintValue(e){let t=Rt(this,dd,"f").y(e);t.type==="unitValue"?this.setUnitValue(we(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(Rt(this,ys,"f").clamp(Rt(this,$o,"f").initValue))}terminate(){Rt(this,Df,"f").terminate()}};$o=new WeakMap,ys=new WeakMap,dd=new WeakMap,Jy=new WeakMap,Qy=new WeakMap,Df=new WeakMap,kf=new WeakMap,IA=new WeakMap;var pd=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},To,Yy,Xy,ex,tx,rx,ix=class{constructor(e){To.set(this,void 0),Yy.set(this,void 0),Xy.set(this,void 0),ex.set(this,void 0),tx.set(this,void 0),rx.set(this,void 0),pd(this,To,e,"f"),pd(this,Yy,new xs(dn(this,To,"f").keyboard,w.values([88,76,61,49]),_.numeric({fractionDigits:1}),"Keyboard Type"),"f"),pd(this,Xy,new xs(dn(this,To,"f").timeRangeInQuarters,w.exponential(1,64),_.numeric({fractionDigits:1}),"Time-Range"),"f"),pd(this,ex,new xs(dn(this,To,"f").noteScale,w.exponential(.5,2),_.numeric({fractionDigits:1}),"Note Scale"),"f"),pd(this,tx,new xs(dn(this,To,"f").noteLabels,w.bool,_.bool,"Note Labels"),"f"),pd(this,rx,new xs(dn(this,To,"f").transpose,w.linearInteger(-48,48),_.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return dn(this,To,"f").box.subscribe(Ue.Children,()=>e(this))}get object(){return dn(this,To,"f")}get keyboard(){return dn(this,Yy,"f")}get timeRangeInQuarters(){return dn(this,Xy,"f")}get noteScale(){return dn(this,ex,"f")}get noteLabels(){return dn(this,tx,"f")}get transpose(){return dn(this,rx,"f")}};To=new WeakMap,Yy=new WeakMap,Xy=new WeakMap,ex=new WeakMap,tx=new WeakMap,rx=new WeakMap;var Mf=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ic,Ti,nc,nx,ox,hd=class{constructor(e,t){ic.set(this,void 0),Ti.set(this,void 0),nc.set(this,void 0),nx.set(this,void 0),ox.set(this,void 0),Mf(this,ic,e,"f"),Mf(this,Ti,t,"f"),Mf(this,nc,ar.create(rr(this,Ti,"f").audioUnits,n=>rr(this,ic,"f").boxAdapters.adapterFor(n,rn),c.AudioUnits),"f"),Mf(this,nx,new Ay(rr(this,Ti,"f").audioBusses.pointerHub,n=>rr(this,ic,"f").boxAdapters.adapterFor(n,qr),c.AudioBusses),"f"),Mf(this,ox,new ix(rr(this,Ti,"f").pianoMode),"f")}get uuid(){return rr(this,Ti,"f").address.uuid}get address(){return rr(this,Ti,"f").address}get box(){return rr(this,Ti,"f")}get audioBusses(){return rr(this,nx,"f")}get audioUnits(){return rr(this,nc,"f")}get clips(){return rr(this,nc,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return rr(this,ic,"f").boxAdapters.adapterFor(rr(this,Ti,"f").groove.targetVertex.unwrap("no groove").box,Mo)}get timeline(){return rr(this,ic,"f").boxAdapters.adapterFor(rr(this,Ti,"f").timeline.targetVertex.unwrap("no timeline").box,sn)}get pianoMode(){return rr(this,ox,"f")}get created(){return new Date(rr(this,Ti,"f").created.getValue())}get midiOutputDevices(){return rr(this,Ti,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>ze(e,Mn))}*labeledAudioOutputs(){for(let e of rr(this,nc,"f").adapters())yield{label:e.label,address:e.address,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){rr(this,nc,"f").terminate()}};ic=new WeakMap,Ti=new WeakMap,nc=new WeakMap,nx=new WeakMap,ox=new WeakMap;var DA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Cr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},kA,$f,Wn,bs,jB,fd=class{constructor(e,t){kA.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=pe.Tape,$f.set(this,void 0),Wn.set(this,void 0),bs.set(this,void 0),DA(this,$f,e,"f"),DA(this,Wn,t,"f"),DA(this,bs,new be(Cr(this,$f,"f")),"f"),this.namedParameter=Cr(this,kA,"m",jB).call(this,t)}get box(){return Cr(this,Wn,"f")}get uuid(){return Cr(this,Wn,"f").address.uuid}get address(){return Cr(this,Wn,"f").address}get labelField(){return Cr(this,Wn,"f").label}get iconField(){return Cr(this,Wn,"f").icon}get defaultTrackType(){return fe.Audio}get enabledField(){return Cr(this,Wn,"f").enabled}get minimizedField(){return Cr(this,Wn,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Cr(this,$f,"f").boxAdapters.adapterFor(Cr(this,Wn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Cr(this,bs,"f").terminate()}};$f=new WeakMap,Wn=new WeakMap,bs=new WeakMap,kA=new WeakSet,jB=function(e){return{flutter:Cr(this,bs,"f").createParameter(e.flutter,w.unipolar(),_.percent(),"flutter"),wow:Cr(this,bs,"f").createParameter(e.wow,w.unipolar(),_.percent(),"wow"),noise:Cr(this,bs,"f").createParameter(e.noise,w.unipolar(),_.percent(),"noise"),saturation:Cr(this,bs,"f").createParameter(e.saturation,w.unipolar(),_.percent(),"saturation")}};var Ro=(()=>{let t=[1,2,3,4],n=["12","24","36","48"],i=[ut.sine,ut.triangle,ut.saw,ut.square],o=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:w.exponential(20,2e4),CUTOFF_STRING_MAPPING:_.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:w.values(t),FILTER_ORDER_STRING_MAPPING:_.values("db",t,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:o,LFO_WAVEFORM_VALUE_MAPPING:w.values(i),LFO_WAVEFORM_STRING_MAPPING:_.values("",i,o)}})();var MA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},We=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$A,Tf,Zn,it,LB,md=class{constructor(e,t){$A.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=pe.Vaporisateur,Tf.set(this,void 0),Zn.set(this,void 0),it.set(this,void 0),MA(this,Tf,e,"f"),MA(this,Zn,t,"f"),MA(this,it,new be(We(this,Tf,"f")),"f"),this.namedParameter=We(this,$A,"m",LB).call(this,t)}get box(){return We(this,Zn,"f")}get uuid(){return We(this,Zn,"f").address.uuid}get address(){return We(this,Zn,"f").address}get labelField(){return We(this,Zn,"f").label}get iconField(){return We(this,Zn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return We(this,Zn,"f").enabled}get minimizedField(){return We(this,Zn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return We(this,Tf,"f").boxAdapters.adapterFor(We(this,Zn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){We(this,it,"f").terminate()}};Tf=new WeakMap,Zn=new WeakMap,it=new WeakMap,$A=new WeakSet,LB=function(e){let t=[xo.Monophonic,xo.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:We(this,it,"f").createParameter(n.waveform,w.linearInteger(0,3),_.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:We(this,it,"f").createParameter(n.volume,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:We(this,it,"f").createParameter(n.octave,w.linearInteger(-3,3),_.numeric({unit:"oct"}),"Octave",.5),tune:We(this,it,"f").createParameter(n.tune,w.linear(-1200,1200),_.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:We(this,it,"f").createParameter(e.noise.volume,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:We(this,it,"f").createParameter(e.noise.attack,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:We(this,it,"f").createParameter(e.noise.hold,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Hold"),release:We(this,it,"f").createParameter(e.noise.release,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:We(this,it,"f").createParameter(e.filterOrder,Ro.FILTER_ORDER_VALUE_MAPPING,Ro.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:We(this,it,"f").createParameter(e.cutoff,Ro.CUTOFF_VALUE_MAPPING,Ro.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:We(this,it,"f").createParameter(e.resonance,w.exponential(.01,10),_.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:We(this,it,"f").createParameter(e.attack,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:We(this,it,"f").createParameter(e.decay,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:We(this,it,"f").createParameter(e.sustain,w.unipolar(),_.percent({fractionDigits:1}),"Sustain"),release:We(this,it,"f").createParameter(e.release,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:We(this,it,"f").createParameter(e.filterEnvelope,w.bipolar(),_.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:We(this,it,"f").createParameter(e.filterKeyboard,w.bipolar(),_.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:We(this,it,"f").createParameter(e.voicingMode,w.values(t),_.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:We(this,it,"f").createParameter(e.glideTime,w.unipolar(),_.percent({fractionDigits:1}),"Glide time",0),unisonCount:We(this,it,"f").createParameter(e.unisonCount,w.values([1,3,5]),_.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:We(this,it,"f").createParameter(e.unisonDetune,w.exponential(1,1200),_.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:We(this,it,"f").createParameter(e.unisonStereo,w.unipolar(),_.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:We(this,it,"f").createParameter(e.lfo.waveform,Ro.LFO_WAVEFORM_VALUE_MAPPING,Ro.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:We(this,it,"f").createParameter(e.lfo.rate,w.exponential(1e-4,30),_.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:We(this,it,"f").createParameter(e.lfo.targetTune,w.bipolar(),_.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:We(this,it,"f").createParameter(e.lfo.targetVolume,w.bipolar(),_.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:We(this,it,"f").createParameter(e.lfo.targetCutoff,w.bipolar(),_.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var TA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},cr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},RA,ax,Rf,pn,Co,KB,Gn=class{constructor(e,t){RA.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Arpeggio,Rf.set(this,void 0),pn.set(this,void 0),Co.set(this,void 0),TA(this,Rf,e,"f"),TA(this,pn,t,"f"),TA(this,Co,new be(cr(this,Rf,"f")),"f"),this.namedParameter=cr(this,RA,"m",KB).call(this,t)}get box(){return cr(this,pn,"f")}get uuid(){return cr(this,pn,"f").address.uuid}get address(){return cr(this,pn,"f").address}get indexField(){return cr(this,pn,"f").index}get labelField(){return cr(this,pn,"f").label}get enabledField(){return cr(this,pn,"f").enabled}get minimizedField(){return cr(this,pn,"f").minimized}get host(){return cr(this,pn,"f").host}deviceHost(){return cr(this,Rf,"f").boxAdapters.adapterFor(cr(this,pn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){cr(this,Co,"f").terminate()}};ax=Gn,Rf=new WeakMap,pn=new WeakMap,Co=new WeakMap,RA=new WeakSet,KB=function(e){return{modeIndex:cr(this,Co,"f").createParameter(e.modeIndex,w.linearInteger(0,2),_.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:cr(this,Co,"f").createParameter(e.numOctaves,w.linearInteger(1,5),_.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:cr(this,Co,"f").createParameter(e.rateIndex,w.linearInteger(0,ax.RateFractions.length-1),ax.RateStringMapping,"Rate"),gate:cr(this,Co,"f").createParameter(e.gate,w.linear(0,2),_.percent({fractionDigits:0}),"Gate"),repeat:cr(this,Co,"f").createParameter(e.repeat,w.linearInteger(1,16),_.numeric({fractionDigits:0}),"Repeat"),velocity:cr(this,Co,"f").createParameter(e.velocity,w.bipolar(),_.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Gn.RateFractions=xr.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();Gn.RateStringMapping=_.indices("",ax.RateFractions.map(([r,e])=>`${r}/${e}`));var CA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Or=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},OA,Cf,hn,oc,WB,gd=class{constructor(e,t){OA.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Pitch,Cf.set(this,void 0),hn.set(this,void 0),oc.set(this,void 0),CA(this,Cf,e,"f"),CA(this,hn,t,"f"),CA(this,oc,new be(Or(this,Cf,"f")),"f"),this.namedParameter=Or(this,OA,"m",WB).call(this,t)}get box(){return Or(this,hn,"f")}get uuid(){return Or(this,hn,"f").address.uuid}get address(){return Or(this,hn,"f").address}get indexField(){return Or(this,hn,"f").index}get labelField(){return Or(this,hn,"f").label}get enabledField(){return Or(this,hn,"f").enabled}get minimizedField(){return Or(this,hn,"f").minimized}get host(){return Or(this,hn,"f").host}deviceHost(){return Or(this,Cf,"f").boxAdapters.adapterFor(Or(this,hn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Or(this,oc,"f").terminate()}};Cf=new WeakMap,hn=new WeakMap,oc=new WeakMap,OA=new WeakSet,WB=function(e){return{octaves:Or(this,oc,"f").createParameter(e.octaves,w.linearInteger(-7,7),_.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Or(this,oc,"f").createParameter(e.semiTones,w.linearInteger(-36,36),_.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Or(this,oc,"f").createParameter(e.cents,w.linear(-50,50),_.numeric({unit:"cents",fractionDigits:1}),"cents")}};var VA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},hi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zA,Of,qn,vd,ZB,yd=class{constructor(e,t){zA.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=pe.Nano,Of.set(this,void 0),qn.set(this,void 0),vd.set(this,void 0),VA(this,Of,e,"f"),VA(this,qn,t,"f"),VA(this,vd,new be(hi(this,Of,"f")),"f"),this.namedParameter=hi(this,zA,"m",ZB).call(this,t)}get box(){return hi(this,qn,"f")}get uuid(){return hi(this,qn,"f").address.uuid}get address(){return hi(this,qn,"f").address}get labelField(){return hi(this,qn,"f").label}get iconField(){return hi(this,qn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return hi(this,qn,"f").enabled}get minimizedField(){return hi(this,qn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return hi(this,Of,"f").boxAdapters.adapterFor(hi(this,qn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){hi(this,vd,"f").terminate()}};Of=new WeakMap,qn=new WeakMap,vd=new WeakMap,zA=new WeakSet,ZB=function(e){return{volume:hi(this,vd,"f").createParameter(e.volume,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"volume"),release:hi(this,vd,"f").createParameter(e.release,w.exponential(.001,8),_.numeric({unit:"s",fractionDigits:3}),"release")}};var xd=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},se=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},UA,ac,ws,Te,sx,Vf,Ri,sc,GB,bd=class{constructor(e,t){UA.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",ac.set(this,new j),ws.set(this,void 0),Te.set(this,void 0),sx.set(this,void 0),Vf.set(this,void 0),Ri.set(this,void 0),sc.set(this,m.None),xd(this,ws,e,"f"),xd(this,Te,t,"f"),xd(this,sx,se(this,ac,"f").own(ar.create(se(this,Te,"f").midiEffects,n=>se(this,ws,"f").boxAdapters.adapterFor(n,de.isMidiEffect),c.MIDIEffectHost)),"f"),xd(this,Vf,se(this,ac,"f").own(ar.create(se(this,Te,"f").audioEffects,n=>se(this,ws,"f").boxAdapters.adapterFor(n,de.isAudioEffect),c.AudioEffectHost)),"f"),xd(this,Ri,se(this,ac,"f").own(new be(se(this,ws,"f"))),"f"),this.namedParameter=se(this,UA,"m",GB).call(this,t),se(this,ac,"f").own(se(this,Te,"f").file.catchupAndSubscribe(n=>{xd(this,sc,n.targetVertex.map(({box:i})=>se(this,ws,"f").boxAdapters.adapterFor(i,Rn)),"f"),se(this,sc,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,Te,"f")}get uuid(){return se(this,Te,"f").address.uuid}get address(){return se(this,Te,"f").address}get peakAddress(){return se(this,Te,"f").address.append(1001)}get indexField(){return se(this,Te,"f").index}get gate(){return se(this,Te,"f").gate.getValue()}get exclude(){return se(this,Te,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,sc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,sc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,Te,"f").icon}get defaultTrackType(){return fe.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return se(this,Te,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return se(this,Te,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return se(this,sc,"f")}fileUUID(){return se(this,Te,"f").file.targetAddress.unwrap().uuid}resetParameters(){se(this,Te,"f").mute.reset(),se(this,Te,"f").solo.reset(),se(this,Te,"f").exclude.reset(),se(this,Te,"f").polyphone.reset(),se(this,Te,"f").pitch.reset(),se(this,Te,"f").attack.reset(),se(this,Te,"f").release.reset(),se(this,Te,"f").sampleStart.reset(),se(this,Te,"f").sampleEnd.reset(),se(this,Te,"f").gate.reset()}copyToIndex(e){Ka.create(se(this,Te,"f").graph,A.generate(),t=>{t.file.refer(se(this,Te,"f").file.targetVertex.unwrap()),t.device.refer(se(this,Te,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(se(this,Te,"f").mute.getValue()),t.solo.setValue(se(this,Te,"f").solo.getValue()),t.sampleStart.setValue(se(this,Te,"f").sampleStart.getValue()),t.sampleEnd.setValue(se(this,Te,"f").sampleEnd.getValue()),t.attack.setValue(se(this,Te,"f").attack.getValue()),t.release.setValue(se(this,Te,"f").release.getValue()),t.pitch.setValue(se(this,Te,"f").pitch.getValue()),t.exclude.setValue(se(this,Te,"f").exclude.getValue()),t.gate.setValue(se(this,Te,"f").gate.getValue())})}get midiEffects(){return se(this,sx,"f")}get inputAdapter(){return m.wrap(this)}get audioEffects(){return se(this,Vf,"f")}get labelField(){return ze(se(this,Te,"f").file.targetVertex.unwrap().box,br).fileName}get enabledField(){return se(this,Te,"f").enabled}get minimizedField(){return se(this,Te,"f").minimized}device(){return se(this,ws,"f").boxAdapters.adapterFor(se(this,Te,"f").device.targetVertex.unwrap().box,As)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>m.None};for(let e of se(this,Vf,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,ac,"f").terminate()}};ac=new WeakMap,ws=new WeakMap,Te=new WeakMap,sx=new WeakMap,Vf=new WeakMap,Ri=new WeakMap,sc=new WeakMap,UA=new WeakSet,GB=function(e){return{gate:se(this,Ri,"f").createParameter(e.gate,w.linearInteger(0,2),_.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,Ri,"f").createParameter(e.mute,w.bool,_.bool,"Mute"),solo:se(this,Ri,"f").createParameter(e.solo,w.bool,_.bool,"Solo"),polyphone:se(this,Ri,"f").createParameter(e.polyphone,w.bool,_.bool,"Polyphone"),exclude:se(this,Ri,"f").createParameter(e.exclude,w.bool,_.bool,"Exclude"),pitch:se(this,Ri,"f").createParameter(e.pitch,w.linear(-1200,1200),_.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,Ri,"f").createParameter(e.sampleStart,w.unipolar(),_.percent(),"Start",0),sampleEnd:se(this,Ri,"f").createParameter(e.sampleEnd,w.unipolar(),_.percent(),"End",1),attack:se(this,Ri,"f").createParameter(e.attack,w.exponential(.001,5),_.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,Ri,"f").createParameter(e.release,w.exponential(.001,5),_.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var lx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Qr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wd,Hn,Ad,cx,As=class{constructor(e,t){this.type="instrument",this.accepts="midi",this.manualUrl=pe.Playfield,wd.set(this,void 0),Hn.set(this,void 0),Ad.set(this,void 0),cx.set(this,void 0),lx(this,wd,e,"f"),lx(this,Hn,t,"f"),lx(this,Ad,ar.create(t.samples,n=>e.boxAdapters.adapterFor(n,bd),c.Sample),"f"),lx(this,cx,new be(Qr(this,wd,"f")),"f")}reset(){Qr(this,Ad,"f").adapters().forEach(e=>e.box.delete())}get box(){return Qr(this,Hn,"f")}get uuid(){return Qr(this,Hn,"f").address.uuid}get address(){return Qr(this,Hn,"f").address}get labelField(){return Qr(this,Hn,"f").label}get iconField(){return Qr(this,Hn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return Qr(this,Hn,"f").enabled}get minimizedField(){return Qr(this,Hn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Qr(this,Ad,"f")}get context(){return Qr(this,wd,"f")}deviceHost(){return Qr(this,wd,"f").boxAdapters.adapterFor(Qr(this,Hn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None};for(let e of Qr(this,Ad,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){Qr(this,cx,"f").terminate()}};wd=new WeakMap,Hn=new WeakMap,Ad=new WeakMap,cx=new WeakMap;var jA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ur=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},LA,zf,fn,Oo,qB,_d=class{constructor(e,t){LA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.StereoTool,zf.set(this,void 0),fn.set(this,void 0),Oo.set(this,void 0),jA(this,zf,e,"f"),jA(this,fn,t,"f"),jA(this,Oo,new be(ur(this,zf,"f")),"f"),this.namedParameter=ur(this,LA,"m",qB).call(this,t)}get box(){return ur(this,fn,"f")}get uuid(){return ur(this,fn,"f").address.uuid}get address(){return ur(this,fn,"f").address}get indexField(){return ur(this,fn,"f").index}get labelField(){return ur(this,fn,"f").label}get enabledField(){return ur(this,fn,"f").enabled}get minimizedField(){return ur(this,fn,"f").minimized}get host(){return ur(this,fn,"f").host}deviceHost(){return ur(this,zf,"f").boxAdapters.adapterFor(ur(this,fn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ur(this,Oo,"f").terminate()}};zf=new WeakMap,fn=new WeakMap,Oo=new WeakMap,LA=new WeakSet,qB=function(e){return{volume:ur(this,Oo,"f").createParameter(e.volume,w.decibel(-72,0,12),_.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:ur(this,Oo,"f").createParameter(e.panning,w.bipolar(),_.panning,"Panning",.5),stereo:ur(this,Oo,"f").createParameter(e.stereo,w.bipolar(),_.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:ur(this,Oo,"f").createParameter(e.invertL,w.bool,_.bool,"Invert Left"),invertR:ur(this,Oo,"f").createParameter(e.invertR,w.bool,_.bool,"Invert Right"),swap:ur(this,Oo,"f").createParameter(e.swap,w.bool,_.bool,"Swap")}};var lc;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(lc||(lc={}));var HB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Pd,mi,Sd=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Zeitgeist,Pd.set(this,void 0),mi.set(this,void 0),HB(this,Pd,e,"f"),HB(this,mi,t,"f"),this.groove()}get box(){return fi(this,mi,"f")}get uuid(){return fi(this,mi,"f").address.uuid}get address(){return fi(this,mi,"f").address}get indexField(){return fi(this,mi,"f").index}get labelField(){return fi(this,mi,"f").label}get enabledField(){return fi(this,mi,"f").enabled}get minimizedField(){return fi(this,mi,"f").minimized}get host(){return fi(this,mi,"f").host}deviceHost(){return fi(this,Pd,"f").boxAdapters.adapterFor(fi(this,mi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}groove(){return fi(this,Pd,"f").boxAdapters.adapterFor(fi(this,mi,"f").groove.targetVertex.unwrap("no groove").box,lc.checkType)}catchupAndSubscribeGroove(e){return fi(this,mi,"f").groove.catchupAndSubscribe(t=>e(fi(this,Pd,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,lc.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Pd=new WeakMap,mi=new WeakMap;var JB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Jn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ux,Ci,Ed=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",this.manualUrl="",ux.set(this,void 0),Ci.set(this,void 0),JB(this,ux,e,"f"),JB(this,Ci,t,"f")}get box(){return Jn(this,Ci,"f")}get uuid(){return Jn(this,Ci,"f").address.uuid}get address(){return Jn(this,Ci,"f").address}get indexField(){return Jn(this,Ci,"f").index}get labelField(){return Jn(this,Ci,"f").label}get enabledField(){return Jn(this,Ci,"f").enabled}get minimizedField(){return Jn(this,Ci,"f").minimized}get host(){return Jn(this,Ci,"f").host}get commentField(){return Jn(this,Ci,"f").comment}deviceHost(){return Jn(this,ux,"f").boxAdapters.adapterFor(Jn(this,Ci,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};ux=new WeakMap,Ci=new WeakMap;var QB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Qn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},dx,Oi,Fd=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",this.manualUrl="",dx.set(this,void 0),Oi.set(this,void 0),QB(this,dx,e,"f"),QB(this,Oi,t,"f")}get box(){return Qn(this,Oi,"f")}get uuid(){return Qn(this,Oi,"f").address.uuid}get address(){return Qn(this,Oi,"f").address}get indexField(){return Qn(this,Oi,"f").index}get labelField(){return Qn(this,Oi,"f").label}get enabledField(){return Qn(this,Oi,"f").enabled}get minimizedField(){return Qn(this,Oi,"f").minimized}get host(){return Qn(this,Oi,"f").host}get commentField(){return Qn(this,Oi,"f").comment}deviceHost(){return Qn(this,dx,"f").boxAdapters.adapterFor(Qn(this,Oi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};dx=new WeakMap,Oi=new WeakMap;var _s=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ze=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},KA,WA,Uf,gi,px,Bd,Yn,mn,Nd,YB,ZA,Id=class{constructor(e,t){KA.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=pe.Soundfont,WA.set(this,new j),Uf.set(this,void 0),gi.set(this,void 0),px.set(this,void 0),Bd.set(this,void 0),Yn.set(this,void 0),mn.set(this,void 0),Nd.set(this,re.Empty),ZA.set(this,n=>n.match({none:()=>{Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear(),Ze(this,Nd,"f").terminate(),_s(this,Nd,i.subscribe(o=>{if(o.type==="loaded"){let a=i.soundfont.unwrap();Ze(this,mn,"f").wrap(a.presets[this.presetIndex]??a.presets[0]),Ze(this,Yn,"f").wrap(a)}else o.type==="error"?(Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear()):o.type==="idle"&&(Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear())}),"f")},some:o=>{Ze(this,Yn,"f").wrap(o),Ze(this,mn,"f").wrap(o.presets[this.presetIndex]??o.presets[0])}})})),_s(this,Uf,e,"f"),_s(this,gi,t,"f"),_s(this,px,new be(Ze(this,Uf,"f")),"f"),this.namedParameter=Ze(this,KA,"m",YB).call(this,t),_s(this,Bd,new Dr,"f"),_s(this,Yn,new Dr,"f"),_s(this,mn,new Dr,"f"),Ze(this,WA,"f").ownAll(Ze(this,Bd,"f").subscribe(Ze(this,ZA,"f")),Ze(this,gi,"f").file.catchupAndSubscribe(({targetVertex:n})=>Ze(this,Bd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ze(this,gi,"f").presetIndex.catchupAndSubscribe(n=>Ze(this,Yn,"f").match({none:()=>Ze(this,mn,"f").clear(),some:i=>Ze(this,mn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Ze(this,Bd,"f")}get soundfont(){return Ze(this,Yn,"f")}get preset(){return Ze(this,mn,"f")}get presetIndex(){return Ze(this,gi,"f").presetIndex.getValue()}get box(){return Ze(this,gi,"f")}get uuid(){return Ze(this,gi,"f").address.uuid}get address(){return Ze(this,gi,"f").address}get labelField(){return Ze(this,gi,"f").label}get iconField(){return Ze(this,gi,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return Ze(this,gi,"f").enabled}get minimizedField(){return Ze(this,gi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ze(this,Uf,"f").boxAdapters.adapterFor(Ze(this,gi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ze(this,Nd,"f").terminate(),_s(this,Nd,re.Empty,"f"),Ze(this,px,"f").terminate()}};WA=new WeakMap,Uf=new WeakMap,gi=new WeakMap,px=new WeakMap,Bd=new WeakMap,Yn=new WeakMap,mn=new WeakMap,Nd=new WeakMap,ZA=new WeakMap,KA=new WeakSet,YB=function(e){return{}};var XB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jf=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},hx,cc,fx=class{constructor(e,t){hx.set(this,void 0),cc.set(this,void 0),XB(this,hx,e,"f"),XB(this,cc,t,"f")}get box(){return jf(this,cc,"f")}get uuid(){return jf(this,cc,"f").address.uuid}get address(){return jf(this,cc,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return jf(this,hx,"f").soundfontManager.getOrCreate(jf(this,cc,"f").address.uuid)}terminate(){}};hx=new WeakMap,cc=new WeakMap;var GA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},vi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qA,Lf,gn,Kf,eN,Dd=class{constructor(e,t){qA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Maximizer,Lf.set(this,void 0),gn.set(this,void 0),Kf.set(this,void 0),GA(this,Lf,e,"f"),GA(this,gn,t,"f"),GA(this,Kf,new be(vi(this,Lf,"f")),"f"),this.namedParameter=vi(this,qA,"m",eN).call(this,t)}get box(){return vi(this,gn,"f")}get uuid(){return vi(this,gn,"f").address.uuid}get address(){return vi(this,gn,"f").address}get indexField(){return vi(this,gn,"f").index}get labelField(){return vi(this,gn,"f").label}get enabledField(){return vi(this,gn,"f").enabled}get minimizedField(){return vi(this,gn,"f").minimized}get host(){return vi(this,gn,"f").host}deviceHost(){return vi(this,Lf,"f").boxAdapters.adapterFor(vi(this,gn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){vi(this,Kf,"f").terminate()}};Lf=new WeakMap,gn=new WeakMap,Kf=new WeakMap,qA=new WeakSet,eN=function(e){return{threshold:vi(this,Kf,"f").createParameter(e.threshold,w.linear(-24,0),_.decible,"Threshold")}};var HA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},At=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},JA,Wf,Vi,Vr,tN,kd=class{constructor(e,t){JA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Compressor,Wf.set(this,void 0),Vi.set(this,void 0),Vr.set(this,void 0),HA(this,Wf,e,"f"),HA(this,Vi,t,"f"),HA(this,Vr,new be(At(this,Wf,"f")),"f"),this.namedParameter=At(this,JA,"m",tN).call(this,t)}get box(){return At(this,Vi,"f")}get uuid(){return At(this,Vi,"f").address.uuid}get address(){return At(this,Vi,"f").address}get indexField(){return At(this,Vi,"f").index}get labelField(){return At(this,Vi,"f").label}get enabledField(){return At(this,Vi,"f").enabled}get minimizedField(){return At(this,Vi,"f").minimized}get host(){return At(this,Vi,"f").host}get sideChain(){return At(this,Vi,"f").sideChain}deviceHost(){return At(this,Wf,"f").boxAdapters.adapterFor(At(this,Vi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){At(this,Vr,"f").terminate()}};Wf=new WeakMap,Vi=new WeakMap,Vr=new WeakMap,JA=new WeakSet,tN=function(e){return{lookahead:At(this,Vr,"f").createParameter(e.lookahead,w.bool,_.bool,"Lookahead"),automakeup:At(this,Vr,"f").createParameter(e.automakeup,w.bool,_.bool,"Auto Makeup"),autoattack:At(this,Vr,"f").createParameter(e.autoattack,w.bool,_.bool,"Auto Attack"),autorelease:At(this,Vr,"f").createParameter(e.autorelease,w.bool,_.bool,"Auto Release"),inputgain:At(this,Vr,"f").createParameter(e.inputgain,w.linear(-30,30),_.decible,"Input Gain"),threshold:At(this,Vr,"f").createParameter(e.threshold,w.linear(-60,0),_.decible,"Threshold"),ratio:At(this,Vr,"f").createParameter(e.ratio,w.exponential(1,24),_.numeric({fractionDigits:1}),"Ratio"),knee:At(this,Vr,"f").createParameter(e.knee,w.linear(0,24),_.decible,"Knee"),attack:At(this,Vr,"f").createParameter(e.attack,w.linear(0,100),_.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:At(this,Vr,"f").createParameter(e.release,w.linear(5,1500),_.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:At(this,Vr,"f").createParameter(e.makeup,w.linear(-40,40),_.decible,"Makeup Gain"),mix:At(this,Vr,"f").createParameter(e.mix,w.unipolar(),_.percent(),"Dry/Wet")}};var QA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},YA,Zf,zi,Xn,rN,Md=class{constructor(e,t){YA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Gate,Zf.set(this,void 0),zi.set(this,void 0),Xn.set(this,void 0),QA(this,Zf,e,"f"),QA(this,zi,t,"f"),QA(this,Xn,new be(Gt(this,Zf,"f")),"f"),this.namedParameter=Gt(this,YA,"m",rN).call(this,t)}get box(){return Gt(this,zi,"f")}get uuid(){return Gt(this,zi,"f").address.uuid}get address(){return Gt(this,zi,"f").address}get indexField(){return Gt(this,zi,"f").index}get labelField(){return Gt(this,zi,"f").label}get enabledField(){return Gt(this,zi,"f").enabled}get minimizedField(){return Gt(this,zi,"f").minimized}get host(){return Gt(this,zi,"f").host}get sideChain(){return Gt(this,zi,"f").sideChain}deviceHost(){return Gt(this,Zf,"f").boxAdapters.adapterFor(Gt(this,zi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Gt(this,Xn,"f").terminate()}};Zf=new WeakMap,zi=new WeakMap,Xn=new WeakMap,YA=new WeakSet,rN=function(e){return{inverse:Gt(this,Xn,"f").createParameter(e.inverse,w.bool,_.bool,"Inverse"),threshold:Gt(this,Xn,"f").createParameter(e.threshold,w.linear(-80,0),_.decible,"Threshold"),return:Gt(this,Xn,"f").createParameter(e.return,w.linear(0,24),_.decible,"Return"),attack:Gt(this,Xn,"f").createParameter(e.attack,w.linear(0,50),_.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Gt(this,Xn,"f").createParameter(e.hold,w.linear(0,500),_.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Gt(this,Xn,"f").createParameter(e.release,w.linear(1,2e3),_.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Gt(this,Xn,"f").createParameter(e.floor,w.decibel(-72,-12,0),_.decible,"Floor")}};var XA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Fr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},e_,Gf,vn,Ps,iN,$d=class{constructor(e,t){e_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Crusher,Gf.set(this,void 0),vn.set(this,void 0),Ps.set(this,void 0),XA(this,Gf,e,"f"),XA(this,vn,t,"f"),XA(this,Ps,new be(Fr(this,Gf,"f")),"f"),this.namedParameter=Fr(this,e_,"m",iN).call(this,t)}get box(){return Fr(this,vn,"f")}get uuid(){return Fr(this,vn,"f").address.uuid}get address(){return Fr(this,vn,"f").address}get indexField(){return Fr(this,vn,"f").index}get labelField(){return Fr(this,vn,"f").label}get enabledField(){return Fr(this,vn,"f").enabled}get minimizedField(){return Fr(this,vn,"f").minimized}get host(){return Fr(this,vn,"f").host}deviceHost(){return Fr(this,Gf,"f").boxAdapters.adapterFor(Fr(this,vn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Fr(this,Ps,"f").terminate()}};Gf=new WeakMap,vn=new WeakMap,Ps=new WeakMap,e_=new WeakSet,iN=function(e){return{crush:Fr(this,Ps,"f").createParameter(e.crush,w.unipolar(),_.percent(),"Crush"),bits:Fr(this,Ps,"f").createParameter(e.bits,w.linearInteger(1,16),_.numeric(),"Bits"),boost:Fr(this,Ps,"f").createParameter(e.boost,w.linear(0,24),_.decible,"Boost"),mix:Fr(this,Ps,"f").createParameter(e.mix,w.exponential(.001,1),_.percent(),"Mix")}};var t_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Yr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},r_,qf,yn,Td,nN,Rd=class{constructor(e,t){r_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Fold,qf.set(this,void 0),yn.set(this,void 0),Td.set(this,void 0),t_(this,qf,e,"f"),t_(this,yn,t,"f"),t_(this,Td,new be(Yr(this,qf,"f")),"f"),this.namedParameter=Yr(this,r_,"m",nN).call(this,t)}get box(){return Yr(this,yn,"f")}get uuid(){return Yr(this,yn,"f").address.uuid}get address(){return Yr(this,yn,"f").address}get indexField(){return Yr(this,yn,"f").index}get labelField(){return Yr(this,yn,"f").label}get enabledField(){return Yr(this,yn,"f").enabled}get minimizedField(){return Yr(this,yn,"f").minimized}get host(){return Yr(this,yn,"f").host}deviceHost(){return Yr(this,qf,"f").boxAdapters.adapterFor(Yr(this,yn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Yr(this,Td,"f").terminate()}};qf=new WeakMap,yn=new WeakMap,Td=new WeakMap,r_=new WeakSet,nN=function(e){return{drive:Yr(this,Td,"f").createParameter(e.drive,w.linear(0,30),_.decible,"Drive"),volume:Yr(this,Td,"f").createParameter(e.volume,w.linear(-18,0),_.decible,"Volume")}};var mx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ir=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Hf,Jf,xn,Cd,Od,Vd=class{constructor(e,t){Hf.set(this,new j),this.type="instrument",this.accepts="midi",this.manualUrl=pe.MIDIOutput,Jf.set(this,void 0),xn.set(this,void 0),Cd.set(this,void 0),Od.set(this,void 0),mx(this,Jf,e,"f"),mx(this,xn,t,"f"),mx(this,Cd,new Dr,"f"),mx(this,Od,ir(this,Hf,"f").own(new be(ir(this,Jf,"f"))),"f"),ir(this,Hf,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>ir(this,Od,"f").createParameter(ze(n,$n).value,w.unipolar(),_.percent({fractionDigits:1}),"",0),onRemoved:({box:n})=>ir(this,Od,"f").removeParameter(ze(n,$n).value.address)}),ir(this,xn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>ir(this,Cd,"f").clear(),some:({box:i})=>ir(this,Cd,"f").wrap(ze(i,Mn))})))}get box(){return ir(this,xn,"f")}get uuid(){return ir(this,xn,"f").address.uuid}get address(){return ir(this,xn,"f").address}get labelField(){return ir(this,xn,"f").label}get iconField(){return ir(this,xn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return ir(this,xn,"f").enabled}get minimizedField(){return ir(this,xn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return ir(this,Od,"f")}get midiDevice(){return ir(this,Cd,"f")}deviceHost(){return ir(this,Jf,"f").boxAdapters.adapterFor(ir(this,xn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ir(this,Hf,"f").terminate()}};Hf=new WeakMap,Jf=new WeakMap,xn=new WeakMap,Cd=new WeakMap,Od=new WeakMap;var gx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},qt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},i_,Qf,bn,Vo,Yf,oN,zd=class{constructor(e,t){i_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Velocity,Qf.set(this,void 0),bn.set(this,void 0),Vo.set(this,void 0),Yf.set(this,void 0),gx(this,Qf,e,"f"),gx(this,bn,t,"f"),gx(this,Vo,new be(qt(this,Qf,"f")),"f"),gx(this,Yf,Tc.create(),"f"),this.namedParameter=qt(this,i_,"m",oN).call(this,t)}computeVelocity(e,t){let{magnetPosition:n,magnetStrength:i,randomSeed:o,randomAmount:a,offset:s,mix:l}=this.namedParameter;qt(this,Yf,"f").setSeed(o.valueAt(e)+e);let u=t+(n.valueAt(e)-t)*i.valueAt(e),p=(qt(this,Yf,"f").uniform()*2-1)*a.valueAt(e),d=s.valueAt(e),h=l.valueAt(e);return t*(1-h)+Gi(u+p+d)*h}get box(){return qt(this,bn,"f")}get uuid(){return qt(this,bn,"f").address.uuid}get address(){return qt(this,bn,"f").address}get indexField(){return qt(this,bn,"f").index}get labelField(){return qt(this,bn,"f").label}get enabledField(){return qt(this,bn,"f").enabled}get minimizedField(){return qt(this,bn,"f").minimized}get host(){return qt(this,bn,"f").host}deviceHost(){return qt(this,Qf,"f").boxAdapters.adapterFor(qt(this,bn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){qt(this,Vo,"f").terminate()}};Qf=new WeakMap,bn=new WeakMap,Vo=new WeakMap,Yf=new WeakMap,i_=new WeakSet,oN=function(e){return{magnetPosition:qt(this,Vo,"f").createParameter(e.magnetPosition,w.unipolar(),_.percent(),"Position"),magnetStrength:qt(this,Vo,"f").createParameter(e.magnetStrength,w.unipolar(),_.percent(),"Strength"),randomSeed:qt(this,Vo,"f").createParameter(e.randomSeed,w.linearInteger(0,65535),_.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:qt(this,Vo,"f").createParameter(e.randomAmount,w.unipolar(),_.percent(),"Amount"),offset:qt(this,Vo,"f").createParameter(e.offset,w.bipolar(),_.percent(),"Offset"),mix:qt(this,Vo,"f").createParameter(e.mix,w.unipolar(),_.percent(),"Mix")}};var n_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},o_,a_,Xf,wn,zo,aN,eo=class{constructor(e,t){o_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Tidal,Xf.set(this,void 0),wn.set(this,void 0),zo.set(this,void 0),n_(this,Xf,e,"f"),n_(this,wn,t,"f"),n_(this,zo,new be(dr(this,Xf,"f")),"f"),this.namedParameter=dr(this,o_,"m",aN).call(this,t)}get box(){return dr(this,wn,"f")}get uuid(){return dr(this,wn,"f").address.uuid}get address(){return dr(this,wn,"f").address}get indexField(){return dr(this,wn,"f").index}get labelField(){return dr(this,wn,"f").label}get enabledField(){return dr(this,wn,"f").enabled}get minimizedField(){return dr(this,wn,"f").minimized}get host(){return dr(this,wn,"f").host}deviceHost(){return dr(this,Xf,"f").boxAdapters.adapterFor(dr(this,wn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){dr(this,zo,"f").terminate()}};a_=eo,Xf=new WeakMap,wn=new WeakMap,zo=new WeakMap,o_=new WeakSet,aN=function(e){let{RateFractions:t,RateStringMapping:n}=a_;return{slope:dr(this,zo,"f").createParameter(e.slope,w.bipolar(),_.percent({fractionDigits:1}),"Slope",.5),symmetry:dr(this,zo,"f").createParameter(e.symmetry,w.unipolar(),_.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:dr(this,zo,"f").createParameter(e.rate,w.values(t.map((i,o)=>o)),n,"Rate",0),depth:dr(this,zo,"f").createParameter(e.depth,w.unipolar(),_.percent({fractionDigits:1}),"Depth",0),offset:dr(this,zo,"f").createParameter(e.offset,w.linear(-180,180),_.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:dr(this,zo,"f").createParameter(e.channelOffset,w.linear(-180,180),_.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};eo.RateFractions=xr.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();eo.RateStringMapping=_.indices("",a_.RateFractions.map(([r,e])=>`${r}/${e}`));var s_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ft=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},l_,em,An,zr,sN,Ud=class{constructor(e,t){l_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.DattorroReverb,em.set(this,void 0),An.set(this,void 0),zr.set(this,void 0),s_(this,em,e,"f"),s_(this,An,t,"f"),s_(this,zr,new be(Ft(this,em,"f")),"f"),this.namedParameter=Ft(this,l_,"m",sN).call(this,t)}get box(){return Ft(this,An,"f")}get uuid(){return Ft(this,An,"f").address.uuid}get address(){return Ft(this,An,"f").address}get indexField(){return Ft(this,An,"f").index}get labelField(){return Ft(this,An,"f").label}get enabledField(){return Ft(this,An,"f").enabled}get minimizedField(){return Ft(this,An,"f").minimized}get host(){return Ft(this,An,"f").host}deviceHost(){return Ft(this,em,"f").boxAdapters.adapterFor(Ft(this,An,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ft(this,zr,"f").terminate()}};em=new WeakMap,An=new WeakMap,zr=new WeakMap,l_=new WeakSet,sN=function(e){return{preDelay:Ft(this,zr,"f").createParameter(e.preDelay,w.linear(0,1e3),_.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:Ft(this,zr,"f").createParameter(e.bandwidth,w.unipolar(),_.percent(),"Bandwidth"),inputDiffusion1:Ft(this,zr,"f").createParameter(e.inputDiffusion1,w.unipolar(),_.percent(),"Tank 1"),inputDiffusion2:Ft(this,zr,"f").createParameter(e.inputDiffusion2,w.unipolar(),_.percent(),"Tank 2"),decay:Ft(this,zr,"f").createParameter(e.decay,w.unipolar(),_.percent(),"Decay"),decayDiffusion1:Ft(this,zr,"f").createParameter(e.decayDiffusion1,w.unipolar(),_.percent(),"Tank 1"),decayDiffusion2:Ft(this,zr,"f").createParameter(e.decayDiffusion2,w.unipolar(),_.percent(),"Tank 2"),damping:Ft(this,zr,"f").createParameter(e.damping,w.unipolar(),_.percent(),"Damping"),excursionRate:Ft(this,zr,"f").createParameter(e.excursionRate,w.unipolar(),_.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:Ft(this,zr,"f").createParameter(e.excursionDepth,w.unipolar(),_.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:Ft(this,zr,"f").createParameter(e.wet,w.DefaultDecibel,_.decible,"Wet"),dry:Ft(this,zr,"f").createParameter(e.dry,w.DefaultDecibel,_.decible,"Dry")}};var lN=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jd=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},c_,Pa,Ld=class{constructor(e,t){c_.set(this,void 0),Pa.set(this,void 0),lN(this,c_,e,"f"),lN(this,Pa,t,"f")}get box(){return jd(this,Pa,"f")}get uuid(){return jd(this,Pa,"f").address.uuid}get address(){return jd(this,Pa,"f").address}get labelField(){return jd(this,Pa,"f").label}get modelField(){return jd(this,Pa,"f").model}getModelJson(){return jd(this,Pa,"f").model.getValue()}terminate(){}};c_=new WeakMap,Pa=new WeakMap;var u_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Lt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},d_,Kd,Br,uc,cN,Wd=class{constructor(e,t){d_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.NeuralAmp,Kd.set(this,void 0),Br.set(this,void 0),uc.set(this,void 0),u_(this,Kd,e,"f"),u_(this,Br,t,"f"),u_(this,uc,new be(Lt(this,Kd,"f")),"f"),this.namedParameter=Lt(this,d_,"m",cN).call(this,t)}get box(){return Lt(this,Br,"f")}get uuid(){return Lt(this,Br,"f").address.uuid}get address(){return Lt(this,Br,"f").address}get indexField(){return Lt(this,Br,"f").index}get labelField(){return Lt(this,Br,"f").label}get enabledField(){return Lt(this,Br,"f").enabled}get minimizedField(){return Lt(this,Br,"f").minimized}get host(){return Lt(this,Br,"f").host}get modelField(){return Lt(this,Br,"f").model}get monoField(){return Lt(this,Br,"f").mono}get spectrum(){return Lt(this,Br,"f").address.append(4095)}getModelAdapter(){let e=Lt(this,Br,"f").model.targetVertex;return e.isEmpty()?m.None:m.wrap(Lt(this,Kd,"f").boxAdapters.adapterFor(e.unwrap().box,Ld))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Lt(this,Br,"f").modelJson.getValue()}deviceHost(){return Lt(this,Kd,"f").boxAdapters.adapterFor(Lt(this,Br,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Lt(this,uc,"f").terminate()}};Kd=new WeakMap,Br=new WeakMap,uc=new WeakMap,d_=new WeakSet,cN=function(e){return{inputGain:Lt(this,uc,"f").createParameter(e.inputGain,w.decibel(-72,0,12),_.numeric({unit:"dB",fractionDigits:1}),"input"),outputGain:Lt(this,uc,"f").createParameter(e.outputGain,w.decibel(-72,0,12),_.numeric({unit:"dB",fractionDigits:1}),"output"),mix:Lt(this,uc,"f").createParameter(e.mix,w.linear(0,1),_.percent(),"Mix")}};var vx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},oe=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},p_,ue,Uo,tm,yx,uN,xx=class{constructor(e){p_.add(this),ue.set(this,void 0),Uo.set(this,void 0),tm.set(this,void 0),yx.set(this,void 0),vx(this,ue,e,"f"),vx(this,Uo,A.newSet(t=>t.uuid),"f"),vx(this,tm,new Set,"f"),vx(this,yx,oe(this,ue,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let n=oe(this,Uo,"f").getOrNull(t.uuid);q(n)&&(oe(this,tm,"f").add(n.box),oe(this,Uo,"f").removeByValue(n).terminate())}}}),"f")}terminate(){oe(this,Uo,"f").values().forEach(e=>e.terminate()),oe(this,Uo,"f").clear(),oe(this,yx,"f").terminate()}adapterFor(e,t){if(oe(this,tm,"f").has(e))return D(`Cannot resolve adapter for already deleted box: ${e}`);let n=oe(this,Uo,"f").getOrNull(e.address.uuid);if(n===null){n=oe(this,p_,"m",uN).call(this,e);let i=oe(this,Uo,"f").add(n);V(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?n instanceof t?n:D(`${n} is not instance of ${t}`):t(n)?n:D(`${n} did not pass custom type guard`):D("Unknown checkType method")}optAdapter(e){return oe(this,Uo,"f").opt(e.address.uuid)}};ue=new WeakMap,Uo=new WeakMap,tm=new WeakMap,yx=new WeakMap,p_=new WeakSet,uN=function(e){return ve(e.accept({visitArpeggioDeviceBox:t=>new Gn(oe(this,ue,"f"),t),visitAudioBusBox:t=>new qr(oe(this,ue,"f"),t),visitAudioClipBox:t=>new ts(oe(this,ue,"f"),t),visitAudioFileBox:t=>new Rn(oe(this,ue,"f"),t),visitAudioTimeStretchBox:t=>new _o(oe(this,ue,"f"),t),visitAudioPitchStretchBox:t=>new Ao(oe(this,ue,"f"),t),visitTransientMarkerBox:t=>new hu(t),visitWarpMarkerBox:t=>new es(oe(this,ue,"f"),t),visitAudioRegionBox:t=>new da(oe(this,ue,"f"),t),visitAudioUnitBox:t=>new rn(oe(this,ue,"f"),t),visitAuxSendBox:t=>new Lu(oe(this,ue,"f"),t),visitMaximizerDeviceBox:t=>new Dd(oe(this,ue,"f"),t),visitCompressorDeviceBox:t=>new kd(oe(this,ue,"f"),t),visitGateDeviceBox:t=>new Md(oe(this,ue,"f"),t),visitCrusherDeviceBox:t=>new $d(oe(this,ue,"f"),t),visitDattorroReverbDeviceBox:t=>new Ud(oe(this,ue,"f"),t),visitDelayDeviceBox:t=>new tr(oe(this,ue,"f"),t),visitDeviceInterfaceKnobBox:t=>new nd(oe(this,ue,"f"),t),visitTidalDeviceBox:t=>new eo(oe(this,ue,"f"),t),visitFoldDeviceBox:t=>new Rd(oe(this,ue,"f"),t),visitGrooveShuffleBox:t=>new Mo(oe(this,ue,"f"),t),visitMarkerBox:t=>new us(oe(this,ue,"f"),t),visitSignatureEventBox:t=>new Gl(oe(this,ue,"f"),t),visitMIDIOutputDeviceBox:t=>new Vd(oe(this,ue,"f"),t),visitModularAudioInputBox:t=>new rd(oe(this,ue,"f"),t),visitModularAudioOutputBox:t=>new Xu(oe(this,ue,"f"),t),visitModularBox:t=>new fs(oe(this,ue,"f"),t),visitModularDeviceBox:t=>new gs(oe(this,ue,"f"),t),visitModuleConnectionBox:t=>new hs(oe(this,ue,"f"),t),visitModuleDelayBox:t=>new Yu(oe(this,ue,"f"),t),visitModuleGainBox:t=>new ed(oe(this,ue,"f"),t),visitModuleMultiplierBox:t=>new td(oe(this,ue,"f"),t),visitNanoDeviceBox:t=>new yd(oe(this,ue,"f"),t),visitNeuralAmpDeviceBox:t=>new Wd(oe(this,ue,"f"),t),visitNeuralAmpModelBox:t=>new Ld(oe(this,ue,"f"),t),visitNoteClipBox:t=>new Pu(oe(this,ue,"f"),t),visitNoteEventBox:t=>new Pl(oe(this,ue,"f"),t),visitNoteEventCollectionBox:t=>new Qi(oe(this,ue,"f"),t),visitNoteRegionBox:t=>new os(oe(this,ue,"f"),t),visitPitchDeviceBox:t=>new gd(oe(this,ue,"f"),t),visitPlayfieldDeviceBox:t=>new As(oe(this,ue,"f"),t),visitPlayfieldSampleBox:t=>new bd(oe(this,ue,"f"),t),visitRevampDeviceBox:t=>new Ju(oe(this,ue,"f"),t),visitReverbDeviceBox:t=>new Hu(oe(this,ue,"f"),t),visitRootBox:t=>new hd(oe(this,ue,"f"),t),visitSoundfontDeviceBox:t=>new Id(oe(this,ue,"f"),t),visitSoundfontFileBox:t=>new fx(oe(this,ue,"f"),t),visitStereoToolDeviceBox:t=>new _d(oe(this,ue,"f"),t),visitTapeDeviceBox:t=>new fd(oe(this,ue,"f"),t),visitTimelineBox:t=>new sn(oe(this,ue,"f"),t),visitTrackBox:t=>new Vt(oe(this,ue,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new Ed(oe(this,ue,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new Fd(oe(this,ue,"f"),t),visitValueClipBox:t=>new Xa(oe(this,ue,"f"),t),visitValueEventBox:t=>new sa(oe(this,ue,"f"),t),visitValueEventCollectionBox:t=>new Ar(oe(this,ue,"f"),t),visitValueRegionBox:t=>new ma(oe(this,ue,"f"),t),visitVaporisateurDeviceBox:t=>new md(oe(this,ue,"f"),t),visitVelocityDeviceBox:t=>new zd(oe(this,ue,"f"),t),visitZeitgeistDeviceBox:t=>new Sd(oe(this,ue,"f"),t)}),`Could not find factory for ${e}`)};var Zd;(function(r){r.PEAKS=ke.compose(A.Lowest).append(0),r.SPECTRUM=ke.compose(A.Lowest).append(1),r.WAVEFORM=ke.compose(A.Lowest).append(2)})(Zd||(Zd={}));var dN;(function(r){r.countStems=e=>e.match({none:()=>1,some:t=>Object.keys(t).length}),r.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),r.sanitizeExportNamesInPlace=e=>{let t=new Map,n=i=>{let o=t.get(i)??0,a=i;for(;t.has(a);)o++,a=`${i} ${o}`;return t.set(i,o),t.set(a,1),a};Object.keys(e).forEach(i=>{let o=e[i];o.fileName=n(r.sanitizeFileName(o.fileName))})}})(dN||(dN={}));var bx=512,pN=yr.createBuilder({position:yr.float,bpm:yr.float,playbackTimestamp:yr.float,countInBeatsRemaining:yr.float,isPlaying:yr.bool,isCountingIn:yr.bool,isRecording:yr.bool,perfIndex:yr.int32,perfBuffer:yr.floats(bx)});var hN;(function(r){r.store=(e,t,n)=>{if(n==="")return D("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(c.MetaData).map(({box:a})=>a).find(a=>a instanceof ia&&a.origin.getValue()===n),o=a=>{a.target.refer(e),a.origin.setValue(n),a.value.setValue(JSON.stringify(t))};Ws(i)?o(i):ia.create(e.graph,A.generate(),o)},r.read=(e,t)=>{if(t==="")return D("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(c.MetaData).map(({box:i})=>i).find(i=>i instanceof ia&&i.origin.getValue()===t);if(Ws(n)){let{status:i,value:o,error:a}=Jo(()=>JSON.parse(n.value.getValue()));if(i==="success")return o;console.warn(a)}return null},r.clear=(e,t)=>{if(t==="")return D("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(c.MetaData).map(({box:n})=>n).filter(n=>n instanceof ia&&n.origin.getValue()===t).forEach(n=>n.delete())}})(hN||(hN={}));var h_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ss=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wx,Ax,_x,dc,_n=class{constructor(e,t){wx.set(this,new j),Ax.set(this,void 0),_x.set(this,void 0),dc.set(this,void 0),h_(this,Ax,e,"f"),h_(this,_x,t,"f"),h_(this,dc,new _t(128),"f"),Ss(this,wx,"f").own(Ss(this,Ax,"f").broadcastIntegers(Ss(this,_x,"f"),new Int32Array(Ss(this,dc,"f").buffer),n=>{}))}noteOn(e){e>=0&&e<128&&Ss(this,dc,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&Ss(this,dc,"f").setBit(e,!1)}reset(){}clear(){Ss(this,dc,"f").clear()}terminate(){Ss(this,wx,"f").terminate()}toString(){return`{${this.constructor.name}}`}};wx=new WeakMap,Ax=new WeakMap,_x=new WeakMap,dc=new WeakMap;var Bt;(function(r){let e;(function(t){t[t.NoteOn=144]="NoteOn",t[t.NoteOff=128]="NoteOff",t[t.PitchBend=224]="PitchBend",t[t.Controller=176]="Controller",t[t.Start=250]="Start",t[t.Continue=251]="Continue",t[t.Stop=252]="Stop",t[t.Clock=248]="Clock",t[t.Position=242]="Position"})(e=r.Command||(r.Command={})),r.readCommand=t=>t[0]&240,r.readChannel=t=>t[0]&15,r.readParam1=t=>t.length>1?t[1]&255:0,r.readParam2=t=>t.length>2?t[2]&255:0,r.readPitch=t=>t[1],r.readVelocity=t=>t[2]/127,r.isNoteOn=t=>r.readCommand(t)===e.NoteOn&&r.readVelocity(t)>0,r.isNoteOff=t=>r.readCommand(t)===e.NoteOff||r.readCommand(t)===e.NoteOn&&r.readVelocity(t)===0,r.isPitchWheel=t=>r.readCommand(t)===e.PitchBend,r.isController=t=>r.readCommand(t)===e.Controller,r.isClock=t=>t[0]===e.Clock,r.isStart=t=>t[0]===e.Start,r.isContinue=t=>t[0]===e.Continue,r.isStop=t=>t[0]===e.Stop,r.isPosition=t=>t[0]===e.Position,r.asPitchBend=t=>{let n=r.readParam1(t)&127,i=r.readParam2(t)&127,o=n|i<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.asValue=t=>{let n=r.readParam2(t);return n>64?.5+(n-63)/128:n<64?n/128:.5},r.Clock=new Uint8Array([e.Clock]),r.Start=new Uint8Array([e.Start]),r.Continue=new Uint8Array([e.Continue]),r.Stop=new Uint8Array([e.Stop]),r.noteOn=(t,n,i)=>new Uint8Array([e.NoteOn|t,n,i]),r.noteOff=(t,n)=>new Uint8Array([e.NoteOff|t,n,0]),r.control=(t,n,i)=>new Uint8Array([e.Controller|t,n&127,i&127]),r.position=(t,n)=>new Uint8Array([e.Position,t&127,n&127]),r.positionInPPQN=t=>{let n=Math.floor(t/96),i=n&127,o=n>>7&127;return new Uint8Array([e.Position,i,o])},r.accept=(t,n)=>{so(t)||(r.isNoteOn(t)?P(n.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?P(n.noteOff,r.readPitch(t)):r.isPitchWheel(t)?P(n.pitchBend,r.asPitchBend(t)):r.isController(t)?P(n.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?P(n.clock):r.isStart(t)?P(n.start):r.isContinue(t)?P(n.continue):r.isStop(t)?P(n.stop):r.isPosition(t)&&P(n.songPos,r.readParam1(t)|r.readParam2(t)<<7))},r.debug=t=>t===null?"null":r.isNoteOn(t)?`NoteOn #${r.readChannel(t)} ${r.readPitch(t)} : ${r.readVelocity(t).toFixed(2)}`:r.isNoteOff(t)?`NoteOff #${r.readChannel(t)} ${r.readPitch(t)}`:r.isPitchWheel(t)?`PitchWheel #${r.readChannel(t)} ${r.asPitchBend(t)}`:r.isController(t)?`Control #${r.readChannel(t)} ${r.asValue(t)}`:r.isClock(t)?"Clock":r.isStart(t)?"Start":r.isContinue(t)?"Continue":r.isStop(t)?"Stop":r.isPosition(t)?`SongPosition ${r.readParam1(t)|r.readParam2(t)<<7}`:"Unknown"})(Bt||(Bt={}));var Sa;(function(r){r.on=(e,t,n)=>({type:"note-on",uuid:e,pitch:t,velocity:n}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.audition=(e,t,n,i)=>({type:"note-audition",uuid:e,pitch:t,duration:n,velocity:i}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.isAudition=e=>e.type==="note-audition",r.fromEvent=(e,t)=>{let n=e.data;if(Bt.isNoteOn(n)){let i=Bt.readPitch(n),o=Bt.readVelocity(n);return{type:"note-on",uuid:t,pitch:i,velocity:o}}else if(Bt.isNoteOff(n)){let i=Bt.readPitch(n);return{type:"note-off",uuid:t,pitch:i}}return D("Unknown MIDI event")}})(Sa||(Sa={}));var fN;(function(r){r.start=(e,t,n,i=1)=>{let o=!0;return e(Sa.on(t,n,i)),{terminate:()=>{o&&(e(Sa.off(t,n)),o=!1)}}}})(fN||(fN={}));var BM,NM,IM,DM,kM;BM=new WeakMap,NM=new WeakMap,IM=new WeakMap,DM=new WeakMap,kM=new WeakMap;var mN=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gd=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},pc,rm,Px=class{constructor(){pc.set(this,void 0),rm.set(this,void 0),mN(this,pc,ke.newSet(e=>e.field.address),"f"),mN(this,rm,new ce,"f")}register(e){return Gd(this,pc,"f").add(e),{terminate:()=>Gd(this,pc,"f").removeByValue(e)}}get(e){return Gd(this,pc,"f").get(e)}opt(e){return Gd(this,pc,"f").opt(e)}subscribeWrites(e){return Gd(this,rm,"f").subscribe(e)}notifyWrite(e,t){Gd(this,rm,"f").notify({adapter:e,previousUnitValue:t})}};pc=new WeakMap,rm=new WeakMap;var Es={isClipBox:r=>r.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:r=>r.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??D("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var im={min:30,max:1e3};var Sx;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?co.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||t&t-1?co.err("Denominator must be a power of two between 1 and 32"):co.ok([e,t]),r.clampBpm=e=>Number.isFinite(e)?we(e,im.min,im.max):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:n=>{for(let[i,o]of U.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:a})=>Es.asRegionBox(a)).sort(({position:a},{position:s})=>a.getValue()-s.getValue()))){if(i instanceof za&&i.timeBase.getValue()===Kr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>o.position.getValue())return!0}return!1}})??!1)})(Sx||(Sx={}));var gN;(function(r){r.parseTimeSignature=e=>{let[t,n]=e.split("/"),i=parseInt(t,10),o=parseInt(n,10);return Sx.isTimeSignatureValid(i,o)}})(gN||(gN={}));var Ex;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i},o)=>{let a=!0,s=new Int32Array(e,0,2),l=new Float32Array(e,8),u=new Float32Array(n*i),p=typeof document>"u",d=()=>{if(!a)return;let h=Atomics.load(s,1),g=Atomics.load(s,0);if(h===g){if(p)Atomics.wait(s,0,g);else{setTimeout(d,1);return}g=Atomics.load(s,0)}for(;h!==g;){let v=h*n*i;u.set(l.subarray(v,v+n*i));let y=[];for(let x=0;x<n;x++){let F=x*i,I=F+i;y.push(u.slice(F,I))}if(h=(h+1)%t,Atomics.store(s,1,h),!a)return;o(y)}d()};return d(),{stop:()=>a=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i})=>{let o=new Int32Array(e,0,2),a=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==n)return;for(let p of s)if(p.length!==i)return D("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(o,0),u=l*n*i;s.forEach((p,d)=>a.set(p,u+d*i)),Atomics.store(o,0,(l+1)%t),Atomics.notify(o,0)}})}})(Ex||(Ex={}));var f_={isRegion:r=>Es.isRegionBox(r.box),isLoopableRegion:r=>Es.isLoopableRegionBox(r.box)};var MM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ye=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},to,Fx,Ui,Fs,Bs,m_,nm,Bx,Nx=class{constructor(e){to.add(this),Fx.set(this,new j),Ui.set(this,void 0),Fs.set(this,[]),Bs.set(this,[]),MM(this,Ui,e,"f"),Ye(this,Fx,"f").ownAll(e.box.bpm.subscribe(()=>Ye(this,to,"m",m_).call(this)),e.catchupAndSubscribeTempoAutomation(()=>Ye(this,to,"m",m_).call(this)))}terminate(){Ye(this,Fx,"f").terminate()}getTempoAt(e){let t=Ye(this,Ui,"f").box.bpm.getValue();return Ye(this,Ui,"f").tempoTrackEvents.mapOr(n=>n.valueAt(e,t),t)}ppqnToSeconds(e){return e<0?-Ye(this,to,"m",nm).call(this,-e):Ye(this,to,"m",nm).call(this,e)}secondsToPPQN(e){return Ye(this,to,"m",Bx).call(this,e)}intervalToSeconds(e,t){return e>=t?0:Ye(this,to,"m",nm).call(this,t)-Ye(this,to,"m",nm).call(this,e)}intervalToPPQN(e,t){if(e>=t)return 0;let n=Ye(this,to,"m",Bx).call(this,e);return Ye(this,to,"m",Bx).call(this,t)-n}subscribe(e){let t=new j;return t.ownAll(Ye(this,Ui,"f").box.bpm.subscribe(()=>e(this)),Ye(this,Ui,"f").catchupAndSubscribeTempoAutomation(()=>e(this))),t}};Fx=new WeakMap,Ui=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,to=new WeakSet,m_=function(){Ye(this,Fs,"f").length=0,Ye(this,Bs,"f").length=0;let e=Ye(this,Ui,"f").tempoTrackEvents;if(e.isEmpty())return;let t=e.unwrap();if(t.events.isEmpty())return;let n=t.events.asArray(),i=Ye(this,Ui,"f").box.bpm.getValue(),o=[{ppqn:0,seconds:0,bpm:t.valueAt(0,i)}],a=0,s=0;for(let u of n){let p=u.position;if(!(p<=s)){for(;s<p;){let d=t.valueAt(s,i),h=Ic(s,ta),g=h<=s?h+ta:h,v=Math.min(g,p);a+=Q.pulsesToSeconds(v-s,d),s=v}o.push({ppqn:p,seconds:a,bpm:t.valueAt(p,i)})}}Ye(this,Fs,"f").push(...o);let l=o.slice().sort((u,p)=>u.seconds-p.seconds);Ye(this,Bs,"f").push(...l)},nm=function(e){if(e<=0)return 0;let t=Ye(this,Ui,"f").box.bpm.getValue(),n=Ye(this,Ui,"f").tempoTrackEvents;if(n.isEmpty())return Q.pulsesToSeconds(e,t);let i=n.unwrap();if(i.events.isEmpty())return Q.pulsesToSeconds(e,t);let o=0,a=0;if(Ye(this,Fs,"f").length>0){let u=ct.rightMostMapped(Ye(this,Fs,"f"),e,ka,p=>p.ppqn);if(u>=0){let p=Ye(this,Fs,"f")[u];if(o=p.ppqn,a=p.seconds,u===Ye(this,Fs,"f").length-1)return a+Q.pulsesToSeconds(e-o,p.bpm)}}let s=a,l=o;for(;l<e;){let u=i.valueAt(l,t),p=Ic(l,ta),d=p<=l?p+ta:p,h=Math.min(d,e);s+=Q.pulsesToSeconds(h-l,u),l=h}return s},Bx=function(e){if(e<=0)return 0;let t=Ye(this,Ui,"f").box.bpm.getValue(),n=Ye(this,Ui,"f").tempoTrackEvents;if(n.isEmpty())return Q.secondsToPulses(e,t);let i=n.unwrap();if(i.events.isEmpty())return Q.secondsToPulses(e,t);let o=0,a=0;if(Ye(this,Bs,"f").length>0){let u=ct.rightMostMapped(Ye(this,Bs,"f"),e,ka,p=>p.seconds);if(u>=0){let p=Ye(this,Bs,"f")[u];if(o=p.ppqn,a=p.seconds,u===Ye(this,Bs,"f").length-1)return o+Q.secondsToPulses(e-a,p.bpm)}}let s=a,l=o;for(;s<e;){let u=i.valueAt(l,t),p=Ic(l,ta),d=p<=l?p+ta:p,h=d-l,g=Q.pulsesToSeconds(h,u);if(s+g>=e){let v=e-s;l+=Q.secondsToPulses(v,u);break}s+=g,l=d}return l};var jo;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(jo||(jo={}));var $M,TM,RM,CM;$M=new WeakMap,TM=new WeakMap,RM=new WeakMap,CM=new WeakMap;var OM,VM,zM,UM;OM=new WeakMap,VM=new WeakMap,zM=new WeakMap,UM=new WeakMap;var Le={};Ho(Le,{$brand:()=>Ix,$input:()=>T1,$output:()=>$1,NEVER:()=>g_,TimePrecision:()=>V1,ZodAny:()=>BE,ZodArray:()=>kE,ZodBase64:()=>iw,ZodBase64URL:()=>nw,ZodBigInt:()=>_p,ZodBigIntFormat:()=>sw,ZodBoolean:()=>Ap,ZodCIDRv4:()=>tw,ZodCIDRv6:()=>rw,ZodCUID:()=>qb,ZodCUID2:()=>Hb,ZodCatch:()=>eF,ZodCodec:()=>mw,ZodCustom:()=>Rm,ZodCustomStringFormat:()=>bp,ZodDate:()=>Dm,ZodDefault:()=>qE,ZodDiscriminatedUnion:()=>$E,ZodE164:()=>ow,ZodEmail:()=>Wb,ZodEmoji:()=>Zb,ZodEnum:()=>yp,ZodError:()=>mR,ZodExactOptional:()=>WE,ZodFile:()=>LE,ZodFirstPartyTypeKind:()=>pF,ZodFunction:()=>cF,ZodGUID:()=>Em,ZodIPv4:()=>Xb,ZodIPv6:()=>ew,ZodISODate:()=>Vb,ZodISODateTime:()=>Ob,ZodISODuration:()=>Ub,ZodISOTime:()=>zb,ZodIntersection:()=>TE,ZodIssueCode:()=>vR,ZodJWT:()=>aw,ZodKSUID:()=>Yb,ZodLazy:()=>aF,ZodLiteral:()=>jE,ZodMAC:()=>wE,ZodMap:()=>zE,ZodNaN:()=>rF,ZodNanoID:()=>Gb,ZodNever:()=>IE,ZodNonOptional:()=>hw,ZodNull:()=>EE,ZodNullable:()=>GE,ZodNumber:()=>wp,ZodNumberFormat:()=>bc,ZodObject:()=>Mm,ZodOptional:()=>pw,ZodPipe:()=>fw,ZodPrefault:()=>JE,ZodPromise:()=>lF,ZodReadonly:()=>iF,ZodRealError:()=>bi,ZodRecord:()=>Tm,ZodSet:()=>UE,ZodString:()=>xp,ZodStringFormat:()=>mt,ZodSuccess:()=>XE,ZodSymbol:()=>PE,ZodTemplateLiteral:()=>oF,ZodTransform:()=>KE,ZodTuple:()=>CE,ZodType:()=>Ce,ZodULID:()=>Jb,ZodURL:()=>Im,ZodUUID:()=>Zo,ZodUndefined:()=>SE,ZodUnion:()=>$m,ZodUnknown:()=>NE,ZodVoid:()=>DE,ZodXID:()=>Qb,ZodXor:()=>ME,_ZodString:()=>Kb,_default:()=>HE,_function:()=>HD,any:()=>FD,array:()=>km,base64:()=>uD,base64url:()=>dD,bigint:()=>AD,boolean:()=>_E,catch:()=>tF,check:()=>JD,cidrv4:()=>lD,cidrv6:()=>cD,clone:()=>Xr,codec:()=>ZD,coerce:()=>hF,config:()=>Kt,core:()=>Ba,cuid:()=>eD,cuid2:()=>tD,custom:()=>QD,date:()=>ND,decode:()=>fE,decodeAsync:()=>gE,describe:()=>YD,discriminatedUnion:()=>TD,e164:()=>pD,email:()=>KI,emoji:()=>YI,encode:()=>hE,encodeAsync:()=>mE,endsWith:()=>lp,enum:()=>uw,exactOptional:()=>ZE,file:()=>jD,flattenError:()=>hm,float32:()=>yD,float64:()=>xD,formatError:()=>fm,fromJSONSchema:()=>ok,function:()=>HD,getErrorMap:()=>xR,globalRegistry:()=>Nr,gt:()=>Ko,gte:()=>ei,guid:()=>WI,hash:()=>vD,hex:()=>gD,hostname:()=>mD,httpUrl:()=>QI,includes:()=>ap,instanceof:()=>ek,int:()=>Lb,int32:()=>bD,int64:()=>_D,intersection:()=>RE,ipv4:()=>oD,ipv6:()=>sD,iso:()=>vp,json:()=>rk,jwt:()=>hD,keyof:()=>ID,ksuid:()=>nD,lazy:()=>sF,length:()=>yc,literal:()=>UD,locales:()=>Am,looseObject:()=>MD,looseRecord:()=>CD,lowercase:()=>np,lt:()=>Lo,lte:()=>Li,mac:()=>aD,map:()=>OD,maxLength:()=>vc,maxSize:()=>Ts,meta:()=>XD,mime:()=>cp,minLength:()=>Fa,minSize:()=>Wo,multipleOf:()=>$s,nan:()=>WD,nanoid:()=>XI,nativeEnum:()=>zD,negative:()=>Bb,never:()=>lw,nonnegative:()=>Ib,nonoptional:()=>YE,nonpositive:()=>Nb,normalize:()=>up,null:()=>FE,nullable:()=>Bm,nullish:()=>LD,number:()=>AE,object:()=>DD,optional:()=>Fm,overwrite:()=>io,parse:()=>cE,parseAsync:()=>uE,partialRecord:()=>RD,pipe:()=>Nm,positive:()=>Fb,prefault:()=>QE,preprocess:()=>ik,prettifyError:()=>B_,promise:()=>qD,property:()=>Db,readonly:()=>nF,record:()=>VE,refine:()=>uF,regex:()=>ip,regexes:()=>Sn,registry:()=>ab,safeDecode:()=>yE,safeDecodeAsync:()=>bE,safeEncode:()=>vE,safeEncodeAsync:()=>xE,safeParse:()=>dE,safeParseAsync:()=>pE,set:()=>VD,setErrorMap:()=>yR,size:()=>gc,slugify:()=>fp,startsWith:()=>sp,strictObject:()=>kD,string:()=>jb,stringFormat:()=>fD,stringbool:()=>tk,success:()=>KD,superRefine:()=>dF,symbol:()=>SD,templateLiteral:()=>GD,toJSONSchema:()=>Tb,toLowerCase:()=>pp,toUpperCase:()=>hp,transform:()=>dw,treeifyError:()=>F_,trim:()=>dp,tuple:()=>OE,uint32:()=>wD,uint64:()=>PD,ulid:()=>rD,undefined:()=>ED,union:()=>cw,unknown:()=>xc,uppercase:()=>op,url:()=>JI,util:()=>G,uuid:()=>ZI,uuidv4:()=>GI,uuidv6:()=>qI,uuidv7:()=>HI,void:()=>BD,xid:()=>iD,xor:()=>$D});var Ba={};Ho(Ba,{$ZodAny:()=>r1,$ZodArray:()=>s1,$ZodAsyncError:()=>ro,$ZodBase64:()=>ZP,$ZodBase64URL:()=>GP,$ZodBigInt:()=>Xx,$ZodBigIntFormat:()=>YP,$ZodBoolean:()=>ym,$ZodCIDRv4:()=>LP,$ZodCIDRv6:()=>KP,$ZodCUID:()=>DP,$ZodCUID2:()=>kP,$ZodCatch:()=>S1,$ZodCheck:()=>yt,$ZodCheckBigIntFormat:()=>sP,$ZodCheckEndsWith:()=>xP,$ZodCheckGreaterThan:()=>Zx,$ZodCheckIncludes:()=>vP,$ZodCheckLengthEquals:()=>hP,$ZodCheckLessThan:()=>Wx,$ZodCheckLowerCase:()=>mP,$ZodCheckMaxLength:()=>dP,$ZodCheckMaxSize:()=>lP,$ZodCheckMimeType:()=>wP,$ZodCheckMinLength:()=>pP,$ZodCheckMinSize:()=>cP,$ZodCheckMultipleOf:()=>oP,$ZodCheckNumberFormat:()=>aP,$ZodCheckOverwrite:()=>AP,$ZodCheckProperty:()=>bP,$ZodCheckRegex:()=>fP,$ZodCheckSizeEquals:()=>uP,$ZodCheckStartsWith:()=>yP,$ZodCheckStringFormat:()=>tp,$ZodCheckUpperCase:()=>gP,$ZodCodec:()=>bm,$ZodCustom:()=>M1,$ZodCustomStringFormat:()=>JP,$ZodDate:()=>a1,$ZodDefault:()=>w1,$ZodDiscriminatedUnion:()=>u1,$ZodE164:()=>qP,$ZodEmail:()=>FP,$ZodEmoji:()=>NP,$ZodEncodeError:()=>Ns,$ZodEnum:()=>m1,$ZodError:()=>pm,$ZodExactOptional:()=>x1,$ZodFile:()=>v1,$ZodFunction:()=>I1,$ZodGUID:()=>SP,$ZodIPv4:()=>zP,$ZodIPv6:()=>UP,$ZodISODate:()=>CP,$ZodISODateTime:()=>RP,$ZodISODuration:()=>VP,$ZodISOTime:()=>OP,$ZodIntersection:()=>d1,$ZodJWT:()=>HP,$ZodKSUID:()=>TP,$ZodLazy:()=>k1,$ZodLiteral:()=>g1,$ZodMAC:()=>jP,$ZodMap:()=>h1,$ZodNaN:()=>E1,$ZodNanoID:()=>IP,$ZodNever:()=>n1,$ZodNonOptional:()=>_1,$ZodNull:()=>t1,$ZodNullable:()=>b1,$ZodNumber:()=>Yx,$ZodNumberFormat:()=>QP,$ZodObject:()=>LN,$ZodObjectJIT:()=>l1,$ZodOptional:()=>tb,$ZodPipe:()=>F1,$ZodPrefault:()=>A1,$ZodPromise:()=>D1,$ZodReadonly:()=>B1,$ZodRealError:()=>xi,$ZodRecord:()=>p1,$ZodRegistry:()=>ob,$ZodSet:()=>f1,$ZodString:()=>mc,$ZodStringFormat:()=>ft,$ZodSuccess:()=>P1,$ZodSymbol:()=>XP,$ZodTemplateLiteral:()=>N1,$ZodTransform:()=>y1,$ZodTuple:()=>eb,$ZodType:()=>De,$ZodULID:()=>MP,$ZodURL:()=>BP,$ZodUUID:()=>EP,$ZodUndefined:()=>e1,$ZodUnion:()=>xm,$ZodUnknown:()=>i1,$ZodVoid:()=>o1,$ZodXID:()=>$P,$ZodXor:()=>c1,$brand:()=>Ix,$constructor:()=>S,$input:()=>T1,$output:()=>$1,Doc:()=>vm,JSONSchema:()=>jI,JSONSchemaGenerator:()=>Rb,NEVER:()=>g_,TimePrecision:()=>V1,_any:()=>aS,_array:()=>hS,_base64:()=>_b,_base64url:()=>Pb,_bigint:()=>X1,_boolean:()=>Q1,_catch:()=>sR,_check:()=>UI,_cidrv4:()=>wb,_cidrv6:()=>Ab,_coercedBigint:()=>eS,_coercedBoolean:()=>Y1,_coercedDate:()=>dS,_coercedNumber:()=>W1,_coercedString:()=>C1,_cuid:()=>fb,_cuid2:()=>mb,_custom:()=>mS,_date:()=>uS,_decode:()=>Rx,_decodeAsync:()=>Ox,_default:()=>nR,_discriminatedUnion:()=>ZT,_e164:()=>Sb,_email:()=>sb,_emoji:()=>pb,_encode:()=>Tx,_encodeAsync:()=>Cx,_endsWith:()=>lp,_enum:()=>YT,_file:()=>fS,_float32:()=>G1,_float64:()=>q1,_gt:()=>Ko,_gte:()=>ei,_guid:()=>_m,_includes:()=>ap,_int:()=>Z1,_int32:()=>H1,_int64:()=>tS,_intersection:()=>GT,_ipv4:()=>xb,_ipv6:()=>bb,_isoDate:()=>U1,_isoDateTime:()=>z1,_isoDuration:()=>L1,_isoTime:()=>j1,_jwt:()=>Eb,_ksuid:()=>yb,_lazy:()=>dR,_length:()=>yc,_literal:()=>eR,_lowercase:()=>np,_lt:()=>Lo,_lte:()=>Li,_mac:()=>O1,_map:()=>JT,_max:()=>Li,_maxLength:()=>vc,_maxSize:()=>Ts,_mime:()=>cp,_min:()=>ei,_minLength:()=>Fa,_minSize:()=>Wo,_multipleOf:()=>$s,_nan:()=>pS,_nanoid:()=>hb,_nativeEnum:()=>XT,_negative:()=>Bb,_never:()=>lS,_nonnegative:()=>Ib,_nonoptional:()=>oR,_nonpositive:()=>Nb,_normalize:()=>up,_null:()=>oS,_nullable:()=>iR,_number:()=>K1,_optional:()=>rR,_overwrite:()=>io,_parse:()=>Qd,_parseAsync:()=>Yd,_pipe:()=>lR,_positive:()=>Fb,_promise:()=>pR,_property:()=>Db,_readonly:()=>cR,_record:()=>HT,_refine:()=>gS,_regex:()=>ip,_safeDecode:()=>zx,_safeDecodeAsync:()=>jx,_safeEncode:()=>Vx,_safeEncodeAsync:()=>Ux,_safeParse:()=>Xd,_safeParseAsync:()=>ep,_set:()=>QT,_size:()=>gc,_slugify:()=>fp,_startsWith:()=>sp,_string:()=>R1,_stringFormat:()=>mp,_stringbool:()=>bS,_success:()=>aR,_superRefine:()=>vS,_symbol:()=>iS,_templateLiteral:()=>uR,_toLowerCase:()=>pp,_toUpperCase:()=>hp,_transform:()=>tR,_trim:()=>dp,_tuple:()=>qT,_uint32:()=>J1,_uint64:()=>rS,_ulid:()=>gb,_undefined:()=>nS,_union:()=>KT,_unknown:()=>sS,_uppercase:()=>op,_url:()=>Pm,_uuid:()=>lb,_uuidv4:()=>cb,_uuidv6:()=>ub,_uuidv7:()=>db,_void:()=>cS,_xid:()=>vb,_xor:()=>WT,clone:()=>Xr,config:()=>Kt,createStandardJSONSchemaMethod:()=>gp,createToJSONSchemaMethod:()=>wS,decode:()=>m$,decodeAsync:()=>v$,describe:()=>yS,encode:()=>f$,encodeAsync:()=>g$,extractDefs:()=>Cs,finalize:()=>Os,flattenError:()=>hm,formatError:()=>fm,globalConfig:()=>om,globalRegistry:()=>Nr,initializeContext:()=>Rs,isValidBase64:()=>WP,isValidBase64URL:()=>VN,isValidJWT:()=>zN,locales:()=>Am,meta:()=>xS,parse:()=>Mx,parseAsync:()=>$x,prettifyError:()=>B_,process:()=>at,regexes:()=>Sn,registry:()=>ab,safeDecode:()=>x$,safeDecodeAsync:()=>w$,safeEncode:()=>y$,safeEncodeAsync:()=>b$,safeParse:()=>N_,safeParseAsync:()=>I_,toDotPath:()=>wN,toJSONSchema:()=>Tb,treeifyError:()=>F_,util:()=>G,version:()=>_P});var g_=Object.freeze({status:"aborted"});function S(r,e,t){function n(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(r))return;s._zod.traits.add(r),e(s,l);let u=a.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let h=p[d];h in s||(s[h]=u[h].bind(s))}}let i=t?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:r});function a(s){var l;let u=t?.Parent?new o:this;n(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(r)}),Object.defineProperty(a,"name",{value:r}),a}var Ix=Symbol("zod_brand"),ro=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ns=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},om={};function Kt(r){return r&&Object.assign(om,r),om}var G={};Ho(G,{BIGINT_FORMAT_RANGES:()=>E_,Class:()=>y_,NUMBER_FORMAT_RANGES:()=>S_,aborted:()=>Ms,allowsEval:()=>w_,assert:()=>ZM,assertEqual:()=>jM,assertIs:()=>KM,assertNever:()=>WM,assertNotEqual:()=>LM,assignProp:()=>Ds,base64ToUint8Array:()=>yN,base64urlToUint8Array:()=>c$,cached:()=>Hd,captureStackTrace:()=>kx,cleanEnum:()=>l$,cleanRegex:()=>lm,clone:()=>Xr,cloneDef:()=>qM,createTransparentProxy:()=>e$,defineLazy:()=>je,esc:()=>Dx,escapeRegex:()=>Pn,extend:()=>i$,finalizeIssue:()=>yi,floatSafeRemainder:()=>x_,getElementAtPath:()=>HM,getEnumValues:()=>sm,getLengthableOrigin:()=>dm,getParsedType:()=>XM,getSizableOrigin:()=>um,hexToUint8Array:()=>d$,isObject:()=>hc,isPlainObject:()=>ks,issue:()=>Jd,joinValues:()=>T,jsonStringifyReplacer:()=>qd,merge:()=>o$,mergeDefs:()=>Ea,normalizeParams:()=>H,nullish:()=>Is,numKeys:()=>YM,objectClone:()=>GM,omit:()=>r$,optionalKeys:()=>P_,parsedType:()=>Z,partial:()=>a$,pick:()=>t$,prefixIssues:()=>ji,primitiveTypes:()=>__,promiseAllObject:()=>JM,propertyKeyTypes:()=>cm,randomString:()=>QM,required:()=>s$,safeExtend:()=>n$,shallowClone:()=>A_,slugify:()=>b_,stringifyPrimitive:()=>W,uint8ArrayToBase64:()=>xN,uint8ArrayToBase64url:()=>u$,uint8ArrayToHex:()=>p$,unwrapMessage:()=>am});function jM(r){return r}function LM(r){return r}function KM(r){}function WM(r){throw new Error("Unexpected value in exhaustive check")}function ZM(r){}function sm(r){let e=Object.values(r).filter(n=>typeof n=="number");return Object.entries(r).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function T(r,e="|"){return r.map(t=>W(t)).join(e)}function qd(r,e){return typeof e=="bigint"?e.toString():e}function Hd(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function Is(r){return r==null}function lm(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function x_(r,e){let t=(r.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let l=n.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}let o=t>i?t:i,a=Number.parseInt(r.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var vN=Symbol("evaluating");function je(r,e,t){let n;Object.defineProperty(r,e,{get(){if(n!==vN)return n===void 0&&(n=vN,n=t()),n},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function GM(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Ds(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Ea(...r){let e={};for(let t of r){let n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function qM(r){return Ea(r._zod.def)}function HM(r,e){return e?e.reduce((t,n)=>t?.[n],r):r}function JM(r){let e=Object.keys(r),t=e.map(n=>r[n]);return Promise.all(t).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function QM(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let n=0;n<r;n++)t+=e[Math.floor(Math.random()*e.length)];return t}function Dx(r){return JSON.stringify(r)}function b_(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var kx="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function hc(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var w_=Hd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function ks(r){if(hc(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(hc(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function A_(r){return ks(r)?{...r}:Array.isArray(r)?[...r]:r}function YM(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var XM=r=>{let e=typeof r;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(r)?"array":r===null?"null":r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?"promise":typeof Map<"u"&&r instanceof Map?"map":typeof Set<"u"&&r instanceof Set?"set":typeof Date<"u"&&r instanceof Date?"date":typeof File<"u"&&r instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},cm=new Set(["string","number","symbol"]),__=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xr(r,e,t){let n=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(n._zod.parent=r),n}function H(r){let e=r;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function e$(r){let e;return new Proxy({},{get(t,n,i){return e??(e=r()),Reflect.get(e,n,i)},set(t,n,i,o){return e??(e=r()),Reflect.set(e,n,i,o)},has(t,n){return e??(e=r()),Reflect.has(e,n)},deleteProperty(t,n){return e??(e=r()),Reflect.deleteProperty(e,n)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,n){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(t,n,i){return e??(e=r()),Reflect.defineProperty(e,n,i)}})}function W(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function P_(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var S_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},E_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function t$(r,e){let t=r._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Ea(r._zod.def,{get shape(){let a={};for(let s in e){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(a[s]=t.shape[s])}return Ds(this,"shape",a),a},checks:[]});return Xr(r,o)}function r$(r,e){let t=r._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Ea(r._zod.def,{get shape(){let a={...r._zod.def.shape};for(let s in e){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete a[s]}return Ds(this,"shape",a),a},checks:[]});return Xr(r,o)}function i$(r,e){if(!ks(e))throw new Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0){let o=r._zod.def.shape;for(let a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=Ea(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return Ds(this,"shape",o),o}});return Xr(r,i)}function n$(r,e){if(!ks(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t=Ea(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e};return Ds(this,"shape",n),n}});return Xr(r,t)}function o$(r,e){let t=Ea(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e._zod.def.shape};return Ds(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Xr(r,t)}function a$(r,e,t){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Ea(e._zod.def,{get shape(){let s=e._zod.def.shape,l={...s};if(t)for(let u in t){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=r?new r({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)l[u]=r?new r({type:"optional",innerType:s[u]}):s[u];return Ds(this,"shape",l),l},checks:[]});return Xr(e,a)}function s$(r,e,t){let n=Ea(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(t)for(let a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new r({type:"nonoptional",innerType:i[a]}))}else for(let a in i)o[a]=new r({type:"nonoptional",innerType:i[a]});return Ds(this,"shape",o),o}});return Xr(e,n)}function Ms(r,e=0){if(r.aborted===!0)return!0;for(let t=e;t<r.issues.length;t++)if(r.issues[t]?.continue!==!0)return!0;return!1}function ji(r,e){return e.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(r),t})}function am(r){return typeof r=="string"?r:r?.message}function yi(r,e,t){let n={...r,path:r.path??[]};if(!r.message){let i=am(r.inst?._zod.def?.error?.(r))??am(e?.error?.(r))??am(t.customError?.(r))??am(t.localeError?.(r))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function um(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function dm(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function Z(r){let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";let t=r;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return e}function Jd(...r){let[e,t,n]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:{...e}}function l$(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function yN(r){let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function xN(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function c$(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return yN(e+t)}function u$(r){return xN(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function d$(r){let e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=Number.parseInt(e.slice(n,n+2),16);return t}function p$(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var y_=class{constructor(...e){}};var bN=(r,e)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:e,enumerable:!1}),r.message=JSON.stringify(e,qd,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},pm=S("$ZodError",bN),xi=S("$ZodError",bN,{Parent:Error});function hm(r,e=t=>t.message){let t={},n=[];for(let i of r.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}function fm(r,e=t=>t.message){let t={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>n({issues:a}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let a=t,s=0;for(;s<o.path.length;){let l=o.path[s];s===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(e(o))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return n(r),t}function F_(r,e=t=>t.message){let t={errors:[]},n=(i,o=[])=>{var a,s;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>n({issues:u},l.path));else if(l.code==="invalid_key")n({issues:l.issues},l.path);else if(l.code==="invalid_element")n({issues:l.issues},l.path);else{let u=[...o,...l.path];if(u.length===0){t.errors.push(e(l));continue}let p=t,d=0;for(;d<u.length;){let h=u[d],g=d===u.length-1;typeof h=="string"?(p.properties??(p.properties={}),(a=p.properties)[h]??(a[h]={errors:[]}),p=p.properties[h]):(p.items??(p.items=[]),(s=p.items)[h]??(s[h]={errors:[]}),p=p.items[h]),g&&p.errors.push(e(l)),d++}}};return n(r),t}function wN(r){let e=[],t=r.map(n=>typeof n=="object"?n.key:n);for(let n of t)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function B_(r){let e=[],t=[...r.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of t)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${wN(n.path)}`);return e.join(`
3
+ `),this));for(let n of t)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=t=>t.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()}`}};AM([kc,sB("design:type",vo),sB("design:paramtypes",[])],k.prototype,"pointerHub",null);var Jp;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Jp||(Jp={}));var Ue;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(Ue||(Ue={}));var Mg;(function(r){r.create=()=>new sA})(Mg||(Mg={}));var sA=class{#e=new Qp(Ys.equals);#t=new Qp(Ys.startsWith);#r=new Qp(Ys.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,n){let i=new lA(t,e,this.#n++,n);if(this.#o){let o=new cA(i,e);return this.#i.push(o),o}else return this.subscribeMonitor(i,e)}dispatch(e){this.#o=!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.#o=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case Ue.This:return this.#e.subscribe(e);case Ue.Parent:return this.#t.subscribe(e);case Ue.Children:return this.#r.subscribe(e);default:return ag(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},lA=class{address;propagation;order;procedure;constructor(e,t,n,i){this.address=e,this.propagation=t,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${Ue[this.propagation]}, order: ${this.order} }`}},Qp=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 t=this.#e.length;for(;--t>=0;)this.#e[t]===e&&this.#e.splice(t,1)}}}stations(){return this.#t||(this.#e.sort(Ys.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},cA=class{monitor;propagation;#e=new j;#t=!1;constructor(e,t){this.monitor=e,this.propagation=t}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var Ot;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(Ot||(Ot={}));var el={[Ot.Boolean]:{type:Ot.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[Ot.Float32]:{type:Ot.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[Ot.Int32]:{type:Ot.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[Ot.String]:{type:Ot.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[Ot.Bytes]:{type:Ot.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},Xs=class extends X{#e;#t;#r;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#r=this.#t}accept(e){return P(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ue.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){V(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let t=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,t,n))}writeValue(e,t){V(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,t)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?D("not implemented"):e}fromJSON(e){return D("Type mismatch")}reset(){this.setValue(this.#t)}},M=class r extends Xs{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,Ot.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return el[Ot.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){V(!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()))}},b=class r extends Xs{static create(e,t,n,i=0){return new r(e,t,n,i)}#e;#t;constructor(e,t,n,i){super(e,Ot.Float32,i),this.#e=t,this.#t=n}serialization(){return el[Ot.Float32]}equals(e){return this.getValue()===e}clamp(e){return Jp.clampFloat32(this.#e,Xo.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){V(!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()))}},E=class r extends Xs{static create(e,t,n,i=0){return new r(e,t,n,i)}#e;#t;constructor(e,t,n,i){super(e,Ot.Int32,i),this.#e=t,this.#t=n}serialization(){return el[Ot.Int32]}equals(e){return this.getValue()===e}clamp(e){return Jp.clampInt32(this.#e,vr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){V(!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>=vr.MIN_VALUE&&e<=vr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends Xs{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,Ot.String,t)}serialization(){return el[Ot.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){V(!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()))}},lB=class r extends Xs{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,Ot.Bytes,t)}serialization(){return el[Ot.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){V(!this.deprecated,"ByteArrayField.write: deprecated field");let t=this.getValue();e.writeInt(t.length),e.writeBytes(t)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(t=>typeof t=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var cB;(function(r){r.decode=e=>{let t=e.readInt();return U.create(()=>{switch(e.readString()){case"new":{let i=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new tl(i,o,a.buffer)}case"pointer":{let i=ke.read(e),o=e.readBoolean()?m.wrap(ke.read(e)):m.None,a=e.readBoolean()?m.wrap(ke.read(e)):m.None;return new Xp(i,o,a)}case"primitive":{let i=ke.read(e),o=e.readString(),a=el[o],s=a.decode(e),l=a.decode(e);return new Yp(i,a,s,l)}case"delete":{let i=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new rl(i,o,a.buffer)}}},t)}})(cB||(cB={}));var tl=class{type="new";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,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,t=>t.read(new It(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Yp=class{type="primitive";#e;#t;#r;#i;constructor(e,t,n,i){this.#e=e,this.#t=t,this.#r=n,this.#i=i}get address(){return this.#e}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}`}},Xp=class{type="pointer";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,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:t=>{e.writeBoolean(!0),t.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},rl=class{type="delete";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,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,t=>t.read(new It(this.#r)))}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var ez=Symbol("Unreferenceable"),N=class r extends X{static create(e,t,n){return new r(e,t,n)}static encodeWith(e,t){V(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=m.wrap(e);let n=Jo(t);if(this.#e=m.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,t){V(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=m.wrap(e);let n=Jo(t);if(this.#t=m.None,n.status==="failure")throw n.error;return n.value}static#e=m.None;static#t=m.None;#r;#i;#n=m.None;#o=m.None;constructor(e,t,n){super(e),this.#r=t,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return D(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return P(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ue.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=m.wrap(e)}defer(){this.targetVertex=m.None}get targetVertex(){return this.graph.inTransaction()?this.#o.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let t=vo.validate(this,e.unwrap());t.nonEmpty()&&D(t.unwrap())}this.targetAddress=e.map(t=>t.address)}get targetAddress(){return this.#o}set targetAddress(e){let t=this.#o;t.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&t.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#o=e,this.graph.onPointerAddressUpdated(this,t,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap())}resolvedTo(e){this.#n=e}read(e){let t=e.readBoolean()?m.wrap(ke.read(e)):m.None;this.targetAddress=r.#t.match({none:()=>t,some:n=>n.map(this,t)})}write(e){V(!this.deprecated,"PointerField.write: deprecated field"),r.#e.match({none:()=>this.#o,some:t=>t.map(this)}).match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toJSON(){if(!this.deprecated)return r.#e.match({none:()=>this.#o,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(so(e)||typeof e=="string"){let t=m.wrap(so(e)?null:ke.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:n=>n.map(this,t)})}else return D(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var $g=class{#e;#t;#r;#i;#n;constructor(){this.#e=ke.newSet(e=>e.address),this.#t=ke.newSet(e=>e.address),this.#r=ke.newSet(e=>e.address),this.#i=ke.newSet(([e])=>e),this.#n=ke.newSet(([e])=>e.address)}watchVertex(e){if(pt(e,N)){if(!e.mandatory)return D("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:t,exclusive:n}=e.pointerRules;if(!t&&!n)return D("watchVertex called but has no edge requirement");t&&this.#t.add(e),n&&this.#r.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#a(this.#e,n,t),this.#a(this.#t,n,t),this.#a(this.#r,n,t);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return D(`${n} has outgoing edges: ${i.map(([a,s])=>`[${a.toString()}, ${s.toString()}]`)}`);let o=this.incomingEdgesOf(n);if(o.length>0)return D(`${n} has incoming edges from: ${o.map(a=>a.toString())}`)}}connect(e,t){this.#n.add([e,t]),this.#i.opt(t).match({none:()=>this.#i.add([t,[e]]),some:([,n])=>n.push(e)})}disconnect(e){let[,t]=this.#n.removeByKey(e.address),[,n]=this.#i.get(t);U.remove(n,e),n.length===0&&this.#i.removeByKey(t)}isConnected(e,t){return this.#n.opt(e.address).mapOr(([,n])=>n.equals(t),!1)}outgoingEdgesOf(e){return this.#o(this.#n,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#i,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,n])=>n):this.#i.opt(e.address).mapOr(([t,n])=>n,U.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),D(`Pointer ${e.toString()} requires an edge.`)):D(`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.`),D(`Target ${e.toString()} requires an edge.`)):D(`Illegal state: ${e} has no edge requirements.`)}),this.#r.forEach(e=>{let t=e.pointerHub.size();if(t>1)return console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} is exclusive but has ${t} incoming pointers.`),D(`Target ${e.toString()} is exclusive but has ${t} incoming pointers.`)})}#o(e,t,n){let i=ke.boxRange(e,t,n);return q(i)?e.values().slice(i[0],i[1]):U.empty()}#a(e,t,n){let i=ke.boxRange(e,t,n);q(i)&&e.removeRange(i[0],i[1])}};var il=class{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u;#p=!1;#d=!1;constructor(e=m.None){this.#e=e,this.#t=A.newSet(t=>t.address.uuid),this.#r=[],this.#a=Mg.create(),this.#i=new or,this.#n=new or,this.#o=new or,this.#s=new $g,this.#l=ke.newSet(({pointer:t})=>t.address),this.#c=[],this.#u=A.newSet(t=>t.uuid)}beginTransaction(){V(!this.#p,"Transaction already in progress"),this.#p=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(V(this.#p,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#f(e,t)),this.#r.length=0),this.#l.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:n})=>{t.equals(n)||(t.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#l.clear(),this.#p=!1;this.#c.length>0;)this.#c.splice(0).forEach(e=>e()),this.#c.length>0&&console.debug(`${this.#c.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#p}constructingBox(){return this.#d}createBox(e,t,n){return this.#e.unwrap("No box-factory installed")(e,this,t,n)}stageBox(e,t){this.#g(),V(!this.#d,"Cannot construct box while other box is constructing"),q(t)&&(this.#d=!0,t(e),this.#d=!1);let n=this.#t.add(e);V(n,()=>`${e.name} ${e.address.toString()} already staged`);let i=new tl(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#n.subscribe(e)}subscribeVertexUpdates(e,t,n){return this.#a.subscribe(e,t,n)}subscribeEndTransaction(e){this.#c.push(e)}subscribeDeletion(e,t){let n=this.#u.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(t),{terminate:()=>{n.listeners.delete(t),n.listeners.size===0&&this.#u.removeByKeyIfExist(e)}}}unstageBox(e){this.#g();let t=this.#t.removeByKey(e.address.uuid);V(t===e,`${e} could not be found to unstage`),this.#s.unwatchVerticesOf(e);let n=new rl(e.address.uuid,e.name,e.toArrayBuffer());this.#u.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(t=>t.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#s}checksum(){let e=new ug;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,n){if(this.#g(),e.isAttached()&&!this.#d){let i=new Yp(e.address,e.serialization(),t,n);this.#a.dispatch(i),this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}}onPointerAddressUpdated(e,t,n){this.#g(),t.nonEmpty()&&this.#s.disconnect(e),n.nonEmpty()&&this.#s.connect(e,n.unwrap());let i=new Xp(e.address,t,n);this.#d?this.#r.push({pointerField:e,update:i}):(this.#f(e,i),this.#n.proxy.onUpdate(i))}#f(e,t){let{oldAddress:n,newAddress:i}=t;e.resolvedTo(i.flatMap(a=>this.findVertex(a))),this.#l.opt(e.address).match({none:()=>this.#l.add({pointer:e,initial:n,final:i,index:this.#l.size()}),some:a=>a.final=i}),this.#a.dispatch(t),this.#i.proxy.onUpdate(t)}findOrphans(e){let t=this.#h(e);return this.boxes().filter(n=>!t.has(n))}#h(e){let t=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!t.has(i)){t.add(i),this.#m(i).forEach(o=>{o.targetAddress.ifSome(a=>{this.findBox(a.uuid).ifSome(s=>{t.has(s)||n.push(s)})})});for(let o of i.incomingEdges())t.has(o.box)||n.push(o.box)}}return t}#m(e){let t=[],n=i=>{for(let o of i)o.accept({visitPointerField:a=>t.push(a),visitObjectField:a=>n(a.fields()),visitArrayField:a=>n(a.fields())})};return n(e.fields()),t}dependenciesOf(e,t={}){let n=q(t.excludeBox)?t.excludeBox:$c.alwaysFalse,i=q(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,o=q(t.stopAtResources)?t.stopAtResources:!1,a=new Set,s=new Set,l=(u,p=!1)=>{if(!(a.has(u)||!p&&n(u))){if(a.add(u),o&&q(u.resource)){u.incomingEdges().forEach(d=>{s.add(d);let h=d.targetAddress.mapOr(g=>!g.isBox(),!1);if(d.mandatory&&h){if(u.resource==="shared"&&d.targetAddress.flatMap(v=>this.findVertex(v)).mapOr(v=>v.pointerRules.mandatory,!1))return;l(d.box)}});return}u.outgoingEdges().filter(([d])=>!s.has(d)).forEach(([d,h])=>{let g=this.findVertex(h).unwrap(`Could not find target of ${d.toString()}`);if(s.add(d),g.pointerRules.mandatory&&(i||g.pointerHub.incoming().filter(v=>v.targetAddress.mapOr(y=>y.equals(h),!1)).every(v=>s.has(v))))return l(g.box)}),u.incomingEdges().forEach(d=>{s.add(d),d.mandatory&&l(d.box)})}};return l(e,!0),a.delete(e),{boxes:a,pointers:Array.from(s).reverse()}}verifyPointers(){this.#s.validateRequirements();let e=0,t=n=>{for(let i of n.fields())i.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let a=o.targetVertex.nonEmpty(),s=this.findVertex(o.targetAddress.unwrap()).nonEmpty();V(a,`pointer ${o.address} is broken`),V(s,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#t.forEach(n=>t(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[A.toString(t.address.uuid)]={class:t.name,"incoming links":t.incomingEdges().length,"outgoing links":t.outgoingEdges().length,"est. memory (bytes)":t.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let t of this.dependenciesOf(e).boxes)console.debug(` ${t}`)})}addressToDebugPath(e){return e.flatMap(t=>t.isBox()?this.findBox(t.uuid).map(n=>n.name):this.findBox(t.uuid).flatMap(n=>n.searchVertex(t.fieldKeys).map(i=>i.isField()?i.debugPath:D("Unknown address"))))}toArrayBuffer(){let e=nr.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e){V(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new It(e),n=t.readInt();this.beginTransaction();let i=[];for(let o=0;o<n;o++){let a=t.readInt(),s=new Int8Array(a);t.readBytes(s);let l=new It(s.buffer),u=l.readInt(),p=l.readString(),d=A.fromDataInput(l);i.push({creationIndex:u,name:p,uuid:d,boxStream:l})}i.sort((o,a)=>o.creationIndex-a.creationIndex).forEach(({name:o,uuid:a,boxStream:s})=>this.createBox(o,a,l=>l.read(s))),this.endTransaction()}toJSON(){let e={};for(let t of this.#t.values())e[t.address.toString()]={name:t.name,fields:ve(t.toJSON())};return e}fromJSON(e){if(typeof e!="object"||e===null||Array.isArray(e))return D("Expected object");this.beginTransaction();let t=Object.entries(e);for(let[n,{name:i,fields:o}]of t)this.createBox(i,A.parse(n),a=>a.fromJSON(o));this.endTransaction()}#g(){V(this.#p,()=>"Modification only prohibited in transaction mode.")}};var Kc;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let n=r.collectIndexedBoxes(e),i=we(t,0,n.length);if(i<n.length)for(let o=i;o<n.length;o++)n[o].index.setValue(o+1);return i},r.removeOrder=(e,t)=>{let n=r.collectIndexedBoxes(e);if(t<n.length)for(let i=t+1;i<n.length;i++)n[i].index.setValue(i-1)},r.moveIndex=(e,t,n)=>{let i=r.collectIndexedBoxes(e),o=i[t];if(n<0){let a=we(t+n,0,i.length-1);for(let s=a;s<t;s++)i[s].index.setValue(s+1);o.index.setValue(a)}else if(n>1){let a=we(t+(n-1),0,i.length-1);for(let s=t;s<a;s++)i[s+1].index.setValue(s);o.index.setValue(a)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${n}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof E,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:n})=>r.isIndexedBox(n)&&(t===void 0||n instanceof t)?n:D(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(Kc||(Kc={}));var qe=class extends X{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return P(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return ve(this.#e[e])}optField(e){return m.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Ue.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Ca.readFields(e,this.#e)}write(e){Ca.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,n])=>(e[t]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(og(e))Object.entries(e).forEach(([t,n])=>{let i=this.#e[parseInt(t)];q(n)&&i.fromJSON(n)});else return D("Type mismatch")}};var Nn;(function(r){class e{value;constructor(s){this.value=s}}r.Transfer=e,r.makeTransferable=a=>new e(a),r.sender=(a,s)=>s(new i(a)),r.executor=(a,s)=>new o(a,s);let t=a=>{let s=[];for(let l of a)l instanceof e?s.push(l.value):(l instanceof MessagePort||typeof ImageBitmap<"u"&&l instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&l instanceof OffscreenCanvas)&&s.push(l);return s},n=a=>a instanceof e?a.value:a;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,...l)=>{let u=t(l);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(ht.map(l,p=>({value:n(p)})))},u)};dispatchAndReturn=(s,...l)=>new Promise((u,p)=>{let d=ht.reduce(l,(g,v,y)=>(typeof v=="function"&&g.push([y,v]),g),[]);this.#t.set(this.#i,{executorTuple:{resolve:u,reject:p},callbacks:new Map(d)});let h=t(l);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(ht.map(l,(g,v)=>typeof g=="function"?{callback:v}:{value:n(g)}))},h),this.#i++});#n=s=>{let l=this.#t.get(s.returnId);q(l)?s.type==="resolve"?(l.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(l.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&l.callbacks?.get(s.funcAt).apply(this,s.args):D(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class o{#e;#t;#r;constructor(s,l){this.#e=s,this.#t=l,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{V(s.type==="send",()=>"Message type must be 'send'");let l=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),u=ve(l[s.func],`${s.func.toString()} does not exists on ${this.#t}`),p=s.returnId;if(p===!1)u.apply(this.#t,s.args.map(d=>"value"in d?d.value:D(`${s.func.toString()} has no promise.`)));else try{u.apply(this.#t,s.args.map(h=>"callback"in h?(...g)=>this.#a(p,h.callback,g):h.value)).then(h=>{try{this.#n(p,h)}catch(g){this.#o(p,g)}},h=>this.#o(p,h))}catch(d){this.#o(p,d)}};#n=(s,l)=>this.#e.send({type:"resolve",returnId:s,resolve:l});#o=(s,l)=>this.#e.send({type:"reject",returnId:s,reject:l});#a=(s,l,u)=>this.#e.send({type:"callback",returnId:s,funcAt:l,args:u})}r.Executor=o})(Nn||(Nn={}));var uB={for:r=>new uA(r)},_M=[],uA=class{#e;#t=new ce;constructor(e){if(this.#e=e,q(e.onmessage)||q(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=t=>this.#t.notify(t.data),e.onmessageerror=t=>{throw new Error(t.type)}}send(e,t){this.#e.postMessage(e,t??_M)}channel(e){return new dA(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},dA=class r{#e;#t;#r=new ce;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(n=>{"__id__"in n&&n.__id__==="42"&&"message"in n&&"channel"in n&&n.channel===t&&this.#r.notify(n.message)})}send(e,t){this.#e.send({__id__:"42",channel:this.#t,message:e},t)}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var eh;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let n=e,i=()=>{--n<=0?t():requestAnimationFrame(i)};requestAnimationFrame(i)}),r.timeSpan=(e,...t)=>new Promise(n=>setTimeout(n,e.millis(),...t)),r.event=(e,t)=>new Promise(n=>e.addEventListener(t,n,{once:!0})),r.observable=e=>new Promise(t=>{let n=e.subscribe(()=>{n.terminate(),t()})}),r.complete=e=>new Promise((t,n)=>{let i=setInterval(()=>{let{status:o,value:a,error:s}=Jo(()=>e.next());if(o==="success"){let{done:l,value:u}=a;l&&(clearInterval(i),t(u))}else clearInterval(i),n(s)},0)})})(eh||(eh={}));var pA=class{maxRetry;timeSpan;#e=0;constructor(e,t){this.maxRetry=e,this.timeSpan=t}retry(e,t){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(t,this.timeSpan.millis()),!0)}},Tg;(function(r){class e{value;status="resolved";constructor(s){this.value=s}error=Zs("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(s){this.error=s}value=Zs("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(a,s)=>{let l=!0;return a.own(re.create(()=>l=!1)),new Promise((u,p)=>s.then(d=>{l&&u(d)},d=>{l&&p(d)}))},r.tryCatch=a=>a.then(s=>new e(s),s=>new t(s));let n=new pA(3,jp.seconds(3));r.retry=(a,s=n)=>a().catch(l=>new Promise((u,p)=>{let d=h=>{s.retry(h,()=>a().then(g=>u(g),d))||p(h)};d(l)})),r.guardedRetry=(a,s)=>{let l=async(u=0)=>{try{return await a()}catch(p){if(s(p,++u))return console.debug(`retry after failure (online: ${navigator.onLine}):`,p),await eh.timeSpan(jp.seconds(1)),l(u);throw new Error(`Failed after ${u} retries: ${p}`)}};return l()},r.approvedRetry=(a,s)=>{let l=async()=>{try{return await a()}catch(u){if(await Cc.approve(s(u)))return l();throw u}};return l()},r.delay=(a,s)=>Promise.all([a,eh.timeSpan(s)]).then(([l])=>l),r.fail=(a,s="fail")=>Promise.reject(s),r.timeout=(a,s,l)=>new Promise((u,p)=>{let d=!0,h=setTimeout(()=>{d=!1,p(new Error(l??"timeout"))},s.millis());a.then(g=>{d&&u(g)},g=>{d&&p(g)}).finally(()=>clearTimeout(h))}),r.sequentialAll=a=>a.reduce((s,l)=>s.then(async u=>[...u,await l()]),Promise.resolve([])),r.sequentialize=a=>{let s=Promise.resolve();return l=>{let u=()=>a(l),p=s.then(u,u);return s=p.catch(()=>{}),p}},r.memoizeAsync=(a,s)=>{let l=null,u=Date.now();return()=>{let p=Date.now();return(so(l)||q(s)&&p-u>s.millis())&&(u=p,l=a(),l.catch(d=>(l=null,d))),l}},r.allWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,p=!1,d=async()=>{for(;u<a.length&&!p;){let h=u++;try{let g=await a[h]();p||(l[h]=g)}catch(g){throw p=!0,g}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},d)),l},r.allSettledWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,p=async()=>{for(;u<a.length;){let d=u++;try{let h=await a[d]();l[d]={status:"fulfilled",value:h}}catch(h){l[d]={status:"rejected",reason:h}}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},p)),l};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 l=Promise.withResolvers();return this.#e.push([s,l]),l.promise.finally(()=>this.#r())}}#r(){if(V(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:l,reject:u}]=this.#e.shift();this.#t++,s().then(l,u)}}}r.Limit=i;class o{#e;#t;#r;#i=m.None;constructor(s,l,u){this.#e=s,this.#t=l,this.#r=u}update(s){this.#i=m.wrap(s),s.then(l=>{this.#i.contains(s)&&this.#e(l)}).catch(l=>{this.#i.contains(s)&&this.#t(l)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),P(this.#r))})}terminate(){this.#i=m.None}}r.Latest=o})(Tg||(Tg={}));var dB=(r,e)=>Nn.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(n=>{let i=n.type;i==="new"?r.createBox(n.name,n.uuid,o=>o.read(new It(n.buffer))):i==="update-primitive"?r.findVertex(ke.reconstruct(n.address)).unwrap(()=>`Could not find primitive field ${n.address}`).setValue(n.value):i==="update-pointer"?r.findVertex(ke.reconstruct(n.address)).unwrap(()=>`Could not find pointer field ${n.address}`).targetAddress=q(n.target)?m.wrap(ke.reconstruct(n.target)):m.None:n.type==="delete"&&r.unstageBox(r.findBox(n.uuid).unwrap(()=>`Could not find box ${A.toString(n.uuid)}`))}),r.endTransaction()}checksum(t){return U.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var nl;(function(r){r.create=(e,t,n,i)=>{switch(e){case"MetaDataBox":return ia.create(t,n,i);case"RootBox":return Wc.create(t,n,i);case"SelectionBox":return ol.create(t,n,i);case"UserInterfaceBox":return al.create(t,n,i);case"UploadFileBox":return Rg.create(t,n,i);case"ShadertoyBox":return Cg.create(t,n,i);case"MIDIControllerBox":return Og.create(t,n,i);case"TimelineBox":return sl.create(t,n,i);case"TrackBox":return Wr.create(t,n,i);case"NoteEventBox":return Oa.create(t,n,i);case"NoteEventRepeatBox":return Vg.create(t,n,i);case"NoteEventCollectionBox":return na.create(t,n,i);case"NoteRegionBox":return ll.create(t,n,i);case"NoteClipBox":return Zc.create(t,n,i);case"ValueEventBox":return In.create(t,n,i);case"ValueEventCollectionBox":return Dn.create(t,n,i);case"ValueEventCurveBox":return Va.create(t,n,i);case"ValueRegionBox":return cl.create(t,n,i);case"ValueClipBox":return Gc.create(t,n,i);case"SignatureEventBox":return qc.create(t,n,i);case"AudioRegionBox":return za.create(t,n,i);case"AudioClipBox":return Hc.create(t,n,i);case"AudioPitchStretchBox":return Jc.create(t,n,i);case"AudioTimeStretchBox":return Qc.create(t,n,i);case"TransientMarkerBox":return zg.create(t,n,i);case"WarpMarkerBox":return Ua.create(t,n,i);case"MarkerBox":return Yc.create(t,n,i);case"AudioFileBox":return br.create(t,n,i);case"SoundfontFileBox":return yo.create(t,n,i);case"NeuralAmpModelBox":return Ug.create(t,n,i);case"AudioUnitBox":return Pt.create(t,n,i);case"CaptureAudioBox":return ja.create(t,n,i);case"CaptureMidiBox":return La.create(t,n,i);case"AudioBusBox":return kn.create(t,n,i);case"AuxSendBox":return Xc.create(t,n,i);case"GrooveShuffleBox":return eu.create(t,n,i);case"UnknownAudioEffectDeviceBox":return jg.create(t,n,i);case"UnknownMidiEffectDeviceBox":return Lg.create(t,n,i);case"DeviceInterfaceKnobBox":return Kg.create(t,n,i);case"ModularDeviceBox":return Wg.create(t,n,i);case"StereoToolDeviceBox":return Zg.create(t,n,i);case"MaximizerDeviceBox":return Gg.create(t,n,i);case"CompressorDeviceBox":return tu.create(t,n,i);case"GateDeviceBox":return qg.create(t,n,i);case"DelayDeviceBox":return Hg.create(t,n,i);case"CrusherDeviceBox":return Jg.create(t,n,i);case"DattorroReverbDeviceBox":return Qg.create(t,n,i);case"VelocityDeviceBox":return Yg.create(t,n,i);case"FoldDeviceBox":return Xg.create(t,n,i);case"TidalDeviceBox":return ev.create(t,n,i);case"RevampDeviceBox":return tv.create(t,n,i);case"ReverbDeviceBox":return rv.create(t,n,i);case"VaporisateurDeviceBox":return ru.create(t,n,i);case"MIDIOutputDeviceBox":return iu.create(t,n,i);case"MIDIOutputBox":return Mn.create(t,n,i);case"MIDIOutputParameterBox":return $n.create(t,n,i);case"SoundfontDeviceBox":return nu.create(t,n,i);case"NanoDeviceBox":return ou.create(t,n,i);case"PlayfieldDeviceBox":return au.create(t,n,i);case"PlayfieldSampleBox":return Ka.create(t,n,i);case"TapeDeviceBox":return su.create(t,n,i);case"ArpeggioDeviceBox":return iv.create(t,n,i);case"PitchDeviceBox":return nv.create(t,n,i);case"ZeitgeistDeviceBox":return ov.create(t,n,i);case"NeuralAmpDeviceBox":return av.create(t,n,i);case"ModularBox":return sv.create(t,n,i);case"ModuleConnectionBox":return lv.create(t,n,i);case"ModularAudioInputBox":return cv.create(t,n,i);case"ModularAudioOutputBox":return uv.create(t,n,i);case"ModuleDelayBox":return dv.create(t,n,i);case"ModuleMultiplierBox":return pv.create(t,n,i);case"ModuleGainBox":return hv.create(t,n,i);default:return D(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let n=new It(t),i=n.readString(),o=A.fromDataInput(n),a=r.create(i,e,o);return a.read(n),a}})(nl||(nl={}));var pB;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(pB||(pB={}));var hB;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(hB||(hB={}));var Qt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(Qt||(Qt={}));var Wa={white:new Ht(0,0,100),blue:new Ht(189,100,65),green:new Ht(150,77,69),yellow:new Ht(60,100,84),cream:new Ht(65,20,83),orange:new Ht(31,100,73),red:new Ht(354,100,65),purple:new Ht(314,100,78),bright:new Ht(197,5,95),gray:new Ht(197,31,80),dark:new Ht(197,15,60),shadow:new Ht(197,10,45),black:new Ht(197,10,16),background:new Ht(197,6,7),panelBackground:new Ht(197,14,10),panelBackgroundBright:new Ht(197,10,17),panelBackgroundDark:new Ht(197,14,9)};var He;(function(r){r[r.Add=0]="Add",r[r.Adsr=1]="Adsr",r[r.ArrayDown=2]="ArrayDown",r[r.AudioBus=3]="AudioBus",r[r.AudioDevice=4]="AudioDevice",r[r.AudioFile=5]="AudioFile",r[r.AutoGain=6]="AutoGain",r[r.Automation=7]="Automation",r[r.BassGuitar=8]="BassGuitar",r[r.Book=9]="Book",r[r.Box=10]="Box",r[r.Browse=11]="Browse",r[r.Maximizer=12]="Maximizer",r[r.Bug=13]="Bug",r[r.Fold=14]="Fold",r[r.Checkbox=15]="Checkbox",r[r.Clips=16]="Clips",r[r.Close=17]="Close",r[r.CloudFolder=18]="CloudFolder",r[r.CollapseDown=19]="CollapseDown",r[r.Compressor=20]="Compressor",r[r.Connected=21]="Connected",r[r.Cube=22]="Cube",r[r.Cursor=23]="Cursor",r[r.Curve=24]="Curve",r[r.Dattorro=25]="Dattorro",r[r.Delete=26]="Delete",r[r.Dial=27]="Dial",r[r.DinSlot=28]="DinSlot",r[r.Disconnected=29]="Disconnected",r[r.Divide=30]="Divide",r[r.DragConnections=31]="DragConnections",r[r.Dropdown=32]="Dropdown",r[r.Dropbox=33]="Dropbox",r[r.DrumSet=34]="DrumSet",r[r.Tidal=35]="Tidal",r[r.Duration=36]="Duration",r[r.EditBox=37]="EditBox",r[r.Effects=38]="Effects",r[r.Embed=39]="Embed",r[r.EQ=40]="EQ",r[r.Eraser=41]="Eraser",r[r.Exclude=42]="Exclude",r[r.Exit=43]="Exit",r[r.ExpandWidth=44]="ExpandWidth",r[r.FileList=45]="FileList",r[r.Film=46]="Film",r[r.Flask=47]="Flask",r[r.Focus=48]="Focus",r[r.Gate=49]="Gate",r[r.Generator=50]="Generator",r[r.GoogleDrive=51]="GoogleDrive",r[r.Groove=52]="Groove",r[r.Guitar=53]="Guitar",r[r.GuitarTab=54]="GuitarTab",r[r.Headphone=55]="Headphone",r[r.Heart=56]="Heart",r[r.Help=57]="Help",r[r.HighPass=58]="HighPass",r[r.HighShelf=59]="HighShelf",r[r.Insert=60]="Insert",r[r.Invert=61]="Invert",r[r.Info=62]="Info",r[r.Loop=63]="Loop",r[r.LoopEnd=64]="LoopEnd",r[r.LoopStart=65]="LoopStart",r[r.LowPass=66]="LowPass",r[r.LowShelf=67]="LowShelf",r[r.Magnet=68]="Magnet",r[r.MainMenu=69]="MainMenu",r[r.Maximized=70]="Maximized",r[r.Menu=71]="Menu",r[r.Merge=72]="Merge",r[r.Metronome=73]="Metronome",r[r.Microphone=74]="Microphone",r[r.Midi=75]="Midi",r[r.Minimized=76]="Minimized",r[r.Mix=77]="Mix",r[r.Mixing=78]="Mixing",r[r.Mute=79]="Mute",r[r.NanoWave=80]="NanoWave",r[r.NeuralAmp=81]="NeuralAmp",r[r.New=82]="New",r[r.NoAudio=83]="NoAudio",r[r.Note=84]="Note",r[r.NotePad=85]="NotePad",r[r.OpenDAW=86]="OpenDAW",r[r.Panel=87]="Panel",r[r.Peak=88]="Peak",r[r.Pencil=89]="Pencil",r[r.Piano=90]="Piano",r[r.Play=91]="Play",r[r.Playfield=92]="Playfield",r[r.PlayOnce=93]="PlayOnce",r[r.PlayRepeat=94]="PlayRepeat",r[r.PlayAlternate=95]="PlayAlternate",r[r.Pointer=96]="Pointer",r[r.Popout=97]="Popout",r[r.Primary=98]="Primary",r[r.Random=99]="Random",r[r.Record=100]="Record",r[r.Rectangle=101]="Rectangle",r[r.Redo=102]="Redo",r[r.Region=103]="Region",r[r.Robot=104]="Robot",r[r.RoundDown=105]="RoundDown",r[r.RoundUp=106]="RoundUp",r[r.Run=107]="Run",r[r.Sawtooth=108]="Sawtooth",r[r.Saxophone=109]="Saxophone",r[r.Scissors=110]="Scissors",r[r.Search=111]="Search",r[r.Shadertoy=112]="Shadertoy",r[r.Shutdown=113]="Shutdown",r[r.Sine=114]="Sine",r[r.Solo=115]="Solo",r[r.SoundFont=116]="SoundFont",r[r.Speaker=117]="Speaker",r[r.SpeakerHeadphone=118]="SpeakerHeadphone",r[r.Square=119]="Square",r[r.Stack=120]="Stack",r[r.Start=121]="Start",r[r.Stereo=122]="Stereo",r[r.Stop=123]="Stop",r[r.Subtract=124]="Subtract",r[r.Sun=125]="Sun",r[r.Swap=126]="Swap",r[r.System=127]="System",r[r.Table=128]="Table",r[r.Tape=129]="Tape",r[r.TapeReel=130]="TapeReel",r[r.Time=131]="Time",r[r.Timeline=132]="Timeline",r[r.Tool=133]="Tool",r[r.Triangle=134]="Triangle",r[r.Undo=135]="Undo",r[r.Unknown=136]="Unknown",r[r.UserFolder=137]="UserFolder",r[r.Velocity=138]="Velocity",r[r.Vinyl=139]="Vinyl",r[r.Volume=140]="Volume",r[r.VUMeter=141]="VUMeter",r[r.Waveform=142]="Waveform",r[r.Zeitgeist=143]="Zeitgeist"})(He||(He={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(He||(He={}));var c;(function(r){r[r.Deprecated=NaN]="Deprecated",r[r.MetaData=0]="MetaData",r[r.AudioBusses=1]="AudioBusses",r[r.AudioConnection=2]="AudioConnection",r[r.AudioEffectHost=3]="AudioEffectHost",r[r.AudioFile=4]="AudioFile",r[r.AudioOutput=5]="AudioOutput",r[r.AudioPlayMode=6]="AudioPlayMode",r[r.AudioUnit=7]="AudioUnit",r[r.AudioUnits=8]="AudioUnits",r[r.Automation=9]="Automation",r[r.AuxSend=10]="AuxSend",r[r.Capture=11]="Capture",r[r.ClipCollection=12]="ClipCollection",r[r.ConnectionCollection=13]="ConnectionCollection",r[r.Device=14]="Device",r[r.DeviceUserInterface=15]="DeviceUserInterface",r[r.Editing=16]="Editing",r[r.FileUploadState=17]="FileUploadState",r[r.Groove=18]="Groove",r[r.InstrumentHost=19]="InstrumentHost",r[r.MarkerEvents=20]="MarkerEvents",r[r.MarkerTrack=21]="MarkerTrack",r[r.MIDIControl=22]="MIDIControl",r[r.MIDIControllers=23]="MIDIControllers",r[r.MIDIDevice=24]="MIDIDevice",r[r.MIDIEffectHost=25]="MIDIEffectHost",r[r.ModularSetup=26]="ModularSetup",r[r.Modulation=27]="Modulation",r[r.ModuleCollection=28]="ModuleCollection",r[r.NoteEventCollection=29]="NoteEventCollection",r[r.NoteEventFeature=30]="NoteEventFeature",r[r.NoteEvents=31]="NoteEvents",r[r.NotesConnection=32]="NotesConnection",r[r.Parameter=33]="Parameter",r[r.ParameterController=34]="ParameterController",r[r.PianoMode=35]="PianoMode",r[r.RegionCollection=36]="RegionCollection",r[r.Sample=37]="Sample",r[r.Selection=38]="Selection",r[r.Shadertoy=39]="Shadertoy",r[r.SideChain=40]="SideChain",r[r.SignatureAutomation=41]="SignatureAutomation",r[r.SoundfontFile=42]="SoundfontFile",r[r.StepAutomation=43]="StepAutomation",r[r.Timeline=44]="Timeline",r[r.TrackCollection=45]="TrackCollection",r[r.TransientMarkers=46]="TransientMarkers",r[r.User=47]="User",r[r.ValueEventCollection=48]="ValueEventCollection",r[r.ValueEvents=49]="ValueEvents",r[r.ValueInterpolation=50]="ValueInterpolation",r[r.VoltageConnection=51]="VoltageConnection",r[r.WarpMarkers=52]="WarpMarkers",r[r.NeuralAmpModel=53]="NeuralAmpModel"})(c||(c={}));var Za;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(Za||(Za={}));var xo;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(xo||(xo={}));var ia=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:f,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 P(e.visitMetaDataBox,this)}get tags(){return r.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:f},c.MetaData,!0),2:C.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:f})}}};var fv=class r extends qe{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:f},{length:4},"",0),2:b.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:f},{min:1,max:64,scaling:"linear"},"",8),3:b.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:f},{min:.5,max:2,scaling:"linear"},"",1),4:M.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:f},!1),5:E.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:f},{min:-48,max:48},"st",0)}}};var Wc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:{accepts:[c.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 P(e.visitRootBox,this)}get tags(){return r.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 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 editingChannel(){return this.getField(111)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:f},c.Timeline,!0),2:X.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[c.User],mandatory:!0,exclusive:!1}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:f}),4:N.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0),10:X.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!1,exclusive:!1}}),20:X.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[c.AudioUnits],mandatory:!1,exclusive:!1}}),21:X.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[c.AudioBusses],mandatory:!1,exclusive:!1}}),30:X.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!0,exclusive:!1}}),35:X.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!1,exclusive:!1}}),40:fv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:f}),100:N.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:f},c.Shadertoy,!1),111:N.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:f},c.Editing,!1)}}};var ol=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:f,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 P(e.visitSelectionBox,this)}get tags(){return r.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:f},c.Selection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:f},c.Selection,!0)}}};var al=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[c.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 P(e.visitUserInterfaceBox,this)}get tags(){return r.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:f},c.User,!0),10:X.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[c.Selection],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[c.FileUploadState],mandatory:!1,exclusive:!1}}),21:N.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:f},c.Editing,!1),22:N.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:f},c.Editing,!1),23:N.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:f},c.Editing,!1),30:X.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[c.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var Rg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:f,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 P(e.visitUploadFileBox,this)}get tags(){return r.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:f},c.FileUploadState,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.FileUploadState,!0)}}};var Cg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[c.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 P(e.visitShadertoyBox,this)}get tags(){return r.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:f}),2:M.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:f},!0)}}};var Og=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIControllerBox",pointerRules:f,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 P(e.visitMIDIControllerBox,this)}get tags(){return r.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:f},c.MIDIControllers,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.MIDIControl,!0),3:C.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:f}),4:E.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:f},{min:0,max:127},""),5:E.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:f},{min:0,max:127},"")}}};var mv=class r extends qe{static create(e){return new r(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4),2:E.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4)}}};var gv=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),2:E.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:f},"any","ppqn",0),3:E.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:f},"any","ppqn",15360)}}};var vv=class r extends qe{static create(e){return new r(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:X.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1,exclusive:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var yv=class r extends qe{static create(e){return new r(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:f},c.ValueEventCollection,!1),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",2),15:E.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:f},{min:30,max:999},"bpm",60),16:E.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:f},{min:31,max:1e3},"bpm",240),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var xv=class r extends qe{static create(e){return new r(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:X.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",1),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var sl=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:{accepts:[c.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 P(e.visitTimelineBox,this)}get tags(){return r.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:X.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[c.Timeline],mandatory:!0,exclusive:!1}}),10:mv.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:f}),11:gv.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:f}),20:X.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1,exclusive:!1}}),21:vv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:f}),22:yv.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:f}),23:xv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:f}),30:E.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:f},"positive","ppqn",491520),31:b.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:f},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var Wr=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[c.Selection,c.PianoMode,c.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 P(e.visitTrackBox,this)}get tags(){return r.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:f},c.TrackCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:f},c.Automation,!0),3:X.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[c.RegionCollection],mandatory:!1,exclusive:!1}}),4:X.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[c.ClipCollection],mandatory:!1,exclusive:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),11:E.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:f},{values:[0,1,2,3]},""),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),30:M.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:f},!1)}}};var Oa=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[c.Selection,c.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 P(e.visitNoteEventBox,this)}get tags(){return r.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:f},c.NoteEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn",240),20:E.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),21:b.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:f},"unipolar","%",.7874015748031497),22:E.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),23:b.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:f},"bipolar","%",0),24:b.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:f},{min:-50,max:50,scaling:"linear"},"ct",0),25:E.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:f},{min:0,max:100},"",100)}}};var Vg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:f,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 P(e.visitNoteEventRepeatBox,this)}get tags(){return r.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:f},c.NoteEventFeature,!0),2:E.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),3:b.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:f},"bipolar","%",0),4:b.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:f},"unipolar","%",1)}}};var na=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[c.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 P(e.visitNoteEventCollectionBox,this)}get tags(){return r.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.NoteEvents],mandatory:!1,exclusive:!1}}),2:X.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var ll=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitNoteRegionBox,this)}get tags(){return r.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:f},c.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:E.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:f},"any","ppqn"),15:M.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:f}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:f}),17:E.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Ga=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:f},!0),2:M.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:f}),3:M.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:f}),4:E.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:f},"non-negative",""),5:E.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:f},"non-negative",""),6:E.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:f},"non-negative","")}}};var Zc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitNoteClipBox,this)}get tags(){return r.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:f},c.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:Ga.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var In=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[c.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 P(e.visitValueEventBox,this)}get tags(){return r.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:f},c.ValueEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:E.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[c.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:b.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:f},"any",""),14:b.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:f},"any","",NaN)}}};var Dn=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[c.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 P(e.visitValueEventCollectionBox,this)}get tags(){return r.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.ValueEvents],mandatory:!1,exclusive:!1}}),2:X.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Va=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:f,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 P(e.visitValueEventCurveBox,this)}get tags(){return r.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:f},c.ValueInterpolation,!0),2:b.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:f},"unipolar","%",.5)}}};var cl=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitValueRegionBox,this)}get tags(){return r.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:f},c.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Gc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitValueClipBox,this)}get tags(){return r.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:f},c.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:Ga.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var qc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[c.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 P(e.visitSignatureEventBox,this)}get tags(){return r.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:f},c.SignatureAutomation,!0),9:E.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),10:E.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:f},"positive","bars",1),21:E.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:f},"positive","",4),22:E.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:f},"positive","",4)}}};var bv=class r extends qe{static create(e){return new r(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:b.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:f},"positive","ppqn",0),2:b.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:f},"positive","ppqn",0),3:b.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:f},"unipolar","ratio",.75),4:b.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:f},"unipolar","ratio",.25)}}};var za=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitAudioRegionBox,this)}get tags(){return r.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:f},c.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:f}),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical"),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:b.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"any","mixed"),12:b.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","mixed"),13:b.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"any","mixed"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db"),18:bv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:f})}}};var Hc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.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 P(e.visitAudioClipBox,this)}get tags(){return r.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:f},c.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:Ga.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:b.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),14:b.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db"),20:C.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:f}),21:C.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical")}}};var Jc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[c.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 P(e.visitAudioPitchStretchBox,this)}get tags(){return r.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[c.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var Qc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[c.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 P(e.visitAudioTimeStretchBox,this)}get tags(){return r.Tags}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[c.WarpMarkers],mandatory:!0,exclusive:!1}}),2:E.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:f},"positive","enum",2),3:b.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:f},"positive","ratio",1)}}};var zg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[c.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 P(e.visitTransientMarkerBox,this)}get tags(){return r.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:f},c.TransientMarkers,!0),2:b.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var Ua=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[c.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 P(e.visitWarpMarkerBox,this)}get tags(){return r.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:f},c.WarpMarkers,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:b.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var Yc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[c.Selection,c.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 P(e.visitMarkerBox,this)}get tags(){return r.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:f},c.MarkerTrack,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:E.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:f},"non-negative","",1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:E.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var br=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[c.AudioFile,c.FileUploadState,c.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 P(e.visitAudioFileBox,this)}get tags(){return r.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:b.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),2:b.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[c.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var yo=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[c.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 P(e.visitSoundfontFileBox,this)}get tags(){return r.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:f})}}};var Ug=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NeuralAmpModelBox",pointerRules:{accepts:[c.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 P(e.visitNeuralAmpModelBox,this)}get tags(){return r.Tags}get label(){return this.getField(1)}get model(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:f})}}};var Pt=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[c.Selection,c.Automation,c.MetaData,c.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 P(e.visitAudioUnitBox,this)}get tags(){return r.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)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:f},"instrument"),2:N.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:f},c.AudioUnits,!0),3:X.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1,exclusive:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:b.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),20:X.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[c.TrackCollection],mandatory:!1,exclusive:!1}}),21:X.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:X.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.InstrumentHost,c.AudioOutput],mandatory:!1,exclusive:!0}}),23:X.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:X.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[c.AuxSend],mandatory:!1,exclusive:!1}}),25:N.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!1),26:N.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:f},c.Capture,!1)}}};var ja=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[c.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 P(e.visitCaptureAudioBox,this)}get tags(){return r.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)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:f},"any","",2),11:b.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:f},"decibel","dB",0)}}};var La=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[c.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 P(e.visitCaptureMidiBox,this)}get tags(){return r.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:f},"any","",-1)}}};var kn=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:{accepts:[c.SideChain,c.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 P(e.visitAudioBusBox,this)}get tags(){return r.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:f},c.AudioBusses,!0),2:N.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:X.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!1,exclusive:!1}}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:f}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:f}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:f},"red"),8:M.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:f})}}};var Xc=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:{accepts:[c.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 P(e.visitAuxSendBox,this)}get tags(){return r.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:f},c.AuxSend,!0),2:N.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:E.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1),5:b.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:b.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var eu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[c.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 P(e.visitGrooveShuffleBox,this)}get tags(){return r.Tags}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:f}),10:b.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"non-negative","ppqn",480)}}};var jg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitUnknownAudioEffectDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var Lg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitUnknownMidiEffectDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var Kg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:f,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 P(e.visitDeviceInterfaceKnobBox,this)}get tags(){return r.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:f},c.DeviceUserInterface,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.ParameterController,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),10:b.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:f},"unipolar","%"),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:f})}}};var wv=class r extends qe{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:X.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[c.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var Wg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitModularDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:f},c.ModularSetup,!0),11:wv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:f})}}};var Zg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitStereoToolDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:b.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:b.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:M.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),14:M.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1)}}};var Gg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitMaximizerDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:M.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:f},!0),11:b.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:0,scaling:"linear"},"dB",0)}}};var tu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitCompressorDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:M.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:M.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:M.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:M.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:b.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:b.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:b.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:b.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:b.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:b.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:b.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:b.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:f},c.SideChain,!1)}}};var qg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"GateDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitGateDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-6),11:b.create({parent:this,fieldKey:11,fieldName:"return",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),12:b.create({parent:this,fieldKey:12,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",1),13:b.create({parent:this,fieldKey:13,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:500,scaling:"linear"},"ms",50),14:b.create({parent:this,fieldKey:14,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:2e3,scaling:"linear"},"ms",100),15:b.create({parent:this,fieldKey:15,fieldName:"floor",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,max:0,scaling:"linear"},"dB",-72),16:M.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:f},c.SideChain,!1)}}};var Hg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitDelayDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:b.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:b.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),16:b.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:b.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:b.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:b.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:b.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:b.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:b.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:f},"any","")}}};var Jg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitCrusherDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:E.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"bits",16),12:b.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:b.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Qg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitDattorroReverbDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:b.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:b.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:b.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:b.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:b.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:b.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:b.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:b.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:b.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:b.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),21:b.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Yg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitVelocityDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:E.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:f},"any","",2048),13:b.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:b.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:b.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Xg=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitFoldDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:E.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:f},{length:3},"",0),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var ev=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitTidalDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:b.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:b.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",3),21:b.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:b.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:b.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var th=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:E.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var rh=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var lu=class r extends qe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var tv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitRevampDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:th.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:f}),11:rh.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:f}),12:lu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:f}),13:lu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:f}),14:lu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:f}),15:rh.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:f}),16:th.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:f}),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var rv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitReverbDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:b.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Av=class r extends qe{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",-1/0),3:E.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),4:b.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var _v=class r extends qe{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:M.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:b.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var Pv=class r extends qe{static create(e){return new r(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:b.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:b.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:b.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:b.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",.001)}}};var ru=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitVaporisateurDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),11:E.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:b.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:E.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:b.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:b.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:b.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:b.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:b.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:b.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:b.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:b.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:E.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),23:E.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,3,5]},"",1),24:b.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:b.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:E.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,2,3,4]},"",1),27:b.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:_v.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:f}),40:kg.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:f},e=>Av.create(e),2),50:Pv.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:f}),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:f},"any","")}}};var Sv=class r extends qe{static create(e){return new r(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:f}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f})}}};var iu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitMIDIOutputDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:Sv.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:f}),11:E.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:f},{min:0,max:15},"ch"),12:E.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:f},"any","ms",10),13:X.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[c.Parameter],mandatory:!1,exclusive:!1}}),14:N.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:f},c.MIDIDevice,!1)}}};var Mn=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:f,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 P(e.visitMIDIOutputBox,this)}get tags(){return r.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:f},c.MIDIDevice,!0),2:X.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!0,exclusive:!1}}),3:C.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:f}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:E.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:f},{min:0,max:500},"ms",10),6:M.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:f},!0)}}};var $n=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:f,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 P(e.visitMIDIOutputParameterBox,this)}get tags(){return r.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:f},c.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f},""),3:E.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:f},{min:0,max:127},"#",64),4:b.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var nu=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitSoundfontDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:N.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:f},c.SoundfontFile,!1),11:E.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:f},{min:0,max:65535},"")}}};var ou=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitNanoDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:N.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!1),20:b.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var au=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitPlayfieldDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:X.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[c.Sample],mandatory:!1,exclusive:!1}})}}};var Ka=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[c.Editing,c.SideChain,c.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 P(e.visitPlayfieldSampleBox,this)}get tags(){return r.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)}initializeFields(){return{10:N.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:f},c.Sample,!0),11:N.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),12:X.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:X.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:E.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:f}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:f}),22:M.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),23:M.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),40:M.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:f}),41:M.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:f}),42:M.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:f}),43:M.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:f}),44:E.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:f},{length:3},"",0),45:b.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:b.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:b.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:b.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:b.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var su=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain,c.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 P(e.visitTapeDeviceBox,this)}get tags(){return r.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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:b.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var iv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitArpeggioDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:E.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),11:E.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:5},"oct",1),12:E.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{length:17},"",9),13:b.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:2,scaling:"linear"},"",1),14:E.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"",1),15:b.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var nv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitPitchDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:E.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-36,max:36},"st",0),11:b.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:E.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:-7,max:7},"oct",0)}}};var ov=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.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 P(e.visitZeitgeistDeviceBox,this)}get tags(){return r.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:f},c.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:N.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0)}}};var av=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NeuralAmpDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.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 P(e.visitNeuralAmpDeviceBox,this)}get tags(){return r.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:f},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:f}),11:b.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),12:b.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),13:M.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:f},!0),14:b.create({parent:this,fieldKey:14,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1,scaling:"linear"},"%",1),20:N.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:f},c.NeuralAmpModel,!1)}}};var sv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:f,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 P(e.visitModularBox,this)}get tags(){return r.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:f},c.ModularSetup,!0),2:X.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!0,exclusive:!1}}),3:X.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[c.ModuleCollection],mandatory:!1,exclusive:!1}}),12:X.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[c.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:f})}}};var lv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:f,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 P(e.visitModuleConnectionBox,this)}get tags(){return r.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:f},c.ConnectionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:f},c.VoltageConnection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:f},c.VoltageConnection,!0)}}};var Hi=class r extends qe{static create(e){return new r(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:f},c.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:E.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:f},"any","x"),4:E.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:f},"any","y"),5:M.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:f},!1),6:M.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:f},!0)}}};var cv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[c.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 P(e.visitModularAudioInputBox,this)}get tags(){return r.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var uv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[c.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 P(e.visitModularAudioOutputBox,this)}get tags(){return r.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var dv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[c.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 P(e.visitModuleDelayBox,this)}get tags(){return r.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:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var pv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[c.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 P(e.visitModuleMultiplierBox,this)}get tags(){return r.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:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),11:X.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),12:X.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:f},"unipolar","%")}}};var hv=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[c.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 P(e.visitModuleGainBox,this)}get tags(){return r.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:Hi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:X.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),12:X.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1,exclusive:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var Ev=class{#e=0;#t=!1;#r=!1;isRecording=!1;isCountingIn=!1;metronomeEnabled=!1;getLeapStateAndReset(){let e=this.#r;return this.#r=!1,e}get position(){return this.#e}set position(e){this.#e=e,this.#r=!0}get transporting(){return this.#t}set transporting(e){this.#t!==e&&(this.#t=e)}pause(){this.#t=!1,this.isRecording=!1,this.isCountingIn=!1}advanceTo(e){this.#e=e}};var fB=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?D(`Indices cannot be equal (${r}, ${e})`):t};var oa=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},wr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fv,Tn,qa,Bv,aa,ar=class r{static create(e,t,n){return new r(e,t,n)}constructor(e,t,n){Fv.set(this,void 0),Tn.set(this,void 0),qa.set(this,void 0),Bv.set(this,void 0),aa.set(this,null),oa(this,Fv,e,"f"),oa(this,Tn,A.newSet(i=>i.adapter.uuid),"f"),oa(this,qa,new or,"f"),oa(this,Bv,e.pointerHub.catchupAndSubscribe({onAdded:i=>{oa(this,aa,null,"f");let o=t(i.box),a=o.indexField.subscribe(()=>{oa(this,aa,null,"f"),wr(this,qa,"f").proxy.onReorder(o)}),s=wr(this,Tn,"f").add({adapter:o,subscription:a});V(s,`Could not add ${o}`),wr(this,qa,"f").proxy.onAdd(o)},onRemoved:i=>{oa(this,aa,null,"f");let o=i.box.address.uuid,{adapter:a,subscription:s}=wr(this,Tn,"f").removeByKey(o);s.terminate(),wr(this,qa,"f").proxy.onRemove(a)}},n),"f")}field(){return wr(this,Fv,"f")}subscribe(e){return wr(this,qa,"f").subscribe(e)}catchupAndSubscribe(e){return wr(this,Tn,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=ct.exactMapped(this.adapters(),e,fB,n=>n.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return wr(this,Tn,"f").opt(e).map(({adapter:t})=>t)}getMinFreeIndex(){let e=this.adapters();for(let t=0;t<e.length;t++)if(e[t].indexField.getValue()>t)return t;return e.length}adapters(){return wr(this,aa,"f")===null&&oa(this,aa,wr(this,Tn,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),wr(this,aa,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let n=this.adapters(),i=n[e];if(t<0){let o=we(e+t,0,n.length-1);for(let a=o;a<e;a++)n[a].indexField.setValue(a+1);i.indexField.setValue(o)}else if(t>1){let o=we(e+(t-1),0,n.length-1);for(let a=e;a<o;a++)n[a+1].indexField.setValue(a);i.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return wr(this,Tn,"f").size()}isEmpty(){return this.size()===0}terminate(){oa(this,aa,null,"f"),wr(this,Tn,"f").forEach(({subscription:e})=>e.terminate()),wr(this,Tn,"f").clear(),wr(this,qa,"f").terminate(),wr(this,Bv,"f").terminate()}};Fv=new WeakMap,Tn=new WeakMap,qa=new WeakMap,Bv=new WeakMap,aa=new WeakMap;var si;(function(r){r.write=(e,t)=>{if(t.type==="none")e.disconnect(),e.setValue(0);else if(t.type==="linear")e.disconnect(),e.setValue(1);else if(t.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(c.ValueInterpolation).at(0)?.box;q(n)?(W0(n,Va),n.slope.setValue(t.slope)):Va.create(e.box.graph,A.generate(),i=>{i.slope.setValue(t.slope),i.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return q(t)?(W0(t,Va),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?ai.None:e.getValue()===1?ai.Linear:D("Unknown Interpolation value")}})(si||(si={}));var Ha=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xe=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ih,cu,$t,nh,Ja,oh,sa=class r{constructor(e,t){this.type="value-event",ih.set(this,new j),cu.set(this,void 0),$t.set(this,void 0),nh.set(this,void 0),Ja.set(this,void 0),oh.set(this,!1),Ha(this,cu,e,"f"),Ha(this,$t,t,"f"),Ha(this,nh,Xe(this,ih,"f").own(new sg(()=>si.read(Xe(this,$t,"f").interpolation))),"f");let n=()=>{Xe(this,nh,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Xe(this,ih,"f").ownAll(Xe(this,$t,"f").subscribe(Ue.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let o=this.collection.unwrap(),a=i.address.fieldKeys,s=U.equals(Xe(this,$t,"f").index.address.fieldKeys,a),l=U.equals(Xe(this,$t,"f").position.address.fieldKeys,a);s||l?o.requestSorting():o.onEventPropertyChanged()}}),Xe(this,$t,"f").interpolation.subscribe(n),Xe(this,$t,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Xe(this,Ja,"f").terminate(),Ha(this,Ja,i.subscribe(Ue.Children,n),"f"),n()},onRemoved:()=>{Xe(this,Ja,"f").terminate(),Ha(this,Ja,re.Empty,"f"),n()}})),Ha(this,Ja,Xe(this,$t,"f").interpolation.pointerHub.filter(c.ValueInterpolation).at(0)?.box.subscribe(Ue.Children,n)??re.Empty,"f")}onSelected(){Ha(this,oh,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Ha(this,oh,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Xe(this,Ja,"f").terminate(),Xe(this,ih,"f").terminate()}get box(){return Xe(this,$t,"f")}get uuid(){return Xe(this,$t,"f").address.uuid}get address(){return Xe(this,$t,"f").address}get position(){return Xe(this,$t,"f").position.getValue()}get index(){return Xe(this,$t,"f").index.getValue()}set interpolation(e){si.write(Xe(this,$t,"f").interpolation,e)}get interpolation(){return Xe(this,nh,"f").get()}get value(){return Xe(this,$t,"f").value.getValue()}get isSelected(){return Xe(this,oh,"f")}get collection(){return Xe(this,$t,"f").events.targetVertex.map(e=>Xe(this,cu,"f").boxAdapters.adapterFor(e.box,Ar))}copyTo(e){let t=e?.position??this.position,n=e?.index??this.index,i=In.create(Xe(this,cu,"f").boxGraph,A.generate(),o=>{o.position.setValue(t),o.index.setValue(n),o.events.refer(e?.events??this.collection.unwrap().box.events),o.value.setValue(e?.value??this.value)});return si.write(i.interpolation,e?.interpolation??this.interpolation),Xe(this,cu,"f").boxAdapters.adapterFor(i,r)}copyFrom(e){return Xe(this,$t,"f").position.setValue(e?.position??this.position),Xe(this,$t,"f").index.setValue(e?.index??this.index),Xe(this,$t,"f").events.refer(e?.events??this.collection.unwrap().box.events),Xe(this,$t,"f").value.setValue(e?.value??this.value),si.write(Xe(this,$t,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};ih=new WeakMap,cu=new WeakMap,$t=new WeakMap,nh=new WeakMap,Ja=new WeakMap,oh=new WeakMap;sa.Comparator=(r,e)=>{if(r===e)return D(`${r} is equal to itself`);let t=r.position-e.position;if(t!==0)return t;let n=r.index-e.index;return n!==0?n:D(`${r} and ${e} are identical in terms of comparison`)};var ah=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Qe=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},sh,lh,Qa,Ji,ul,uu,la,Nv,Ar=class r{constructor(e,t){sh.add(this),lh.set(this,new j),Qa.set(this,void 0),Ji.set(this,void 0),ul.set(this,void 0),uu.set(this,void 0),la.set(this,void 0),ah(this,Qa,e,"f"),ah(this,Ji,t,"f"),ah(this,ul,new ce,"f"),ah(this,uu,A.newSet(i=>i.uuid),"f"),ah(this,la,oi.create(sa.Comparator),"f");let n=i=>{let o=ve(i.accept({visitValueEventBox:a=>Qe(this,Qa,"f").boxAdapters.adapterFor(a,sa)}),`Could not find adapter for ${i}`);Qe(this,uu,"f").add(o)&&(Qe(this,la,"f").add(o),Qe(this,sh,"m",Nv).call(this))};Qe(this,Ji,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Qe(this,lh,"f").own(Qe(this,Ji,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Qe(this,la,"f").remove(Qe(this,uu,"f").removeByKey(i)),Qe(this,sh,"m",Nv).call(this)}})),Qe(this,lh,"f").own(Qe(this,Ji,"f").owners.pointerHub.subscribe({onAdded:()=>Qe(this,ul,"f").notify(this),onRemoved:()=>Qe(this,ul,"f").notify(this)}))}valueAt(e,t){return Ig.valueAt(Qe(this,la,"f"),e,t)}copy(){let e=Qe(this,Qa,"f").boxGraph,t=Dn.create(e,A.generate());return Qe(this,la,"f").asArray().forEach(n=>n.copyTo({events:t.events})),Qe(this,Qa,"f").boxAdapters.adapterFor(t,r)}cut(e,t=w.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?m.None:m.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return m.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return m.wrap(n);if(i.position===e)return m.wrap(i);if(n.interpolation.type==="none")return m.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:o}=n,{position:a}=i,s=t.x(n.value),l=t.x(i.value),u=lg(s,l,(e-o)/(a-o));return m.wrap(this.createEvent({position:e,value:t.y(u),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:o}=n,{position:a}=i,s=t.x(n.value),l=t.x(i.value),u=a-o,p=e-o,d=gr.byHalf(u,s,gr.valueAt({slope:n.interpolation.slope,steps:u,y0:s,y1:l},u*.5),l),h=gr.valueAt(d,p),g=gr.slopeByHalf(s,gr.valueAt(d,p*.5),h);return si.write(n.box.interpolation,ai.Curve(g)),m.wrap(this.createEvent({position:e,value:t.y(h),index:0,interpolation:ai.Curve(gr.slopeByHalf(h,gr.valueAt(d,(p+u)*.5),l))}))}return D("Unknown interpolation type")}subscribeChange(e){return Qe(this,ul,"f").subscribe(e)}createEvent({position:e,index:t,value:n,interpolation:i}){let o=Math.trunc(e),a=Qe(this,uu,"f").values().find(l=>l.position===o&&l.index===t);if(q(a)&&a.box.isAttached())return a.box.value.setValue(n),si.write(a.box.interpolation,i),a;let s=In.create(Qe(this,Qa,"f").boxGraph,A.generate(),l=>{l.position.setValue(e),l.index.setValue(t),l.value.setValue(n),l.events.refer(Qe(this,Ji,"f").events)});return si.write(s.interpolation,i),Qe(this,Qa,"f").boxAdapters.adapterFor(s,sa)}requestSorting(){Qe(this,la,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Qe(this,sh,"m",Nv).call(this)}terminate(){Qe(this,lh,"f").terminate()}get box(){return Qe(this,Ji,"f")}get uuid(){return Qe(this,Ji,"f").address.uuid}get address(){return Qe(this,Ji,"f").address}get numOwners(){return Qe(this,Ji,"f").owners.pointerHub.filter(c.ValueEventCollection).length}get events(){return Qe(this,la,"f")}toString(){return`{ValueEventCollectionBox ${A.toString(Qe(this,Ji,"f").address.uuid)}}`}};lh=new WeakMap,Qa=new WeakMap,Ji=new WeakMap,ul=new WeakMap,uu=new WeakMap,la=new WeakMap,sh=new WeakSet,Nv=function(){Qe(this,ul,"f").notify(this)};var dl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ve=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},pl,Ya,hl,Yt,fl,dh,ch,uh,du,Xa=class{constructor(e,t){pl.add(this),this.type="value-clip",Ya.set(this,new j),hl.set(this,void 0),Yt.set(this,void 0),fl.set(this,void 0),dh.set(this,void 0),ch.set(this,void 0),uh.set(this,re.Empty),dl(this,hl,e,"f"),dl(this,Yt,t,"f"),dl(this,ch,!0,"f"),dl(this,fl,Ve(this,Ya,"f").own(new qi(!1)),"f"),dl(this,dh,Ve(this,Ya,"f").own(new ce),"f"),Ve(this,Ya,"f").own(Ve(this,Yt,"f").pointerHub.subscribe({onAdded:()=>Ve(this,pl,"m",du).call(this),onRemoved:()=>Ve(this,pl,"m",du).call(this)})),Ve(this,Ya,"f").own(Ve(this,Yt,"f").subscribe(Ue.Children,n=>Ve(this,pl,"m",du).call(this))),Ve(this,Ya,"f").own(Ve(this,Yt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ve(this,uh,"f").terminate(),dl(this,uh,n.match({none:()=>re.Empty,some:({box:i})=>Ve(this,hl,"f").boxAdapters.adapterFor(i,Ar).subscribeChange(()=>Ve(this,pl,"m",du).call(this))}),"f"),Ve(this,pl,"m",du).call(this)})),dl(this,ch,!1,"f")}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return Ve(this,fl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ve(this,dh,"f").subscribe(e)}accept(e){return P(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ve(this,Yt,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ve(this,Yt,"f").events.targetVertex.unwrap();Gc.create(Ve(this,hl,"f").boxGraph,A.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(Ve(this,Yt,"f").clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){Ve(this,fl,"f").setValue(!0)}onDeselected(){Ve(this,fl,"f").setValue(!1)}get isSelected(){return Ve(this,fl,"f").getValue()}terminate(){Ve(this,uh,"f").terminate(),Ve(this,Ya,"f").terminate()}get box(){return Ve(this,Yt,"f")}get uuid(){return Ve(this,Yt,"f").address.uuid}get address(){return Ve(this,Yt,"f").address}get indexField(){return Ve(this,Yt,"f").index}get duration(){return Ve(this,Yt,"f").duration.getValue()}get mute(){return Ve(this,Yt,"f").mute.getValue()}get hue(){return Ve(this,Yt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ve(this,Yt,"f").events.targetVertex.map(e=>Ve(this,hl,"f").boxAdapters.adapterFor(e.box,Ar))}get label(){return Ve(this,Yt,"f").label.getValue()}get trackBoxAdapter(){return Ve(this,ch,"f")?m.None:Ve(this,Yt,"f").clips.targetVertex.map(e=>Ve(this,hl,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${A.toString(Ve(this,Yt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Ya=new WeakMap,hl=new WeakMap,Yt=new WeakMap,fl=new WeakMap,dh=new WeakMap,ch=new WeakMap,uh=new WeakMap,pl=new WeakSet,du=function(){Ve(this,dh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var mB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},pu=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},hA,ml,Iv,hu=class{constructor(e){this.type="transient-marker",hA.set(this,new j),ml.set(this,void 0),Iv.set(this,void 0),mB(this,ml,e,"f"),mB(this,Iv,new ce,"f")}get box(){return pu(this,ml,"f")}get uuid(){return pu(this,ml,"f").address.uuid}get address(){return pu(this,ml,"f").address}get position(){return pu(this,ml,"f").position.getValue()}subscribe(e){return pu(this,Iv,"f").subscribe(e)}terminate(){pu(this,hA,"f").terminate()}};hA=new WeakMap,ml=new WeakMap,Iv=new WeakMap;var ph=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_r=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Dv,hh,bo,fh,fu,kv,Rn=class r{constructor(e,t){Dv.set(this,new j),hh.set(this,void 0),bo.set(this,void 0),fh.set(this,void 0),fu.set(this,void 0),kv.set(this,void 0),ph(this,hh,e,"f"),ph(this,bo,t,"f"),ph(this,fh,A.newSet(({uuid:n})=>n),"f"),ph(this,fu,oi.create(r.Comparator),"f"),ph(this,kv,Tg.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:o}=Promise.withResolvers(),a=this.getOrCreateLoader(),s=a.subscribe(l=>{l.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(a.data.unwrap("State mismatch"))):l.type==="error"&&(queueMicrotask(()=>s.terminate()),o(new Error(l.reason)))});return n}),"f"),_r(this,Dv,"f").ownAll(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=_r(this,hh,"f").boxAdapters.adapterFor(n.box,hu);_r(this,fh,"f").add(i)&&_r(this,fu,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{_r(this,fu,"f").remove(_r(this,fh,"f").removeByKey(n))}}))}get box(){return _r(this,bo,"f")}get uuid(){return _r(this,bo,"f").address.uuid}get address(){return _r(this,bo,"f").address}get startInSeconds(){return _r(this,bo,"f").startInSeconds.getValue()}get endInSeconds(){return _r(this,bo,"f").endInSeconds.getValue()}get transients(){return _r(this,fu,"f")}get fileName(){return _r(this,bo,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return _r(this,kv,"f").call(this)}getOrCreateLoader(){return _r(this,hh,"f").sampleManager.getOrCreate(_r(this,bo,"f").address.uuid)}terminate(){_r(this,Dv,"f").terminate()}};Dv=new WeakMap,hh=new WeakMap,bo=new WeakMap,fh=new WeakMap,fu=new WeakMap,kv=new WeakMap;Rn.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),D("Events at the same position: "+r.position+", "+e.position)):t};var mh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gh,Mv,$v,ca,yh,vh,Tv,es=class{constructor(e,t){gh.add(this),this.type="warp-marker",Mv.set(this,new j),$v.set(this,void 0),ca.set(this,void 0),yh.set(this,void 0),vh.set(this,!1),mh(this,$v,e,"f"),mh(this,ca,t,"f"),mh(this,yh,new ce,"f"),Zr(this,Mv,"f").own(t.subscribe(Ue.Children,()=>Zr(this,gh,"m",Tv).call(this)))}onSelected(){mh(this,vh,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Zr(this,gh,"m",Tv).call(this)}onDeselected(){mh(this,vh,!1,"f"),Zr(this,gh,"m",Tv).call(this)}get box(){return Zr(this,ca,"f")}get uuid(){return Zr(this,ca,"f").address.uuid}get address(){return Zr(this,ca,"f").address}get position(){return Zr(this,ca,"f").position.getValue()}get seconds(){return Zr(this,ca,"f").seconds.getValue()}get isSelected(){return Zr(this,vh,"f")}get optWarping(){return Zr(this,ca,"f").owner.targetVertex.map(e=>Zr(this,$v,"f").boxAdapters.adapterFor(e.box,wo.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Zr(this,yh,"f").subscribe(e)}terminate(){Zr(this,Mv,"f").terminate()}};Mv=new WeakMap,$v=new WeakMap,ca=new WeakMap,yh=new WeakMap,vh=new WeakMap,gh=new WeakSet,Tv=function(){Zr(this,yh,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var Rv=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),D("Events at the same position: "+r.position+", "+e.position)):t};var xh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$r=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Cv,Ov,gl,vl,bh,mu,Ao=class{constructor(e,t){Cv.set(this,new j),Ov.set(this,void 0),gl.set(this,void 0),vl.set(this,void 0),bh.set(this,void 0),mu.set(this,void 0),xh(this,Ov,e,"f"),xh(this,gl,t,"f"),xh(this,vl,new ce,"f"),xh(this,bh,A.newSet(({uuid:n})=>n),"f"),xh(this,mu,oi.create(Rv),"f"),$r(this,Cv,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=$r(this,Ov,"f").boxAdapters.adapterFor(n.box,es);$r(this,bh,"f").add(i)&&($r(this,mu,"f").add(i),$r(this,vl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{$r(this,mu,"f").remove($r(this,bh,"f").removeByKey(n)),$r(this,vl,"f").notify()}}))}get box(){return $r(this,gl,"f")}get uuid(){return $r(this,gl,"f").address.uuid}get address(){return $r(this,gl,"f").address}get warpMarkers(){return $r(this,mu,"f")}clone(){let e=Jc.create($r(this,gl,"f").graph,A.generate());return this.warpMarkers.asArray().forEach(t=>Ua.create(e.graph,A.generate(),n=>{n.position.setValue(t.position),n.seconds.setValue(t.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return $r(this,vl,"f").subscribe(e)}onChanged(){$r(this,vl,"f").notify()}terminate(){$r(this,Cv,"f").terminate()}};Cv=new WeakMap,Ov=new WeakMap,gl=new WeakMap,vl=new WeakMap,bh=new WeakMap,mu=new WeakMap;var wh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Vv,zv,Cn,yl,Ah,gu,_o=class{constructor(e,t){Vv.set(this,new j),zv.set(this,void 0),Cn.set(this,void 0),yl.set(this,void 0),Ah.set(this,void 0),gu.set(this,void 0),wh(this,zv,e,"f"),wh(this,Cn,t,"f"),wh(this,yl,new ce,"f"),wh(this,Ah,A.newSet(({uuid:n})=>n),"f"),wh(this,gu,oi.create(Rv),"f"),Xt(this,Vv,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Xt(this,zv,"f").boxAdapters.adapterFor(n.box,es);Xt(this,Ah,"f").add(i)&&(Xt(this,gu,"f").add(i),Xt(this,yl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Xt(this,gu,"f").remove(Xt(this,Ah,"f").removeByKey(n)),Xt(this,yl,"f").notify()}}))}get box(){return Xt(this,Cn,"f")}get uuid(){return Xt(this,Cn,"f").address.uuid}get address(){return Xt(this,Cn,"f").address}get warpMarkers(){return Xt(this,gu,"f")}get playbackRate(){return Xt(this,Cn,"f").playbackRate.getValue()}get cents(){return Math.log2(Xt(this,Cn,"f").playbackRate.getValue())*1200}set cents(e){Xt(this,Cn,"f").playbackRate.setValue(we(2**(e/1200),.5,2))}get transientPlayMode(){return Zi(Xt(this,Cn,"f").transientPlayMode.getValue(),Za)}clone(){let e=Qc.create(Xt(this,Cn,"f").graph,A.generate(),t=>{t.transientPlayMode.setValue(this.transientPlayMode),t.playbackRate.setValue(this.playbackRate),t.warpMarkers});return this.warpMarkers.asArray().forEach(t=>Ua.create(e.graph,A.generate(),n=>{n.position.setValue(t.position),n.seconds.setValue(t.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Xt(this,yl,"f").subscribe(e)}onChanged(){Xt(this,yl,"f").notify()}terminate(){Xt(this,Vv,"f").terminate()}};Vv=new WeakMap,zv=new WeakMap,Cn=new WeakMap,yl=new WeakMap,Ah=new WeakMap,gu=new WeakMap;var wo;(function(r){r.isAudioPlayMode=e=>e instanceof Ao||e instanceof _o})(wo||(wo={}));var Pi=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ye=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},xl,vu,bl,Tt,wl,Al,_h,Sh,Ph,_l,yu,xu,bu,ts=class{constructor(e,t){xl.add(this),this.type="audio-clip",vu.set(this,new j),bl.set(this,void 0),Tt.set(this,void 0),wl.set(this,void 0),Al.set(this,void 0),_h.set(this,void 0),Sh.set(this,void 0),Ph.set(this,void 0),_l.set(this,m.None),yu.set(this,m.None),xu.set(this,re.Empty),Pi(this,bl,e,"f"),Pi(this,Tt,t,"f"),Pi(this,Ph,!0,"f"),Pi(this,wl,new Dr,"f"),Pi(this,Al,ye(this,vu,"f").own(new qi(!1)),"f"),Pi(this,_h,Qs.aware(e.tempoMap,t.timeBase,t.duration),"f"),Pi(this,Sh,ye(this,vu,"f").own(new ce),"f"),ye(this,vu,"f").ownAll(ye(this,Tt,"f").pointerHub.subscribe({onAdded:()=>ye(this,xl,"m",bu).call(this),onRemoved:()=>ye(this,xl,"m",bu).call(this)}),ye(this,Tt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{ye(this,xu,"f").terminate(),n.match({none:()=>ye(this,wl,"f").clear(),some:({box:i})=>{let o=ye(this,bl,"f").boxAdapters.adapterFor(i,wo.isAudioPlayMode);Pi(this,xu,o.subscribe(()=>ye(this,xl,"m",bu).call(this)),"f"),ye(this,wl,"f").wrap(o)}})}),ye(this,Tt,"f").file.catchupAndSubscribe(n=>{Pi(this,_l,n.targetVertex.map(i=>ye(this,bl,"f").boxAdapters.adapterFor(i.box,Rn)),"f"),ye(this,yu,"f").ifSome(i=>i.terminate()),Pi(this,yu,ye(this,_l,"f").map(i=>i.getOrCreateLoader().subscribe(()=>ye(this,xl,"m",bu).call(this))),"f")}),ye(this,Tt,"f").subscribe(Ue.Children,n=>ye(this,xl,"m",bu).call(this))),Pi(this,Ph,!1,"f")}catchupAndSubscribeSelected(e){return ye(this,Al,"f").catchupAndSubscribe(e)}subscribeChange(e){return ye(this,Sh,"f").subscribe(e)}accept(e){return P(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let t=this.observableOptPlayMode.map(n=>n.clone());Hc.create(ye(this,bl,"f").boxGraph,A.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(ye(this,Tt,"f").clips.targetVertex.unwrap()),n.file.refer(ye(this,Tt,"f").file.targetVertex.unwrap()),n.events.refer(ye(this,Tt,"f").events.targetVertex.unwrap()),t.ifSome(i=>n.playMode.refer(i))})}onSelected(){ye(this,Al,"f").setValue(!0)}onDeselected(){ye(this,Al,"f").setValue(!1)}get isSelected(){return ye(this,Al,"f").getValue()}get box(){return ye(this,Tt,"f")}get uuid(){return ye(this,Tt,"f").address.uuid}get address(){return ye(this,Tt,"f").address}get indexField(){return ye(this,Tt,"f").index}get duration(){return ye(this,_h,"f").toPPQN(0)}set duration(e){ye(this,_h,"f").fromPPQN(e,0)}get mute(){return ye(this,Tt,"f").mute.getValue()}get hue(){return ye(this,Tt,"f").hue.getValue()}get gain(){return ye(this,Tt,"f").gain}get file(){return ye(this,_l,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return ye(this,wl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get timeBase(){return Zi(ye(this,Tt,"f").timeBase.getValue(),Kr)}get waveformOffset(){return ye(this,Tt,"f").waveformOffset}get isPlayModeNoStretch(){return ye(this,Tt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>pt(e,Ao)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>pt(e,_o)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>wo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ye(this,_l,"f").isEmpty())return"No Audio File";let e=ye(this,_l,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ye(this,Tt,"f").label.getValue()}get trackBoxAdapter(){return ye(this,Ph,"f")?m.None:ye(this,Tt,"f").clips.targetVertex.map(e=>ye(this,bl,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return ye(this,wl,"f").nonEmpty()}terminate(){ye(this,yu,"f").ifSome(e=>e.terminate()),Pi(this,yu,m.None,"f"),ye(this,xu,"f").terminate(),Pi(this,xu,re.Empty,"f"),ye(this,vu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${A.toString(ye(this,Tt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};vu=new WeakMap,bl=new WeakMap,Tt=new WeakMap,wl=new WeakMap,Al=new WeakMap,_h=new WeakMap,Sh=new WeakMap,Ph=new WeakMap,_l=new WeakMap,yu=new WeakMap,xu=new WeakMap,xl=new WeakSet,bu=function(){ye(this,Sh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Eh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Wt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wu,sr,Uv,Fh,Pl=class r{constructor(e,t){this.type="note-event",wu.set(this,void 0),sr.set(this,void 0),Uv.set(this,void 0),Fh.set(this,!1),Eh(this,wu,e,"f"),Eh(this,sr,t,"f"),Eh(this,Uv,Wt(this,sr,"f").subscribe(Ue.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),o=n.address.fieldKeys,a=U.equals(Wt(this,sr,"f").pitch.address.fieldKeys,o),s=U.equals(Wt(this,sr,"f").position.address.fieldKeys,o);a||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Eh(this,Fh,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Eh(this,Fh,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Wt(this,Uv,"f").terminate()}get box(){return Wt(this,sr,"f")}get uuid(){return Wt(this,sr,"f").address.uuid}get address(){return Wt(this,sr,"f").address}get position(){return Wt(this,sr,"f").position.getValue()}get duration(){return Wt(this,sr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Wt(this,sr,"f").velocity.getValue()}get pitch(){return Wt(this,sr,"f").pitch.getValue()}get cent(){return Wt(this,sr,"f").cent.getValue()}get chance(){return Wt(this,sr,"f").chance.getValue()}get playCount(){return Wt(this,sr,"f").playCount.getValue()}get playCurve(){return Wt(this,sr,"f").playCurve.getValue()}get isSelected(){return Wt(this,Fh,"f")}get collection(){return Wt(this,sr,"f").events.targetVertex.map(e=>Wt(this,wu,"f").boxAdapters.adapterFor(e.box,Qi))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:t}=this.collection.unwrap();return e===t?.5:1-(this.pitch-e)/(t-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return Wt(this,wu,"f").boxAdapters.adapterFor(Oa.create(Wt(this,wu,"f").boxGraph,A.generate(),t=>{t.position.setValue(e?.position??this.position),t.duration.setValue(e?.duration??this.duration),t.pitch.setValue(e?.pitch??this.pitch),t.playCount.setValue(e?.playCount??this.playCount),t.events.refer(e?.events??this.collection.unwrap().box.events),t.velocity.setValue(this.velocity),t.cent.setValue(this.cent),t.chance.setValue(this.chance)}),r)}computeCurveValue(e){return Mr.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,n=U.create(i=>{let o=Math.floor(this.computeCurveValue(i/e)*this.duration),a=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+o),duration:Math.max(1,a-o),playCount:1,events:t})},e);return Wt(this,sr,"f").delete(),n}};wu=new WeakMap,sr=new WeakMap,Uv=new WeakMap,Fh=new WeakMap;var Po=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ne=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ua,Bh,rs,On,Sl,Nh,Si,Lv,Kv,Wv,is,jv,Ih,Qi=class r{constructor(e,t){ua.add(this),Bh.set(this,new j),rs.set(this,void 0),On.set(this,void 0),Sl.set(this,void 0),Nh.set(this,void 0),Si.set(this,void 0),Lv.set(this,60),Kv.set(this,60),Wv.set(this,0),is.set(this,!1),Po(this,rs,e,"f"),Po(this,On,t,"f"),Po(this,Sl,new ce,"f"),Po(this,Nh,A.newSet(n=>n.uuid),"f"),Po(this,Si,oi.create(Mr.Comparator),"f"),Ne(this,Bh,"f").own(Ne(this,On,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Ne(this,rs,"f").boxAdapters.adapterFor(n,Pl);Ne(this,Nh,"f").add(i)&&(Ne(this,Si,"f").add(i),Ne(this,ua,"m",jv).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Ne(this,Si,"f").remove(Ne(this,Nh,"f").removeByKey(n)),Ne(this,ua,"m",jv).call(this)}})),Ne(this,Bh,"f").own(Ne(this,On,"f").owners.pointerHub.subscribe({onAdded:()=>Ne(this,Sl,"f").notify(this),onRemoved:()=>Ne(this,Sl,"f").notify(this)}))}copy(){let e=Ne(this,rs,"f").boxGraph,t=na.create(e,A.generate());return Ne(this,Si,"f").asArray().forEach(n=>n.copyTo({events:t.events})),Ne(this,rs,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:n,pitch:i,chance:o,playCount:a,cent:s}){return Ne(this,rs,"f").boxAdapters.adapterFor(Oa.create(Ne(this,rs,"f").boxGraph,A.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(n),l.pitch.setValue(i),l.chance.setValue(o),l.playCount.setValue(a),l.cent.setValue(s),l.events.refer(Ne(this,On,"f").events)}),Pl)}subscribeChange(e){return Ne(this,Sl,"f").subscribe(e)}selectable(){return Ne(this,Si,"f").asArray()}selectableAt(e){for(let t of Ne(this,Si,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return ht.one(t);return ht.empty()}selectablesBetween(e,t){let n=[],i=Ne(this,Si,"f").asArray(),o=Ne(this,Si,"f").ceilFirstIndex(t.u);for(let a=0;a<o;a++){let s=i[a];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=t.v&&n.push(s)}return n}requestSorting(){Ne(this,Si,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ne(this,ua,"m",jv).call(this)}terminate(){Ne(this,Bh,"f").terminate()}get box(){return Ne(this,On,"f")}get uuid(){return Ne(this,On,"f").address.uuid}get address(){return Ne(this,On,"f").address}get numOwners(){return Ne(this,On,"f").owners.pointerHub.filter(c.NoteEventCollection).length}get events(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Si,"f")}get minPitch(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Lv,"f")}get maxPitch(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Kv,"f")}get maxDuration(){return Ne(this,is,"f")||Ne(this,ua,"m",Ih).call(this),Ne(this,Wv,"f")}toString(){return`{NoteEventCollectionBox ${A.toString(Ne(this,On,"f").address.uuid)}}`}};Bh=new WeakMap,rs=new WeakMap,On=new WeakMap,Sl=new WeakMap,Nh=new WeakMap,Si=new WeakMap,Lv=new WeakMap,Kv=new WeakMap,Wv=new WeakMap,is=new WeakMap,ua=new WeakSet,jv=function(){Po(this,is,!1,"f"),Ne(this,Sl,"f").notify(this)},Ih=function(){let e=127,t=0,n=0;Ne(this,Si,"f").asArray().forEach(({pitch:i,duration:o})=>{e=Math.min(e,i),t=Math.max(t,i),n=Math.max(n,o)}),Po(this,Lv,e,"f"),Po(this,Kv,t,"f"),Po(this,Wv,n,"f"),Po(this,is,!0,"f")};var El=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ke=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fl,Au,Bl,er,Nl,Mh,Dh,kh,_u,Pu=class{constructor(e,t){Fl.add(this),this.type="note-clip",Au.set(this,new j),Bl.set(this,void 0),er.set(this,void 0),Nl.set(this,void 0),Mh.set(this,void 0),Dh.set(this,void 0),kh.set(this,re.Empty),El(this,Bl,e,"f"),El(this,er,t,"f"),El(this,Dh,!0,"f"),El(this,Nl,Ke(this,Au,"f").own(new qi(!1)),"f"),El(this,Mh,Ke(this,Au,"f").own(new ce),"f"),Ke(this,Au,"f").ownAll(Ke(this,er,"f").pointerHub.subscribe({onAdded:()=>Ke(this,Fl,"m",_u).call(this),onRemoved:()=>Ke(this,Fl,"m",_u).call(this)}),Ke(this,er,"f").subscribe(Ue.Children,n=>Ke(this,Fl,"m",_u).call(this)),Ke(this,er,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ke(this,kh,"f").terminate(),El(this,kh,n.match({none:()=>re.Empty,some:({box:i})=>Ke(this,Bl,"f").boxAdapters.adapterFor(i,Qi).subscribeChange(()=>Ke(this,Fl,"m",_u).call(this))}),"f"),Ke(this,Fl,"m",_u).call(this)})),El(this,Dh,!1,"f")}catchupAndSubscribeSelected(e){return Ke(this,Nl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ke(this,Mh,"f").subscribe(e)}accept(e){return P(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ke(this,er,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ke(this,er,"f").events.targetVertex.unwrap();Zc.create(Ke(this,Bl,"f").boxGraph,A.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(Ke(this,er,"f").clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){Ke(this,Nl,"f").setValue(!0)}onDeselected(){Ke(this,Nl,"f").setValue(!1)}get isSelected(){return Ke(this,Nl,"f").getValue()}terminate(){Ke(this,kh,"f").terminate(),Ke(this,Au,"f").terminate()}get box(){return Ke(this,er,"f")}get uuid(){return Ke(this,er,"f").address.uuid}get address(){return Ke(this,er,"f").address}get indexField(){return Ke(this,er,"f").index}get duration(){return Ke(this,er,"f").duration.getValue()}get mute(){return Ke(this,er,"f").mute.getValue()}get hue(){return Ke(this,er,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ke(this,er,"f").events.targetVertex.map(e=>Ke(this,Bl,"f").boxAdapters.adapterFor(e.box,Qi))}get label(){return Ke(this,er,"f").label.getValue()}get trackBoxAdapter(){return Ke(this,Dh,"f")?m.None:Ke(this,er,"f").clips.targetVertex.map(e=>Ke(this,Bl,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${A.toString(Ke(this,er,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Au=new WeakMap,Bl=new WeakMap,er=new WeakMap,Nl=new WeakMap,Mh=new WeakMap,Dh=new WeakMap,kh=new WeakMap,Fl=new WeakSet,_u=function(){Ke(this,Mh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Zv={for:(r,e)=>ve(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Pu),visitValueClipBox:t=>r.adapterFor(t,Xa),visitAudioClipBox:t=>r.adapterFor(t,ts)}),"")};var Gv=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ns=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qv,Su,$h,Th,Hv=class{constructor(e,t){qv.set(this,void 0),Su.set(this,void 0),$h.set(this,void 0),Th.set(this,void 0),Gv(this,qv,e,"f"),Gv(this,Su,new j,"f"),Gv(this,$h,ns(this,Su,"f").own(new ce),"f"),Gv(this,Th,ns(this,Su,"f").own(ar.create(e.box.clips,n=>Zv.for(t,n),c.ClipCollection)),"f"),ns(this,Th,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return ns(this,qv,"f")}get collection(){return ns(this,Th,"f")}dispatchChange(){ns(this,$h,"f").notify()}subscribeChanges(e){return ns(this,$h,"f").subscribe(e)}terminate(){ns(this,Su,"f").terminate()}};qv=new WeakMap,Su=new WeakMap,$h=new WeakMap,Th=new WeakMap;var PM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Yi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Gr,Jv=class{constructor(e){Gr.set(this,void 0),PM(this,Gr,e,"f")}get inField(){return Yi(this,Gr,"f").in}get outField(){return Yi(this,Gr,"f").out}get inSlopeField(){return Yi(this,Gr,"f").inSlope}get outSlopeField(){return Yi(this,Gr,"f").outSlope}get in(){return Yi(this,Gr,"f").in.getValue()}get out(){return Yi(this,Gr,"f").out.getValue()}get inSlope(){return Yi(this,Gr,"f").inSlope.getValue()}get outSlope(){return Yi(this,Gr,"f").outSlope.getValue()}get hasFading(){return Ta.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(){Yi(this,Gr,"f").in.setValue(0),Yi(this,Gr,"f").out.setValue(0),Yi(this,Gr,"f").inSlope.setValue(.75),Yi(this,Gr,"f").outSlope.setValue(.25)}};Gr=new WeakMap;var zt=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ee=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ei,Rh,Xi,et,Eu,Fu,Bu,Ch,Vn,Oh,Il,Nu,Iu,Du,ku,Mu,en,da=class r{constructor(e,t){Ei.add(this),this.type="audio-region",Rh.set(this,void 0),Xi.set(this,void 0),et.set(this,void 0),Eu.set(this,void 0),Fu.set(this,void 0),Bu.set(this,void 0),Ch.set(this,void 0),Vn.set(this,void 0),Oh.set(this,void 0),Il.set(this,m.None),Nu.set(this,re.Empty),Iu.set(this,re.Empty),Du.set(this,re.Empty),ku.set(this,re.Empty),Mu.set(this,void 0),zt(this,Xi,e,"f"),zt(this,et,t,"f"),zt(this,Rh,new j,"f");let{timeBase:n,duration:i,loopDuration:o}=t;zt(this,Eu,Qs.aware(e.tempoMap,n,i),"f"),zt(this,Fu,Qs.aware(e.tempoMap,n,o),"f"),zt(this,Bu,new Dr,"f"),zt(this,Ch,new ce,"f"),zt(this,Vn,new Jv(t.fading),"f"),zt(this,Mu,!1,"f"),zt(this,Oh,!0,"f"),ee(this,Rh,"f").ownAll(ee(this,et,"f").pointerHub.subscribe({onAdded:()=>ee(this,Ei,"m",en).call(this),onRemoved:()=>ee(this,Ei,"m",en).call(this)}),ee(this,et,"f").file.catchupAndSubscribe(a=>{zt(this,Il,a.targetVertex.map(s=>ee(this,Xi,"f").boxAdapters.adapterFor(s.box,Rn)),"f"),ee(this,Nu,"f").terminate(),zt(this,Nu,ee(this,Il,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>ee(this,Ei,"m",en).call(this)),re.Empty),"f")}),ee(this,et,"f").playMode.catchupAndSubscribe(({targetVertex:a})=>{ee(this,Iu,"f").terminate(),a.match({none:()=>ee(this,Bu,"f").clear(),some:({box:s})=>{let l=ee(this,Xi,"f").boxAdapters.adapterFor(s,wo.isAudioPlayMode);zt(this,Iu,l.subscribe(()=>ee(this,Ei,"m",en).call(this)),"f"),ee(this,Bu,"f").wrap(l)}})}),ee(this,et,"f").timeBase.catchupAndSubscribe(a=>{ee(this,Du,"f").terminate(),Zi(a.getValue(),Kr)===Kr.Seconds&&zt(this,Du,e.tempoMap.subscribe(()=>ee(this,Ei,"m",en).call(this)),"f")}),ee(this,et,"f").subscribe(Ue.Children,a=>{if(!this.trackBoxAdapter.isEmpty()&&(a.type==="primitive"||a.type==="pointer")){let s=this.trackBoxAdapter.unwrap();ee(this,et,"f").position.address.equals(a.address)?(s.regions.onIndexingChanged(),ee(this,Ei,"m",en).call(this)):ee(this,Ei,"m",en).call(this)}}),ee(this,et,"f").events.catchupAndSubscribe(({targetVertex:a})=>{ee(this,ku,"f").terminate(),zt(this,ku,a.match({none:()=>re.Empty,some:({box:s})=>ee(this,Xi,"f").boxAdapters.adapterFor(s,Ar).subscribeChange(()=>ee(this,Ei,"m",en).call(this))}),"f"),ee(this,Ei,"m",en).call(this)})),zt(this,Oh,!1,"f")}subscribeChange(e){return ee(this,Ch,"f").subscribe(e)}accept(e){return P(e.visitAudioRegionBoxAdapter,this)}onSelected(){zt(this,Mu,!0,"f"),ee(this,Ei,"m",en).call(this)}onDeselected(){zt(this,Mu,!1,"f"),ee(this,Ei,"m",en).call(this)}get isSelected(){return ee(this,Mu,"f")}get box(){return ee(this,et,"f")}get uuid(){return ee(this,et,"f").address.uuid}get address(){return ee(this,et,"f").address}get position(){return ee(this,et,"f").position.getValue()}get duration(){return ee(this,Eu,"f").toPPQN(this.position)}get complete(){return this.position+this.duration}get loopOffset(){return ee(this,et,"f").loopOffset.getValue()}get loopDuration(){return ee(this,Fu,"f").toPPQN(this.position)}resolveDuration(e){return ee(this,Eu,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return ee(this,Fu,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return ee(this,et,"f").mute.getValue()}get hue(){return ee(this,et,"f").hue.getValue()}get gain(){return ee(this,et,"f").gain}get fading(){return ee(this,Vn,"f")}get file(){return ee(this,Il,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return ee(this,Bu,"f")}get timeBase(){return Zi(ee(this,et,"f").timeBase.getValue(),Kr)}get waveformOffset(){return ee(this,et,"f").waveformOffset}get isPlayModeNoStretch(){return ee(this,et,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>pt(e,Ao)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>pt(e,_o)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>wo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ee(this,Il,"f").isEmpty())return"No Audio File";let e=ee(this,Il,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ee(this,et,"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 ee(this,et,"f").regions.targetVertex.map(e=>ee(this,Xi,"f").boxAdapters.adapterFor(e.box,Vt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return ee(this,et,"f").events.targetVertex.map(e=>ee(this,Xi,"f").boxAdapters.adapterFor(e.box,Ar))}set position(e){ee(this,et,"f").position.setValue(e)}set duration(e){ee(this,Eu,"f").fromPPQN(e,this.position);let t=ee(this,Vn,"f").in+ee(this,Vn,"f").out;if(t>e){let n=e/t;ee(this,Vn,"f").inField.setValue(ee(this,Vn,"f").in*n),ee(this,Vn,"f").outField.setValue(ee(this,Vn,"f").out*n)}}set loopOffset(e){ee(this,et,"f").loopOffset.setValue(Gs(e,this.loopDuration))}set loopDuration(e){ee(this,Fu,"f").fromPPQN(e,this.position)}moveContentStart(e){let t=this.position,n=t+e;if(this.position=n,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e,this.timeBase===Kr.Seconds){let i=e>=0?ee(this,Xi,"f").tempoMap.intervalToSeconds(t,n):-ee(this,Xi,"f").tempoMap.intervalToSeconds(n,t);ee(this,et,"f").waveformOffset.setValue(this.waveformOffset.getValue()+i)}else this.optWarpMarkers.ifSome(i=>i.asArray().forEach(o=>o.box.position.setValue(o.position-e)))}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners,i=this.observableOptPlayMode.map(a=>a.clone()),o=ee(this,Xi,"f").boxAdapters.adapterFor(za.create(ee(this,Xi,"f").boxGraph,A.generate(),a=>{a.timeBase.setValue(ee(this,et,"f").timeBase.getValue()),a.position.setValue(e?.position??ee(this,et,"f").position.getValue()),a.regions.refer(e?.target??ee(this,et,"f").regions.targetVertex.unwrap()),a.file.refer(ee(this,et,"f").file.targetVertex.unwrap()),a.events.refer(n),a.mute.setValue(this.mute),a.hue.setValue(this.hue),a.label.setValue(this.label),a.gain.setValue(this.gain.getValue()),a.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>a.playMode.refer(s)),ee(this,Vn,"f").copyTo(a.fading)}),r);return o.loopDuration=e?.loopDuration??this.resolveLoopDuration(o.position),o.loopOffset=e?.loopOffset??this.loopOffset,o.duration=e?.duration??this.resolveDuration(o.position),o}consolidate(){}canFlatten(e){return e.length>0&&U.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){return m.None}terminate(){ee(this,Nu,"f").terminate(),zt(this,Nu,re.Empty,"f"),ee(this,Du,"f").terminate(),zt(this,Du,re.Empty,"f"),ee(this,Iu,"f").terminate(),zt(this,Iu,re.Empty,"f"),ee(this,ku,"f").terminate(),zt(this,ku,re.Empty,"f"),ee(this,Rh,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${A.toString(ee(this,et,"f").address.uuid)}}`}};Rh=new WeakMap,Xi=new WeakMap,et=new WeakMap,Eu=new WeakMap,Fu=new WeakMap,Bu=new WeakMap,Ch=new WeakMap,Vn=new WeakMap,Oh=new WeakMap,Il=new WeakMap,Nu=new WeakMap,Iu=new WeakMap,Du=new WeakMap,ku=new WeakMap,Mu=new WeakMap,Ei=new WeakSet,en=function(){ee(this,Oh,"f")||(ee(this,Ch,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var pa=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ie=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},So,Qv,Eo,xt,Uh,Vh,$u,zh,ha,os=class r{constructor(e,t){So.add(this),this.type="note-region",Qv.set(this,new j),Eo.set(this,void 0),xt.set(this,void 0),Uh.set(this,void 0),Vh.set(this,void 0),$u.set(this,void 0),zh.set(this,re.Empty),pa(this,Eo,e,"f"),pa(this,xt,t,"f"),pa(this,Uh,new ce,"f"),pa(this,$u,!1,"f"),pa(this,Vh,!0,"f"),Ie(this,Qv,"f").ownAll(Ie(this,xt,"f").pointerHub.subscribe({onAdded:()=>Ie(this,So,"m",ha).call(this),onRemoved:()=>Ie(this,So,"m",ha).call(this)}),Ie(this,xt,"f").subscribe(Ue.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ie(this,xt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ie(this,So,"m",ha).call(this)):Ie(this,So,"m",ha).call(this)}}),Ie(this,xt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ie(this,zh,"f").terminate(),pa(this,zh,n.match({none:()=>re.Empty,some:({box:i})=>Ie(this,Eo,"f").boxAdapters.adapterFor(i,Qi).subscribeChange(()=>Ie(this,So,"m",ha).call(this))}),"f"),Ie(this,So,"m",ha).call(this)})),pa(this,Vh,!1,"f")}set position(e){Ie(this,xt,"f").position.setValue(e)}set duration(e){Ie(this,xt,"f").duration.setValue(e)}set loopOffset(e){Ie(this,xt,"f").loopOffset.setValue(e)}set loopDuration(e){Ie(this,xt,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(t=>t.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 Ie(this,Uh,"f").subscribe(e)}accept(e){return P(e.visitNoteRegionBoxAdapter,this)}onSelected(){pa(this,$u,!0,"f"),Ie(this,So,"m",ha).call(this)}onDeselected(){pa(this,$u,!1,"f"),Ie(this,So,"m",ha).call(this)}get isSelected(){return Ie(this,$u,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let n=t.unwrap(),i=kr.globalToLocal(this,e);for(let o of n.events.iterateFrom(i-n.maxDuration)){if(i<o.position)return;i<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){Ie(this,zh,"f").terminate(),Ie(this,Qv,"f").terminate()}get box(){return Ie(this,xt,"f")}get uuid(){return Ie(this,xt,"f").address.uuid}get address(){return Ie(this,xt,"f").address}get position(){return Ie(this,xt,"f").position.getValue()}get duration(){return Ie(this,xt,"f").duration.getValue()}get loopOffset(){return Ie(this,xt,"f").loopOffset.getValue()}get loopDuration(){return Ie(this,xt,"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 Ie(this,xt,"f").mute.getValue()}get hue(){return Ie(this,xt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Ie(this,xt,"f").events.targetVertex.map(e=>Ie(this,Eo,"f").boxAdapters.adapterFor(e.box,Qi))}get label(){return Ie(this,xt,"f").label.getValue()}get trackBoxAdapter(){return Ie(this,Vh,"f")?m.None:Ie(this,xt,"f").regions.targetVertex.map(e=>Ie(this,Eo,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return Ie(this,Eo,"f").boxAdapters.adapterFor(ll.create(Ie(this,Eo,"f").boxGraph,A.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??Ie(this,xt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=Ie(this,Eo,"f").boxGraph,n=na.create(t,A.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Ie(this,xt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&U.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=Ie(this,Eo,"f").boxGraph,n=e.toSorted($a.Comparator),i=U.getFirst(n,"Internal error (no first)"),o=U.getLast(n,"Internal error (no last)"),a=i.position,s=o.position+o.duration,l=i.trackBoxAdapter.unwrap(),u=na.create(t,A.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let h=d;for(let{resultStart:g,resultEnd:v,rawStart:y}of kr.locateLoops(h,h.position,h.complete)){let x=Math.floor(g-y),F=Math.floor(v-y);for(let I of h.optCollection.unwrap().events.iterateRange(x,F))I.copyTo({position:I.position+y-i.position,events:u.events})}}),p.forEach(({box:d})=>d.delete()),m.wrap(ll.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(u.owners),d.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${A.toString(Ie(this,xt,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Qv=new WeakMap,Eo=new WeakMap,xt=new WeakMap,Uh=new WeakMap,Vh=new WeakMap,$u=new WeakMap,zh=new WeakMap,So=new WeakSet,ha=function(){Ie(this,Uh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var fa=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Se=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zn,Tu,Fo,bt,Kh,Ru,jh,Lh,Bo,ma=class r{constructor(e,t){zn.add(this),this.type="value-region",Tu.set(this,new j),Fo.set(this,void 0),bt.set(this,void 0),Kh.set(this,void 0),Ru.set(this,void 0),jh.set(this,void 0),Lh.set(this,re.Empty),fa(this,Fo,e,"f"),fa(this,bt,t,"f"),fa(this,jh,!0,"f"),fa(this,Kh,new ce,"f"),fa(this,Ru,!1,"f"),Se(this,Tu,"f").own(Se(this,bt,"f").pointerHub.subscribe({onAdded:()=>Se(this,zn,"m",Bo).call(this),onRemoved:()=>Se(this,zn,"m",Bo).call(this)})),Se(this,Tu,"f").own(Se(this,bt,"f").subscribe(Ue.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Se(this,bt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Se(this,zn,"m",Bo).call(this)):Se(this,zn,"m",Bo).call(this)}})),Se(this,Tu,"f").own(Se(this,bt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Se(this,Lh,"f").terminate(),fa(this,Lh,n.match({none:()=>re.Empty,some:({box:i})=>Se(this,Fo,"f").boxAdapters.adapterFor(i,Ar).subscribeChange(()=>Se(this,zn,"m",Bo).call(this))}),"f"),Se(this,zn,"m",Bo).call(this)})),fa(this,jh,!1,"f")}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(kr.globalToLocal(this,e),t)}incomingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let n=t.unwrap().events.greaterEqual(0);return q(n)&&n.position===0?n.value:this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let n=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(kr.globalToLocal(this,this.complete),e)}subscribeChange(e){return Se(this,Kh,"f").subscribe(e)}accept(e){return P(e.visitValueRegionBoxAdapter,this)}onSelected(){fa(this,Ru,!0,"f"),Se(this,zn,"m",Bo).call(this)}onDeselected(){fa(this,Ru,!1,"f"),Se(this,zn,"m",Bo).call(this)}get isSelected(){return Se(this,Ru,"f")}onValuesPropertyChanged(){Se(this,zn,"m",Bo).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Se(this,Lh,"f").terminate(),Se(this,Tu,"f").terminate()}get box(){return Se(this,bt,"f")}get uuid(){return Se(this,bt,"f").address.uuid}get address(){return Se(this,bt,"f").address}get position(){return Se(this,bt,"f").position.getValue()}get duration(){return Se(this,bt,"f").duration.getValue()}get loopOffset(){return Se(this,bt,"f").loopOffset.getValue()}get loopDuration(){return Se(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 Se(this,bt,"f").mute.getValue()}get hue(){return Se(this,bt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Se(this,bt,"f").events.targetVertex.map(e=>Se(this,Fo,"f").boxAdapters.adapterFor(e.box,Ar))}get label(){return Se(this,bt,"f").label.getValue()}get trackBoxAdapter(){return Se(this,jh,"f")?m.None:Se(this,bt,"f").regions.targetVertex.map(e=>Se(this,Fo,"f").boxAdapters.adapterFor(e.box,Vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Se(this,bt,"f").position.setValue(e)}set duration(e){Se(this,bt,"f").duration.setValue(e)}set loopOffset(e){Se(this,bt,"f").loopOffset.setValue(e)}set loopDuration(e){Se(this,bt,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(t=>t.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 t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return Se(this,Fo,"f").boxAdapters.adapterFor(cl.create(Se(this,Fo,"f").boxGraph,A.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??Se(this,bt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=Se(this,Fo,"f").boxGraph,n=Dn.create(t,A.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Se(this,bt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&U.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=Se(this,Fo,"f").boxGraph,n=e.toSorted($a.Comparator),i=U.getFirst(n,"Internal error (no first)"),o=U.getLast(n,"Internal error (no last)"),a=i.position,s=o.position+o.duration,l=i.trackBoxAdapter.unwrap(),u=Array.from(l.regions.collection.iterateRange(a,s)),p=[];u.filter(v=>v.isSelected).forEach(v=>{let y=v,x=y.optCollection.unwrap(),F=x.events;for(let{rawStart:I,regionStart:O,regionEnd:z}of kr.locateLoops(y,y.position,y.complete)){let $=O-I,J=z-I,te=F.greaterEqual($);if(!q(te)||te.position!==$){let K=F.lowerEqual($);q(K)&&p.push({position:O-a,value:x.valueAt($,0),interpolation:K.interpolation})}let ae=!1;for(let K of F.iterateRange($,vr.MAX_VALUE)){let ge=K.position+I;if(ge<z)p.push({position:ge-a,value:K.value,interpolation:K.interpolation});else if(ge===z){p.push({position:ge-a,value:K.value,interpolation:ai.None}),ae=!0;break}else{p.push({position:z-a,value:x.valueAt(J,0),interpolation:ai.None}),ae=!0;break}}ae||p.push({position:z-a,value:x.valueAt(J,0),interpolation:ai.None})}});let d=[];for(let v of p){let y=d.length>0?d[d.length-1]:void 0;q(y)&&y.position===v.position&&y.value===v.value?d[d.length-1]=v:d.push(v)}let h=Dn.create(t,A.generate()),g=0;for(;g<d.length;){let v=g+1;for(;v<d.length&&d[v].position===d[g].position;)v++;let y=d[g],x=d[v-1],F=In.create(t,A.generate(),I=>{I.position.setValue(y.position),I.index.setValue(0),I.value.setValue(y.value),I.events.refer(h.events)});if(si.write(F.interpolation,v-g>1?ai.None:y.interpolation),v-g>1){let I=In.create(t,A.generate(),O=>{O.position.setValue(x.position),O.index.setValue(1),O.value.setValue(x.value),O.events.refer(h.events)});si.write(I.interpolation,x.interpolation)}g=v}return u.forEach(({box:v})=>v.delete()),m.wrap(cl.create(t,A.generate(),v=>{v.position.setValue(a),v.duration.setValue(s-a),v.loopDuration.setValue(s-a),v.loopOffset.setValue(0),v.hue.setValue(this.hue),v.mute.setValue(this.mute),v.label.setValue(this.label),v.events.refer(h.owners),v.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${A.toString(Se(this,bt,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Tu=new WeakMap,Fo=new WeakMap,bt=new WeakMap,Kh=new WeakMap,Ru=new WeakMap,jh=new WeakMap,Lh=new WeakMap,zn=new WeakSet,Bo=function(){Se(this,Kh,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var gB=(r,e)=>r.position-e.position,vB={for:(r,e)=>ve(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,os),visitAudioRegionBox:t=>r.adapterFor(t,da),visitValueRegionBox:t=>r.adapterFor(t,ma)}),"")};var Cu=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Wh,Dl,Zh,Ou,kl,Vu,Yv=class{constructor(e,t){Wh.set(this,void 0),Dl.set(this,void 0),Zh.set(this,void 0),Ou.set(this,void 0),kl.set(this,void 0),Vu.set(this,void 0),Cu(this,Wh,e,"f"),Cu(this,Dl,new j,"f"),Cu(this,Zh,fr(this,Dl,"f").own(new ce),"f"),Cu(this,Ou,fr(this,Dl,"f").own(new or),"f"),Cu(this,kl,$a.create(gB),"f"),Cu(this,Vu,A.newSet(n=>n.uuid),"f"),fr(this,Dl,"f").ownAll(fr(this,Wh,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=vB.for(t,n),o=fr(this,Vu,"f").add(i);V(o,`Cannot add ${n}`),fr(this,kl,"f").add(i),fr(this,Ou,"f").forEach(a=>a.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=fr(this,Vu,"f").removeByKey(n);fr(this,kl,"f").remove(i),fr(this,Ou,"f").forEach(o=>o.onRemoved(i)),this.dispatchChange()}},c.RegionCollection))}get trackBoxAdapter(){return fr(this,Wh,"f")}get collection(){return fr(this,kl,"f")}get adapters(){return fr(this,Vu,"f")}onIndexingChanged(){fr(this,kl,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),fr(this,Ou,"f").subscribe(e)}subscribeChanges(e){return fr(this,Zh,"f").subscribe(e)}dispatchChange(){fr(this,Zh,"f").notify()}terminate(){fr(this,Dl,"f").terminate()}};Wh=new WeakMap,Dl=new WeakMap,Zh=new WeakMap,Ou=new WeakMap,kl=new WeakMap,Vu=new WeakMap;var fe;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(fe||(fe={}));(function(r){r.toLabelString=e=>{switch(e){case r.Audio:return"Audio";case r.Notes:return"Note";case r.Value:return"Automation";case r.Undefined:default:return"N/A"}},r.toIconSymbol=e=>{switch(e){case r.Audio:return He.Waveform;case r.Notes:return He.Piano;case r.Value:return He.Automation;case r.Undefined:return He.AudioBus;default:return He.Unknown}}})(fe||(fe={}));var Xv;(function(r){r.isDeviceBox=e=>e.tags.type==="device",r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.tags.deviceType==="instrument",r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&(e.tags.deviceType==="audio-effect"||e.tags.deviceType==="midi-effect"),r.lookupHostField=e=>q(e)&&"host"in e&&pt(e.host,N)?e.host:D(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>q(e)&&"label"in e&&pt(e.label,C)?e.label:D(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>q(e)&&"enabled"in e&&pt(e.enabled,M)?e.enabled:D(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>q(e)&&"minimized"in e&&pt(e.minimized,M)?e.minimized:D(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>q(e)&&"index"in e&&pt(e.index,E)?e.index:D(`Could not find 'index' field in '${e?.name}'`)})(Xv||(Xv={}));var yB;(function(r){r.toTrackType=e=>{switch(e){case"midi":return fe.Notes;case"audio":return fe.Audio;default:return D()}}})(yB||(yB={}));var de;(function(r){r.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),r.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),r.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",r.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",r.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",r.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",r.deleteEffectDevices=e=>{if(e.length===0)return;V(U.satisfy(e,(i,o)=>i.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(c.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(c.MIDIEffectHost):D("unknown type")).map(({box:i})=>Xv.lookupIndexField(i)).filter(i=>e.some(o=>A.Comparator(o.uuid,i.address.uuid)!==0)).sort((i,o)=>i.getValue()-o.getValue()).forEach((i,o)=>i.setValue(o)),e.forEach(i=>i.box.delete())}})(de||(de={}));var ey=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Pr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Gh,ty,Un,Ml,ry,iy=class{constructor(e,t){Gh.set(this,void 0),ty.set(this,new ce),Un.set(this,void 0),Ml.set(this,void 0),ry.set(this,void 0),ey(this,Gh,e,"f"),ey(this,Un,ar.create(e.box.tracks,n=>t.adapterFor(n,Vt),c.TrackCollection),"f"),ey(this,Ml,A.newSet(({uuid:n})=>n),"f"),ey(this,ry,Pr(this,Un,"f").catchupAndSubscribe({onAdd:n=>Pr(this,Ml,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Pr(this,ty,"f").notify())}),onRemove:({uuid:n})=>Pr(this,Ml,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,t,n){let i=Pr(this,Gh,"f").box.graph,o=Pr(this,Gh,"f").box.tracks;Wr.create(i,A.generate(),a=>{a.index.setValue(n??Pr(this,Un,"f").getMinFreeIndex()),a.type.setValue(e),a.tracks.refer(o),a.target.refer(t)})}controls(e){return m.wrap(Pr(this,Un,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=Pr(this,Un,"f").adapters(),n=t.indexOf(e);if(n===-1)return D(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<t.length;i++)t[i].indexField.setValue(i-1);e.box.delete()}get collection(){return Pr(this,Un,"f")}values(){return Pr(this,Un,"f").adapters()}catchupAndSubscribe(e){return Pr(this,Un,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Pr(this,ty,"f").subscribe(e)}terminate(){Pr(this,Un,"f").terminate(),Pr(this,ry,"f").terminate(),Pr(this,Ml,"f").forEach(({subscription:e})=>e.terminate()),Pr(this,Ml,"f").clear()}};Gh=new WeakMap,ty=new WeakMap,Un=new WeakMap,Ml=new WeakMap,ry=new WeakMap;var pe;(function(r){r.AudioBus="manuals/audio-bus",r.Arpeggio="manuals/devices/midi/arpeggio",r.Pitch="manuals/devices/midi/pitch",r.Velocity="manuals/devices/midi/velocity",r.Zeitgeist="manuals/devices/midi/zeitgeist",r.StereoTool="manuals/devices/audio/stereo-tool",r.Delay="manuals/devices/audio/delay",r.DattorroReverb="manuals/devices/audio/dattorro-reverb",r.Maximizer="manuals/devices/audio/maximizer",r.Compressor="manuals/devices/audio/compressor",r.Gate="manuals/devices/audio/gate",r.Reverb="manuals/devices/audio/cheap-reverb",r.Crusher="manuals/devices/audio/crusher",r.Fold="manuals/devices/audio/fold",r.Tidal="manuals/devices/audio/tidal",r.Revamp="manuals/devices/audio/revamp",r.Modular="manuals/devices/audio/modular",r.NeuralAmp="manuals/devices/audio/neural-amp",r.Tape="manuals/devices/instruments/tape",r.Nano="manuals/devices/instruments/nano",r.Playfield="manuals/devices/instruments/playfield",r.Vaporisateur="manuals/devices/instruments/vaporisateur",r.MIDIOutput="manuals/devices/instruments/midi-output",r.Soundfont="manuals/devices/instruments/soundfont"})(pe||(pe={}));var xB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ny,Fi,qr=class{constructor(e,t){this.type="bus",this.accepts="audio",this.manualUrl=pe.AudioBus,ny.set(this,void 0),Fi.set(this,void 0),xB(this,ny,e,"f"),xB(this,Fi,t,"f")}catchupAndSubscribe(e){return e(this),jn(this,Fi,"f").subscribe(Ue.Children,()=>e(this))}get uuid(){return jn(this,Fi,"f").address.uuid}get address(){return jn(this,Fi,"f").address}get box(){return jn(this,Fi,"f")}get enabledField(){return jn(this,Fi,"f").enabled}get minimizedField(){return jn(this,Fi,"f").minimized}get iconField(){return jn(this,Fi,"f").icon}get labelField(){return jn(this,Fi,"f").label}get colorField(){return jn(this,Fi,"f").color}get iconSymbol(){return He.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return jn(this,ny,"f").boxAdapters.adapterFor(jn(this,Fi,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};ny=new WeakMap,Fi=new WeakMap;var qh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Dt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ga,zu,Uu,Bi,Hh,oy=class{constructor(e,t){ga.set(this,void 0),zu.set(this,void 0),Uu.set(this,void 0),Bi.set(this,void 0),Hh.set(this,re.Empty),qh(this,ga,new j,"f"),qh(this,zu,Dt(this,ga,"f").own(new ce),"f"),qh(this,Uu,Dt(this,ga,"f").own(new qi(He.Unknown)),"f"),qh(this,Bi,Dt(this,ga,"f").own(new Dr),"f"),Dt(this,ga,"f").own(Dt(this,Bi,"f").subscribe(n=>{Dt(this,Hh,"f").terminate(),qh(this,Hh,n.match({none:()=>(Dt(this,zu,"f").notify(m.None),re.Empty),some:({labelField:i,iconField:o})=>re.many(o.catchupAndSubscribe(a=>Dt(this,Uu,"f").setValue(He.fromName(a.getValue()))),i.catchupAndSubscribe(a=>Dt(this,zu,"f").notify(m.wrap(a.getValue()))))}),"f")})),Dt(this,ga,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(Dt(this,Bi,"f").nonEmpty()){let a=Dt(this,Bi,"f").unwrap();D(`AudioUnitInput already has an input. Existing: ${a.box.name}@${a.box.address.toString()} (type: ${a.type}), Incoming: ${n.name}@${n.address.toString()} (pointerType: ${String(i)})`)}let o=n instanceof kn?t.adapterFor(n,qr):t.adapterFor(n,de.isInstrument);Dt(this,Bi,"f").unwrapOrNull()!==o&&Dt(this,Bi,"f").wrap(o)},onRemoved:({box:n})=>{V(Dt(this,Bi,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),Dt(this,Bi,"f").clear()}},c.InstrumentHost,c.AudioOutput))}adapter(){return Dt(this,Bi,"f")}subscribe(e){return Dt(this,Bi,"f").subscribe(e)}catchupAndSubscribe(e){return e(Dt(this,Bi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),Dt(this,zu,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return Dt(this,Uu,"f").catchupAndSubscribe(e)}set label(e){this.adapter().ifSome(t=>t.labelField.setValue(e))}get label(){return this.adapter().map(e=>e.labelField.getValue())}set icon(e){this.adapter().ifSome(t=>t.iconField.setValue(He.toName(e)))}get icon(){return this.adapter().match({none:()=>He.Unknown,some:e=>He.fromName(e.iconField.getValue())})}get iconValue(){return Dt(this,Uu,"f")}terminate(){Dt(this,ga,"f").terminate(),Dt(this,Hh,"f").terminate()}};ga=new WeakMap,zu=new WeakMap,Uu=new WeakMap,Bi=new WeakMap,Hh=new WeakMap;var bB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$l=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ay,va,be=class{constructor(e){ay.set(this,void 0),va.set(this,void 0),bB(this,ay,e,"f"),bB(this,va,ke.newSet(t=>t.address),"f")}terminate(){$l(this,va,"f").forEach(e=>e.terminate()),$l(this,va,"f").clear()}parameters(){return $l(this,va,"f").values()}parameterAt(e){return $l(this,va,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,n,i,o){let a=new Tl($l(this,ay,"f"),e,t,n,i,o),s=$l(this,va,"f").add(a);return V(s,`Could not add adapter for ${e}`),a}removeParameter(e){return $l(this,va,"f").removeByKey(e)}};ay=new WeakMap,va=new WeakMap;var Rl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},St=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Cl,tn,as,ju,sy,ly,Jh,Lu=class{constructor(e,t){Cl.set(this,void 0),tn.set(this,void 0),as.set(this,void 0),ju.set(this,void 0),sy.set(this,void 0),ly.set(this,void 0),Jh.set(this,re.Empty),Rl(this,Cl,e,"f"),Rl(this,tn,t,"f"),Rl(this,as,new j,"f"),Rl(this,ju,St(this,as,"f").own(new ce),"f"),St(this,as,"f").own(t.targetBus.catchupAndSubscribe(()=>{St(this,Jh,"f").terminate(),Rl(this,Jh,this.optTargetBus.match({none:()=>(St(this,ju,"f").notify(m.None),re.Empty),some:n=>n.catchupAndSubscribe(i=>St(this,ju,"f").notify(m.wrap(i)))}),"f")})),Rl(this,sy,St(this,as,"f").own(new Tl(St(this,Cl,"f"),St(this,tn,"f").sendPan,w.bipolar(),_.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Rl(this,ly,St(this,as,"f").own(new Tl(St(this,Cl,"f"),St(this,tn,"f").sendGain,w.DefaultDecibel,_.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),St(this,ju,"f").subscribe(e)}get uuid(){return St(this,tn,"f").address.uuid}get address(){return St(this,tn,"f").address}get box(){return St(this,tn,"f")}get indexField(){return St(this,tn,"f").index}get sendPan(){return St(this,sy,"f")}get sendGain(){return St(this,ly,"f")}get targetBus(){return St(this,Cl,"f").boxAdapters.adapterFor(St(this,tn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,qr)}get optTargetBus(){return St(this,tn,"f").targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>St(this,Cl,"f").boxAdapters.adapterFor(t,qr)})))}delete(){St(this,tn,"f").delete()}terminate(){St(this,as,"f").terminate(),St(this,Jh,"f").terminate()}};Cl=new WeakMap,tn=new WeakMap,as=new WeakMap,ju=new WeakMap,sy=new WeakMap,ly=new WeakMap,Jh=new WeakMap;var Qh=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},No=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},cy,uy,Ku,Wu,Yh,dy=class{constructor(e,t){cy.set(this,void 0),uy.set(this,void 0),Ku.set(this,void 0),Wu.set(this,void 0),Yh.set(this,re.Empty),Qh(this,cy,e,"f"),Qh(this,uy,t,"f"),Qh(this,Ku,new j,"f"),Qh(this,Wu,No(this,Ku,"f").own(new ce),"f"),No(this,Ku,"f").own(e.catchupAndSubscribe(()=>{No(this,Yh,"f").terminate(),Qh(this,Yh,this.adapter.match({none:()=>(No(this,Wu,"f").notify(m.None),re.Empty),some:n=>n.catchupAndSubscribe(i=>No(this,Wu,"f").notify(m.wrap(i)))}),"f")}))}subscribe(e){return No(this,Wu,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return No(this,cy,"f").targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>No(this,uy,"f").adapterFor(t,qr)})))}terminate(){No(this,Ku,"f").terminate(),No(this,Yh,"f").terminate()}};cy=new WeakMap,uy=new WeakMap,Ku=new WeakMap,Wu=new WeakMap,Yh=new WeakMap;var ya=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},me=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},py,wB,Io,Ni,Ut,Vl,Zu,Ol,hy,Xh,fy,my,AB,_B,rn=class{constructor(e,t){py.add(this),this.class="device-host",Io.set(this,new j),Ni.set(this,void 0),Ut.set(this,void 0),Vl.set(this,void 0),Zu.set(this,void 0),Ol.set(this,void 0),hy.set(this,void 0),Xh.set(this,void 0),fy.set(this,void 0),my.set(this,void 0),ya(this,Ni,e,"f"),ya(this,Ut,t,"f"),ya(this,Vl,me(this,Io,"f").own(new be(me(this,Ni,"f"))),"f"),ya(this,Zu,me(this,Io,"f").own(new iy(this,me(this,Ni,"f").boxAdapters)),"f"),ya(this,Ol,me(this,Io,"f").own(new oy(me(this,Ut,"f").input.pointerHub,me(this,Ni,"f").boxAdapters)),"f"),ya(this,hy,me(this,Io,"f").own(ar.create(me(this,Ut,"f").midiEffects,n=>me(this,Ni,"f").boxAdapters.adapterFor(n,de.isMidiEffect),c.MIDIEffectHost)),"f"),ya(this,Xh,me(this,Io,"f").own(ar.create(me(this,Ut,"f").audioEffects,n=>me(this,Ni,"f").boxAdapters.adapterFor(n,de.isAudioEffect),c.AudioEffectHost)),"f"),ya(this,fy,me(this,Io,"f").own(ar.create(me(this,Ut,"f").auxSends,n=>me(this,Ni,"f").boxAdapters.adapterFor(n,Lu),c.AuxSend)),"f"),ya(this,my,me(this,Io,"f").own(new dy(me(this,Ut,"f").output,me(this,Ni,"f").boxAdapters)),"f"),this.namedParameter=me(this,py,"m",AB).call(this,t),me(this,py,"m",_B).call(this)}get box(){return me(this,Ut,"f")}get uuid(){return me(this,Ut,"f").address.uuid}get address(){return me(this,Ut,"f").address}get indexField(){return me(this,Ut,"f").index}get type(){return me(this,Ut,"f").type.getValue()}get captureBox(){return me(this,Ut,"f").capture.targetVertex}get tracks(){return me(this,Zu,"f")}get input(){return me(this,Ol,"f")}get midiEffects(){return me(this,hy,"f")}get audioEffects(){return me(this,Xh,"f")}get inputAdapter(){return me(this,Ol,"f").adapter()}get auxSends(){return me(this,fy,"f")}get output(){return me(this,my,"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 me(this,Ut,"f").output.targetVertex.mapOr(e=>e.box.address.equals(me(this,Ni,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return me(this,Ut,"f").midiEffects}get inputField(){return me(this,Ut,"f").input}get audioEffectsField(){return me(this,Ut,"f").audioEffects}get tracksField(){return me(this,Ut,"f").tracks}get minimizedField(){return me(this,Ol,"f").adapter().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return me(this,Ol,"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 t of me(this,Xh,"f").adapters())yield*t.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>m.None}}indicesLimit(){let e=me(this,Ni,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),n=this.type,i=t,o=t;for(;i>0&&e[i-1].type===n;)i--;for(;o<e.length-1&&e[o+1].type===n;)o++;return[i,o+1]}move(e){me(this,Ni,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){me(this,Zu,"f").collection.move(e,t)}deleteTrack(e){me(this,Zu,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){me(this,Io,"f").terminate()}};wB=rn,Io=new WeakMap,Ni=new WeakMap,Ut=new WeakMap,Vl=new WeakMap,Zu=new WeakMap,Ol=new WeakMap,hy=new WeakMap,Xh=new WeakMap,fy=new WeakMap,my=new WeakMap,py=new WeakSet,AB=function(e){return{volume:me(this,Vl,"f").createParameter(e.volume,wB.VolumeMapper,_.decible,"volume"),panning:me(this,Vl,"f").createParameter(e.panning,w.bipolar(),_.panning,"panning",.5),mute:me(this,Vl,"f").createParameter(e.mute,w.bool,_.bool,"mute"),solo:me(this,Vl,"f").createParameter(e.solo,w.bool,_.bool,"solo")}},_B=function(){let e=this.address.toString(),t=me(this,Ut,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${me(this,Ut,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;V(this.type!==Qt.Instrument||me(this,Ut,"f").capture.targetAddress.nonEmpty(),n)};rn.VolumeMapper=w.decibel(-96,-9,6);var Gu=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gy,nn,Hr,zl,vy,yy,ef,PB,SB,Vt=class{constructor(e,t){gy.add(this),nn.set(this,void 0),Hr.set(this,void 0),zl.set(this,void 0),vy.set(this,void 0),yy.set(this,void 0),ef.set(this,void 0),Gu(this,nn,e,"f"),Gu(this,Hr,t,"f"),Gu(this,zl,new j,"f"),Gu(this,vy,rt(this,zl,"f").own(new Hv(this,e.boxAdapters)),"f"),Gu(this,yy,rt(this,zl,"f").own(new Yv(this,e.boxAdapters)),"f"),Gu(this,ef,rt(this,zl,"f").own(new qi(-1)),"f")}catchupAndSubscribePath(e){let t=[m.None,m.None],n=()=>{t.every(i=>i.nonEmpty())?e(m.wrap(t.map(i=>i.unwrap()))):e(m.None)};return re.many(rt(this,gy,"m",PB).call(this,i=>{t[0].equals(i)||(t[0]=i,n())}),rt(this,gy,"m",SB).call(this,i=>{t[1].equals(i)||(t[1]=i,n())}))}get context(){return rt(this,nn,"f")}set targetName(e){rt(this,Hr,"f").target.targetVertex.ifSome(t=>{let n=t.box;if(n instanceof Pt){rt(this,nn,"f").boxAdapters.adapterFor(n,rn).input.adapter().ifSome(o=>o.labelField.setValue(e));return}rt(this,nn,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof C&&i.labelField.setValue(e)})})}get targetName(){return rt(this,Hr,"f").target.targetVertex.flatMap(e=>{let t=e.box;if(t instanceof Pt)return rt(this,nn,"f").boxAdapters.adapterFor(t,rn).input.label;let n=rt(this,nn,"f").boxAdapters.optAdapter(t);if(n.nonEmpty()){let i=n.unwrap();if("labelField"in i&&i.labelField instanceof C)return m.wrap(i.labelField.getValue())}return m.wrap(t.name)})}terminate(){rt(this,zl,"f").terminate()}get audioUnit(){return ze(rt(this,Hr,"f").tracks.targetVertex.unwrap().box,Pt)}get target(){return rt(this,Hr,"f").target}get clips(){return rt(this,vy,"f")}get regions(){return rt(this,yy,"f")}get enabled(){return rt(this,Hr,"f").enabled}get indexField(){return rt(this,Hr,"f").index}get type(){return rt(this,Hr,"f").type.getValue()}get box(){return rt(this,Hr,"f")}get uuid(){return rt(this,Hr,"f").address.uuid}get address(){return rt(this,Hr,"f").address}get listIndex(){return rt(this,ef,"f").getValue()}set listIndex(e){rt(this,ef,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===fe.Audio;case"note-clip":return this.type===fe.Notes;case"value-clip":return this.type===fe.Value;case"audio-region":return this.type===fe.Audio;case"note-region":return this.type===fe.Notes;case"value-region":return this.type===fe.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let n=t,i=rt(this,nn,"f").clipSequencing.iterate(this.uuid,e,e+Ng);for(let{optClip:o,sectionFrom:a}of i)n=o.match({none:()=>{let s=this.regions.collection.lowerEqual(e,l=>!l.mute);if(s===null){let l=this.regions.collection.optAt(0);return pt(l,ma)?l.incomingValue(t):t}else if(pt(s,ma))return e<s.complete?s.valueAt(e,t):s.outgoingValue(t);return t},some:s=>a===e&&pt(s,Xa)?s.valueAt(e,t):t});return n}};nn=new WeakMap,Hr=new WeakMap,zl=new WeakMap,vy=new WeakMap,yy=new WeakMap,ef=new WeakMap,gy=new WeakSet,PB=function(e){let t=rt(this,Hr,"f").target.targetVertex;if(t.nonEmpty()){let n=t.unwrap().box;if(n instanceof Pt)return rt(this,nn,"f").boxAdapters.adapterFor(n,rn).input.catchupAndSubscribeLabelChange(a=>e(a));let i=rt(this,nn,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof C)return o.labelField.catchupAndSubscribe(a=>e(m.wrap(a.getValue())))}return e(m.wrap(n.name)),re.Empty}return e(m.None),re.Empty},SB=function(e){let t=this.type;switch(t){case fe.Audio:case fe.Notes:return e(m.wrap(fe[t])),re.Empty;case fe.Value:{let n=rt(this,Hr,"f").target.targetVertex.unwrap();if(n.isField())e(rt(this,nn,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(m.wrap(n.name));else return D("Illegal State. Vertex is not a field nor box.");return re.Empty}case fe.Undefined:return e(m.wrap("")),re.Empty;default:return e(m.None),re.Empty}};var Sr=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_e=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},xa,Ii,ss,Ul,xy,by,jl,Ll,ls,cs,Kl,qu,tf,EB=[c.Automation,c.Modulation,c.MIDIControl,c.ParameterController],Tl=class{constructor(e,t,n,i,o,a){xa.set(this,void 0),Ii.set(this,void 0),ss.set(this,void 0),Ul.set(this,void 0),xy.set(this,void 0),by.set(this,void 0),jl.set(this,new j),Ll.set(this,void 0),ls.set(this,void 0),cs.set(this,m.None),Kl.set(this,m.None),qu.set(this,null),tf.set(this,!1),Sr(this,xa,e,"f"),Sr(this,Ii,t,"f"),Sr(this,ss,n,"f"),Sr(this,Ul,i,"f"),Sr(this,xy,o,"f"),Sr(this,by,a??0,"f"),_e(this,jl,"f").own(_e(this,xa,"f").parameterFieldAdapters.register(this)),Sr(this,Ll,_e(this,jl,"f").own(new ce),"f"),Sr(this,ls,new or,"f"),_e(this,jl,"f").own(_e(this,Ii,"f").subscribe(()=>_e(this,Ll,"f").notify(this))),_e(this,jl,"f").own(_e(this,Ii,"f").pointerHub.catchupAndSubscribe({onAdded:s=>{_e(this,ls,"f").proxy.onControlSourceAdd(fA(s.pointerType)),s.box.accept({visitTrackBox:l=>{V(_e(this,cs,"f").isEmpty(),"Already assigned");let u=_e(this,xa,"f").boxAdapters.adapterFor(l,Vt);Sr(this,cs,m.wrap(u),"f"),_e(this,xa,"f").isMainThread&&Sr(this,Kl,m.wrap(_e(this,xa,"f").liveStreamReceiver.subscribeFloat(_e(this,Ii,"f").address,p=>{_e(this,qu,"f")!==p&&(Sr(this,qu,p,"f"),_e(this,Ll,"f").notify(this))})),"f")}})},onRemoved:s=>{_e(this,ls,"f").proxy.onControlSourceRemove(fA(s.pointerType)),s.box.accept({visitTrackBox:l=>{V(_e(this,cs,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),Sr(this,cs,m.None,"f"),_e(this,xa,"f").isMainThread&&(_e(this,Kl,"f").ifSome(u=>u.terminate()),Sr(this,Kl,m.None,"f"),Sr(this,qu,null,"f"),_e(this,Ll,"f").notify(this))}})}},...EB)),t.getValue(),n.clamp(t.getValue())}registerMidiControl(){return _e(this,ls,"f").proxy.onControlSourceAdd("midi"),Sr(this,tf,!0,"f"),{terminate:()=>{Sr(this,tf,!1,"f"),_e(this,ls,"f").proxy.onControlSourceRemove("midi")}}}get field(){return _e(this,Ii,"f")}get valueMapping(){return _e(this,ss,"f")}get stringMapping(){return _e(this,Ul,"f")}get name(){return _e(this,xy,"f")}get anchor(){return _e(this,by,"f")}get type(){return _e(this,Ii,"f").type}get address(){return _e(this,Ii,"f").address}get track(){return _e(this,cs,"f")}valueAt(e){let t=_e(this,cs,"f");if(t.nonEmpty()){let n=t.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return _e(this,Ll,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return _e(this,tf,"f")&&e.onControlSourceAdd("midi"),_e(this,Ii,"f").pointerHub.filter(...EB).forEach(t=>e.onControlSourceAdd(fA(t.pointerType))),_e(this,ls,"f").subscribe(e)}getValue(){return _e(this,Ii,"f").getValue()}setValue(e){let t=this.getUnitValue();_e(this,Ii,"f").setValue(e),_e(this,xa,"f").parameterFieldAdapters.notifyWrite(this,t)}setUnitValue(e){this.setValue(_e(this,ss,"f").y(e))}getUnitValue(){return _e(this,ss,"f").x(this.getValue())}getControlledValue(){return _e(this,ss,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return _e(this,qu,"f")??this.getUnitValue()}getControlledPrintValue(){return _e(this,Ul,"f").x(this.getControlledValue())}getPrintValue(){return _e(this,Ul,"f").x(this.getValue())}setPrintValue(e){let t=_e(this,Ul,"f").y(e);t.type==="unitValue"?this.setUnitValue(we(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(_e(this,ss,"f").clamp(_e(this,Ii,"f").initValue))}terminate(){_e(this,Kl,"f").ifSome(e=>e.terminate()),Sr(this,Kl,m.None,"f"),_e(this,jl,"f").terminate()}};xa=new WeakMap,Ii=new WeakMap,ss=new WeakMap,Ul=new WeakMap,xy=new WeakMap,by=new WeakMap,jl=new WeakMap,Ll=new WeakMap,ls=new WeakMap,cs=new WeakMap,Kl=new WeakMap,qu=new WeakMap,tf=new WeakMap;var fA=r=>{switch(r){case c.Automation:return"automated";case c.Modulation:return"modulated";case c.MIDIControl:return"midi";case c.ParameterController:return"external";default:return D(`${r.toString()} is an unknown pointer type`)}};var mA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ln=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ba,Wl,wy,Ay=class{constructor(e,t,n){ba.set(this,void 0),Wl.set(this,void 0),wy.set(this,void 0),mA(this,ba,A.newSet(i=>i.uuid),"f"),mA(this,Wl,new or,"f"),mA(this,wy,e.catchupAndSubscribe({onAdded:i=>{let o=t(i.box),a=Ln(this,ba,"f").add(o);V(a,`Could not add ${o}`),Ln(this,Wl,"f").proxy.onAdd(o)},onRemoved:i=>{let o=i.box.address.uuid;Ln(this,Wl,"f").proxy.onRemove(Ln(this,ba,"f").removeByKey(o))}},n),"f")}subscribe(e){return Ln(this,Wl,"f").subscribe(e)}catchupAndSubscribe(e){return Ln(this,ba,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return Ln(this,ba,"f").values()}size(){return Ln(this,ba,"f").size()}isEmpty(){return this.size()===0}terminate(){Ln(this,ba,"f").clear(),Ln(this,Wl,"f").terminate(),Ln(this,wy,"f").terminate()}};ba=new WeakMap,Wl=new WeakMap,wy=new WeakMap;var gA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},wt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},vA,li,rf,on,Er,FB,tr=class{constructor(e,t){vA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Delay,rf.set(this,void 0),on.set(this,void 0),Er.set(this,void 0),gA(this,rf,e,"f"),gA(this,on,t,"f"),gA(this,Er,new be(wt(this,rf,"f")),"f"),this.namedParameter=wt(this,vA,"m",FB).call(this,t)}get box(){return wt(this,on,"f")}get uuid(){return wt(this,on,"f").address.uuid}get address(){return wt(this,on,"f").address}get indexField(){return wt(this,on,"f").index}get labelField(){return wt(this,on,"f").label}get enabledField(){return wt(this,on,"f").enabled}get minimizedField(){return wt(this,on,"f").minimized}get host(){return wt(this,on,"f").host}deviceHost(){return wt(this,rf,"f").boxAdapters.adapterFor(wt(this,on,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){wt(this,Er,"f").terminate()}};li=tr,rf=new WeakMap,on=new WeakMap,Er=new WeakMap,vA=new WeakSet,FB=function(e){return{preSyncTimeLeft:wt(this,Er,"f").createParameter(e.preSyncTimeLeft,w.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:wt(this,Er,"f").createParameter(e.preMillisTimeLeft,w.powerByCenter(100,0,li.MAX_MILLIS_TIME),_.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:wt(this,Er,"f").createParameter(e.preSyncTimeRight,w.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync R"),preMillisTimeRight:wt(this,Er,"f").createParameter(e.preMillisTimeRight,w.powerByCenter(100,0,li.MAX_MILLIS_TIME),_.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:wt(this,Er,"f").createParameter(e.delayMusical,w.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"delay"),millisTime:wt(this,Er,"f").createParameter(e.delayMillis,w.powerByCenter(100,0,li.MAX_MILLIS_TIME),_.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:wt(this,Er,"f").createParameter(e.feedback,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:wt(this,Er,"f").createParameter(e.cross,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:wt(this,Er,"f").createParameter(e.lfoSpeed,w.exponential(li.LFO_SPEED_MIN,li.LFO_SPEED_MAX),_.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:wt(this,Er,"f").createParameter(e.lfoDepth,w.power(4,0,li.LFO_DEPTH_MAX),_.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:wt(this,Er,"f").createParameter(e.filter,w.bipolar(),_.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:wt(this,Er,"f").createParameter(e.dry,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"dry"),wet:wt(this,Er,"f").createParameter(e.wet,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"wet")}};tr.Fractions=xr.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();tr.FractionsStringMapping=_.indices("",li.Fractions.map(([r,e])=>r===0?"Off":`${r}/${e}`));tr.MAX_MILLIS_TIME=1e3;tr.LFO_SPEED_MIN=.1;tr.LFO_SPEED_MAX=5;tr.LFO_DEPTH_MAX=50;var yA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},lr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},xA,nf,an,Do,BB,Hu=class{constructor(e,t){xA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Reverb,nf.set(this,void 0),an.set(this,void 0),Do.set(this,void 0),yA(this,nf,e,"f"),yA(this,an,t,"f"),yA(this,Do,new be(lr(this,nf,"f")),"f"),this.namedParameter=lr(this,xA,"m",BB).call(this,t)}get box(){return lr(this,an,"f")}get uuid(){return lr(this,an,"f").address.uuid}get address(){return lr(this,an,"f").address}get indexField(){return lr(this,an,"f").index}get labelField(){return lr(this,an,"f").label}get enabledField(){return lr(this,an,"f").enabled}get minimizedField(){return lr(this,an,"f").minimized}get host(){return lr(this,an,"f").host}deviceHost(){return lr(this,nf,"f").boxAdapters.adapterFor(lr(this,an,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){lr(this,Do,"f").terminate()}};nf=new WeakMap,an=new WeakMap,Do=new WeakMap,xA=new WeakSet,BB=function(e){return{decay:lr(this,Do,"f").createParameter(e.decay,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:lr(this,Do,"f").createParameter(e.preDelay,w.exponential(.001,.5),_.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:lr(this,Do,"f").createParameter(e.damp,w.unipolar(),_.numeric({unit:"%",fractionDigits:0}),"damping"),filter:lr(this,Do,"f").createParameter(e.filter,w.bipolar(),_.numeric({unit:"%",fractionDigits:0}),"filter"),dry:lr(this,Do,"f").createParameter(e.dry,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"dry"),wet:lr(this,Do,"f").createParameter(e.wet,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"wet")}};var bA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},AA,of,Di,Kn,DB,Ju=class{constructor(e,t){AA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Revamp,of.set(this,void 0),Di.set(this,void 0),Kn.set(this,void 0),bA(this,of,e,"f"),bA(this,Di,t,"f"),bA(this,Kn,new be(Zt(this,of,"f")),"f"),this.namedParameter=Zt(this,AA,"m",DB).call(this,t)}get box(){return Zt(this,Di,"f")}get uuid(){return Zt(this,Di,"f").address.uuid}get address(){return Zt(this,Di,"f").address}get indexField(){return Zt(this,Di,"f").index}get labelField(){return Zt(this,Di,"f").label}get enabledField(){return Zt(this,Di,"f").enabled}get minimizedField(){return Zt(this,Di,"f").minimized}get host(){return Zt(this,Di,"f").host}get spectrum(){return Zt(this,Di,"f").address.append(4095)}deviceHost(){return Zt(this,of,"f").boxAdapters.adapterFor(Zt(this,Di,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Zt(this,Kn,"f").terminate()}};of=new WeakMap,Di=new WeakMap,Kn=new WeakMap,AA=new WeakSet,DB=function(e){return{highPass:NB(Zt(this,Kn,"f"),e.highPass,"High-Pass"),lowShelf:IB(Zt(this,Kn,"f"),e.lowShelf,"Low-Shelf"),lowBell:wA(Zt(this,Kn,"f"),e.lowBell,"Low-Bell"),midBell:wA(Zt(this,Kn,"f"),e.midBell,"Mid-Bell"),highBell:wA(Zt(this,Kn,"f"),e.highBell,"High-Bell"),highShelf:IB(Zt(this,Kn,"f"),e.highShelf,"High-Shelf"),lowPass:NB(Zt(this,Kn,"f"),e.lowPass,"Low-Pass")}};var _A=w.exponential(20,2e4),kB=w.linear(-24,24),MB=w.exponential(.01,10),NB=(r,e,t)=>({enabled:r.createParameter(e.enabled,w.bool,_.bool,"enabled"),frequency:r.createParameter(e.frequency,_A,_.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,w.linearInteger(0,3),_.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,MB,_.numeric({fractionDigits:3}),`${t} Q`)}),IB=(r,e,t)=>({enabled:r.createParameter(e.enabled,w.bool,_.bool,"enabled"),frequency:r.createParameter(e.frequency,_A,_.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,kB,_.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),wA=(r,e,t)=>({enabled:r.createParameter(e.enabled,w.bool,_.bool,"enabled"),frequency:r.createParameter(e.frequency,_A,_.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,kB,_.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,MB,_.numeric({fractionDigits:3}),`${t} Q`)});var $B=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ci=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},_y,Py,ui,us=class{constructor(e,t){this.type="marker-event",_y.set(this,new j),Py.set(this,void 0),ui.set(this,void 0),$B(this,Py,e,"f"),$B(this,ui,t,"f"),ci(this,_y,"f").own(ci(this,ui,"f").subscribe(Ue.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();ci(this,ui,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return ci(this,ui,"f")}get uuid(){return ci(this,ui,"f").address.uuid}get address(){return ci(this,ui,"f").address}get position(){return ci(this,ui,"f").position.getValue()}get plays(){return ci(this,ui,"f").plays.getValue()}get hue(){return ci(this,ui,"f").hue.getValue()}get label(){return ci(this,ui,"f").label.getValue()}get trackAdapter(){return ci(this,ui,"f").track.targetVertex.map(e=>ci(this,Py,"f").boxAdapters.adapterFor(e.box,sn).markerTrack)}terminate(){ci(this,_y,"f").terminate()}toString(){return`{MarkerBoxAdapter ${A.toString(ci(this,ui,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};_y=new WeakMap,Py=new WeakMap,ui=new WeakMap;us.Comparator=(r,e)=>r.position-e.position;var af=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ln=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},sf,Qu,lf,Zl,Sy,Ey=class{constructor(e,t){sf.set(this,void 0),Qu.set(this,void 0),lf.set(this,void 0),Zl.set(this,void 0),Sy.set(this,void 0),af(this,sf,e,"f"),af(this,Qu,t,"f"),this.changeNotifier=new ce,af(this,lf,A.newSet(n=>n.uuid),"f"),af(this,Zl,oi.create(us.Comparator),"f"),af(this,Sy,ln(this,Qu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof Yc){let i=ln(this,sf,"f").boxAdapters.adapterFor(n,us),o=ln(this,lf,"f").add(i);V(o,"Could not add adapter"),ln(this,Zl,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{ln(this,Zl,"f").remove(ln(this,lf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return ln(this,sf,"f")}get enabled(){return ln(this,Qu,"f").enabled.getValue()}get events(){return ln(this,Zl,"f")}get object(){return ln(this,Qu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){ln(this,Zl,"f").onIndexingChanged(),this.dispatchChange()}terminate(){ln(this,Sy,"f").terminate()}};sf=new WeakMap,Qu=new WeakMap,lf=new WeakMap,Zl=new WeakMap,Sy=new WeakMap;var TB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ki=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fy,By,Mi,Gl=class{constructor(e,t){this.type="signature-event",Fy.set(this,new j),By.set(this,void 0),Mi.set(this,void 0),TB(this,By,e,"f"),TB(this,Mi,t,"f"),ki(this,Fy,"f").own(ki(this,Mi,"f").subscribe(Ue.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return ki(this,Mi,"f")}get uuid(){return ki(this,Mi,"f").address.uuid}get address(){return ki(this,Mi,"f").address}get index(){return ki(this,Mi,"f").index.getValue()}get indexField(){return ki(this,Mi,"f").index}get relativePosition(){return ki(this,Mi,"f").relativePosition.getValue()}get nominator(){return ki(this,Mi,"f").nominator.getValue()}get denominator(){return ki(this,Mi,"f").denominator.getValue()}get trackAdapter(){return ki(this,Mi,"f").events.targetVertex.map(e=>ki(this,By,"f").boxAdapters.adapterFor(e.box,sn).signatureTrack)}terminate(){ki(this,Fy,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Fy=new WeakMap,By=new WeakMap,Mi=new WeakMap;Gl.Comparator=(r,e)=>r.index-e.index;var Ny=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Et=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ql,cf,uf,Hl,wa,ds,RB,df,Iy=class{constructor(e,t,n){ql.add(this),cf.set(this,new j),uf.set(this,void 0),Hl.set(this,void 0),wa.set(this,void 0),ds.set(this,void 0),Ny(this,uf,e,"f"),Ny(this,Hl,t,"f"),Ny(this,wa,n,"f"),this.changeNotifier=new ce,Ny(this,ds,Et(this,cf,"f").own(ar.create(Et(this,wa,"f").events,i=>e.boxAdapters.adapterFor(i,Gl),c.SignatureAutomation)),"f"),Et(this,cf,"f").ownAll(Et(this,Hl,"f").subscribe(()=>this.dispatchChange()),Et(this,wa,"f").enabled.subscribe(()=>this.dispatchChange()),Et(this,ds,"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 Et(this,uf,"f")}get enabled(){return Et(this,wa,"f").enabled.getValue()}get object(){return Et(this,wa,"f")}get size(){return Et(this,ds,"f").size()}get storageSignature(){let{nominator:e,denominator:t}=Et(this,Hl,"f");return[e.getValue(),t.getValue()]}nonEmpty(){return Et(this,ds,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let t=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:o}of this.iterateAll()){if(n>e)break;t=[i,o]}return t}*iterateAll(){let e=0,t=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:t,nominator:n,denominator:i},!!Et(this,wa,"f").enabled.getValue())for(let o of Et(this,ds,"f").adapters())e+=Q.fromSignature(n,i)*o.relativePosition,t+=o.relativePosition,n=o.nominator,i=o.denominator,yield{index:o.index,accumulatedPpqn:e,accumulatedBars:t,nominator:n,denominator:i}}changeSignature(e,t){let n=Array.from(this.iterateAll()).slice(1),i=n.map(l=>l.accumulatedPpqn);Et(this,Hl,"f").nominator.setValue(e),Et(this,Hl,"f").denominator.setValue(t);let o=0,a=0,s=Q.fromSignature(e,t);for(let l=0;l<n.length;l++){let u=n[l],p=this.adapterAt(u.index);if(p.isEmpty())continue;let h=(i[l]-o)/s,g=Math.floor(h),v=h-g;a+=v;let y=g;a>=1&&(y++,a--),y=Math.max(1,y),p.unwrap().box.relativePosition.setValue(y),o+=y*s,s=Q.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let t=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(g=>g.index===t);if(i===-1)return;let o=n.slice(i+1),a=o.map(g=>g.accumulatedPpqn),s=i>0?n[i-1]:null,[l,u]=s!==null?[s.nominator,s.denominator]:this.storageSignature,p=s!==null?s.accumulatedPpqn:0;e.box.delete();let d=p,h=Q.fromSignature(l,u);for(let g=0;g<o.length;g++){let v=o[g],y=this.adapterAt(v.index);if(y.isEmpty())continue;let F=(a[g]-d)/h,I=Math.max(1,Math.round(F));y.unwrap().box.relativePosition.setValue(I),d+=I*h,h=Q.fromSignature(v.nominator,v.denominator)}}createEvent(e,t,n){let i=Array.from(this.iterateAll()),o=i[0],a=0;for(let y=1;y<i.length&&!(i[y].accumulatedPpqn>e);y++)o=i[y],a=y;let s=Q.fromSignature(o.nominator,o.denominator),l=(e-o.accumulatedPpqn)/s,u=Math.max(1,Math.round(l)),p=o.index+1,d=i.slice(a+1),h=o.accumulatedPpqn+u*s,g=Q.fromSignature(t,n),v=d.map(y=>({event:y,adapter:this.adapterAt(y.index)})).filter(({adapter:y})=>y.nonEmpty()).map(({event:y,adapter:x})=>({event:y,adapter:x.unwrap()}));for(let y=0;y<v.length;y++){let{event:x,adapter:F}=v[y];if(F.box.index.setValue(x.index+1),y===0){let I=(x.accumulatedPpqn-h)/g;F.box.relativePosition.setValue(Math.max(1,Math.round(I)))}}qc.create(Et(this,uf,"f").boxGraph,A.generate(),y=>{y.index.setValue(p),y.relativePosition.setValue(u),y.nominator.setValue(t),y.denominator.setValue(n),y.events.refer(Et(this,wa,"f").events)})}adapterAt(e){return Et(this,ds,"f").getAdapterByIndex(e)}moveEvent(e,t){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(h=>h.index===e.index);if(i===-1)return;let o=n[i];if(t===o.accumulatedPpqn)return;let a=n.map(h=>h.accumulatedBars),s=Et(this,ql,"m",RB).call(this,t,o.index);if(s===o.accumulatedBars)return;let l=[...a];l[i]=s;let u=l.map((h,g)=>({bar:h,i:g})).sort((h,g)=>h.bar-g.bar).map(h=>h.i),p=n.map(h=>this.adapterAt(h.index).unwrap());for(let h=0;h<u.length;h++)p[u[h]].box.index.setValue(h);let d=0;for(let h=0;h<u.length;h++){let g=u[h],v=p[g],y=l[g],x=Math.max(1,y-d);v.box.relativePosition.setValue(x),d=y}}floorToBar(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}ceilToBar(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.ceil((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}roundToBar(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.round((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}barLengthAt(e){let[t,n]=this.signatureAt(e);return Q.fromSignature(t,n)}getBarInterval(e){let{event:t,barPpqn:n}=Et(this,ql,"m",df).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/n),o=t.accumulatedPpqn+i*n;return{position:o,complete:o+n}}terminate(){Et(this,cf,"f").terminate()}};cf=new WeakMap,uf=new WeakMap,Hl=new WeakMap,wa=new WeakMap,ds=new WeakMap,ql=new WeakSet,RB=function(e,t){let n=null;for(let a of this.iterateAll())if(a.index!==t){if(a.accumulatedPpqn>e)break;n=a}if(so(n)){let[a,s]=this.storageSignature,l=Q.fromSignature(a,s);return Math.max(1,Math.round(e/l))}let i=Q.fromSignature(n.nominator,n.denominator),o=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+o)},df=function(e){let t=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;t=n}if(so(t)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Q.fromSignature(n,i)}}return{event:t,barPpqn:Q.fromSignature(t.nominator,t.denominator)}};var pf=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},hf,ko,Dy,ky,Aa,ff,My,sn=class{constructor(e,t){hf.set(this,new j),ko.set(this,void 0),Dy.set(this,void 0),ky.set(this,void 0),Aa.set(this,void 0),ff.set(this,void 0),My.set(this,()=>{let{tempoTrack:{enabled:s}}=jt(this,ko,"f");return s.getValue()?jt(this,Aa,"f").isEmpty()?m.None:jt(this,Aa,"f").unwrap().events.isEmpty()?m.None:jt(this,Aa,"f"):m.None}),pf(this,ko,t,"f"),pf(this,Dy,new Ey(e,t.markerTrack),"f"),pf(this,ky,new Iy(e,t.signature,t.signatureTrack),"f"),pf(this,Aa,new Dr,"f"),pf(this,ff,new ce,"f");let n=jt(this,hf,"f").own(new j),i=()=>jt(this,ff,"f").notify(jt(this,My,"f").call(this)),{tempoTrack:{events:o,enabled:a}}=t;jt(this,hf,"f").own(o.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>jt(this,Aa,"f").clear(),some:({box:l})=>{let u=e.boxAdapters.adapterFor(l,Ar);jt(this,Aa,"f").wrap(u),n.ownAll(u.subscribeChange(i),a.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(jt(this,My,"f").call(this)),jt(this,ff,"f").subscribe(e)}get box(){return jt(this,ko,"f")}get uuid(){return jt(this,ko,"f").address.uuid}get address(){return jt(this,ko,"f").address}get markerTrack(){return jt(this,Dy,"f")}get signatureTrack(){return jt(this,ky,"f")}get tempoTrackEvents(){return jt(this,Aa,"f")}get signature(){let{nominator:e,denominator:t}=jt(this,ko,"f").signature;return[e.getValue(),t.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=jt(this,ko,"f").signature;return Q.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),jt(this,ko,"f").signature.subscribe(()=>e(this.signature))}terminate(){jt(this,hf,"f").terminate()}};hf=new WeakMap,ko=new WeakMap,Dy=new WeakMap,ky=new WeakMap,Aa=new WeakMap,ff=new WeakMap,My=new WeakMap;var SM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},mf=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ps,hs=class{constructor(e,t){ps.set(this,void 0),SM(this,ps,t,"f")}get box(){return mf(this,ps,"f")}get uuid(){return mf(this,ps,"f").address.uuid}get address(){return mf(this,ps,"f").address}get source(){return mf(this,ps,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return mf(this,ps,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};ps=new WeakMap;var Jl=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},cn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$y,Ql,Yl,Ty,Ry,gf,un=class{constructor(e,t){$y.set(this,void 0),Ql.set(this,void 0),Yl.set(this,void 0),Ty.set(this,void 0),Ry.set(this,void 0),gf.set(this,!1),Jl(this,$y,e,"f"),Jl(this,Ql,t,"f"),Jl(this,Yl,new j,"f"),Jl(this,Ty,t.attributes,"f"),Jl(this,Ry,cn(this,Yl,"f").own(new be(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return cn(this,Yl,"f").own(e)}ownAll(...e){cn(this,Yl,"f").ownAll(...e)}onSelected(){Jl(this,gf,!0,"f")}onDeselected(){Jl(this,gf,!1,"f")}isSelected(){return cn(this,gf,"f")}get box(){return cn(this,Ql,"f")}get attributes(){return cn(this,Ty,"f")}get uuid(){return cn(this,Ql,"f").address.uuid}get address(){return cn(this,Ql,"f").address}get parameters(){return cn(this,Ry,"f")}get modular(){return cn(this,$y,"f").boxAdapters.adapterFor(cn(this,Ql,"f").attributes.collection.targetVertex.unwrap().box,fs)}terminate(){cn(this,Yl,"f").terminate()}};$y=new WeakMap,Ql=new WeakMap,Yl=new WeakMap,Ty=new WeakMap,Ry=new WeakMap,gf=new WeakMap;var Cy=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_a=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Oy,ms,vf,Vy,Tr;(function(r){r.Input="input",r.Output="output"})(Tr||(Tr={}));var Rr=class r{static create(e,t,n,i){return new r(e,t,n,i??t.fieldName)}constructor(e,t,n,i){Oy.set(this,void 0),ms.set(this,void 0),vf.set(this,void 0),Vy.set(this,void 0),Cy(this,Oy,e,"f"),Cy(this,ms,t,"f"),Cy(this,vf,n,"f"),Cy(this,Vy,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(n=>n===t))}get connections(){return _a(this,ms,"f").pointerHub.isEmpty()?U.empty():_a(this,ms,"f").pointerHub.filter(c.VoltageConnection).map(({box:e})=>_a(this,Oy,"f").adapterFor(e,hs))}get field(){return _a(this,ms,"f")}get address(){return _a(this,ms,"f").address}get direction(){return _a(this,vf,"f")}get name(){return _a(this,Vy,"f")}toString(){return`{ModuleConnectorAdapter address: ${_a(this,ms,"f").address.toString()}, direction: ${_a(this,vf,"f")}}`}};Oy=new WeakMap,ms=new WeakMap,vf=new WeakMap,Vy=new WeakMap;var PA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},yf=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zy,xf,bf,Yu=class extends un{constructor(e,t){super(e,t),zy.set(this,void 0),xf.set(this,void 0),bf.set(this,void 0),PA(this,zy,this.parameters.createParameter(t.time,w.exponential(1,1e4),_.numeric({unit:"ms"}),"Time"),"f"),PA(this,xf,Rr.create(e.boxAdapters,t.voltageInput,Tr.Input,"Input"),"f"),PA(this,bf,Rr.create(e.boxAdapters,t.voltageOutput,Tr.Output,"Output"),"f")}get parameterTime(){return yf(this,zy,"f")}get voltageInput(){return yf(this,xf,"f")}get voltageOutput(){return yf(this,bf,"f")}get inputs(){return[yf(this,xf,"f")]}get outputs(){return[yf(this,bf,"f")]}};zy=new WeakMap,xf=new WeakMap,bf=new WeakMap;var EM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},CB=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wf,Xu=class extends un{constructor(e,t){super(e,t),wf.set(this,void 0),EM(this,wf,Rr.create(e.boxAdapters,t.input,Tr.Input,"Input"),"f")}get voltageInput(){return CB(this,wf,"f")}get inputs(){return[CB(this,wf,"f")]}get outputs(){return U.empty()}};wf=new WeakMap;var SA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Af=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Uy,_f,Pf,ed=class extends un{constructor(e,t){super(e,t),Uy.set(this,void 0),_f.set(this,void 0),Pf.set(this,void 0),SA(this,Uy,this.parameters.createParameter(t.gain,w.DefaultDecibel,_.numeric({unit:"db"}),"Gain"),"f"),SA(this,_f,Rr.create(e.boxAdapters,t.voltageInput,Tr.Input,"Input"),"f"),SA(this,Pf,Rr.create(e.boxAdapters,t.voltageOutput,Tr.Output,"Output"),"f")}get parameterGain(){return Af(this,Uy,"f")}get voltageInput(){return Af(this,_f,"f")}get voltageOutput(){return Af(this,Pf,"f")}get inputs(){return[Af(this,_f,"f")]}get outputs(){return[Af(this,Pf,"f")]}};Uy=new WeakMap,_f=new WeakMap,Pf=new WeakMap;var EA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},FA=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},jy,Ly,Ky,td=class extends un{constructor(e,t){super(e,t),jy.set(this,void 0),Ly.set(this,void 0),Ky.set(this,void 0),EA(this,jy,Rr.create(e.boxAdapters,t.voltageInputX,Tr.Input,"X"),"f"),EA(this,Ly,Rr.create(e.boxAdapters,t.voltageInputY,Tr.Input,"Y"),"f"),EA(this,Ky,Rr.create(e.boxAdapters,t.voltageOutput,Tr.Output,"Result"),"f")}get inputs(){return[FA(this,jy,"f"),FA(this,Ly,"f")]}get outputs(){return[FA(this,Ky,"f")]}};jy=new WeakMap,Ly=new WeakMap,Ky=new WeakMap;var FM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},OB=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Sf,rd=class extends un{constructor(e,t){super(e,t),Sf.set(this,void 0),FM(this,Sf,Rr.create(e.boxAdapters,t.output,Tr.Output,"Output"),"f")}get voltageOutput(){return OB(this,Sf,"f")}get inputs(){return U.empty()}get outputs(){return[OB(this,Sf,"f")]}};Sf=new WeakMap;var id;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>ve(t.accept({visitModuleGainBox:n=>e.adapterFor(n,ed),visitModuleDelayBox:n=>e.adapterFor(n,Yu),visitModuleMultiplierBox:n=>e.adapterFor(n,td),visitModularAudioInputBox:n=>e.adapterFor(n,rd),visitModularAudioOutputBox:n=>e.adapterFor(n,Xu)}),`Could not find ModuleAdapter for ${t.name}`)})(id||(id={}));var VB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xl=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Wy,Zy,ec,BA,nd=class{constructor(e,t){Wy.add(this),Zy.set(this,void 0),ec.set(this,void 0),VB(this,Zy,e,"f"),VB(this,ec,t,"f")}get box(){return Xl(this,ec,"f")}get uuid(){return Xl(this,ec,"f").address.uuid}get address(){return Xl(this,ec,"f").address}get moduleAdapter(){return id.adapterFor(Xl(this,Zy,"f").boxAdapters,Xl(this,Wy,"a",BA).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Xl(this,Wy,"a",BA).address)}terminate(){}};Zy=new WeakMap,ec=new WeakMap,Wy=new WeakSet,BA=function(){return Xl(this,ec,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var zB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},di=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},od,pi,gs=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Modular,od.set(this,void 0),pi.set(this,void 0),zB(this,od,e,"f"),zB(this,pi,t,"f")}get box(){return di(this,pi,"f")}get uuid(){return di(this,pi,"f").address.uuid}get address(){return di(this,pi,"f").address}get indexField(){return di(this,pi,"f").index}get labelField(){return di(this,pi,"f").label}get enabledField(){return di(this,pi,"f").enabled}get minimizedField(){return di(this,pi,"f").minimized}get host(){return di(this,pi,"f").host}parameterAt(e){return D("Not yet implemented")}deviceHost(){return di(this,od,"f").boxAdapters.adapterFor(di(this,pi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return di(this,od,"f").boxAdapters.adapterFor(di(this,pi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,fs)}elements(){return di(this,pi,"f").userInterface.elements.pointerHub.filter(c.DeviceUserInterface).map(e=>di(this,od,"f").boxAdapters.adapterFor(e.box,nd))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};od=new WeakMap,pi=new WeakMap;var Ef=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ot=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ad,vs,sd,$i,tc,rc,fs=class{constructor(e,t){ad.set(this,new j),vs.set(this,void 0),sd.set(this,void 0),$i.set(this,void 0),tc.set(this,void 0),rc.set(this,void 0),Ef(this,sd,e,"f"),Ef(this,$i,t,"f"),Ef(this,vs,ot(this,ad,"f").own(new or),"f"),Ef(this,tc,A.newSet(s=>s.uuid),"f"),Ef(this,rc,A.newSet(s=>s.uuid),"f");let n=s=>{let l=id.adapterFor(ot(this,sd,"f").boxAdapters,s.box);ot(this,tc,"f").add(l)&&ot(this,vs,"f").proxy.onModuleAdded(l)},i=s=>ot(this,vs,"f").proxy.onModuleRemoved(ot(this,tc,"f").removeByKey(s.address.uuid)),o=s=>{let l=ot(this,sd,"f").boxAdapters.adapterFor(s.box,hs);ot(this,rc,"f").add(l)&&ot(this,vs,"f").proxy.onConnectionAdded(l)},a=s=>ot(this,vs,"f").proxy.onConnectionRemoved(ot(this,rc,"f").removeByKey(s.address.uuid));ot(this,$i,"f").modules.pointerHub.filter(c.ModuleCollection).forEach(n),ot(this,$i,"f").connections.pointerHub.filter(c.ConnectionCollection).forEach(o),ot(this,ad,"f").own(ot(this,$i,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},c.ModuleCollection)),ot(this,ad,"f").own(ot(this,$i,"f").connections.pointerHub.subscribe({onAdded:o,onRemoved:a},c.ConnectionCollection))}catchupAndSubscribe(e){return K0(e.onModuleAdded,t=>ot(this,tc,"f").forEach(n=>t(n))),K0(e.onConnectionAdded,t=>ot(this,rc,"f").forEach(n=>t(n))),ot(this,vs,"f").subscribe(e)}get box(){return ot(this,$i,"f")}get address(){return ot(this,$i,"f").address}get uuid(){return ot(this,$i,"f").address.uuid}get editingField(){return ot(this,$i,"f").editing}get labelField(){return ot(this,$i,"f").label}get modules(){return ot(this,tc,"f").values()}get connections(){return ot(this,rc,"f").values()}get device(){return ot(this,sd,"f").boxAdapters.adapterFor(ve(ot(this,$i,"f").device.pointerHub.incoming().at(0),"No device found").box,gs)}terminate(){console.debug(`terminate ${this}`),ot(this,ad,"f").terminate()}};ad=new WeakMap,vs=new WeakMap,sd=new WeakMap,$i=new WeakMap,tc=new WeakMap,rc=new WeakMap;var Ff=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Jr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},NA,cd,Bf,Gy,ld,If,qy,Nf,Hy,UB,Mo=class{constructor(e,t){NA.add(this),this.type="groove-adapter",Bf.set(this,new j),Gy.set(this,void 0),ld.set(this,void 0),If.set(this,void 0),qy.set(this,new _g({duration:()=>Jr(this,Hy,"f"),fx:n=>q0(n,Jr(this,Nf,"f")),fy:n=>q0(n,1-Jr(this,Nf,"f"))})),Nf.set(this,0),Hy.set(this,Q.SemiQuaver*2),Ff(this,Gy,e,"f"),Ff(this,ld,t,"f"),Ff(this,If,Jr(this,Bf,"f").own(new be(Jr(this,Gy,"f"))),"f"),this.namedParameter=Jr(this,NA,"m",UB).call(this,t),Jr(this,Bf,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>Ff(this,Hy,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>Ff(this,Nf,HF(n.getValue(),.01),"f")))}unwarp(e){return Jr(this,qy,"f").unwarp(e)}warp(e){return Jr(this,qy,"f").warp(e)}get box(){return Jr(this,ld,"f")}get uuid(){return Jr(this,ld,"f").address.uuid}get address(){return Jr(this,ld,"f").address}terminate(){Jr(this,Bf,"f").terminate()}};cd=Mo,Bf=new WeakMap,Gy=new WeakMap,ld=new WeakMap,If=new WeakMap,qy=new WeakMap,Nf=new WeakMap,Hy=new WeakMap,NA=new WeakSet,UB=function(e){return{duration:Jr(this,If,"f").createParameter(e.duration,w.values(cd.DurationPPQNs),_.values("",cd.DurationPPQNs,cd.DurationStrings),"duration"),amount:Jr(this,If,"f").createParameter(e.amount,w.unipolar(),_.percent({fractionDigits:0}),"amount")}};Mo.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Mo.DurationPPQNs=cd.Durations.map(([r,e])=>Q.fromSignature(r,e));Mo.DurationStrings=cd.Durations.map(([r,e])=>`${r}/${e}`);var ud=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Rt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$o,ys,dd,Jy,Qy,Df,kf,IA,xs=class{constructor(e,t,n,i,o){$o.set(this,void 0),ys.set(this,void 0),dd.set(this,void 0),Jy.set(this,void 0),Qy.set(this,void 0),Df.set(this,new j),kf.set(this,void 0),IA.set(this,m.None),ud(this,$o,e,"f"),ud(this,ys,t,"f"),ud(this,dd,n,"f"),ud(this,Jy,i,"f"),ud(this,Qy,o??0,"f"),ud(this,kf,Rt(this,Df,"f").own(new ce),"f"),Rt(this,Df,"f").own(Rt(this,$o,"f").subscribe(()=>Rt(this,kf,"f").notify(this))),e.getValue(),t.clamp(e.getValue())}get field(){return Rt(this,$o,"f")}get valueMapping(){return Rt(this,ys,"f")}get stringMapping(){return Rt(this,dd,"f")}get name(){return Rt(this,Jy,"f")}get anchor(){return Rt(this,Qy,"f")}get type(){return Rt(this,$o,"f").type}get address(){return Rt(this,$o,"f").address}get track(){return Rt(this,IA,"f")}subscribe(e){return Rt(this,kf,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Rt(this,$o,"f").getValue()}setValue(e){Rt(this,$o,"f").setValue(Rt(this,ys,"f").clamp(e))}setUnitValue(e){this.setValue(Rt(this,ys,"f").y(e))}getUnitValue(){return Rt(this,ys,"f").x(this.getValue())}getPrintValue(){return Rt(this,dd,"f").x(this.getValue())}setPrintValue(e){let t=Rt(this,dd,"f").y(e);t.type==="unitValue"?this.setUnitValue(we(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(Rt(this,ys,"f").clamp(Rt(this,$o,"f").initValue))}terminate(){Rt(this,Df,"f").terminate()}};$o=new WeakMap,ys=new WeakMap,dd=new WeakMap,Jy=new WeakMap,Qy=new WeakMap,Df=new WeakMap,kf=new WeakMap,IA=new WeakMap;var pd=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},To,Yy,Xy,ex,tx,rx,ix=class{constructor(e){To.set(this,void 0),Yy.set(this,void 0),Xy.set(this,void 0),ex.set(this,void 0),tx.set(this,void 0),rx.set(this,void 0),pd(this,To,e,"f"),pd(this,Yy,new xs(dn(this,To,"f").keyboard,w.values([88,76,61,49]),_.numeric({fractionDigits:1}),"Keyboard Type"),"f"),pd(this,Xy,new xs(dn(this,To,"f").timeRangeInQuarters,w.exponential(1,64),_.numeric({fractionDigits:1}),"Time-Range"),"f"),pd(this,ex,new xs(dn(this,To,"f").noteScale,w.exponential(.5,2),_.numeric({fractionDigits:1}),"Note Scale"),"f"),pd(this,tx,new xs(dn(this,To,"f").noteLabels,w.bool,_.bool,"Note Labels"),"f"),pd(this,rx,new xs(dn(this,To,"f").transpose,w.linearInteger(-48,48),_.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return dn(this,To,"f").box.subscribe(Ue.Children,()=>e(this))}get object(){return dn(this,To,"f")}get keyboard(){return dn(this,Yy,"f")}get timeRangeInQuarters(){return dn(this,Xy,"f")}get noteScale(){return dn(this,ex,"f")}get noteLabels(){return dn(this,tx,"f")}get transpose(){return dn(this,rx,"f")}};To=new WeakMap,Yy=new WeakMap,Xy=new WeakMap,ex=new WeakMap,tx=new WeakMap,rx=new WeakMap;var Mf=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ic,Ti,nc,nx,ox,hd=class{constructor(e,t){ic.set(this,void 0),Ti.set(this,void 0),nc.set(this,void 0),nx.set(this,void 0),ox.set(this,void 0),Mf(this,ic,e,"f"),Mf(this,Ti,t,"f"),Mf(this,nc,ar.create(rr(this,Ti,"f").audioUnits,n=>rr(this,ic,"f").boxAdapters.adapterFor(n,rn),c.AudioUnits),"f"),Mf(this,nx,new Ay(rr(this,Ti,"f").audioBusses.pointerHub,n=>rr(this,ic,"f").boxAdapters.adapterFor(n,qr),c.AudioBusses),"f"),Mf(this,ox,new ix(rr(this,Ti,"f").pianoMode),"f")}get uuid(){return rr(this,Ti,"f").address.uuid}get address(){return rr(this,Ti,"f").address}get box(){return rr(this,Ti,"f")}get audioBusses(){return rr(this,nx,"f")}get audioUnits(){return rr(this,nc,"f")}get clips(){return rr(this,nc,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return rr(this,ic,"f").boxAdapters.adapterFor(rr(this,Ti,"f").groove.targetVertex.unwrap("no groove").box,Mo)}get timeline(){return rr(this,ic,"f").boxAdapters.adapterFor(rr(this,Ti,"f").timeline.targetVertex.unwrap("no timeline").box,sn)}get pianoMode(){return rr(this,ox,"f")}get created(){return new Date(rr(this,Ti,"f").created.getValue())}get midiOutputDevices(){return rr(this,Ti,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>ze(e,Mn))}*labeledAudioOutputs(){for(let e of rr(this,nc,"f").adapters())yield{label:e.label,address:e.address,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){rr(this,nc,"f").terminate()}};ic=new WeakMap,Ti=new WeakMap,nc=new WeakMap,nx=new WeakMap,ox=new WeakMap;var DA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Cr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},kA,$f,Wn,bs,jB,fd=class{constructor(e,t){kA.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=pe.Tape,$f.set(this,void 0),Wn.set(this,void 0),bs.set(this,void 0),DA(this,$f,e,"f"),DA(this,Wn,t,"f"),DA(this,bs,new be(Cr(this,$f,"f")),"f"),this.namedParameter=Cr(this,kA,"m",jB).call(this,t)}get box(){return Cr(this,Wn,"f")}get uuid(){return Cr(this,Wn,"f").address.uuid}get address(){return Cr(this,Wn,"f").address}get labelField(){return Cr(this,Wn,"f").label}get iconField(){return Cr(this,Wn,"f").icon}get defaultTrackType(){return fe.Audio}get enabledField(){return Cr(this,Wn,"f").enabled}get minimizedField(){return Cr(this,Wn,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Cr(this,$f,"f").boxAdapters.adapterFor(Cr(this,Wn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Cr(this,bs,"f").terminate()}};$f=new WeakMap,Wn=new WeakMap,bs=new WeakMap,kA=new WeakSet,jB=function(e){return{flutter:Cr(this,bs,"f").createParameter(e.flutter,w.unipolar(),_.percent(),"flutter"),wow:Cr(this,bs,"f").createParameter(e.wow,w.unipolar(),_.percent(),"wow"),noise:Cr(this,bs,"f").createParameter(e.noise,w.unipolar(),_.percent(),"noise"),saturation:Cr(this,bs,"f").createParameter(e.saturation,w.unipolar(),_.percent(),"saturation")}};var Ro=(()=>{let t=[1,2,3,4],n=["12","24","36","48"],i=[ut.sine,ut.triangle,ut.saw,ut.square],o=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:w.exponential(20,2e4),CUTOFF_STRING_MAPPING:_.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:w.values(t),FILTER_ORDER_STRING_MAPPING:_.values("db",t,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:o,LFO_WAVEFORM_VALUE_MAPPING:w.values(i),LFO_WAVEFORM_STRING_MAPPING:_.values("",i,o)}})();var MA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},We=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$A,Tf,Zn,it,LB,md=class{constructor(e,t){$A.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=pe.Vaporisateur,Tf.set(this,void 0),Zn.set(this,void 0),it.set(this,void 0),MA(this,Tf,e,"f"),MA(this,Zn,t,"f"),MA(this,it,new be(We(this,Tf,"f")),"f"),this.namedParameter=We(this,$A,"m",LB).call(this,t)}get box(){return We(this,Zn,"f")}get uuid(){return We(this,Zn,"f").address.uuid}get address(){return We(this,Zn,"f").address}get labelField(){return We(this,Zn,"f").label}get iconField(){return We(this,Zn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return We(this,Zn,"f").enabled}get minimizedField(){return We(this,Zn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return We(this,Tf,"f").boxAdapters.adapterFor(We(this,Zn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){We(this,it,"f").terminate()}};Tf=new WeakMap,Zn=new WeakMap,it=new WeakMap,$A=new WeakSet,LB=function(e){let t=[xo.Monophonic,xo.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:We(this,it,"f").createParameter(n.waveform,w.linearInteger(0,3),_.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:We(this,it,"f").createParameter(n.volume,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:We(this,it,"f").createParameter(n.octave,w.linearInteger(-3,3),_.numeric({unit:"oct"}),"Octave",.5),tune:We(this,it,"f").createParameter(n.tune,w.linear(-1200,1200),_.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:We(this,it,"f").createParameter(e.noise.volume,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:We(this,it,"f").createParameter(e.noise.attack,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:We(this,it,"f").createParameter(e.noise.hold,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Hold"),release:We(this,it,"f").createParameter(e.noise.release,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:We(this,it,"f").createParameter(e.filterOrder,Ro.FILTER_ORDER_VALUE_MAPPING,Ro.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:We(this,it,"f").createParameter(e.cutoff,Ro.CUTOFF_VALUE_MAPPING,Ro.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:We(this,it,"f").createParameter(e.resonance,w.exponential(.01,10),_.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:We(this,it,"f").createParameter(e.attack,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:We(this,it,"f").createParameter(e.decay,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:We(this,it,"f").createParameter(e.sustain,w.unipolar(),_.percent({fractionDigits:1}),"Sustain"),release:We(this,it,"f").createParameter(e.release,w.exponential(.001,5),_.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:We(this,it,"f").createParameter(e.filterEnvelope,w.bipolar(),_.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:We(this,it,"f").createParameter(e.filterKeyboard,w.bipolar(),_.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:We(this,it,"f").createParameter(e.voicingMode,w.values(t),_.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:We(this,it,"f").createParameter(e.glideTime,w.unipolar(),_.percent({fractionDigits:1}),"Glide time",0),unisonCount:We(this,it,"f").createParameter(e.unisonCount,w.values([1,3,5]),_.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:We(this,it,"f").createParameter(e.unisonDetune,w.exponential(1,1200),_.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:We(this,it,"f").createParameter(e.unisonStereo,w.unipolar(),_.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:We(this,it,"f").createParameter(e.lfo.waveform,Ro.LFO_WAVEFORM_VALUE_MAPPING,Ro.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:We(this,it,"f").createParameter(e.lfo.rate,w.exponential(1e-4,30),_.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:We(this,it,"f").createParameter(e.lfo.targetTune,w.bipolar(),_.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:We(this,it,"f").createParameter(e.lfo.targetVolume,w.bipolar(),_.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:We(this,it,"f").createParameter(e.lfo.targetCutoff,w.bipolar(),_.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var TA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},cr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},RA,ax,Rf,pn,Co,KB,Gn=class{constructor(e,t){RA.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Arpeggio,Rf.set(this,void 0),pn.set(this,void 0),Co.set(this,void 0),TA(this,Rf,e,"f"),TA(this,pn,t,"f"),TA(this,Co,new be(cr(this,Rf,"f")),"f"),this.namedParameter=cr(this,RA,"m",KB).call(this,t)}get box(){return cr(this,pn,"f")}get uuid(){return cr(this,pn,"f").address.uuid}get address(){return cr(this,pn,"f").address}get indexField(){return cr(this,pn,"f").index}get labelField(){return cr(this,pn,"f").label}get enabledField(){return cr(this,pn,"f").enabled}get minimizedField(){return cr(this,pn,"f").minimized}get host(){return cr(this,pn,"f").host}deviceHost(){return cr(this,Rf,"f").boxAdapters.adapterFor(cr(this,pn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){cr(this,Co,"f").terminate()}};ax=Gn,Rf=new WeakMap,pn=new WeakMap,Co=new WeakMap,RA=new WeakSet,KB=function(e){return{modeIndex:cr(this,Co,"f").createParameter(e.modeIndex,w.linearInteger(0,2),_.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:cr(this,Co,"f").createParameter(e.numOctaves,w.linearInteger(1,5),_.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:cr(this,Co,"f").createParameter(e.rateIndex,w.linearInteger(0,ax.RateFractions.length-1),ax.RateStringMapping,"Rate"),gate:cr(this,Co,"f").createParameter(e.gate,w.linear(0,2),_.percent({fractionDigits:0}),"Gate"),repeat:cr(this,Co,"f").createParameter(e.repeat,w.linearInteger(1,16),_.numeric({fractionDigits:0}),"Repeat"),velocity:cr(this,Co,"f").createParameter(e.velocity,w.bipolar(),_.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Gn.RateFractions=xr.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();Gn.RateStringMapping=_.indices("",ax.RateFractions.map(([r,e])=>`${r}/${e}`));var CA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Or=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},OA,Cf,hn,oc,WB,gd=class{constructor(e,t){OA.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Pitch,Cf.set(this,void 0),hn.set(this,void 0),oc.set(this,void 0),CA(this,Cf,e,"f"),CA(this,hn,t,"f"),CA(this,oc,new be(Or(this,Cf,"f")),"f"),this.namedParameter=Or(this,OA,"m",WB).call(this,t)}get box(){return Or(this,hn,"f")}get uuid(){return Or(this,hn,"f").address.uuid}get address(){return Or(this,hn,"f").address}get indexField(){return Or(this,hn,"f").index}get labelField(){return Or(this,hn,"f").label}get enabledField(){return Or(this,hn,"f").enabled}get minimizedField(){return Or(this,hn,"f").minimized}get host(){return Or(this,hn,"f").host}deviceHost(){return Or(this,Cf,"f").boxAdapters.adapterFor(Or(this,hn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Or(this,oc,"f").terminate()}};Cf=new WeakMap,hn=new WeakMap,oc=new WeakMap,OA=new WeakSet,WB=function(e){return{octaves:Or(this,oc,"f").createParameter(e.octaves,w.linearInteger(-7,7),_.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Or(this,oc,"f").createParameter(e.semiTones,w.linearInteger(-36,36),_.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Or(this,oc,"f").createParameter(e.cents,w.linear(-50,50),_.numeric({unit:"cents",fractionDigits:1}),"cents")}};var VA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},hi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zA,Of,qn,vd,ZB,yd=class{constructor(e,t){zA.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=pe.Nano,Of.set(this,void 0),qn.set(this,void 0),vd.set(this,void 0),VA(this,Of,e,"f"),VA(this,qn,t,"f"),VA(this,vd,new be(hi(this,Of,"f")),"f"),this.namedParameter=hi(this,zA,"m",ZB).call(this,t)}get box(){return hi(this,qn,"f")}get uuid(){return hi(this,qn,"f").address.uuid}get address(){return hi(this,qn,"f").address}get labelField(){return hi(this,qn,"f").label}get iconField(){return hi(this,qn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return hi(this,qn,"f").enabled}get minimizedField(){return hi(this,qn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return hi(this,Of,"f").boxAdapters.adapterFor(hi(this,qn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){hi(this,vd,"f").terminate()}};Of=new WeakMap,qn=new WeakMap,vd=new WeakMap,zA=new WeakSet,ZB=function(e){return{volume:hi(this,vd,"f").createParameter(e.volume,w.DefaultDecibel,_.numeric({unit:"db",fractionDigits:1}),"volume"),release:hi(this,vd,"f").createParameter(e.release,w.exponential(.001,8),_.numeric({unit:"s",fractionDigits:3}),"release")}};var xd=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},se=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},UA,ac,ws,Te,sx,Vf,Ri,sc,GB,bd=class{constructor(e,t){UA.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",ac.set(this,new j),ws.set(this,void 0),Te.set(this,void 0),sx.set(this,void 0),Vf.set(this,void 0),Ri.set(this,void 0),sc.set(this,m.None),xd(this,ws,e,"f"),xd(this,Te,t,"f"),xd(this,sx,se(this,ac,"f").own(ar.create(se(this,Te,"f").midiEffects,n=>se(this,ws,"f").boxAdapters.adapterFor(n,de.isMidiEffect),c.MIDIEffectHost)),"f"),xd(this,Vf,se(this,ac,"f").own(ar.create(se(this,Te,"f").audioEffects,n=>se(this,ws,"f").boxAdapters.adapterFor(n,de.isAudioEffect),c.AudioEffectHost)),"f"),xd(this,Ri,se(this,ac,"f").own(new be(se(this,ws,"f"))),"f"),this.namedParameter=se(this,UA,"m",GB).call(this,t),se(this,ac,"f").own(se(this,Te,"f").file.catchupAndSubscribe(n=>{xd(this,sc,n.targetVertex.map(({box:i})=>se(this,ws,"f").boxAdapters.adapterFor(i,Rn)),"f"),se(this,sc,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,Te,"f")}get uuid(){return se(this,Te,"f").address.uuid}get address(){return se(this,Te,"f").address}get peakAddress(){return se(this,Te,"f").address.append(1001)}get indexField(){return se(this,Te,"f").index}get gate(){return se(this,Te,"f").gate.getValue()}get exclude(){return se(this,Te,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,sc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,sc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,Te,"f").icon}get defaultTrackType(){return fe.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return se(this,Te,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return se(this,Te,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return se(this,sc,"f")}fileUUID(){return se(this,Te,"f").file.targetAddress.unwrap().uuid}resetParameters(){se(this,Te,"f").mute.reset(),se(this,Te,"f").solo.reset(),se(this,Te,"f").exclude.reset(),se(this,Te,"f").polyphone.reset(),se(this,Te,"f").pitch.reset(),se(this,Te,"f").attack.reset(),se(this,Te,"f").release.reset(),se(this,Te,"f").sampleStart.reset(),se(this,Te,"f").sampleEnd.reset(),se(this,Te,"f").gate.reset()}copyToIndex(e){Ka.create(se(this,Te,"f").graph,A.generate(),t=>{t.file.refer(se(this,Te,"f").file.targetVertex.unwrap()),t.device.refer(se(this,Te,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(se(this,Te,"f").mute.getValue()),t.solo.setValue(se(this,Te,"f").solo.getValue()),t.sampleStart.setValue(se(this,Te,"f").sampleStart.getValue()),t.sampleEnd.setValue(se(this,Te,"f").sampleEnd.getValue()),t.attack.setValue(se(this,Te,"f").attack.getValue()),t.release.setValue(se(this,Te,"f").release.getValue()),t.pitch.setValue(se(this,Te,"f").pitch.getValue()),t.exclude.setValue(se(this,Te,"f").exclude.getValue()),t.gate.setValue(se(this,Te,"f").gate.getValue())})}get midiEffects(){return se(this,sx,"f")}get inputAdapter(){return m.wrap(this)}get audioEffects(){return se(this,Vf,"f")}get labelField(){return ze(se(this,Te,"f").file.targetVertex.unwrap().box,br).fileName}get enabledField(){return se(this,Te,"f").enabled}get minimizedField(){return se(this,Te,"f").minimized}device(){return se(this,ws,"f").boxAdapters.adapterFor(se(this,Te,"f").device.targetVertex.unwrap().box,As)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>m.None};for(let e of se(this,Vf,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,ac,"f").terminate()}};ac=new WeakMap,ws=new WeakMap,Te=new WeakMap,sx=new WeakMap,Vf=new WeakMap,Ri=new WeakMap,sc=new WeakMap,UA=new WeakSet,GB=function(e){return{gate:se(this,Ri,"f").createParameter(e.gate,w.linearInteger(0,2),_.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,Ri,"f").createParameter(e.mute,w.bool,_.bool,"Mute"),solo:se(this,Ri,"f").createParameter(e.solo,w.bool,_.bool,"Solo"),polyphone:se(this,Ri,"f").createParameter(e.polyphone,w.bool,_.bool,"Polyphone"),exclude:se(this,Ri,"f").createParameter(e.exclude,w.bool,_.bool,"Exclude"),pitch:se(this,Ri,"f").createParameter(e.pitch,w.linear(-1200,1200),_.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,Ri,"f").createParameter(e.sampleStart,w.unipolar(),_.percent(),"Start",0),sampleEnd:se(this,Ri,"f").createParameter(e.sampleEnd,w.unipolar(),_.percent(),"End",1),attack:se(this,Ri,"f").createParameter(e.attack,w.exponential(.001,5),_.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,Ri,"f").createParameter(e.release,w.exponential(.001,5),_.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var lx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Qr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wd,Hn,Ad,cx,As=class{constructor(e,t){this.type="instrument",this.accepts="midi",this.manualUrl=pe.Playfield,wd.set(this,void 0),Hn.set(this,void 0),Ad.set(this,void 0),cx.set(this,void 0),lx(this,wd,e,"f"),lx(this,Hn,t,"f"),lx(this,Ad,ar.create(t.samples,n=>e.boxAdapters.adapterFor(n,bd),c.Sample),"f"),lx(this,cx,new be(Qr(this,wd,"f")),"f")}reset(){Qr(this,Ad,"f").adapters().forEach(e=>e.box.delete())}get box(){return Qr(this,Hn,"f")}get uuid(){return Qr(this,Hn,"f").address.uuid}get address(){return Qr(this,Hn,"f").address}get labelField(){return Qr(this,Hn,"f").label}get iconField(){return Qr(this,Hn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return Qr(this,Hn,"f").enabled}get minimizedField(){return Qr(this,Hn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Qr(this,Ad,"f")}get context(){return Qr(this,wd,"f")}deviceHost(){return Qr(this,wd,"f").boxAdapters.adapterFor(Qr(this,Hn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None};for(let e of Qr(this,Ad,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){Qr(this,cx,"f").terminate()}};wd=new WeakMap,Hn=new WeakMap,Ad=new WeakMap,cx=new WeakMap;var jA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ur=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},LA,zf,fn,Oo,qB,_d=class{constructor(e,t){LA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.StereoTool,zf.set(this,void 0),fn.set(this,void 0),Oo.set(this,void 0),jA(this,zf,e,"f"),jA(this,fn,t,"f"),jA(this,Oo,new be(ur(this,zf,"f")),"f"),this.namedParameter=ur(this,LA,"m",qB).call(this,t)}get box(){return ur(this,fn,"f")}get uuid(){return ur(this,fn,"f").address.uuid}get address(){return ur(this,fn,"f").address}get indexField(){return ur(this,fn,"f").index}get labelField(){return ur(this,fn,"f").label}get enabledField(){return ur(this,fn,"f").enabled}get minimizedField(){return ur(this,fn,"f").minimized}get host(){return ur(this,fn,"f").host}deviceHost(){return ur(this,zf,"f").boxAdapters.adapterFor(ur(this,fn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ur(this,Oo,"f").terminate()}};zf=new WeakMap,fn=new WeakMap,Oo=new WeakMap,LA=new WeakSet,qB=function(e){return{volume:ur(this,Oo,"f").createParameter(e.volume,w.decibel(-72,0,12),_.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:ur(this,Oo,"f").createParameter(e.panning,w.bipolar(),_.panning,"Panning",.5),stereo:ur(this,Oo,"f").createParameter(e.stereo,w.bipolar(),_.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:ur(this,Oo,"f").createParameter(e.invertL,w.bool,_.bool,"Invert Left"),invertR:ur(this,Oo,"f").createParameter(e.invertR,w.bool,_.bool,"Invert Right"),swap:ur(this,Oo,"f").createParameter(e.swap,w.bool,_.bool,"Swap")}};var lc;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(lc||(lc={}));var HB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Pd,mi,Sd=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Zeitgeist,Pd.set(this,void 0),mi.set(this,void 0),HB(this,Pd,e,"f"),HB(this,mi,t,"f"),this.groove()}get box(){return fi(this,mi,"f")}get uuid(){return fi(this,mi,"f").address.uuid}get address(){return fi(this,mi,"f").address}get indexField(){return fi(this,mi,"f").index}get labelField(){return fi(this,mi,"f").label}get enabledField(){return fi(this,mi,"f").enabled}get minimizedField(){return fi(this,mi,"f").minimized}get host(){return fi(this,mi,"f").host}deviceHost(){return fi(this,Pd,"f").boxAdapters.adapterFor(fi(this,mi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}groove(){return fi(this,Pd,"f").boxAdapters.adapterFor(fi(this,mi,"f").groove.targetVertex.unwrap("no groove").box,lc.checkType)}catchupAndSubscribeGroove(e){return fi(this,mi,"f").groove.catchupAndSubscribe(t=>e(fi(this,Pd,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,lc.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Pd=new WeakMap,mi=new WeakMap;var JB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Jn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ux,Ci,Ed=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",this.manualUrl="",ux.set(this,void 0),Ci.set(this,void 0),JB(this,ux,e,"f"),JB(this,Ci,t,"f")}get box(){return Jn(this,Ci,"f")}get uuid(){return Jn(this,Ci,"f").address.uuid}get address(){return Jn(this,Ci,"f").address}get indexField(){return Jn(this,Ci,"f").index}get labelField(){return Jn(this,Ci,"f").label}get enabledField(){return Jn(this,Ci,"f").enabled}get minimizedField(){return Jn(this,Ci,"f").minimized}get host(){return Jn(this,Ci,"f").host}get commentField(){return Jn(this,Ci,"f").comment}deviceHost(){return Jn(this,ux,"f").boxAdapters.adapterFor(Jn(this,Ci,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};ux=new WeakMap,Ci=new WeakMap;var QB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Qn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},dx,Oi,Fd=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",this.manualUrl="",dx.set(this,void 0),Oi.set(this,void 0),QB(this,dx,e,"f"),QB(this,Oi,t,"f")}get box(){return Qn(this,Oi,"f")}get uuid(){return Qn(this,Oi,"f").address.uuid}get address(){return Qn(this,Oi,"f").address}get indexField(){return Qn(this,Oi,"f").index}get labelField(){return Qn(this,Oi,"f").label}get enabledField(){return Qn(this,Oi,"f").enabled}get minimizedField(){return Qn(this,Oi,"f").minimized}get host(){return Qn(this,Oi,"f").host}get commentField(){return Qn(this,Oi,"f").comment}deviceHost(){return Qn(this,dx,"f").boxAdapters.adapterFor(Qn(this,Oi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};dx=new WeakMap,Oi=new WeakMap;var _s=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ze=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},KA,WA,Uf,gi,px,Bd,Yn,mn,Nd,YB,ZA,Id=class{constructor(e,t){KA.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=pe.Soundfont,WA.set(this,new j),Uf.set(this,void 0),gi.set(this,void 0),px.set(this,void 0),Bd.set(this,void 0),Yn.set(this,void 0),mn.set(this,void 0),Nd.set(this,re.Empty),ZA.set(this,n=>n.match({none:()=>{Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear(),Ze(this,Nd,"f").terminate(),_s(this,Nd,i.subscribe(o=>{if(o.type==="loaded"){let a=i.soundfont.unwrap();Ze(this,mn,"f").wrap(a.presets[this.presetIndex]??a.presets[0]),Ze(this,Yn,"f").wrap(a)}else o.type==="error"?(Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear()):o.type==="idle"&&(Ze(this,mn,"f").clear(),Ze(this,Yn,"f").clear())}),"f")},some:o=>{Ze(this,Yn,"f").wrap(o),Ze(this,mn,"f").wrap(o.presets[this.presetIndex]??o.presets[0])}})})),_s(this,Uf,e,"f"),_s(this,gi,t,"f"),_s(this,px,new be(Ze(this,Uf,"f")),"f"),this.namedParameter=Ze(this,KA,"m",YB).call(this,t),_s(this,Bd,new Dr,"f"),_s(this,Yn,new Dr,"f"),_s(this,mn,new Dr,"f"),Ze(this,WA,"f").ownAll(Ze(this,Bd,"f").subscribe(Ze(this,ZA,"f")),Ze(this,gi,"f").file.catchupAndSubscribe(({targetVertex:n})=>Ze(this,Bd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ze(this,gi,"f").presetIndex.catchupAndSubscribe(n=>Ze(this,Yn,"f").match({none:()=>Ze(this,mn,"f").clear(),some:i=>Ze(this,mn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Ze(this,Bd,"f")}get soundfont(){return Ze(this,Yn,"f")}get preset(){return Ze(this,mn,"f")}get presetIndex(){return Ze(this,gi,"f").presetIndex.getValue()}get box(){return Ze(this,gi,"f")}get uuid(){return Ze(this,gi,"f").address.uuid}get address(){return Ze(this,gi,"f").address}get labelField(){return Ze(this,gi,"f").label}get iconField(){return Ze(this,gi,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return Ze(this,gi,"f").enabled}get minimizedField(){return Ze(this,gi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ze(this,Uf,"f").boxAdapters.adapterFor(Ze(this,gi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ze(this,Nd,"f").terminate(),_s(this,Nd,re.Empty,"f"),Ze(this,px,"f").terminate()}};WA=new WeakMap,Uf=new WeakMap,gi=new WeakMap,px=new WeakMap,Bd=new WeakMap,Yn=new WeakMap,mn=new WeakMap,Nd=new WeakMap,ZA=new WeakMap,KA=new WeakSet,YB=function(e){return{}};var XB=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jf=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},hx,cc,fx=class{constructor(e,t){hx.set(this,void 0),cc.set(this,void 0),XB(this,hx,e,"f"),XB(this,cc,t,"f")}get box(){return jf(this,cc,"f")}get uuid(){return jf(this,cc,"f").address.uuid}get address(){return jf(this,cc,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return jf(this,hx,"f").soundfontManager.getOrCreate(jf(this,cc,"f").address.uuid)}terminate(){}};hx=new WeakMap,cc=new WeakMap;var GA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},vi=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qA,Lf,gn,Kf,eN,Dd=class{constructor(e,t){qA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Maximizer,Lf.set(this,void 0),gn.set(this,void 0),Kf.set(this,void 0),GA(this,Lf,e,"f"),GA(this,gn,t,"f"),GA(this,Kf,new be(vi(this,Lf,"f")),"f"),this.namedParameter=vi(this,qA,"m",eN).call(this,t)}get box(){return vi(this,gn,"f")}get uuid(){return vi(this,gn,"f").address.uuid}get address(){return vi(this,gn,"f").address}get indexField(){return vi(this,gn,"f").index}get labelField(){return vi(this,gn,"f").label}get enabledField(){return vi(this,gn,"f").enabled}get minimizedField(){return vi(this,gn,"f").minimized}get host(){return vi(this,gn,"f").host}deviceHost(){return vi(this,Lf,"f").boxAdapters.adapterFor(vi(this,gn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){vi(this,Kf,"f").terminate()}};Lf=new WeakMap,gn=new WeakMap,Kf=new WeakMap,qA=new WeakSet,eN=function(e){return{threshold:vi(this,Kf,"f").createParameter(e.threshold,w.linear(-24,0),_.decible,"Threshold")}};var HA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},At=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},JA,Wf,Vi,Vr,tN,kd=class{constructor(e,t){JA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Compressor,Wf.set(this,void 0),Vi.set(this,void 0),Vr.set(this,void 0),HA(this,Wf,e,"f"),HA(this,Vi,t,"f"),HA(this,Vr,new be(At(this,Wf,"f")),"f"),this.namedParameter=At(this,JA,"m",tN).call(this,t)}get box(){return At(this,Vi,"f")}get uuid(){return At(this,Vi,"f").address.uuid}get address(){return At(this,Vi,"f").address}get indexField(){return At(this,Vi,"f").index}get labelField(){return At(this,Vi,"f").label}get enabledField(){return At(this,Vi,"f").enabled}get minimizedField(){return At(this,Vi,"f").minimized}get host(){return At(this,Vi,"f").host}get sideChain(){return At(this,Vi,"f").sideChain}deviceHost(){return At(this,Wf,"f").boxAdapters.adapterFor(At(this,Vi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){At(this,Vr,"f").terminate()}};Wf=new WeakMap,Vi=new WeakMap,Vr=new WeakMap,JA=new WeakSet,tN=function(e){return{lookahead:At(this,Vr,"f").createParameter(e.lookahead,w.bool,_.bool,"Lookahead"),automakeup:At(this,Vr,"f").createParameter(e.automakeup,w.bool,_.bool,"Auto Makeup"),autoattack:At(this,Vr,"f").createParameter(e.autoattack,w.bool,_.bool,"Auto Attack"),autorelease:At(this,Vr,"f").createParameter(e.autorelease,w.bool,_.bool,"Auto Release"),inputgain:At(this,Vr,"f").createParameter(e.inputgain,w.linear(-30,30),_.decible,"Input Gain"),threshold:At(this,Vr,"f").createParameter(e.threshold,w.linear(-60,0),_.decible,"Threshold"),ratio:At(this,Vr,"f").createParameter(e.ratio,w.exponential(1,24),_.numeric({fractionDigits:1}),"Ratio"),knee:At(this,Vr,"f").createParameter(e.knee,w.linear(0,24),_.decible,"Knee"),attack:At(this,Vr,"f").createParameter(e.attack,w.linear(0,100),_.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:At(this,Vr,"f").createParameter(e.release,w.linear(5,1500),_.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:At(this,Vr,"f").createParameter(e.makeup,w.linear(-40,40),_.decible,"Makeup Gain"),mix:At(this,Vr,"f").createParameter(e.mix,w.unipolar(),_.percent(),"Dry/Wet")}};var QA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},YA,Zf,zi,Xn,rN,Md=class{constructor(e,t){YA.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Gate,Zf.set(this,void 0),zi.set(this,void 0),Xn.set(this,void 0),QA(this,Zf,e,"f"),QA(this,zi,t,"f"),QA(this,Xn,new be(Gt(this,Zf,"f")),"f"),this.namedParameter=Gt(this,YA,"m",rN).call(this,t)}get box(){return Gt(this,zi,"f")}get uuid(){return Gt(this,zi,"f").address.uuid}get address(){return Gt(this,zi,"f").address}get indexField(){return Gt(this,zi,"f").index}get labelField(){return Gt(this,zi,"f").label}get enabledField(){return Gt(this,zi,"f").enabled}get minimizedField(){return Gt(this,zi,"f").minimized}get host(){return Gt(this,zi,"f").host}get sideChain(){return Gt(this,zi,"f").sideChain}deviceHost(){return Gt(this,Zf,"f").boxAdapters.adapterFor(Gt(this,zi,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Gt(this,Xn,"f").terminate()}};Zf=new WeakMap,zi=new WeakMap,Xn=new WeakMap,YA=new WeakSet,rN=function(e){return{inverse:Gt(this,Xn,"f").createParameter(e.inverse,w.bool,_.bool,"Inverse"),threshold:Gt(this,Xn,"f").createParameter(e.threshold,w.linear(-80,0),_.decible,"Threshold"),return:Gt(this,Xn,"f").createParameter(e.return,w.linear(0,24),_.decible,"Return"),attack:Gt(this,Xn,"f").createParameter(e.attack,w.linear(0,50),_.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Gt(this,Xn,"f").createParameter(e.hold,w.linear(0,500),_.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Gt(this,Xn,"f").createParameter(e.release,w.linear(1,2e3),_.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Gt(this,Xn,"f").createParameter(e.floor,w.decibel(-72,-12,0),_.decible,"Floor")}};var XA=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Fr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},e_,Gf,vn,Ps,iN,$d=class{constructor(e,t){e_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Crusher,Gf.set(this,void 0),vn.set(this,void 0),Ps.set(this,void 0),XA(this,Gf,e,"f"),XA(this,vn,t,"f"),XA(this,Ps,new be(Fr(this,Gf,"f")),"f"),this.namedParameter=Fr(this,e_,"m",iN).call(this,t)}get box(){return Fr(this,vn,"f")}get uuid(){return Fr(this,vn,"f").address.uuid}get address(){return Fr(this,vn,"f").address}get indexField(){return Fr(this,vn,"f").index}get labelField(){return Fr(this,vn,"f").label}get enabledField(){return Fr(this,vn,"f").enabled}get minimizedField(){return Fr(this,vn,"f").minimized}get host(){return Fr(this,vn,"f").host}deviceHost(){return Fr(this,Gf,"f").boxAdapters.adapterFor(Fr(this,vn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Fr(this,Ps,"f").terminate()}};Gf=new WeakMap,vn=new WeakMap,Ps=new WeakMap,e_=new WeakSet,iN=function(e){return{crush:Fr(this,Ps,"f").createParameter(e.crush,w.unipolar(),_.percent(),"Crush"),bits:Fr(this,Ps,"f").createParameter(e.bits,w.linearInteger(1,16),_.numeric(),"Bits"),boost:Fr(this,Ps,"f").createParameter(e.boost,w.linear(0,24),_.decible,"Boost"),mix:Fr(this,Ps,"f").createParameter(e.mix,w.exponential(.001,1),_.percent(),"Mix")}};var t_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Yr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},r_,qf,yn,Td,nN,Rd=class{constructor(e,t){r_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Fold,qf.set(this,void 0),yn.set(this,void 0),Td.set(this,void 0),t_(this,qf,e,"f"),t_(this,yn,t,"f"),t_(this,Td,new be(Yr(this,qf,"f")),"f"),this.namedParameter=Yr(this,r_,"m",nN).call(this,t)}get box(){return Yr(this,yn,"f")}get uuid(){return Yr(this,yn,"f").address.uuid}get address(){return Yr(this,yn,"f").address}get indexField(){return Yr(this,yn,"f").index}get labelField(){return Yr(this,yn,"f").label}get enabledField(){return Yr(this,yn,"f").enabled}get minimizedField(){return Yr(this,yn,"f").minimized}get host(){return Yr(this,yn,"f").host}deviceHost(){return Yr(this,qf,"f").boxAdapters.adapterFor(Yr(this,yn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Yr(this,Td,"f").terminate()}};qf=new WeakMap,yn=new WeakMap,Td=new WeakMap,r_=new WeakSet,nN=function(e){return{drive:Yr(this,Td,"f").createParameter(e.drive,w.linear(0,30),_.decible,"Drive"),volume:Yr(this,Td,"f").createParameter(e.volume,w.linear(-18,0),_.decible,"Volume")}};var mx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ir=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Hf,Jf,xn,Cd,Od,Vd=class{constructor(e,t){Hf.set(this,new j),this.type="instrument",this.accepts="midi",this.manualUrl=pe.MIDIOutput,Jf.set(this,void 0),xn.set(this,void 0),Cd.set(this,void 0),Od.set(this,void 0),mx(this,Jf,e,"f"),mx(this,xn,t,"f"),mx(this,Cd,new Dr,"f"),mx(this,Od,ir(this,Hf,"f").own(new be(ir(this,Jf,"f"))),"f"),ir(this,Hf,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>ir(this,Od,"f").createParameter(ze(n,$n).value,w.unipolar(),_.percent({fractionDigits:1}),"",0),onRemoved:({box:n})=>ir(this,Od,"f").removeParameter(ze(n,$n).value.address)}),ir(this,xn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>ir(this,Cd,"f").clear(),some:({box:i})=>ir(this,Cd,"f").wrap(ze(i,Mn))})))}get box(){return ir(this,xn,"f")}get uuid(){return ir(this,xn,"f").address.uuid}get address(){return ir(this,xn,"f").address}get labelField(){return ir(this,xn,"f").label}get iconField(){return ir(this,xn,"f").icon}get defaultTrackType(){return fe.Notes}get enabledField(){return ir(this,xn,"f").enabled}get minimizedField(){return ir(this,xn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return ir(this,Od,"f")}get midiDevice(){return ir(this,Cd,"f")}deviceHost(){return ir(this,Jf,"f").boxAdapters.adapterFor(ir(this,xn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ir(this,Hf,"f").terminate()}};Hf=new WeakMap,Jf=new WeakMap,xn=new WeakMap,Cd=new WeakMap,Od=new WeakMap;var gx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},qt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},i_,Qf,bn,Vo,Yf,oN,zd=class{constructor(e,t){i_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=pe.Velocity,Qf.set(this,void 0),bn.set(this,void 0),Vo.set(this,void 0),Yf.set(this,void 0),gx(this,Qf,e,"f"),gx(this,bn,t,"f"),gx(this,Vo,new be(qt(this,Qf,"f")),"f"),gx(this,Yf,Tc.create(),"f"),this.namedParameter=qt(this,i_,"m",oN).call(this,t)}computeVelocity(e,t){let{magnetPosition:n,magnetStrength:i,randomSeed:o,randomAmount:a,offset:s,mix:l}=this.namedParameter;qt(this,Yf,"f").setSeed(o.valueAt(e)+e);let u=t+(n.valueAt(e)-t)*i.valueAt(e),p=(qt(this,Yf,"f").uniform()*2-1)*a.valueAt(e),d=s.valueAt(e),h=l.valueAt(e);return t*(1-h)+Gi(u+p+d)*h}get box(){return qt(this,bn,"f")}get uuid(){return qt(this,bn,"f").address.uuid}get address(){return qt(this,bn,"f").address}get indexField(){return qt(this,bn,"f").index}get labelField(){return qt(this,bn,"f").label}get enabledField(){return qt(this,bn,"f").enabled}get minimizedField(){return qt(this,bn,"f").minimized}get host(){return qt(this,bn,"f").host}deviceHost(){return qt(this,Qf,"f").boxAdapters.adapterFor(qt(this,bn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){qt(this,Vo,"f").terminate()}};Qf=new WeakMap,bn=new WeakMap,Vo=new WeakMap,Yf=new WeakMap,i_=new WeakSet,oN=function(e){return{magnetPosition:qt(this,Vo,"f").createParameter(e.magnetPosition,w.unipolar(),_.percent(),"Position"),magnetStrength:qt(this,Vo,"f").createParameter(e.magnetStrength,w.unipolar(),_.percent(),"Strength"),randomSeed:qt(this,Vo,"f").createParameter(e.randomSeed,w.linearInteger(0,65535),_.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:qt(this,Vo,"f").createParameter(e.randomAmount,w.unipolar(),_.percent(),"Amount"),offset:qt(this,Vo,"f").createParameter(e.offset,w.bipolar(),_.percent(),"Offset"),mix:qt(this,Vo,"f").createParameter(e.mix,w.unipolar(),_.percent(),"Mix")}};var n_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},o_,a_,Xf,wn,zo,aN,eo=class{constructor(e,t){o_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.Tidal,Xf.set(this,void 0),wn.set(this,void 0),zo.set(this,void 0),n_(this,Xf,e,"f"),n_(this,wn,t,"f"),n_(this,zo,new be(dr(this,Xf,"f")),"f"),this.namedParameter=dr(this,o_,"m",aN).call(this,t)}get box(){return dr(this,wn,"f")}get uuid(){return dr(this,wn,"f").address.uuid}get address(){return dr(this,wn,"f").address}get indexField(){return dr(this,wn,"f").index}get labelField(){return dr(this,wn,"f").label}get enabledField(){return dr(this,wn,"f").enabled}get minimizedField(){return dr(this,wn,"f").minimized}get host(){return dr(this,wn,"f").host}deviceHost(){return dr(this,Xf,"f").boxAdapters.adapterFor(dr(this,wn,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){dr(this,zo,"f").terminate()}};a_=eo,Xf=new WeakMap,wn=new WeakMap,zo=new WeakMap,o_=new WeakSet,aN=function(e){let{RateFractions:t,RateStringMapping:n}=a_;return{slope:dr(this,zo,"f").createParameter(e.slope,w.bipolar(),_.percent({fractionDigits:1}),"Slope",.5),symmetry:dr(this,zo,"f").createParameter(e.symmetry,w.unipolar(),_.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:dr(this,zo,"f").createParameter(e.rate,w.values(t.map((i,o)=>o)),n,"Rate",0),depth:dr(this,zo,"f").createParameter(e.depth,w.unipolar(),_.percent({fractionDigits:1}),"Depth",0),offset:dr(this,zo,"f").createParameter(e.offset,w.linear(-180,180),_.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:dr(this,zo,"f").createParameter(e.channelOffset,w.linear(-180,180),_.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};eo.RateFractions=xr.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();eo.RateStringMapping=_.indices("",a_.RateFractions.map(([r,e])=>`${r}/${e}`));var s_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ft=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},l_,em,An,zr,sN,Ud=class{constructor(e,t){l_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.DattorroReverb,em.set(this,void 0),An.set(this,void 0),zr.set(this,void 0),s_(this,em,e,"f"),s_(this,An,t,"f"),s_(this,zr,new be(Ft(this,em,"f")),"f"),this.namedParameter=Ft(this,l_,"m",sN).call(this,t)}get box(){return Ft(this,An,"f")}get uuid(){return Ft(this,An,"f").address.uuid}get address(){return Ft(this,An,"f").address}get indexField(){return Ft(this,An,"f").index}get labelField(){return Ft(this,An,"f").label}get enabledField(){return Ft(this,An,"f").enabled}get minimizedField(){return Ft(this,An,"f").minimized}get host(){return Ft(this,An,"f").host}deviceHost(){return Ft(this,em,"f").boxAdapters.adapterFor(Ft(this,An,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ft(this,zr,"f").terminate()}};em=new WeakMap,An=new WeakMap,zr=new WeakMap,l_=new WeakSet,sN=function(e){return{preDelay:Ft(this,zr,"f").createParameter(e.preDelay,w.linear(0,1e3),_.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:Ft(this,zr,"f").createParameter(e.bandwidth,w.unipolar(),_.percent(),"Bandwidth"),inputDiffusion1:Ft(this,zr,"f").createParameter(e.inputDiffusion1,w.unipolar(),_.percent(),"Tank 1"),inputDiffusion2:Ft(this,zr,"f").createParameter(e.inputDiffusion2,w.unipolar(),_.percent(),"Tank 2"),decay:Ft(this,zr,"f").createParameter(e.decay,w.unipolar(),_.percent(),"Decay"),decayDiffusion1:Ft(this,zr,"f").createParameter(e.decayDiffusion1,w.unipolar(),_.percent(),"Tank 1"),decayDiffusion2:Ft(this,zr,"f").createParameter(e.decayDiffusion2,w.unipolar(),_.percent(),"Tank 2"),damping:Ft(this,zr,"f").createParameter(e.damping,w.unipolar(),_.percent(),"Damping"),excursionRate:Ft(this,zr,"f").createParameter(e.excursionRate,w.unipolar(),_.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:Ft(this,zr,"f").createParameter(e.excursionDepth,w.unipolar(),_.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:Ft(this,zr,"f").createParameter(e.wet,w.DefaultDecibel,_.decible,"Wet"),dry:Ft(this,zr,"f").createParameter(e.dry,w.DefaultDecibel,_.decible,"Dry")}};var lN=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jd=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},c_,Pa,Ld=class{constructor(e,t){c_.set(this,void 0),Pa.set(this,void 0),lN(this,c_,e,"f"),lN(this,Pa,t,"f")}get box(){return jd(this,Pa,"f")}get uuid(){return jd(this,Pa,"f").address.uuid}get address(){return jd(this,Pa,"f").address}get labelField(){return jd(this,Pa,"f").label}get modelField(){return jd(this,Pa,"f").model}getModelJson(){return jd(this,Pa,"f").model.getValue()}terminate(){}};c_=new WeakMap,Pa=new WeakMap;var u_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Lt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},d_,Kd,Br,uc,cN,Wd=class{constructor(e,t){d_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=pe.NeuralAmp,Kd.set(this,void 0),Br.set(this,void 0),uc.set(this,void 0),u_(this,Kd,e,"f"),u_(this,Br,t,"f"),u_(this,uc,new be(Lt(this,Kd,"f")),"f"),this.namedParameter=Lt(this,d_,"m",cN).call(this,t)}get box(){return Lt(this,Br,"f")}get uuid(){return Lt(this,Br,"f").address.uuid}get address(){return Lt(this,Br,"f").address}get indexField(){return Lt(this,Br,"f").index}get labelField(){return Lt(this,Br,"f").label}get enabledField(){return Lt(this,Br,"f").enabled}get minimizedField(){return Lt(this,Br,"f").minimized}get host(){return Lt(this,Br,"f").host}get modelField(){return Lt(this,Br,"f").model}get monoField(){return Lt(this,Br,"f").mono}get spectrum(){return Lt(this,Br,"f").address.append(4095)}getModelAdapter(){let e=Lt(this,Br,"f").model.targetVertex;return e.isEmpty()?m.None:m.wrap(Lt(this,Kd,"f").boxAdapters.adapterFor(e.unwrap().box,Ld))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Lt(this,Br,"f").modelJson.getValue()}deviceHost(){return Lt(this,Kd,"f").boxAdapters.adapterFor(Lt(this,Br,"f").host.targetVertex.unwrap("no device-host").box,de.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Lt(this,uc,"f").terminate()}};Kd=new WeakMap,Br=new WeakMap,uc=new WeakMap,d_=new WeakSet,cN=function(e){return{inputGain:Lt(this,uc,"f").createParameter(e.inputGain,w.decibel(-72,0,12),_.numeric({unit:"dB",fractionDigits:1}),"input"),outputGain:Lt(this,uc,"f").createParameter(e.outputGain,w.decibel(-72,0,12),_.numeric({unit:"dB",fractionDigits:1}),"output"),mix:Lt(this,uc,"f").createParameter(e.mix,w.linear(0,1),_.percent(),"Mix")}};var vx=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},oe=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},p_,ue,Uo,tm,yx,uN,xx=class{constructor(e){p_.add(this),ue.set(this,void 0),Uo.set(this,void 0),tm.set(this,void 0),yx.set(this,void 0),vx(this,ue,e,"f"),vx(this,Uo,A.newSet(t=>t.uuid),"f"),vx(this,tm,new Set,"f"),vx(this,yx,oe(this,ue,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let n=oe(this,Uo,"f").getOrNull(t.uuid);q(n)&&(oe(this,tm,"f").add(n.box),oe(this,Uo,"f").removeByValue(n).terminate())}}}),"f")}terminate(){oe(this,Uo,"f").values().forEach(e=>e.terminate()),oe(this,Uo,"f").clear(),oe(this,yx,"f").terminate()}adapterFor(e,t){if(oe(this,tm,"f").has(e))return D(`Cannot resolve adapter for already deleted box: ${e}`);let n=oe(this,Uo,"f").getOrNull(e.address.uuid);if(n===null){n=oe(this,p_,"m",uN).call(this,e);let i=oe(this,Uo,"f").add(n);V(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?n instanceof t?n:D(`${n} is not instance of ${t}`):t(n)?n:D(`${n} did not pass custom type guard`):D("Unknown checkType method")}optAdapter(e){return oe(this,Uo,"f").opt(e.address.uuid)}};ue=new WeakMap,Uo=new WeakMap,tm=new WeakMap,yx=new WeakMap,p_=new WeakSet,uN=function(e){return ve(e.accept({visitArpeggioDeviceBox:t=>new Gn(oe(this,ue,"f"),t),visitAudioBusBox:t=>new qr(oe(this,ue,"f"),t),visitAudioClipBox:t=>new ts(oe(this,ue,"f"),t),visitAudioFileBox:t=>new Rn(oe(this,ue,"f"),t),visitAudioTimeStretchBox:t=>new _o(oe(this,ue,"f"),t),visitAudioPitchStretchBox:t=>new Ao(oe(this,ue,"f"),t),visitTransientMarkerBox:t=>new hu(t),visitWarpMarkerBox:t=>new es(oe(this,ue,"f"),t),visitAudioRegionBox:t=>new da(oe(this,ue,"f"),t),visitAudioUnitBox:t=>new rn(oe(this,ue,"f"),t),visitAuxSendBox:t=>new Lu(oe(this,ue,"f"),t),visitMaximizerDeviceBox:t=>new Dd(oe(this,ue,"f"),t),visitCompressorDeviceBox:t=>new kd(oe(this,ue,"f"),t),visitGateDeviceBox:t=>new Md(oe(this,ue,"f"),t),visitCrusherDeviceBox:t=>new $d(oe(this,ue,"f"),t),visitDattorroReverbDeviceBox:t=>new Ud(oe(this,ue,"f"),t),visitDelayDeviceBox:t=>new tr(oe(this,ue,"f"),t),visitDeviceInterfaceKnobBox:t=>new nd(oe(this,ue,"f"),t),visitTidalDeviceBox:t=>new eo(oe(this,ue,"f"),t),visitFoldDeviceBox:t=>new Rd(oe(this,ue,"f"),t),visitGrooveShuffleBox:t=>new Mo(oe(this,ue,"f"),t),visitMarkerBox:t=>new us(oe(this,ue,"f"),t),visitSignatureEventBox:t=>new Gl(oe(this,ue,"f"),t),visitMIDIOutputDeviceBox:t=>new Vd(oe(this,ue,"f"),t),visitModularAudioInputBox:t=>new rd(oe(this,ue,"f"),t),visitModularAudioOutputBox:t=>new Xu(oe(this,ue,"f"),t),visitModularBox:t=>new fs(oe(this,ue,"f"),t),visitModularDeviceBox:t=>new gs(oe(this,ue,"f"),t),visitModuleConnectionBox:t=>new hs(oe(this,ue,"f"),t),visitModuleDelayBox:t=>new Yu(oe(this,ue,"f"),t),visitModuleGainBox:t=>new ed(oe(this,ue,"f"),t),visitModuleMultiplierBox:t=>new td(oe(this,ue,"f"),t),visitNanoDeviceBox:t=>new yd(oe(this,ue,"f"),t),visitNeuralAmpDeviceBox:t=>new Wd(oe(this,ue,"f"),t),visitNeuralAmpModelBox:t=>new Ld(oe(this,ue,"f"),t),visitNoteClipBox:t=>new Pu(oe(this,ue,"f"),t),visitNoteEventBox:t=>new Pl(oe(this,ue,"f"),t),visitNoteEventCollectionBox:t=>new Qi(oe(this,ue,"f"),t),visitNoteRegionBox:t=>new os(oe(this,ue,"f"),t),visitPitchDeviceBox:t=>new gd(oe(this,ue,"f"),t),visitPlayfieldDeviceBox:t=>new As(oe(this,ue,"f"),t),visitPlayfieldSampleBox:t=>new bd(oe(this,ue,"f"),t),visitRevampDeviceBox:t=>new Ju(oe(this,ue,"f"),t),visitReverbDeviceBox:t=>new Hu(oe(this,ue,"f"),t),visitRootBox:t=>new hd(oe(this,ue,"f"),t),visitSoundfontDeviceBox:t=>new Id(oe(this,ue,"f"),t),visitSoundfontFileBox:t=>new fx(oe(this,ue,"f"),t),visitStereoToolDeviceBox:t=>new _d(oe(this,ue,"f"),t),visitTapeDeviceBox:t=>new fd(oe(this,ue,"f"),t),visitTimelineBox:t=>new sn(oe(this,ue,"f"),t),visitTrackBox:t=>new Vt(oe(this,ue,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new Ed(oe(this,ue,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new Fd(oe(this,ue,"f"),t),visitValueClipBox:t=>new Xa(oe(this,ue,"f"),t),visitValueEventBox:t=>new sa(oe(this,ue,"f"),t),visitValueEventCollectionBox:t=>new Ar(oe(this,ue,"f"),t),visitValueRegionBox:t=>new ma(oe(this,ue,"f"),t),visitVaporisateurDeviceBox:t=>new md(oe(this,ue,"f"),t),visitVelocityDeviceBox:t=>new zd(oe(this,ue,"f"),t),visitZeitgeistDeviceBox:t=>new Sd(oe(this,ue,"f"),t)}),`Could not find factory for ${e}`)};var Zd;(function(r){r.PEAKS=ke.compose(A.Lowest).append(0),r.SPECTRUM=ke.compose(A.Lowest).append(1),r.WAVEFORM=ke.compose(A.Lowest).append(2)})(Zd||(Zd={}));var dN;(function(r){r.countStems=e=>e.match({none:()=>1,some:t=>Object.keys(t).length}),r.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),r.sanitizeExportNamesInPlace=e=>{let t=new Map,n=i=>{let o=t.get(i)??0,a=i;for(;t.has(a);)o++,a=`${i} ${o}`;return t.set(i,o),t.set(a,1),a};Object.keys(e).forEach(i=>{let o=e[i];o.fileName=n(r.sanitizeFileName(o.fileName))})}})(dN||(dN={}));var bx=512,pN=yr.createBuilder({position:yr.float,bpm:yr.float,playbackTimestamp:yr.float,countInBeatsRemaining:yr.float,isPlaying:yr.bool,isCountingIn:yr.bool,isRecording:yr.bool,perfIndex:yr.int32,perfBuffer:yr.floats(bx)});var hN;(function(r){r.store=(e,t,n)=>{if(n==="")return D("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(c.MetaData).map(({box:a})=>a).find(a=>a instanceof ia&&a.origin.getValue()===n),o=a=>{a.target.refer(e),a.origin.setValue(n),a.value.setValue(JSON.stringify(t))};Ws(i)?o(i):ia.create(e.graph,A.generate(),o)},r.read=(e,t)=>{if(t==="")return D("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(c.MetaData).map(({box:i})=>i).find(i=>i instanceof ia&&i.origin.getValue()===t);if(Ws(n)){let{status:i,value:o,error:a}=Jo(()=>JSON.parse(n.value.getValue()));if(i==="success")return o;console.warn(a)}return null},r.clear=(e,t)=>{if(t==="")return D("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(c.MetaData).map(({box:n})=>n).filter(n=>n instanceof ia&&n.origin.getValue()===t).forEach(n=>n.delete())}})(hN||(hN={}));var h_=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ss=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},wx,Ax,_x,dc,_n=class{constructor(e,t){wx.set(this,new j),Ax.set(this,void 0),_x.set(this,void 0),dc.set(this,void 0),h_(this,Ax,e,"f"),h_(this,_x,t,"f"),h_(this,dc,new _t(128),"f"),Ss(this,wx,"f").own(Ss(this,Ax,"f").broadcastIntegers(Ss(this,_x,"f"),new Int32Array(Ss(this,dc,"f").buffer),n=>{}))}noteOn(e){e>=0&&e<128&&Ss(this,dc,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&Ss(this,dc,"f").setBit(e,!1)}reset(){}clear(){Ss(this,dc,"f").clear()}terminate(){Ss(this,wx,"f").terminate()}toString(){return`{${this.constructor.name}}`}};wx=new WeakMap,Ax=new WeakMap,_x=new WeakMap,dc=new WeakMap;var Bt;(function(r){let e;(function(t){t[t.NoteOn=144]="NoteOn",t[t.NoteOff=128]="NoteOff",t[t.PitchBend=224]="PitchBend",t[t.Controller=176]="Controller",t[t.Start=250]="Start",t[t.Continue=251]="Continue",t[t.Stop=252]="Stop",t[t.Clock=248]="Clock",t[t.Position=242]="Position"})(e=r.Command||(r.Command={})),r.readCommand=t=>t[0]&240,r.readChannel=t=>t[0]&15,r.readParam1=t=>t.length>1?t[1]&255:0,r.readParam2=t=>t.length>2?t[2]&255:0,r.readPitch=t=>t[1],r.readVelocity=t=>t[2]/127,r.isNoteOn=t=>r.readCommand(t)===e.NoteOn&&r.readVelocity(t)>0,r.isNoteOff=t=>r.readCommand(t)===e.NoteOff||r.readCommand(t)===e.NoteOn&&r.readVelocity(t)===0,r.isPitchWheel=t=>r.readCommand(t)===e.PitchBend,r.isController=t=>r.readCommand(t)===e.Controller,r.isClock=t=>t[0]===e.Clock,r.isStart=t=>t[0]===e.Start,r.isContinue=t=>t[0]===e.Continue,r.isStop=t=>t[0]===e.Stop,r.isPosition=t=>t[0]===e.Position,r.asPitchBend=t=>{let n=r.readParam1(t)&127,i=r.readParam2(t)&127,o=n|i<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.asValue=t=>{let n=r.readParam2(t);return n>64?.5+(n-63)/128:n<64?n/128:.5},r.Clock=new Uint8Array([e.Clock]),r.Start=new Uint8Array([e.Start]),r.Continue=new Uint8Array([e.Continue]),r.Stop=new Uint8Array([e.Stop]),r.noteOn=(t,n,i)=>new Uint8Array([e.NoteOn|t,n,i]),r.noteOff=(t,n)=>new Uint8Array([e.NoteOff|t,n,0]),r.control=(t,n,i)=>new Uint8Array([e.Controller|t,n&127,i&127]),r.position=(t,n)=>new Uint8Array([e.Position,t&127,n&127]),r.positionInPPQN=t=>{let n=Math.floor(t/96),i=n&127,o=n>>7&127;return new Uint8Array([e.Position,i,o])},r.accept=(t,n)=>{so(t)||(r.isNoteOn(t)?P(n.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?P(n.noteOff,r.readPitch(t)):r.isPitchWheel(t)?P(n.pitchBend,r.asPitchBend(t)):r.isController(t)?P(n.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?P(n.clock):r.isStart(t)?P(n.start):r.isContinue(t)?P(n.continue):r.isStop(t)?P(n.stop):r.isPosition(t)&&P(n.songPos,r.readParam1(t)|r.readParam2(t)<<7))},r.debug=t=>t===null?"null":r.isNoteOn(t)?`NoteOn #${r.readChannel(t)} ${r.readPitch(t)} : ${r.readVelocity(t).toFixed(2)}`:r.isNoteOff(t)?`NoteOff #${r.readChannel(t)} ${r.readPitch(t)}`:r.isPitchWheel(t)?`PitchWheel #${r.readChannel(t)} ${r.asPitchBend(t)}`:r.isController(t)?`Control #${r.readChannel(t)} ${r.asValue(t)}`:r.isClock(t)?"Clock":r.isStart(t)?"Start":r.isContinue(t)?"Continue":r.isStop(t)?"Stop":r.isPosition(t)?`SongPosition ${r.readParam1(t)|r.readParam2(t)<<7}`:"Unknown"})(Bt||(Bt={}));var Sa;(function(r){r.on=(e,t,n)=>({type:"note-on",uuid:e,pitch:t,velocity:n}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.audition=(e,t,n,i)=>({type:"note-audition",uuid:e,pitch:t,duration:n,velocity:i}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.isAudition=e=>e.type==="note-audition",r.fromEvent=(e,t)=>{let n=e.data;if(Bt.isNoteOn(n)){let i=Bt.readPitch(n),o=Bt.readVelocity(n);return{type:"note-on",uuid:t,pitch:i,velocity:o}}else if(Bt.isNoteOff(n)){let i=Bt.readPitch(n);return{type:"note-off",uuid:t,pitch:i}}return D("Unknown MIDI event")}})(Sa||(Sa={}));var fN;(function(r){r.start=(e,t,n,i=1)=>{let o=!0;return e(Sa.on(t,n,i)),{terminate:()=>{o&&(e(Sa.off(t,n)),o=!1)}}}})(fN||(fN={}));var BM,NM,IM,DM,kM;BM=new WeakMap,NM=new WeakMap,IM=new WeakMap,DM=new WeakMap,kM=new WeakMap;var mN=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gd=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},pc,rm,Px=class{constructor(){pc.set(this,void 0),rm.set(this,void 0),mN(this,pc,ke.newSet(e=>e.field.address),"f"),mN(this,rm,new ce,"f")}register(e){return Gd(this,pc,"f").add(e),{terminate:()=>Gd(this,pc,"f").removeByValue(e)}}get(e){return Gd(this,pc,"f").get(e)}opt(e){return Gd(this,pc,"f").opt(e)}subscribeWrites(e){return Gd(this,rm,"f").subscribe(e)}notifyWrite(e,t){Gd(this,rm,"f").notify({adapter:e,previousUnitValue:t})}};pc=new WeakMap,rm=new WeakMap;var Es={isClipBox:r=>r.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:r=>r.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??D("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var im={min:30,max:1e3};var Sx;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?co.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||t&t-1?co.err("Denominator must be a power of two between 1 and 32"):co.ok([e,t]),r.clampBpm=e=>Number.isFinite(e)?we(e,im.min,im.max):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:n=>{for(let[i,o]of U.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:a})=>Es.asRegionBox(a)).sort(({position:a},{position:s})=>a.getValue()-s.getValue()))){if(i instanceof za&&i.timeBase.getValue()===Kr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>o.position.getValue())return!0}return!1}})??!1)})(Sx||(Sx={}));var gN;(function(r){r.parseTimeSignature=e=>{let[t,n]=e.split("/"),i=parseInt(t,10),o=parseInt(n,10);return Sx.isTimeSignatureValid(i,o)}})(gN||(gN={}));var Ex;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i},o)=>{let a=!0,s=new Int32Array(e,0,2),l=new Float32Array(e,8),u=new Float32Array(n*i),p=typeof document>"u",d=()=>{if(!a)return;let h=Atomics.load(s,1),g=Atomics.load(s,0);if(h===g){if(p)Atomics.wait(s,0,g);else{setTimeout(d,1);return}g=Atomics.load(s,0)}for(;h!==g;){let v=h*n*i;u.set(l.subarray(v,v+n*i));let y=[];for(let x=0;x<n;x++){let F=x*i,I=F+i;y.push(u.slice(F,I))}if(h=(h+1)%t,Atomics.store(s,1,h),!a)return;o(y)}d()};return d(),{stop:()=>a=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i})=>{let o=new Int32Array(e,0,2),a=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==n)return;for(let p of s)if(p.length!==i)return D("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(o,0),u=l*n*i;s.forEach((p,d)=>a.set(p,u+d*i)),Atomics.store(o,0,(l+1)%t),Atomics.notify(o,0)}})}})(Ex||(Ex={}));var f_={isRegion:r=>Es.isRegionBox(r.box),isLoopableRegion:r=>Es.isLoopableRegionBox(r.box)};var MM=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ye=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},to,Fx,Ui,Fs,Bs,m_,nm,Bx,Nx=class{constructor(e){to.add(this),Fx.set(this,new j),Ui.set(this,void 0),Fs.set(this,[]),Bs.set(this,[]),MM(this,Ui,e,"f"),Ye(this,Fx,"f").ownAll(e.box.bpm.subscribe(()=>Ye(this,to,"m",m_).call(this)),e.catchupAndSubscribeTempoAutomation(()=>Ye(this,to,"m",m_).call(this)))}terminate(){Ye(this,Fx,"f").terminate()}getTempoAt(e){let t=Ye(this,Ui,"f").box.bpm.getValue();return Ye(this,Ui,"f").tempoTrackEvents.mapOr(n=>n.valueAt(e,t),t)}ppqnToSeconds(e){return e<0?-Ye(this,to,"m",nm).call(this,-e):Ye(this,to,"m",nm).call(this,e)}secondsToPPQN(e){return Ye(this,to,"m",Bx).call(this,e)}intervalToSeconds(e,t){return e>=t?0:Ye(this,to,"m",nm).call(this,t)-Ye(this,to,"m",nm).call(this,e)}intervalToPPQN(e,t){if(e>=t)return 0;let n=Ye(this,to,"m",Bx).call(this,e);return Ye(this,to,"m",Bx).call(this,t)-n}subscribe(e){let t=new j;return t.ownAll(Ye(this,Ui,"f").box.bpm.subscribe(()=>e(this)),Ye(this,Ui,"f").catchupAndSubscribeTempoAutomation(()=>e(this))),t}};Fx=new WeakMap,Ui=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,to=new WeakSet,m_=function(){Ye(this,Fs,"f").length=0,Ye(this,Bs,"f").length=0;let e=Ye(this,Ui,"f").tempoTrackEvents;if(e.isEmpty())return;let t=e.unwrap();if(t.events.isEmpty())return;let n=t.events.asArray(),i=Ye(this,Ui,"f").box.bpm.getValue(),o=[{ppqn:0,seconds:0,bpm:t.valueAt(0,i)}],a=0,s=0;for(let u of n){let p=u.position;if(!(p<=s)){for(;s<p;){let d=t.valueAt(s,i),h=Ic(s,ta),g=h<=s?h+ta:h,v=Math.min(g,p);a+=Q.pulsesToSeconds(v-s,d),s=v}o.push({ppqn:p,seconds:a,bpm:t.valueAt(p,i)})}}Ye(this,Fs,"f").push(...o);let l=o.slice().sort((u,p)=>u.seconds-p.seconds);Ye(this,Bs,"f").push(...l)},nm=function(e){if(e<=0)return 0;let t=Ye(this,Ui,"f").box.bpm.getValue(),n=Ye(this,Ui,"f").tempoTrackEvents;if(n.isEmpty())return Q.pulsesToSeconds(e,t);let i=n.unwrap();if(i.events.isEmpty())return Q.pulsesToSeconds(e,t);let o=0,a=0;if(Ye(this,Fs,"f").length>0){let u=ct.rightMostMapped(Ye(this,Fs,"f"),e,ka,p=>p.ppqn);if(u>=0){let p=Ye(this,Fs,"f")[u];if(o=p.ppqn,a=p.seconds,u===Ye(this,Fs,"f").length-1)return a+Q.pulsesToSeconds(e-o,p.bpm)}}let s=a,l=o;for(;l<e;){let u=i.valueAt(l,t),p=Ic(l,ta),d=p<=l?p+ta:p,h=Math.min(d,e);s+=Q.pulsesToSeconds(h-l,u),l=h}return s},Bx=function(e){if(e<=0)return 0;let t=Ye(this,Ui,"f").box.bpm.getValue(),n=Ye(this,Ui,"f").tempoTrackEvents;if(n.isEmpty())return Q.secondsToPulses(e,t);let i=n.unwrap();if(i.events.isEmpty())return Q.secondsToPulses(e,t);let o=0,a=0;if(Ye(this,Bs,"f").length>0){let u=ct.rightMostMapped(Ye(this,Bs,"f"),e,ka,p=>p.seconds);if(u>=0){let p=Ye(this,Bs,"f")[u];if(o=p.ppqn,a=p.seconds,u===Ye(this,Bs,"f").length-1)return o+Q.secondsToPulses(e-a,p.bpm)}}let s=a,l=o;for(;s<e;){let u=i.valueAt(l,t),p=Ic(l,ta),d=p<=l?p+ta:p,h=d-l,g=Q.pulsesToSeconds(h,u);if(s+g>=e){let v=e-s;l+=Q.secondsToPulses(v,u);break}s+=g,l=d}return l};var jo;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(jo||(jo={}));var $M,TM,RM,CM;$M=new WeakMap,TM=new WeakMap,RM=new WeakMap,CM=new WeakMap;var OM,VM,zM,UM;OM=new WeakMap,VM=new WeakMap,zM=new WeakMap,UM=new WeakMap;var Le={};Ho(Le,{$brand:()=>Ix,$input:()=>T1,$output:()=>$1,NEVER:()=>g_,TimePrecision:()=>V1,ZodAny:()=>BE,ZodArray:()=>kE,ZodBase64:()=>iw,ZodBase64URL:()=>nw,ZodBigInt:()=>_p,ZodBigIntFormat:()=>sw,ZodBoolean:()=>Ap,ZodCIDRv4:()=>tw,ZodCIDRv6:()=>rw,ZodCUID:()=>qb,ZodCUID2:()=>Hb,ZodCatch:()=>eF,ZodCodec:()=>mw,ZodCustom:()=>Rm,ZodCustomStringFormat:()=>bp,ZodDate:()=>Dm,ZodDefault:()=>qE,ZodDiscriminatedUnion:()=>$E,ZodE164:()=>ow,ZodEmail:()=>Wb,ZodEmoji:()=>Zb,ZodEnum:()=>yp,ZodError:()=>mR,ZodExactOptional:()=>WE,ZodFile:()=>LE,ZodFirstPartyTypeKind:()=>pF,ZodFunction:()=>cF,ZodGUID:()=>Em,ZodIPv4:()=>Xb,ZodIPv6:()=>ew,ZodISODate:()=>Vb,ZodISODateTime:()=>Ob,ZodISODuration:()=>Ub,ZodISOTime:()=>zb,ZodIntersection:()=>TE,ZodIssueCode:()=>vR,ZodJWT:()=>aw,ZodKSUID:()=>Yb,ZodLazy:()=>aF,ZodLiteral:()=>jE,ZodMAC:()=>wE,ZodMap:()=>zE,ZodNaN:()=>rF,ZodNanoID:()=>Gb,ZodNever:()=>IE,ZodNonOptional:()=>hw,ZodNull:()=>EE,ZodNullable:()=>GE,ZodNumber:()=>wp,ZodNumberFormat:()=>bc,ZodObject:()=>Mm,ZodOptional:()=>pw,ZodPipe:()=>fw,ZodPrefault:()=>JE,ZodPromise:()=>lF,ZodReadonly:()=>iF,ZodRealError:()=>bi,ZodRecord:()=>Tm,ZodSet:()=>UE,ZodString:()=>xp,ZodStringFormat:()=>mt,ZodSuccess:()=>XE,ZodSymbol:()=>PE,ZodTemplateLiteral:()=>oF,ZodTransform:()=>KE,ZodTuple:()=>CE,ZodType:()=>Ce,ZodULID:()=>Jb,ZodURL:()=>Im,ZodUUID:()=>Zo,ZodUndefined:()=>SE,ZodUnion:()=>$m,ZodUnknown:()=>NE,ZodVoid:()=>DE,ZodXID:()=>Qb,ZodXor:()=>ME,_ZodString:()=>Kb,_default:()=>HE,_function:()=>HD,any:()=>FD,array:()=>km,base64:()=>uD,base64url:()=>dD,bigint:()=>AD,boolean:()=>_E,catch:()=>tF,check:()=>JD,cidrv4:()=>lD,cidrv6:()=>cD,clone:()=>Xr,codec:()=>ZD,coerce:()=>hF,config:()=>Kt,core:()=>Ba,cuid:()=>eD,cuid2:()=>tD,custom:()=>QD,date:()=>ND,decode:()=>fE,decodeAsync:()=>gE,describe:()=>YD,discriminatedUnion:()=>TD,e164:()=>pD,email:()=>KI,emoji:()=>YI,encode:()=>hE,encodeAsync:()=>mE,endsWith:()=>lp,enum:()=>uw,exactOptional:()=>ZE,file:()=>jD,flattenError:()=>hm,float32:()=>yD,float64:()=>xD,formatError:()=>fm,fromJSONSchema:()=>ok,function:()=>HD,getErrorMap:()=>xR,globalRegistry:()=>Nr,gt:()=>Ko,gte:()=>ei,guid:()=>WI,hash:()=>vD,hex:()=>gD,hostname:()=>mD,httpUrl:()=>QI,includes:()=>ap,instanceof:()=>ek,int:()=>Lb,int32:()=>bD,int64:()=>_D,intersection:()=>RE,ipv4:()=>oD,ipv6:()=>sD,iso:()=>vp,json:()=>rk,jwt:()=>hD,keyof:()=>ID,ksuid:()=>nD,lazy:()=>sF,length:()=>yc,literal:()=>UD,locales:()=>Am,looseObject:()=>MD,looseRecord:()=>CD,lowercase:()=>np,lt:()=>Lo,lte:()=>Li,mac:()=>aD,map:()=>OD,maxLength:()=>vc,maxSize:()=>Ts,meta:()=>XD,mime:()=>cp,minLength:()=>Fa,minSize:()=>Wo,multipleOf:()=>$s,nan:()=>WD,nanoid:()=>XI,nativeEnum:()=>zD,negative:()=>Bb,never:()=>lw,nonnegative:()=>Ib,nonoptional:()=>YE,nonpositive:()=>Nb,normalize:()=>up,null:()=>FE,nullable:()=>Bm,nullish:()=>LD,number:()=>AE,object:()=>DD,optional:()=>Fm,overwrite:()=>io,parse:()=>cE,parseAsync:()=>uE,partialRecord:()=>RD,pipe:()=>Nm,positive:()=>Fb,prefault:()=>QE,preprocess:()=>ik,prettifyError:()=>B_,promise:()=>qD,property:()=>Db,readonly:()=>nF,record:()=>VE,refine:()=>uF,regex:()=>ip,regexes:()=>Sn,registry:()=>ab,safeDecode:()=>yE,safeDecodeAsync:()=>bE,safeEncode:()=>vE,safeEncodeAsync:()=>xE,safeParse:()=>dE,safeParseAsync:()=>pE,set:()=>VD,setErrorMap:()=>yR,size:()=>gc,slugify:()=>fp,startsWith:()=>sp,strictObject:()=>kD,string:()=>jb,stringFormat:()=>fD,stringbool:()=>tk,success:()=>KD,superRefine:()=>dF,symbol:()=>SD,templateLiteral:()=>GD,toJSONSchema:()=>Tb,toLowerCase:()=>pp,toUpperCase:()=>hp,transform:()=>dw,treeifyError:()=>F_,trim:()=>dp,tuple:()=>OE,uint32:()=>wD,uint64:()=>PD,ulid:()=>rD,undefined:()=>ED,union:()=>cw,unknown:()=>xc,uppercase:()=>op,url:()=>JI,util:()=>G,uuid:()=>ZI,uuidv4:()=>GI,uuidv6:()=>qI,uuidv7:()=>HI,void:()=>BD,xid:()=>iD,xor:()=>$D});var Ba={};Ho(Ba,{$ZodAny:()=>r1,$ZodArray:()=>s1,$ZodAsyncError:()=>ro,$ZodBase64:()=>ZP,$ZodBase64URL:()=>GP,$ZodBigInt:()=>Xx,$ZodBigIntFormat:()=>YP,$ZodBoolean:()=>ym,$ZodCIDRv4:()=>LP,$ZodCIDRv6:()=>KP,$ZodCUID:()=>DP,$ZodCUID2:()=>kP,$ZodCatch:()=>S1,$ZodCheck:()=>yt,$ZodCheckBigIntFormat:()=>sP,$ZodCheckEndsWith:()=>xP,$ZodCheckGreaterThan:()=>Zx,$ZodCheckIncludes:()=>vP,$ZodCheckLengthEquals:()=>hP,$ZodCheckLessThan:()=>Wx,$ZodCheckLowerCase:()=>mP,$ZodCheckMaxLength:()=>dP,$ZodCheckMaxSize:()=>lP,$ZodCheckMimeType:()=>wP,$ZodCheckMinLength:()=>pP,$ZodCheckMinSize:()=>cP,$ZodCheckMultipleOf:()=>oP,$ZodCheckNumberFormat:()=>aP,$ZodCheckOverwrite:()=>AP,$ZodCheckProperty:()=>bP,$ZodCheckRegex:()=>fP,$ZodCheckSizeEquals:()=>uP,$ZodCheckStartsWith:()=>yP,$ZodCheckStringFormat:()=>tp,$ZodCheckUpperCase:()=>gP,$ZodCodec:()=>bm,$ZodCustom:()=>M1,$ZodCustomStringFormat:()=>JP,$ZodDate:()=>a1,$ZodDefault:()=>w1,$ZodDiscriminatedUnion:()=>u1,$ZodE164:()=>qP,$ZodEmail:()=>FP,$ZodEmoji:()=>NP,$ZodEncodeError:()=>Ns,$ZodEnum:()=>m1,$ZodError:()=>pm,$ZodExactOptional:()=>x1,$ZodFile:()=>v1,$ZodFunction:()=>I1,$ZodGUID:()=>SP,$ZodIPv4:()=>zP,$ZodIPv6:()=>UP,$ZodISODate:()=>CP,$ZodISODateTime:()=>RP,$ZodISODuration:()=>VP,$ZodISOTime:()=>OP,$ZodIntersection:()=>d1,$ZodJWT:()=>HP,$ZodKSUID:()=>TP,$ZodLazy:()=>k1,$ZodLiteral:()=>g1,$ZodMAC:()=>jP,$ZodMap:()=>h1,$ZodNaN:()=>E1,$ZodNanoID:()=>IP,$ZodNever:()=>n1,$ZodNonOptional:()=>_1,$ZodNull:()=>t1,$ZodNullable:()=>b1,$ZodNumber:()=>Yx,$ZodNumberFormat:()=>QP,$ZodObject:()=>LN,$ZodObjectJIT:()=>l1,$ZodOptional:()=>tb,$ZodPipe:()=>F1,$ZodPrefault:()=>A1,$ZodPromise:()=>D1,$ZodReadonly:()=>B1,$ZodRealError:()=>xi,$ZodRecord:()=>p1,$ZodRegistry:()=>ob,$ZodSet:()=>f1,$ZodString:()=>mc,$ZodStringFormat:()=>ft,$ZodSuccess:()=>P1,$ZodSymbol:()=>XP,$ZodTemplateLiteral:()=>N1,$ZodTransform:()=>y1,$ZodTuple:()=>eb,$ZodType:()=>De,$ZodULID:()=>MP,$ZodURL:()=>BP,$ZodUUID:()=>EP,$ZodUndefined:()=>e1,$ZodUnion:()=>xm,$ZodUnknown:()=>i1,$ZodVoid:()=>o1,$ZodXID:()=>$P,$ZodXor:()=>c1,$brand:()=>Ix,$constructor:()=>S,$input:()=>T1,$output:()=>$1,Doc:()=>vm,JSONSchema:()=>jI,JSONSchemaGenerator:()=>Rb,NEVER:()=>g_,TimePrecision:()=>V1,_any:()=>aS,_array:()=>hS,_base64:()=>_b,_base64url:()=>Pb,_bigint:()=>X1,_boolean:()=>Q1,_catch:()=>sR,_check:()=>UI,_cidrv4:()=>wb,_cidrv6:()=>Ab,_coercedBigint:()=>eS,_coercedBoolean:()=>Y1,_coercedDate:()=>dS,_coercedNumber:()=>W1,_coercedString:()=>C1,_cuid:()=>fb,_cuid2:()=>mb,_custom:()=>mS,_date:()=>uS,_decode:()=>Rx,_decodeAsync:()=>Ox,_default:()=>nR,_discriminatedUnion:()=>ZT,_e164:()=>Sb,_email:()=>sb,_emoji:()=>pb,_encode:()=>Tx,_encodeAsync:()=>Cx,_endsWith:()=>lp,_enum:()=>YT,_file:()=>fS,_float32:()=>G1,_float64:()=>q1,_gt:()=>Ko,_gte:()=>ei,_guid:()=>_m,_includes:()=>ap,_int:()=>Z1,_int32:()=>H1,_int64:()=>tS,_intersection:()=>GT,_ipv4:()=>xb,_ipv6:()=>bb,_isoDate:()=>U1,_isoDateTime:()=>z1,_isoDuration:()=>L1,_isoTime:()=>j1,_jwt:()=>Eb,_ksuid:()=>yb,_lazy:()=>dR,_length:()=>yc,_literal:()=>eR,_lowercase:()=>np,_lt:()=>Lo,_lte:()=>Li,_mac:()=>O1,_map:()=>JT,_max:()=>Li,_maxLength:()=>vc,_maxSize:()=>Ts,_mime:()=>cp,_min:()=>ei,_minLength:()=>Fa,_minSize:()=>Wo,_multipleOf:()=>$s,_nan:()=>pS,_nanoid:()=>hb,_nativeEnum:()=>XT,_negative:()=>Bb,_never:()=>lS,_nonnegative:()=>Ib,_nonoptional:()=>oR,_nonpositive:()=>Nb,_normalize:()=>up,_null:()=>oS,_nullable:()=>iR,_number:()=>K1,_optional:()=>rR,_overwrite:()=>io,_parse:()=>Qd,_parseAsync:()=>Yd,_pipe:()=>lR,_positive:()=>Fb,_promise:()=>pR,_property:()=>Db,_readonly:()=>cR,_record:()=>HT,_refine:()=>gS,_regex:()=>ip,_safeDecode:()=>zx,_safeDecodeAsync:()=>jx,_safeEncode:()=>Vx,_safeEncodeAsync:()=>Ux,_safeParse:()=>Xd,_safeParseAsync:()=>ep,_set:()=>QT,_size:()=>gc,_slugify:()=>fp,_startsWith:()=>sp,_string:()=>R1,_stringFormat:()=>mp,_stringbool:()=>bS,_success:()=>aR,_superRefine:()=>vS,_symbol:()=>iS,_templateLiteral:()=>uR,_toLowerCase:()=>pp,_toUpperCase:()=>hp,_transform:()=>tR,_trim:()=>dp,_tuple:()=>qT,_uint32:()=>J1,_uint64:()=>rS,_ulid:()=>gb,_undefined:()=>nS,_union:()=>KT,_unknown:()=>sS,_uppercase:()=>op,_url:()=>Pm,_uuid:()=>lb,_uuidv4:()=>cb,_uuidv6:()=>ub,_uuidv7:()=>db,_void:()=>cS,_xid:()=>vb,_xor:()=>WT,clone:()=>Xr,config:()=>Kt,createStandardJSONSchemaMethod:()=>gp,createToJSONSchemaMethod:()=>wS,decode:()=>m$,decodeAsync:()=>v$,describe:()=>yS,encode:()=>f$,encodeAsync:()=>g$,extractDefs:()=>Cs,finalize:()=>Os,flattenError:()=>hm,formatError:()=>fm,globalConfig:()=>om,globalRegistry:()=>Nr,initializeContext:()=>Rs,isValidBase64:()=>WP,isValidBase64URL:()=>VN,isValidJWT:()=>zN,locales:()=>Am,meta:()=>xS,parse:()=>Mx,parseAsync:()=>$x,prettifyError:()=>B_,process:()=>at,regexes:()=>Sn,registry:()=>ab,safeDecode:()=>x$,safeDecodeAsync:()=>w$,safeEncode:()=>y$,safeEncodeAsync:()=>b$,safeParse:()=>N_,safeParseAsync:()=>I_,toDotPath:()=>wN,toJSONSchema:()=>Tb,treeifyError:()=>F_,util:()=>G,version:()=>_P});var g_=Object.freeze({status:"aborted"});function S(r,e,t){function n(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(r))return;s._zod.traits.add(r),e(s,l);let u=a.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let h=p[d];h in s||(s[h]=u[h].bind(s))}}let i=t?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:r});function a(s){var l;let u=t?.Parent?new o:this;n(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(r)}),Object.defineProperty(a,"name",{value:r}),a}var Ix=Symbol("zod_brand"),ro=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ns=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},om={};function Kt(r){return r&&Object.assign(om,r),om}var G={};Ho(G,{BIGINT_FORMAT_RANGES:()=>E_,Class:()=>y_,NUMBER_FORMAT_RANGES:()=>S_,aborted:()=>Ms,allowsEval:()=>w_,assert:()=>ZM,assertEqual:()=>jM,assertIs:()=>KM,assertNever:()=>WM,assertNotEqual:()=>LM,assignProp:()=>Ds,base64ToUint8Array:()=>yN,base64urlToUint8Array:()=>c$,cached:()=>Hd,captureStackTrace:()=>kx,cleanEnum:()=>l$,cleanRegex:()=>lm,clone:()=>Xr,cloneDef:()=>qM,createTransparentProxy:()=>e$,defineLazy:()=>je,esc:()=>Dx,escapeRegex:()=>Pn,extend:()=>i$,finalizeIssue:()=>yi,floatSafeRemainder:()=>x_,getElementAtPath:()=>HM,getEnumValues:()=>sm,getLengthableOrigin:()=>dm,getParsedType:()=>XM,getSizableOrigin:()=>um,hexToUint8Array:()=>d$,isObject:()=>hc,isPlainObject:()=>ks,issue:()=>Jd,joinValues:()=>T,jsonStringifyReplacer:()=>qd,merge:()=>o$,mergeDefs:()=>Ea,normalizeParams:()=>H,nullish:()=>Is,numKeys:()=>YM,objectClone:()=>GM,omit:()=>r$,optionalKeys:()=>P_,parsedType:()=>Z,partial:()=>a$,pick:()=>t$,prefixIssues:()=>ji,primitiveTypes:()=>__,promiseAllObject:()=>JM,propertyKeyTypes:()=>cm,randomString:()=>QM,required:()=>s$,safeExtend:()=>n$,shallowClone:()=>A_,slugify:()=>b_,stringifyPrimitive:()=>W,uint8ArrayToBase64:()=>xN,uint8ArrayToBase64url:()=>u$,uint8ArrayToHex:()=>p$,unwrapMessage:()=>am});function jM(r){return r}function LM(r){return r}function KM(r){}function WM(r){throw new Error("Unexpected value in exhaustive check")}function ZM(r){}function sm(r){let e=Object.values(r).filter(n=>typeof n=="number");return Object.entries(r).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function T(r,e="|"){return r.map(t=>W(t)).join(e)}function qd(r,e){return typeof e=="bigint"?e.toString():e}function Hd(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function Is(r){return r==null}function lm(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function x_(r,e){let t=(r.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let l=n.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}let o=t>i?t:i,a=Number.parseInt(r.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var vN=Symbol("evaluating");function je(r,e,t){let n;Object.defineProperty(r,e,{get(){if(n!==vN)return n===void 0&&(n=vN,n=t()),n},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function GM(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Ds(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Ea(...r){let e={};for(let t of r){let n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function qM(r){return Ea(r._zod.def)}function HM(r,e){return e?e.reduce((t,n)=>t?.[n],r):r}function JM(r){let e=Object.keys(r),t=e.map(n=>r[n]);return Promise.all(t).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function QM(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let n=0;n<r;n++)t+=e[Math.floor(Math.random()*e.length)];return t}function Dx(r){return JSON.stringify(r)}function b_(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var kx="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function hc(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var w_=Hd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function ks(r){if(hc(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(hc(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function A_(r){return ks(r)?{...r}:Array.isArray(r)?[...r]:r}function YM(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var XM=r=>{let e=typeof r;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(r)?"array":r===null?"null":r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?"promise":typeof Map<"u"&&r instanceof Map?"map":typeof Set<"u"&&r instanceof Set?"set":typeof Date<"u"&&r instanceof Date?"date":typeof File<"u"&&r instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},cm=new Set(["string","number","symbol"]),__=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xr(r,e,t){let n=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(n._zod.parent=r),n}function H(r){let e=r;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function e$(r){let e;return new Proxy({},{get(t,n,i){return e??(e=r()),Reflect.get(e,n,i)},set(t,n,i,o){return e??(e=r()),Reflect.set(e,n,i,o)},has(t,n){return e??(e=r()),Reflect.has(e,n)},deleteProperty(t,n){return e??(e=r()),Reflect.deleteProperty(e,n)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,n){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(t,n,i){return e??(e=r()),Reflect.defineProperty(e,n,i)}})}function W(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function P_(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var S_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},E_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function t$(r,e){let t=r._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Ea(r._zod.def,{get shape(){let a={};for(let s in e){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(a[s]=t.shape[s])}return Ds(this,"shape",a),a},checks:[]});return Xr(r,o)}function r$(r,e){let t=r._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Ea(r._zod.def,{get shape(){let a={...r._zod.def.shape};for(let s in e){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete a[s]}return Ds(this,"shape",a),a},checks:[]});return Xr(r,o)}function i$(r,e){if(!ks(e))throw new Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0){let o=r._zod.def.shape;for(let a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=Ea(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return Ds(this,"shape",o),o}});return Xr(r,i)}function n$(r,e){if(!ks(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t=Ea(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e};return Ds(this,"shape",n),n}});return Xr(r,t)}function o$(r,e){let t=Ea(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e._zod.def.shape};return Ds(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Xr(r,t)}function a$(r,e,t){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Ea(e._zod.def,{get shape(){let s=e._zod.def.shape,l={...s};if(t)for(let u in t){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=r?new r({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)l[u]=r?new r({type:"optional",innerType:s[u]}):s[u];return Ds(this,"shape",l),l},checks:[]});return Xr(e,a)}function s$(r,e,t){let n=Ea(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(t)for(let a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new r({type:"nonoptional",innerType:i[a]}))}else for(let a in i)o[a]=new r({type:"nonoptional",innerType:i[a]});return Ds(this,"shape",o),o}});return Xr(e,n)}function Ms(r,e=0){if(r.aborted===!0)return!0;for(let t=e;t<r.issues.length;t++)if(r.issues[t]?.continue!==!0)return!0;return!1}function ji(r,e){return e.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(r),t})}function am(r){return typeof r=="string"?r:r?.message}function yi(r,e,t){let n={...r,path:r.path??[]};if(!r.message){let i=am(r.inst?._zod.def?.error?.(r))??am(e?.error?.(r))??am(t.customError?.(r))??am(t.localeError?.(r))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function um(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function dm(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function Z(r){let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";let t=r;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return e}function Jd(...r){let[e,t,n]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:{...e}}function l$(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function yN(r){let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function xN(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function c$(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return yN(e+t)}function u$(r){return xN(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function d$(r){let e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=Number.parseInt(e.slice(n,n+2),16);return t}function p$(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var y_=class{constructor(...e){}};var bN=(r,e)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:e,enumerable:!1}),r.message=JSON.stringify(e,qd,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},pm=S("$ZodError",bN),xi=S("$ZodError",bN,{Parent:Error});function hm(r,e=t=>t.message){let t={},n=[];for(let i of r.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}function fm(r,e=t=>t.message){let t={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>n({issues:a}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let a=t,s=0;for(;s<o.path.length;){let l=o.path[s];s===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(e(o))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return n(r),t}function F_(r,e=t=>t.message){let t={errors:[]},n=(i,o=[])=>{var a,s;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>n({issues:u},l.path));else if(l.code==="invalid_key")n({issues:l.issues},l.path);else if(l.code==="invalid_element")n({issues:l.issues},l.path);else{let u=[...o,...l.path];if(u.length===0){t.errors.push(e(l));continue}let p=t,d=0;for(;d<u.length;){let h=u[d],g=d===u.length-1;typeof h=="string"?(p.properties??(p.properties={}),(a=p.properties)[h]??(a[h]={errors:[]}),p=p.properties[h]):(p.items??(p.items=[]),(s=p.items)[h]??(s[h]={errors:[]}),p=p.items[h]),g&&p.errors.push(e(l)),d++}}};return n(r),t}function wN(r){let e=[],t=r.map(n=>typeof n=="object"?n.key:n);for(let n of t)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function B_(r){let e=[],t=[...r.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of t)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${wN(n.path)}`);return e.join(`
4
4
  `)}var Qd=r=>(e,t,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new ro;if(a.issues.length){let s=new(i?.Err??r)(a.issues.map(l=>yi(l,o,Kt())));throw kx(s,i?.callee),s}return a.value},Mx=Qd(xi),Yd=r=>async(e,t,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(i?.Err??r)(a.issues.map(l=>yi(l,o,Kt())));throw kx(s,i?.callee),s}return a.value},$x=Yd(xi),Xd=r=>(e,t,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new ro;return o.issues.length?{success:!1,error:new(r??pm)(o.issues.map(a=>yi(a,i,Kt())))}:{success:!0,data:o.value}},N_=Xd(xi),ep=r=>async(e,t,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(a=>yi(a,i,Kt())))}:{success:!0,data:o.value}},I_=ep(xi),Tx=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qd(r)(e,t,i)},f$=Tx(xi),Rx=r=>(e,t,n)=>Qd(r)(e,t,n),m$=Rx(xi),Cx=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yd(r)(e,t,i)},g$=Cx(xi),Ox=r=>async(e,t,n)=>Yd(r)(e,t,n),v$=Ox(xi),Vx=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xd(r)(e,t,i)},y$=Vx(xi),zx=r=>(e,t,n)=>Xd(r)(e,t,n),x$=zx(xi),Ux=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ep(r)(e,t,i)},b$=Ux(xi),jx=r=>async(e,t,n)=>ep(r)(e,t,n),w$=jx(xi);var Sn={};Ho(Sn,{base64:()=>Z_,base64url:()=>Lx,bigint:()=>Y_,boolean:()=>eP,browserEmail:()=>N$,cidrv4:()=>K_,cidrv6:()=>W_,cuid:()=>D_,cuid2:()=>k_,date:()=>q_,datetime:()=>J_,domain:()=>k$,duration:()=>C_,e164:()=>G_,email:()=>V_,emoji:()=>z_,extendedDuration:()=>A$,guid:()=>O_,hex:()=>M$,hostname:()=>D$,html5Email:()=>E$,idnEmail:()=>B$,integer:()=>X_,ipv4:()=>U_,ipv6:()=>j_,ksuid:()=>T_,lowercase:()=>iP,mac:()=>L_,md5_base64:()=>T$,md5_base64url:()=>R$,md5_hex:()=>$$,nanoid:()=>R_,null:()=>tP,number:()=>Kx,rfc5322Email:()=>F$,sha1_base64:()=>O$,sha1_base64url:()=>V$,sha1_hex:()=>C$,sha256_base64:()=>U$,sha256_base64url:()=>j$,sha256_hex:()=>z$,sha384_base64:()=>K$,sha384_base64url:()=>W$,sha384_hex:()=>L$,sha512_base64:()=>G$,sha512_base64url:()=>q$,sha512_hex:()=>Z$,string:()=>Q_,time:()=>H_,ulid:()=>M_,undefined:()=>rP,unicodeEmail:()=>AN,uppercase:()=>nP,uuid:()=>fc,uuid4:()=>_$,uuid6:()=>P$,uuid7:()=>S$,xid:()=>$_});var D_=/^[cC][^\s-]{8,}$/,k_=/^[0-9a-z]+$/,M_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$_=/^[0-9a-vA-V]{20}$/,T_=/^[A-Za-z0-9]{27}$/,R_=/^[a-zA-Z0-9_-]{21}$/,C_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,A$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,O_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fc=r=>r?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${r}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_$=fc(4),P$=fc(6),S$=fc(7),V_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,E$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,F$=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,AN=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,B$=AN,N$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,I$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function z_(){return new RegExp(I$,"u")}var U_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,j_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,L_=r=>{let e=Pn(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},K_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lx=/^[A-Za-z0-9_-]*$/,D$=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,k$=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,G_=/^\+[1-9]\d{6,14}$/,_N="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",q_=new RegExp(`^${_N}$`);function PN(r){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof r.precision=="number"?r.precision===-1?`${e}`:r.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${r.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function H_(r){return new RegExp(`^${PN(r)}$`)}function J_(r){let e=PN({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${t.join("|")})`;return new RegExp(`^${_N}T(?:${n})$`)}var Q_=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Y_=/^-?\d+n?$/,X_=/^-?\d+$/,Kx=/^-?\d+(?:\.\d+)?$/,eP=/^(?:true|false)$/i,tP=/^null$/i;var rP=/^undefined$/i;var iP=/^[^A-Z]*$/,nP=/^[^a-z]*$/,M$=/^[0-9a-fA-F]*$/;function mm(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function gm(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var $$=/^[0-9a-fA-F]{32}$/,T$=mm(22,"=="),R$=gm(22),C$=/^[0-9a-fA-F]{40}$/,O$=mm(27,"="),V$=gm(27),z$=/^[0-9a-fA-F]{64}$/,U$=mm(43,"="),j$=gm(43),L$=/^[0-9a-fA-F]{96}$/,K$=mm(64,""),W$=gm(64),Z$=/^[0-9a-fA-F]{128}$/,G$=mm(86,"=="),q$=gm(86);var yt=S("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),EN={number:"number",bigint:"bigint",object:"date"},Wx=S("$ZodCheckLessThan",(r,e)=>{yt.init(r,e);let t=EN[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:t,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Zx=S("$ZodCheckGreaterThan",(r,e)=>{yt.init(r,e);let t=EN[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),oP=S("$ZodCheckMultipleOf",(r,e)=>{yt.init(r,e),r._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.multipleOf=e.value)}),r._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):x_(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:r,continue:!e.abort})}}),aP=S("$ZodCheckNumberFormat",(r,e)=>{yt.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),n=t?"int":"number",[i,o]=S_[e.format];r._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=i,s.maximum=o,t&&(s.pattern=X_)}),r._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:s,inst:r});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:n,inclusive:!0,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:n,inclusive:!0,continue:!e.abort});return}}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:r,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:r,continue:!e.abort})}}),sP=S("$ZodCheckBigIntFormat",(r,e)=>{yt.init(r,e);let[t,n]=E_[e.format];r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,o.minimum=t,o.maximum=n}),r._zod.check=i=>{let o=i.value;o<t&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:r,continue:!e.abort})}}),lP=S("$ZodCheckMaxSize",(r,e)=>{var t;yt.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Is(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:um(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),cP=S("$ZodCheckMinSize",(r,e)=>{var t;yt.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Is(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:um(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),uP=S("$ZodCheckSizeEquals",(r,e)=>{var t;yt.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Is(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),r._zod.check=n=>{let i=n.value,o=i.size;if(o===e.size)return;let a=o>e.size;n.issues.push({origin:um(i),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),dP=S("$ZodCheckMaxLength",(r,e)=>{var t;yt.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Is(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let a=dm(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),pP=S("$ZodCheckMinLength",(r,e)=>{var t;yt.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Is(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let a=dm(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),hP=S("$ZodCheckLengthEquals",(r,e)=>{var t;yt.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Is(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),r._zod.check=n=>{let i=n.value,o=i.length;if(o===e.length)return;let a=dm(i),s=o>e.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),tp=S("$ZodCheckStringFormat",(r,e)=>{var t,n;yt.init(r,e),r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(n=r._zod).check??(n.check=()=>{})}),fP=S("$ZodCheckRegex",(r,e)=>{tp.init(r,e),r._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:r,continue:!e.abort})}}),mP=S("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=iP),tp.init(r,e)}),gP=S("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=nP),tp.init(r,e)}),vP=S("$ZodCheckIncludes",(r,e)=>{yt.init(r,e);let t=Pn(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=n,r._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),r._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:r,continue:!e.abort})}}),yP=S("$ZodCheckStartsWith",(r,e)=>{yt.init(r,e);let t=new RegExp(`^${Pn(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:r,continue:!e.abort})}}),xP=S("$ZodCheckEndsWith",(r,e)=>{yt.init(r,e);let t=new RegExp(`.*${Pn(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:r,continue:!e.abort})}});function SN(r,e,t){r.issues.length&&e.issues.push(...ji(t,r.issues))}var bP=S("$ZodCheckProperty",(r,e)=>{yt.init(r,e),r._zod.check=t=>{let n=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>SN(i,t,e.property));SN(n,t,e.property)}}),wP=S("$ZodCheckMimeType",(r,e)=>{yt.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),r._zod.check=n=>{t.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:r,continue:!e.abort})}}),AP=S("$ZodCheckOverwrite",(r,e)=>{yt.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var vm=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
5
5
  `).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),o=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...t,i.join(`
6
6
  `))}};var _P={major:4,minor:3,patch:6};var De=S("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=_P;let n=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&n.unshift(r);for(let i of n)for(let o of i._zod.onattach)o(r);if(n.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=(a,s,l)=>{let u=Ms(a),p;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(u)continue;let h=a.issues.length,g=d._zod.check(a);if(g instanceof Promise&&l?.async===!1)throw new ro;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,a.issues.length!==h&&(u||(u=Ms(a,h)))});else{if(a.issues.length===h)continue;u||(u=Ms(a,h))}}return p?p.then(()=>a):a},o=(a,s,l)=>{if(Ms(a))return a.aborted=!0,a;let u=i(s,n,l);if(u instanceof Promise){if(l.async===!1)throw new ro;return u.then(p=>r._zod.parse(p,l))}return r._zod.parse(u,l)};r._zod.run=(a,s)=>{if(s.skipChecks)return r._zod.parse(a,s);if(s.direction==="backward"){let u=r._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(p=>o(p,a,s)):o(u,a,s)}let l=r._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new ro;return l.then(u=>i(u,n,s))}return i(l,n,s)}}je(r,"~standard",()=>({validate:i=>{try{let o=N_(r,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return I_(r,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),mc=S("$ZodString",(r,e)=>{De.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??Q_(r._zod.bag),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),ft=S("$ZodStringFormat",(r,e)=>{tp.init(r,e),mc.init(r,e)}),SP=S("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=O_),ft.init(r,e)}),EP=S("$ZodUUID",(r,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=fc(n))}else e.pattern??(e.pattern=fc());ft.init(r,e)}),FP=S("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=V_),ft.init(r,e)}),BP=S("$ZodURL",(r,e)=>{ft.init(r,e),r._zod.check=t=>{try{let n=t.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=i.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),NP=S("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=z_()),ft.init(r,e)}),IP=S("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=R_),ft.init(r,e)}),DP=S("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=D_),ft.init(r,e)}),kP=S("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=k_),ft.init(r,e)}),MP=S("$ZodULID",(r,e)=>{e.pattern??(e.pattern=M_),ft.init(r,e)}),$P=S("$ZodXID",(r,e)=>{e.pattern??(e.pattern=$_),ft.init(r,e)}),TP=S("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=T_),ft.init(r,e)}),RP=S("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=J_(e)),ft.init(r,e)}),CP=S("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=q_),ft.init(r,e)}),OP=S("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=H_(e)),ft.init(r,e)}),VP=S("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=C_),ft.init(r,e)}),zP=S("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=U_),ft.init(r,e),r._zod.bag.format="ipv4"}),UP=S("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=j_),ft.init(r,e),r._zod.bag.format="ipv6",r._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:r,continue:!e.abort})}}}),jP=S("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=L_(e.delimiter)),ft.init(r,e),r._zod.bag.format="mac"}),LP=S("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=K_),ft.init(r,e)}),KP=S("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=W_),ft.init(r,e),r._zod.check=t=>{let n=t.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function WP(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var ZP=S("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=Z_),ft.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{WP(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function VN(r){if(!Lx.test(r))return!1;let e=r.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return WP(t)}var GP=S("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=Lx),ft.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{VN(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),qP=S("$ZodE164",(r,e)=>{e.pattern??(e.pattern=G_),ft.init(r,e)});function zN(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[n]=t;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var HP=S("$ZodJWT",(r,e)=>{ft.init(r,e),r._zod.check=t=>{zN(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),JP=S("$ZodCustomStringFormat",(r,e)=>{ft.init(r,e),r._zod.check=t=>{e.fn(t.value)||t.issues.push({code:"invalid_format",format:e.format,input:t.value,inst:r,continue:!e.abort})}}),Yx=S("$ZodNumber",(r,e)=>{De.init(r,e),r._zod.pattern=r._zod.bag.pattern??Kx,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:r,...o?{received:o}:{}}),t}}),QP=S("$ZodNumberFormat",(r,e)=>{aP.init(r,e),Yx.init(r,e)}),ym=S("$ZodBoolean",(r,e)=>{De.init(r,e),r._zod.pattern=eP,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=!!t.value}catch{}let i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:r}),t}}),Xx=S("$ZodBigInt",(r,e)=>{De.init(r,e),r._zod.pattern=Y_,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:r}),t}}),YP=S("$ZodBigIntFormat",(r,e)=>{sP.init(r,e),Xx.init(r,e)}),XP=S("$ZodSymbol",(r,e)=>{De.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:r}),t}}),e1=S("$ZodUndefined",(r,e)=>{De.init(r,e),r._zod.pattern=rP,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:r}),t}}),t1=S("$ZodNull",(r,e)=>{De.init(r,e),r._zod.pattern=tP,r._zod.values=new Set([null]),r._zod.parse=(t,n)=>{let i=t.value;return i===null||t.issues.push({expected:"null",code:"invalid_type",input:i,inst:r}),t}}),r1=S("$ZodAny",(r,e)=>{De.init(r,e),r._zod.parse=t=>t}),i1=S("$ZodUnknown",(r,e)=>{De.init(r,e),r._zod.parse=t=>t}),n1=S("$ZodNever",(r,e)=>{De.init(r,e),r._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),o1=S("$ZodVoid",(r,e)=>{De.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),t}}),a1=S("$ZodDate",(r,e)=>{De.init(r,e),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let i=t.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:r}),t}});function BN(r,e,t){r.issues.length&&e.issues.push(...ji(t,r.issues)),e.value[t]=r.value}var s1=S("$ZodArray",(r,e)=>{De.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:r}),t;t.value=Array(i.length);let o=[];for(let a=0;a<i.length;a++){let s=i[a],l=e.element._zod.run({value:s,issues:[]},n);l instanceof Promise?o.push(l.then(u=>BN(u,t,a))):BN(l,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function Qx(r,e,t,n,i){if(r.issues.length){if(i&&!(t in n))return;e.issues.push(...ji(t,r.issues))}r.value===void 0?t in n&&(e.value[t]=void 0):e.value[t]=r.value}function UN(r){let e=Object.keys(r.shape);for(let n of e)if(!r.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let t=P_(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function jN(r,e,t,n,i,o){let a=[],s=i.keySet,l=i.catchall._zod,u=l.def.type,p=l.optout==="optional";for(let d in e){if(s.has(d))continue;if(u==="never"){a.push(d);continue}let h=l.run({value:e[d],issues:[]},n);h instanceof Promise?r.push(h.then(g=>Qx(g,t,d,e,p))):Qx(h,t,d,e,p)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var LN=S("$ZodObject",(r,e)=>{if(De.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let l={...s};return Object.defineProperty(e,"shape",{value:l}),l}})}let n=Hd(()=>UN(e));je(r._zod,"propValues",()=>{let s=e.shape,l={};for(let u in s){let p=s[u]._zod;if(p.values){l[u]??(l[u]=new Set);for(let d of p.values)l[u].add(d)}}return l});let i=hc,o=e.catchall,a;r._zod.parse=(s,l)=>{a??(a=n.value);let u=s.value;if(!i(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:r}),s;s.value={};let p=[],d=a.shape;for(let h of a.keys){let g=d[h],v=g._zod.optout==="optional",y=g._zod.run({value:u[h],issues:[]},l);y instanceof Promise?p.push(y.then(x=>Qx(x,s,h,u,v))):Qx(y,s,h,u,v)}return o?jN(p,u,s,l,n.value,r):p.length?Promise.all(p).then(()=>s):s}}),l1=S("$ZodObjectJIT",(r,e)=>{LN.init(r,e);let t=r._zod.parse,n=Hd(()=>UN(e)),i=h=>{let g=new vm(["shape","payload","ctx"]),v=n.value,y=O=>{let z=Dx(O);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};g.write("const input = payload.value;");let x=Object.create(null),F=0;for(let O of v.keys)x[O]=`key_${F++}`;g.write("const newResult = {};");for(let O of v.keys){let z=x[O],$=Dx(O),te=h[O]?._zod?.optout==="optional";g.write(`const ${z} = ${y(O)};`),te?g.write(`